org.sakaiproject.entitybroker.entityprovider.capabilities
Interface CollectionResolvable

All Superinterfaces:
EntityProvider, Resolvable
All Known Subinterfaces:
BrowseableCollection, RESTful

public interface CollectionResolvable
extends EntityProvider, Resolvable

This type of entity supports retrieval of entities in a collection based on a search, this will be invoked when an entity space is accessed (/prefix) rather than accessing an individual entity (/prefix/id)
The data is returned as a list of entity objects (Object, Map, whatever POJO, etc.) OR as a list of EntityData objects (which can contain the entities or just information about them like properties, url, etc. This is one of the capability extensions for the EntityProvider interface
This extends Resolvable and is part of CRUDable

Author:
Aaron Zeckoski (aaron@caret.cam.ac.uk)

Field Summary
static String SEARCH_LOCATION_REFERENCE
          A search key which indicates the results should be limited by the unique reference for a location (site, group, etc.)
static String SEARCH_TAGS
          A search key which indicates the results should be limited by a tag or an array of tags
static String SEARCH_USER_REFERENCE
          A search key which indicates the results should be limited by the unique reference for a user
 
Method Summary
 List<?> getEntities(EntityReference ref, Search search)
          Allows these entities to be fetched based on search parameters, this should never return null and if there are no entities then the list should be empty
Note: The entity class types in the list need to be able to be resolved from the ClassLoader of the EntityBrokerManager (currently this means deployed into shared)

These do not have to be model objects and may simply be something created (e.g.
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.capabilities.Resolvable
getEntity
 
Methods inherited from interface org.sakaiproject.entitybroker.entityprovider.EntityProvider
getEntityPrefix
 

Field Detail

SEARCH_USER_REFERENCE

static final String SEARCH_USER_REFERENCE
A search key which indicates the results should be limited by the unique reference for a user

See Also:
Constant Field Values

SEARCH_LOCATION_REFERENCE

static final String SEARCH_LOCATION_REFERENCE
A search key which indicates the results should be limited by the unique reference for a location (site, group, etc.)

See Also:
Constant Field Values

SEARCH_TAGS

static final String SEARCH_TAGS
A search key which indicates the results should be limited by a tag or an array of tags

See Also:
Constant Field Values
Method Detail

getEntities

List<?> getEntities(EntityReference ref,
                    Search search)
Allows these entities to be fetched based on search parameters, this should never return null and if there are no entities then the list should be empty
Note: The entity class types in the list need to be able to be resolved from the ClassLoader of the EntityBrokerManager (currently this means deployed into shared)

These do not have to be model objects and may simply be something created (e.g. String, Map, etc.) to give to anyone calling this method

Parameters:
ref - the parsed reference object which uniquely represents this entity, only the prefix will be used from this reference (since that identifies the space and collection)
search - a search object which can define the order to return entities, search filters, and total number of entities returned,
NOTE: There are some predefined search keys which you may optionally support, provider are encourage to support the SEARCH_* search keys listed in this interface
Returns:
a list of entity objects (POJOs, Map, etc.) of the type handled by this provider OR a list of EntityData objects based on the search OR empty if none found, should not return null
Throws:
SecurityException - if the data cannot be accessed by the current user or is not publicly accessible
IllegalArgumentException - if the reference is invalid or the search is invalid
IllegalStateException - if any other error occurs


Copyright © 2007-2013 Sakai Project. All Rights Reserved.