Uses of Class
org.sakaiproject.entitybroker.EntityReference
-
-
Uses of EntityReference in org.sakaiproject.entitybroker
Subclasses of EntityReference in org.sakaiproject.entitybroker Modifier and Type Class Description classIdEntityReferenceDeprecated.UseEntityReferencedirectly, this will be removed eventuallyMethods in org.sakaiproject.entitybroker that return EntityReference Modifier and Type Method Description EntityReferenceEntityReference. copy()static EntityReferenceEntityReference. copy(EntityReference ref)Creates a copy of an entity referenceEntityReferenceEntityView. getEntityReference()EntityReferenceEntityBroker. parseReference(String reference)Parses an entity reference into a concrete object, of typeEntityReference, or some class derived from it, for exampleIdEntityReferenceor some other class of object which is returned fromParseSpecParseable.EntityReferenceEntityBrokerManager. parseReference(String reference)Parses an entity reference into the appropriate reference formMethods in org.sakaiproject.entitybroker with parameters of type EntityReference Modifier and Type Method Description List<EntityData>EntityBrokerManager. browseEntities(String prefix, Search search, String userReference, String associatedReference, EntityReference parentEntityRef, Map<String,Object> params)Fetches the browseable entitiesEntityDataEntityBrokerManager. convertToEntityData(Object entity, EntityReference ref)Convert a single object to an entity data object (also populates it), will preserve null (i.e. null in => null out)List<EntityData>EntityBrokerManager. convertToEntityData(List<?> entities, EntityReference ref)Convert a list of objects to entity data objects (also populates them), will preserve null (i.e. null in => null out)static EntityReferenceEntityReference. copy(EntityReference ref)Creates a copy of an entity referencebooleanEntityBrokerManager. entityExists(EntityReference ref)Determines if an entity exists based on the referenceList<?>EntityBrokerManager. fetchEntities(EntityReference ref, Search search, Map<String,Object> params)Get a list of entities fromCollectionResolvablefirst if available orBrowseSearchableif not, returns the entities as actual entities (converts fromEntityDataif that was used), correctly handles references to single entities as wellObjectEntityBrokerManager. fetchEntity(EntityReference ref)Get an entity object of some kind for this reference if it has an id, will simply return null if no id is available in this referenceList<EntityData>EntityBrokerManager. getEntitiesData(EntityReference ref, Search search, Map<String,Object> params)Get a list of entities fromCollectionResolvablefirst if available orBrowseSearchableif not, returns the entities wrapped inEntityData, correctly handles references to single entities as wellEntityDataEntityBrokerManager. getEntityData(EntityReference ref)Get the entity data for a reference if possibleEntityViewEntityBrokerManager. makeEntityView(EntityReference ref, String viewKey, String extension)Reduce code duplication and ensure custom templates are usedEntityViewEntityView. setEntityReference(EntityReference ref)Allows for easy chained construction of EntityViews by setting an EntityReference, does not set the viewkey or extension unless they are unset, maintains current extensionConstructors in org.sakaiproject.entitybroker with parameters of type EntityReference Constructor Description EntityView(EntityReference ref, String viewKey, String extension)Construct an entity view based on a reference, view, and format extension -
Uses of EntityReference in org.sakaiproject.entitybroker.access
Methods in org.sakaiproject.entitybroker.access with parameters of type EntityReference Modifier and Type Method Description voidHttpServletAccessProvider. handleAccess(HttpServletRequest req, HttpServletResponse res, EntityReference ref)Deprecated.UseEntityViewAccessProviderinstead -
Uses of EntityReference in org.sakaiproject.entitybroker.entityprovider.capabilities
Methods in org.sakaiproject.entitybroker.entityprovider.capabilities that return EntityReference Modifier and Type Method Description EntityReferenceReferenceParseable. getParsedExemplar()Returns an example instance of theEntityReferenceclass that thisEntityProvideruses as its reference type.Methods in org.sakaiproject.entitybroker.entityprovider.capabilities with parameters of type EntityReference Modifier and Type Method Description StringCreateable. createEntity(EntityReference ref, Object entity, Map<String,Object> params)Create a new entity and return the unique local id of the entity, the object should contain the data needed to create the entity or this will failvoidDeleteable. deleteEntity(EntityReference ref, Map<String,Object> params)Deletes the entity identified by this entity reference, if the entity cannot be found then nothing happensvoidOutputFormattable. formatOutput(EntityReference ref, String format, List<EntityData> entities, Map<String,Object> params, OutputStream output)Formats the entity or collection included or referred to by this entity ref object into output according to the format string provided, Should take into account the reference when determining what the entities are and how to encode them
NOTE: be careful to correctly handle the list of entities which are meant to be encoded, note that theEntityDataobjects include meta data and the data they contain can be of any object type (though all data will come from your provider so the types should not be surprising)List<EntityData>BrowseNestable. getChildrenEntities(EntityReference parentRef, Search search, String userReference, String associatedReference, Map<String,Object> params)Returns the list of entities being browsed which are nested under a parent entity with a given reference
Example: Parent entity is /blog/123, there are 3 entries in this blog, the search limits the return to 2 entities This method should return the first 2 blog entries in the blog with reference /blog/123List<?>CollectionResolvable. 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.ObjectResolvable. getEntity(EntityReference ref)Allows this entity to be fetched based on the ref (prefix and local id), also used to determine the class type of these entities by requesting an entity without specifying an id (id = null)
WARNING: this method should not return null, throw the appropriate exception if the entity data cannot be found Note: The entity class type needs to be able to be resolved from the ClassLoader of the EntityBrokerManager (currently this means deployed into shared)
The entity object does not have to be a model object itself and may simply be something created (Map,String,EntityData, etc.) to give to anyone calling this method.ObjectOutputSerializable. makeSerializableObject(EntityReference ref, Object entity)Take the entity and convert it to whatever objects (Map, List, String, etc.) that you want to output, this will be called every time that an entity is about to serialized but only if the type of object matches that of the entities handled by your providerObjectInputTranslatable. translateFormattedData(EntityReference ref, String format, InputStream input, Map<String,Object> params)Translates the input data stream in the supplied format into an entity object for this referencevoidUpdateable. updateEntity(EntityReference ref, Object entity, Map<String,Object> params)Update an existing entity, the object should contain the data needed to update the entity or this will fail
Typically the entity will be retrieved first usingResolvable.getEntity(EntityReference)and the the fields will be updated and it will be passed into this method -
Uses of EntityReference in org.sakaiproject.entitybroker.entityprovider.extension
Methods in org.sakaiproject.entitybroker.entityprovider.extension that return EntityReference Modifier and Type Method Description EntityReferenceEntityData. getEntityRef()The entity reference object which makes it easy to get to the prefix or id of this entity if neededConstructors in org.sakaiproject.entitybroker.entityprovider.extension with parameters of type EntityReference Constructor Description EntityData(EntityReference ref, String displayTitle)Minimal constructor - used for most basic cases
Use the setters to add in properties or the entity data if desiredEntityData(EntityReference ref, String displayTitle, Object entity)Basic constructor
Use this to construct a search result using the typical minimal amount of information, Use the setters to add in properties or the entity data if desiredEntityData(EntityReference ref, String displayTitle, Object entity, Map<String,Object> entityProperties)Full constructor
Use this if you want to return the entity itself along with the key meta data and properties -
Uses of EntityReference in org.sakaiproject.entitybroker.providers
Methods in org.sakaiproject.entitybroker.providers with parameters of type EntityReference Modifier and Type Method Description voidEntityRESTProvider. formatAndOutputEntity(EntityReference ref, String format, List<EntityData> entities, OutputStream outputStream, Map<String,Object> params)Format and output an entity or collection included or referred to by this entity ref object into output according to the format string provided, Should take into account the reference when determining what the entities are and how to encode them (This is basically a copy of the code in EntityHandlerImpl with stuff removed)ActionReturnEntityRESTProvider. handleCustomActionExecution(ActionsExecutable actionProvider, EntityReference ref, String action, Map<String,Object> actionParams, OutputStream outputStream, EntityView view, Map<String,Object> searchParams)This will execute a custom action for an entity or space/collection of entities
This is meant for specialized usage as custom actions are typically meant to be executed by REST calls onlyObjectEntityRESTProvider. translateInputToEntity(EntityReference ref, String format, InputStream inputStream, Map<String,Object> params)Translates the input data stream in the supplied format into an entity object for this reference
-