com.ibm.portal.cp.resources
Interface ResourceModelLocator<R extends Resource>

All Superinterfaces:
Constants, Locator<R>

public interface ResourceModelLocator<R extends Resource>
extends Locator<R>, Constants

Locator for looking up Resources using different criteria.

Since:
7.0.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.ibm.portal.cp.Constants
Constants.Order, Constants.OrderMetric, Constants.SearchPattern
 
Field Summary
 
Fields inherited from interface com.ibm.portal.cp.Constants
ALL, BEGIN, COLON, DEFAULT_ORDER, DEFAULT_ORDERMETRIC
 
Method Summary
 CountableIterablePagedListModel<R> findByCategories(java.util.Collection<java.lang.String> categoryNames, Constants.OrderMetric orderMetric, Constants.Order order)
          Returns a list of Resource objects by given categories.
 CountableIterablePagedListModel<R> findByCategoriesAndRating(java.util.Collection<java.lang.String> categoryNames, int fromRating, int tillRating, Constants.OrderMetric orderMetric, Constants.Order order)
          Returns a list of Resource objects by given categories and rating interval.
 CountableIterablePagedListModel<R> findByCategoriesAndTagNames(java.util.Collection<java.lang.String> categoryNames, java.util.Collection<java.lang.String> tagNames, Constants.OrderMetric orderMetric, Constants.Order order, java.util.Collection<java.util.Locale> locales)
          Returns a list of Resource objects by the given categories and (tag) names.
 CountableIterablePagedListModel<R> findByCategory(java.lang.String categoryName, Constants.OrderMetric orderMetric, Constants.Order order)
          Returns a list of Resource objects by a given category.
 CountableIterablePagedListModel<R> findByCategoryAndRating(java.lang.String categoryName, int fromRating, int tillRating, Constants.OrderMetric orderMetric, Constants.Order order)
          Returns a list of Resource objects by a given category and rating interval.
 CountableIterablePagedListModel<R> findByCategoryAndTagName(java.lang.String categoryName, java.lang.String tagName, Constants.OrderMetric orderMetric, Constants.Order order, java.util.Collection<java.util.Locale> locales)
          Returns a list of Resource objects by a given category and tag name (exact match).
 CountableIterablePagedListModel<R> findByIDs(java.util.List<ObjectID> anObjectIDs)
          Returns a list of Resource objects by the given ObjectIDs
 CountableIterablePagedListModel<R> findByRating(int fromRating, int tillRating, Constants.OrderMetric orderMetric, Constants.Order order)
          Returns a list of Resource objects by a given rating interval.
 CountableIterablePagedListModel<R> findByTagName(java.lang.String tagName, Constants.OrderMetric orderMetric, Constants.Order order, java.util.Collection<java.util.Locale> locales)
          Returns a list of Resource objects by a given (tag) name (exact match).
 CountableIterablePagedListModel<R> findByTagNames(java.util.Collection<java.lang.String> tagNames, Constants.OrderMetric orderMetric, Constants.Order order, java.util.Collection<java.util.Locale> locales)
          Returns a list of Resource objects by given tag names.
 CountableIterablePagedListModel<R> findByTypeSchema(java.lang.String typeSchema, Constants.OrderMetric orderMetric, Constants.Order order)
          Returns a list of Resource objects by a given (resource) type schema (exact match).
 CountableIterablePagedListModel<R> findByTypeSchemaAndRating(java.lang.String typeSchema, int fromRating, int tillRating, Constants.OrderMetric orderMetric, Constants.Order order)
          Returns a list of Resource objects by a given Resource type (schema) and rating interval.
 CountableIterablePagedListModel<R> findByTypeSchemaAndTagName(java.lang.String typeSchema, java.lang.String tagName, Constants.OrderMetric orderMetric, Constants.Order order, java.util.Collection<java.util.Locale> locales)
          Returns a list of Resource objects by given Resource type schemas and tag name (both with exact match)
 CountableIterablePagedListModel<R> findByTypeSchemas(java.util.Collection<java.lang.String> typeSchemas, Constants.OrderMetric orderMetric, Constants.Order order)
          Returns a list of Resource objects by given resource type schemas (exact match).
 CountableIterablePagedListModel<R> findByTypeSchemasAndRating(java.util.Collection<java.lang.String> typeSchemas, int fromRating, int tillRating, Constants.OrderMetric orderMetric, Constants.Order order)
          Returns a list of Resource objects by given Resource type schemas and rating interval.
 CountableIterablePagedListModel<R> findByTypeSchemasAndTagNames(java.util.Collection<java.lang.String> typeSchemas, java.util.Collection<java.lang.String> tagNames, Constants.OrderMetric orderMetric, Constants.Order order, java.util.Collection<java.util.Locale> locales)
          Returns a list of Resource objects by given Resource types (schemas) and (tags) names.
 R findByURI(java.net.URI resourceURI)
          Returns a Resource object by a given URI.
 CountableIterablePagedListModel<R> findByURIs(java.util.List<java.net.URI> resourceURIs, Constants.OrderMetric orderMetric, Constants.Order order)
          Returns a Resource object by given URIs.
 
