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);

Environment

None

Test Plan

None

Activity

Show:

Beth Kirschner October 6, 2009 at 1:15 PM

Implemented as described

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created October 6, 2009 at 5:30 AM
Updated April 25, 2018 at 3:35 PM
Resolved October 6, 2009 at 1:15 PM