Interface ContentService

All Superinterfaces:
com.appiancorp.services.ContextSensitiveService, Service

public interface ContentService extends com.appiancorp.services.ContextSensitiveService

This interface provides access to the Content service (formerly the Collaboration service). Whereas previously there were separate services to deal with different types of content (e.g., FolderService), all content can now be manipulated through this interface. The content service comes with an entirely new API and bean hierarchy, which cannot be used with the old Collaboration services. Inversely, the old beans cannot be used with the new Content service.

The methods in this service that check whether a user can act on a content item, such as canUserView(java.lang.Long, java.lang.String), only permit checking whether the user whose context was used to obtain the service can act on that item. To check whether another user has a certain role for the item, use getRoleMap(java.lang.Long, java.lang.Boolean) and check whether the user is listed for the desired role or is a member of a group in the desired role.

There is also an associated service, the ContentStatisticsService, which can be used to get various statistics on content (such as the number of content items fitting specific criteria).

Type Masks:
Types in Content are all powers of 2. This means that you can specify a filter of multiple types by using the bitwise or operator |. For instance, if you want to both documents and folders, you can set your typemask filter to:
ContentConstants.TYPE_FOLDER | ContentConstants.TYPE_DOCUMENT
Some of these combination filters are already defined as additional type constants at ContentConstants.TYPE_XXX

To obtain the root IDs for Rules and Document Management hierarchies:

  • Rules - Use getIdByUuid(String) and pass com.appiancorp.suiteapi.content.ContentConstants.UUID_RULES_ROOT_FOLDER
  • Document Management - Use getIdByUuid(String) and pass com.appiancorp.suiteapi.content.ContentConstants.UUID_COMMUNITY_ROOT
Code example (using ServiceLocator and ServiceContext):
ServiceContext sc = ServiceLocator.getAdministratorServiceContext();
ContentService cs = ServiceLocator.getContentService(sc);
Long rulesRootId = cs.getIdByUuid(ContentConstants.UUID_RULES_ROOT_FOLDER);