Methods inherited from interface com.ibm.portal.Locator
findByID, findByUniqueName
 

Method Detail

findByTypeSchema

CountableIterablePagedListModel<R> findByTypeSchema(java.lang.String typeSchema,
                                                    Constants.OrderMetric orderMetric,
                                                    Constants.Order order)
                                                                     throws ModelException
Returns a list of Resource objects by a given (resource) type schema (exact match). Typical use case: Find all pages, portlets, products, photos, etc.

Parameters:
typeSchema - The (resource) type (schema).
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
Returns:
A list of Resource objects.
Throws:
ModelException

findByTypeSchemas

CountableIterablePagedListModel<R> findByTypeSchemas(java.util.Collection<java.lang.String> typeSchemas,
                                                     Constants.OrderMetric orderMetric,
                                                     Constants.Order order)
                                                                      throws ModelException
Returns a list of Resource objects by given resource type schemas (exact match). Typical use case: Find all pages, portlets, products, photos, etc.

Parameters:
typeSchemas - The resources type schemas.
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
Returns:
A list of Resource objects.
Throws:
ModelException

findByURI

R findByURI(java.net.URI resourceURI)
                             throws ModelException
Returns a Resource object by a given URI.

Parameters:
resourceURI - The URI identifying the resource.
Returns:
A Resource object or null if the resource with the given URI was not found
Throws:
ModelException

findByURIs

CountableIterablePagedListModel<R> findByURIs(java.util.List<java.net.URI> resourceURIs,
                                              Constants.OrderMetric orderMetric,
                                              Constants.Order order)
                                                               throws ModelException
Returns a Resource object by given URIs.

Parameters:
resourceURIs - The URIs identifying the resources.
Returns:
A list of Resource objects, never null but may be empty
Throws:
ModelException

findByTagName

CountableIterablePagedListModel<R> findByTagName(java.lang.String tagName,
                                                 Constants.OrderMetric orderMetric,
                                                 Constants.Order order,
                                                 java.util.Collection<java.util.Locale> locales)
                                                                  throws ModelException
Returns a list of Resource objects by a given (tag) name (exact match).

Parameters:
tagName - The name of the tag to search for.
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
locales - A collection of locales in which the tags must have been applied. May be null - in this case the tags may have been applied in any locale.
Returns:
A list of Resource objects.
Throws:
ModelException

findByTagNames

CountableIterablePagedListModel<R> findByTagNames(java.util.Collection<java.lang.String> tagNames,
                                                  Constants.OrderMetric orderMetric,
                                                  Constants.Order order,
                                                  java.util.Collection<java.util.Locale> locales)
                                                                   throws ModelException
Returns a list of Resource objects by given tag names. Only exact matches are considered.

Parameters:
tagName - The name of the tag to search for.
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
locales - A collection of locales in which the tags must have been applied. May be null - in this case the tags may have been applied in any locale.
Returns:
A list of Resource objects.
Throws:
ModelException

findByTypeSchemaAndTagName

CountableIterablePagedListModel<R> findByTypeSchemaAndTagName(java.lang.String typeSchema,
                                                              java.lang.String tagName,
                                                              Constants.OrderMetric orderMetric,
                                                              Constants.Order order,
                                                              java.util.Collection<java.util.Locale> locales)
                                                                               throws ModelException
Returns a list of Resource objects by given Resource type schemas and tag name (both with exact match)

Parameters:
typeSchema - The (resource) type (schema).
tagName - The name of the tag to search for.
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
locales - A collection of locales in which the tags must have been applied. May be null - in this case the tags may have been applied in any locale.
Returns:
A list of Resource objects.
Throws:
ModelException

findByTypeSchemasAndTagNames

CountableIterablePagedListModel<R> findByTypeSchemasAndTagNames(java.util.Collection<java.lang.String> typeSchemas,
                                                                java.util.Collection<java.lang.String> tagNames,
                                                                Constants.OrderMetric orderMetric,
                                                                Constants.Order order,
                                                                java.util.Collection<java.util.Locale> locales)
                                                                                 throws ModelException
Returns a list of Resource objects by given Resource types (schemas) and (tags) names. This performs exact match searches only.

Parameters:
typeSchemas - The (resource) types.
tagNames - The names of the tags to search for.
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
locales - A collection of locales in which the tags must have been applied. May be null - in this case the tags may have been applied in any locale.
Returns:
A list of Resource objects.
Throws:
ModelException

findByRating

CountableIterablePagedListModel<R> findByRating(int fromRating,
                                                int tillRating,
                                                Constants.OrderMetric orderMetric,
                                                Constants.Order order)
                                                                 throws ModelException
Returns a list of Resource objects by a given rating interval. The specified values are inclusive.

Parameters:
fromRating - The start value of the interval.
tillRating - The end value of the interval.
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
Returns:
A list of Resource objects.
Throws:
ModelException

findByTypeSchemaAndRating

