function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ccPeterccPeter 

How to enumerate Content Types associated with a Library?

Hi Simon, I was hoping you could help me out with another question: what API in REST (or SOAP in case REST does not support it) do I use to find out what Content Types are associated with a Library?


- ContentWorkspace contains DefaultRecordTypeID, however, it does not point to other Content Types associated with the same ContentWorkSpace
- For RecordType you can list all records of type “ContentVersion” but these records do not point back to a ContentWorkspace
- With DescribeLayout(“ContentVersion”, null) all ContentTypes are listed but they do not contain any references back to a ContentWorkspace (unless I missed it somehow)


I suspect there is another intermediate record or API that returns the association between Libraries and Content Types; please point me in the right direction.


Thanks
Peter

ccPeterccPeter

Hi Simon, before this one falls through the cracks, does the REST API (or possibly SOAP) even allow finding out which page layouts are attached to a particular Content library?

 

Thanks

Peter

SuperfellSuperfell

Pagelayout info (including the layout -> recordType mapping) is only available in the soap api.

ccPeterccPeter

Thanks, Simon. Which Soap API should I look into? I looked at the results from DescribeLayout but that provides field and content type (recordtype) mapping only without any references to a library. I would like to know which page layouts i.e. which content types or recordtypes if you will are associated with a particular library.

 

Peter

James_SFDCJames_SFDC

Hi Peter,

 

You're right there is an association object which links restricted record types to workspaces, however it's not exposed in the API yet.

 

I'm guessing you've setup your workspaces to have restricted content types:

https://login.salesforce.com/help/doc/en/content_types_restrict.htm

 

The only way of determining which record types are available to workspaces is currently through the UI.

 

How many record types and libraries do you have?

 

 

ccPeterccPeter

Hi James, I currently have only a few libraries setup in my developer sandbox and also a small number of content types, and yes, I am trying out restricted content types. For background I am developing a general application for Salesforce Content. I arrived at a point that my application is working well with the default content type found in the selected contentworkspace.

 

I noticed in the Salesforce UI (when you contribute new content to a library) that if you attach more than one content type to a library, that the user is asked to select what content type to use with the newly uploaded content. What I don't know is how often people attach multiple content types to a library (there is something to say for keeping things simple and use only one content type per library). However, since the Salesforce UI provides this content type selection capability I would like my application to offer it too. This would be easy if only I could find out which content types are attached to a library.

 

I spent hours Googling and searching the docs to no avail.However, if that is not possible in the current API, that explains why I could not find anything.

 

Peter

James_SFDCJames_SFDC

Hi Peter,
As you're probably aware content types are used to categorize documents. Custom fields can then be associated with the content type. Whether content admins allow users to publish documents of different content types into the same library is their call, but I think you could consider it an advanced feature.


I'd be interested to learn more about the app you're building, is it for a mobile device?


Any additional feedback on the Content APIs or suggestions on how we can make development on the content platform easier would be appreciated. Our intention is to focus our efforts on expanding the Content API over the next couple of releases and provide functional parity with the UI and API.