Create variant of findResources that restricts query to specific site/contexts
Description
The ContentHostingService.findResources() method will find resources of a given type/mime-type only in the current user's worksites. There is no option for searching other worksites, or worksites for users other than the current user. The following method will accomplish this.
/**
Find all resources in specified sites that match the spcified type and mime type *
@param type
this is the ResourceProperties.PROP_STRUCTOBJ_TYPE for stuctured objects or ResourceProperties.FILE_TYPE for file resources or null for all resources.
@param primaryMimeType
The primary mime type (ie. the "text" of "text/xml") This may be null to include all resources
@param subMimeType
The sub type (ie, the "xml" of "text/xml") This may be null to include all resources of the primary mime type if specified.
@param contextIds
select resources where CONTENT_RESOURCE.CONTEXT in [context,...]
@return List of ContentResource objects that match the search criteria */ public List<ContentResource> findResources(String type, String primaryMimeType, String subMimeType, Set<String> contextIds);
The ContentHostingService.findResources() method will find resources of a given type/mime-type only in the current user's worksites. There is no option for searching other worksites, or worksites for users other than the current user. The following method will accomplish this.
/**
Find all resources in specified sites that match the spcified type and mime type
*
@param type
this is the ResourceProperties.PROP_STRUCTOBJ_TYPE for stuctured objects or ResourceProperties.FILE_TYPE for file resources or null for all resources.
@param primaryMimeType
The primary mime type (ie. the "text" of "text/xml") This may be null to include all resources
@param subMimeType
The sub type (ie, the "xml" of "text/xml") This may be null to include all resources of the primary mime type if specified.
@param contextIds
select resources where CONTENT_RESOURCE.CONTEXT in [context,...]
@return List of ContentResource objects that match the search criteria
*/
public List<ContentResource> findResources(String type, String primaryMimeType, String subMimeType, Set<String> contextIds);