CountableIterablePagedListModel<R> findByTypeSchemaAndRating(java.lang.String typeSchema,
                                                             int fromRating,
                                                             int tillRating,
                                                             Constants.OrderMetric orderMetric,
                                                             Constants.Order order)
                                                                              throws ModelException
Returns a list of Resource objects by a given Resource type (schema) and rating interval. The specified values are inclusive.

Parameters:
typeSchema - The (resource) type (schema).
fromRating - The start value of the interval.
tillRating - The end value of the interval.
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
Returns:
A list of Resource objects.
Throws:
ModelException

findByTypeSchemasAndRating

CountableIterablePagedListModel<R> findByTypeSchemasAndRating(java.util.Collection<java.lang.String> typeSchemas,
                                                              int fromRating,
                                                              int tillRating,
                                                              Constants.OrderMetric orderMetric,
                                                              Constants.Order order)
                                                                               throws ModelException
Returns a list of Resource objects by given Resource type schemas and rating interval. The specified values are inclusive.

Parameters:
typeSchemas - The resource type schemas.
fromRating - The start value of the interval.
tillRating - The end value of the interval.
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
Returns:
A list of Resource objects.
Throws:
ModelException

findByCategory

CountableIterablePagedListModel<R> findByCategory(java.lang.String categoryName,
                                                  Constants.OrderMetric orderMetric,
                                                  Constants.Order order)
                                                                   throws ModelException
Returns a list of Resource objects by a given category. Typical use case: Find all pages, portlets, products, photos, etc. being in a certain category.

Parameters:
categoryName - The name of the category.
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
Returns:
A list of Resource objects.
Throws:
ModelException

findByCategories

CountableIterablePagedListModel<R> findByCategories(java.util.Collection<java.lang.String> categoryNames,
                                                    Constants.OrderMetric orderMetric,
                                                    Constants.Order order)
                                                                     throws ModelException
Returns a list of Resource objects by given categories. Typical use case: Find all pages, portlets, products, photos, etc. being in a certain category.

Parameters:
categoryNames - The names of the categories
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
Returns:
A list of Resource objects.
Throws:
ModelException

findByCategoryAndTagName

CountableIterablePagedListModel<R> findByCategoryAndTagName(java.lang.String categoryName,
                                                            java.lang.String tagName,
                                                            Constants.OrderMetric orderMetric,
                                                            Constants.Order order,
                                                            java.util.Collection<java.util.Locale> locales)
                                                                             throws ModelException
Returns a list of Resource objects by a given category and tag name (exact match).

Parameters:
categoryName - The name of the category.
tagName - The name of the tag to search for.
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
locales - A collection of locales in which the tags must have been applied. May be null - in this case the tags may have been applied in any locale.
Returns:
A list of Resource objects.
Throws:
ModelException

findByCategoriesAndTagNames

CountableIterablePagedListModel<R> findByCategoriesAndTagNames(java.util.Collection<java.lang.String> categoryNames,
                                                               java.util.Collection<java.lang.String> tagNames,
                                                               Constants.OrderMetric orderMetric,
                                                               Constants.Order order,
                                                               java.util.Collection<java.util.Locale> locales)
                                                                                throws ModelException
Returns a list of Resource objects by the given categories and (tag) names.

Parameters:
categoryNames - The names of the categories.
tagNames - The names of the tags to search for.
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
locales - A collection of locales in which the tags must have been applied. May be null - in this case the tags may have been applied in any locale.
Returns:
A list of Resource objects.
Throws:
ModelException

findByIDs

CountableIterablePagedListModel<R> findByIDs(java.util.List<ObjectID> anObjectIDs)
                                                              throws ModelException
Returns a list of Resource objects by the given ObjectIDs

Parameters:
anObjectIDs - the ids of the objects to find. Must not be null.
Returns:
A list of Resource objects.
Throws:
ModelException

findByCategoryAndRating

CountableIterablePagedListModel<R> findByCategoryAndRating(java.lang.String categoryName,
                                                           int fromRating,
                                                           int tillRating,
                                                           Constants.OrderMetric orderMetric,
                                                           Constants.Order order)
                                                                            throws ModelException
Returns a list of Resource objects by a given category and rating interval. The specified values are inclusive.

Parameters:
categoryName - The name of the category.
fromRating - The start value of the interval.
tillRating - The end value of the interval.
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
Returns:
A list of Resource objects.
Throws:
ModelException

findByCategoriesAndRating

CountableIterablePagedListModel<R> findByCategoriesAndRating(java.util.Collection<java.lang.String> categoryNames,
                                                             int fromRating,
                                                             int tillRating,
                                                             Constants.OrderMetric orderMetric,
                                                             Constants.Order order)
                                                                              throws ModelException
Returns a list of Resource objects by given categories and rating interval. The specified values are inclusive.

Parameters:
categoryNames - The names of the category.
fromRating - The start value of the interval.
tillRating - The end value of the interval.
orderMetric - (see Constants.OrderMetric) The order metric in which the results are to be returned. May be null .
order - (see Constants.Order) The order in which the results are to be returned. May be null.
Returns:
A list of Resource objects.
Throws:
ModelException