All Classes
-
All Classes Interface Summary Class Summary Enum Summary Exception Summary Annotation Types Summary Class Description AccessFormats Indicates that entity requests can be handled for certain formats which are indicated
NOTE: By default all entity view requests go through to the available access providers:EntityViewAccessProviderorHttpServletAccessProviderif nothing is specified here or this interface is not implementedAccessViews Indicates that entity requests can be handled for certain views which are indicated
NOTE: By default all entity view requests go through to the available access providers:EntityViewAccessProviderorHttpServletAccessProviderif nothing is specified here or this interface is not implementedActionReturn A special object used to return specialized results from a custom action execution, includes fields to allow for handling of encoded binary data and to indicate that entity action processing should continue as it would have if there had been no custom action call (rather than exiting the standard chain)ActionReturn.Header ActionsDefineable This entity supports custom actions (as defined by RoR and REST microformat: http://microformats.org/wiki/rest/urls)
This is the more controllable version, useActionsExecutableif you want to use the conventions and allow the system to detect your custom actions based on method names and annotations
This means that there are custom actions which can be invoked on entities or entity spaces, custom actions can augment the current entity operation or they can completely change the behavior and skip the current operation entirely
You can create methods in your entity provider which either end with "CustomAction" or use theEntityCustomActionsuffix to define the custom actions
You can describe the actions using theDescribeablekey:.action. = description
If you want more control then you can useActionsExecutionControllableActionsExecutable This entity supports custom actions (as defined by RoR and REST microformat: http://microformats.org/wiki/rest/urls)
This means that there are custom actions which can be invoked on entities or entity spaces, custom actions can augment the current entity operation or they can completely change the behavior and skip the current operation entirely
You can create methods in your entity provider which either end with "CustomAction" or use theEntityCustomActionsuffix to define the custom actions
You can describe the actions using theDescribeablekey:.action. = description
If you want more control then you can useActionsDefineableandActionsExecutionControllableActionsExecutionControllable This entity supports custom actions (as defined by RoR and REST microformat: http://microformats.org/wiki/rest/urls)
This is the most complex interface for implementing custom actions but allows the most control also, useActionsExecutableorActionsDefineablein most circumstance
This means that there are custom actions which can be invoked on entities or entity spaces, custom actions can augment the current entity operation or they can completely change the behavior and skip the current operation entirely
You can describe the actions using theDescribeablekey:.action. = description
You can create methods in your entity provider which either end with "CustomAction" or use theEntityCustomActionsuffix to define the custom actionsAutoRegister By implementing this interface you are telling the system to pick up all the objects which are implementing this interface and put them in a bucket so they will be loaded into any bean which implements BeanCollector and asks for themAutoRegisterEntityProvider By implementing this interface you are telling theEntityProviderManagerto register this entity broker as soon as spring creates it, to be exposed as part of theEntityBroker
This is one of the capability extensions for theEntityProviderinterfaceBeanCollector<T> Implement this in order to cause spring to inject a set of beans into your spring bean (if any exist) which implement the interface you define (they will also have to implementAutoRegister)BeanMapCollector Implement this in order to cause spring to inject a map of type -> a set of beans into your spring bean (if any exist) which implement the type interfaces you define (those interfaces will also have to implementAutoRegister)Browseable This indicates that this entity will participate in browse functionality for entities, For example, it will provide lists of entities which are visible to users in locations which can be looked through and selected
This is the root interface for browsing entities and does not do anything by itself, you must add at leastBrowseableCollectionorBrowseSearchableinterface to this
If your entities are nested then the nested ones will need to implementBrowseNestable
Entities which do not implement this will not appear in lists of entities which are being browsed
Internationalization keys:
{prefix}.browse = the name to show in the browse list for this entity
{prefix}.browse.description = the optional description that is viable to show in the browse list for this entity
This is one of the capability extensions for theEntityProviderinterfaceBrowseableCollection This indicates that this entity will participate in browse functionality for entities, For example, it will provide lists of entities which are visible to users in locations which can be looked through and selected
Entities which do not implement this will not appear in lists of entities which are being browsed
This is the convention interface and simply uses the results of calls toCollectionResolvableto provide lists of entities for browsing, the implementor should be sure that ordering and limiting are supported for the provided search object in their implementation ofCollectionResolvable.getEntities(org.sakaiproject.entitybroker.EntityReference, org.sakaiproject.entitybroker.entityprovider.search.Search)
This is one of the capability extensions for theEntityProviderinterface
SeeBrowseablefor the i18n keys
This extendsCollectionResolvable, use theBrowseSearchableinterface if you require more controlBrowseEntity This is an object to hold data about a browseable entity typeBrowseEntity.PrefixComparator BrowseEntity.TitleComparator BrowseNestable This indicates that this entity will participate in browse functionality for entities and it is nested within another entity: Example:
A blog (parent) contains blog entries (children).BrowseSearchable This indicates that this entity will participate in browse functionality for entities, For example, it will provide lists of entities which are visible to users in locations which can be looked through and selected
This provides fine grained control over which entities will appear in a browse list, normallyCollectionResolvableshould show all entities, however, for the browse list we will explicitly filter by users and/or locations and may not show all entities, entities which do not implement this orBrowseableCollectionwill not appear in lists of entities which are being browsed
This is one of the capability extensions for theEntityProviderinterface
This is the configuration interface forBrowseableCollection(the convention interface)ClassLoaderReporter Allows a bean to report the classloader that is appropriate for it and will be used for dispatching into this beans environment, this is only needed in advanced cases and should not normally be implemented
The primary use case here is to allow someone to set their classloader when they are using a proxied bean or the implementation class is in the wrong classloader
This is primarily used in the case of theHttpServletAccessProviderorEntityViewAccessProviderand the implementations of those should also implement this interface to be able to specify the classloaderCollectionResolvable CoreEntityProvider This is the base unit for working with Sakai entities, by implementing this interface and creating a spring bean you will tie your entities into Sakai, there are many other interfaces which you can implement to extend the interaction of your entities with Sakai in this package
You (the implementor) will want to create one implementation of this interface for each type of entity you want to link to Sakai to track events, provide URL access, etc.
Usage:
1) Implement this interface
2) Implement any additional capabilities interfaces (optional)
3) Create a spring bean definition in the Sakai application context (components.xml)
4) ImplementAutoRegisterEntityProvideror register this implementation some other way
Recommended best practices: (example: Thing entity)
1) Create an interface called ThingEntityProvider which extendsEntityProviderin api logic (add an entity package for it), (e.g. org.sakaiproject.evaluation.logic.entity.EvaluationEntityProvider.java)
2) Add a public static string which contains the entity prefix (called ENTITY_PREFIX), (e.g. public final static String ENTITY_PREFIX = "eval-evaluation";)
3) Implement your ThingEntityProvider in impl logic as ThingEntityProviderImpl (add an entity package for it), (e.g.Createable This entity type can be created (this is the C in CRUD), the current user id should be used for permissions checking in most cases
This is one of the capability extensions for theEntityProviderinterfaceCRUDable A convenient interface to define that this entity type supports all CRUD operations
This is one of the capability extensions for theEntityProviderinterfaceCustomAction This defines a custom entity action, this will be used to define which custom actions are allowed to be performed on entities or collections of entitiesDeleteable This entity type can be deleted (this is the D in CRUD), the current user id should be used for permissions checking in most cases
This is one of the capability extensions for theEntityProviderinterfaceDepthLimitable This entity type can specify its own recursion depth limit.Describeable This entity will describe itself, this description can be accessed for display in interfaces, the description should generally be targeted at developers (in particular, those using REST or web services)
This is the convention interface, it will simply look for the properties file in the classloader which yourEntityProvideris located in, the file must be named <entity-prefix>.properties (e.g. myentity.properties)
The keys inside the file must be as follows:
<entity-prefix> = This is the main description of the entity, appears at the top
<entity-prefix>.view.<viewKey> = This is a description about a particular view for an entity (viewKey from entity view constantsEntityView.VIEW_LIST)
<entity-prefix>.action.<actionKey> = This is a description of a custom action for this entity (seeActionsExecutableorEntityCustomAction)
<entity-prefix>.field.<fieldName> = This is a description about a particular entity field for this entity object (seeResolvableorCollectionResolvable)
<entity-prefix>.redirect.<redirectTemplate> = This is a description about a particular redirect rule for this entity URL space (seeRedirectableorEntityURLRedirect)
<entity-prefix>.<capability> = This is a description about a particular capability for this entity
Example:myentity = This is my entity, it is used for examples only myentity.view.show = this shows a single instance of my entity myentity.action.copy = this makes a copy of an instance of a myentity myentity.field.name = this is the name of the entity, it is a user displayable name myentity.redirect. DescribeDefineable Allows an entity to define the description of itself in code rather than using properties, this will be called each time a description is needed so it should be efficient
This is the configuration interface
This is one of the capability extensions for theEntityProviderinterfaceDescribePropertiesable This allows an entity to define thePropertiesfiles/classes to be used for looking up descriptions of the entity (Describeable)
This is the configuration interface
This is one of the capability extensions for theEntityProviderinterfaceDeveloperHelperService Includes methods which are likely to be helpful to developers who are implementing entity providers in Sakai and working with referencesEntityBroker This service interface defines the capabilities of the entity broker system
It allows Sakai system methods, developers, etc. to access Sakai entity information (new and old)EntityBrokerException The base class for all exceptions out of the entity broker systemEntityBrokerManager The core of the EB system, this is generally not for use by developers and is mostly for internal use but it should be ok to use most of these methodsEntityContent Marks a getter method or field as the main content text for an entity, Example: the main text body for a blog entry or email, the main content of an article or posting, the convention is to run toString on the return from the "getContent" method or the value in the "content" field
NOTE: This annotation should only be used once in a class, the getter method must take no arguments and return an objectEntityCustomAction This annotation indicates that this method is a custom action fromActionsExecutable, this should not be placed on any methods defined by a capability but should be placed on methods which you want to be exposed as custom actions
By default the name of the method is used as the action key and this will work for read requests (viewKey is set toEntityView.VIEW_SHOW), you can add in action and viewKey annotation params to change those settings
You can describe this action using the key:.action. = description
The methods annotated by this can have the following argument (parameter) types:
(type => data which will be given to the method)
EntityView: the current entity view for this request (contains extension, url, segments)
EntityReference: the current entity reference (prefix and optional id)
String: entity prefix
Search: the search object based on the incoming params
OutputStream: stream to place outbound data (probably binary) into for transmission
Map(String=>Object) : a map of the actions parameters (params from the action request)
These methods should return one of the following:
1) null (this is ok in most circumstances to indicate the method is done, use an exception to indicate failure)
2) anActionReturn(this is a special object used to indicate return states and handle binary data)
3) anEntityData(this is a special object used to wrap the object and provide meta data)
4) a UTF-8 encoded OutputStream or String
5) a List of entity objects
6) an entity object
7) a boolean value (true indicates success and is the same as returning null, false indicates failure and causes anEntityNotFoundException
Can throw the following exceptions and have them translated and handled, all others will pass through:
EntityNotFoundExceptionto indicate the entity request could not find the data that was requested
IllegalArgumentExceptionto indicate that the incoming params or the request was invalid
FormatUnsupportedExceptionto indicate that the requested format is not supported for this entity request
EntityExceptionto indicate a specific entity failure occurred, can include a response code and error message
SecurityExceptionto indicate that the the current user is no allowed to perform this action
UnsupportedOperationExceptionto indicate that the current action being requested is invalid (typically indicates bad combination of viewKey and action)
IllegalStateExceptionto indicate a general failure has occurred
EntityData This is an object to hold entity data (e.g. from a search which would normally return entity references), This is basically a POJO which allows us to return a few results instead of only the reference, it helps us get the entity data back more efficiently and makes it easier on developers who need to search for entitiesEntityData.ReferenceComparator EntityData.TitleComparator EntityDateCreated Marks a getter method or field as the date created time code (unix time code) for an entity, this can be aDate,Long, long, orString(will attempt to convert this to a long)
the convention is to try to convert the return from the "getDateCreated" method or the value in the "dateCreated" field
NOTE: This annotation should only be used once in a class, the getter method must take no arguments and return an objectEntityEncodingException Throw to indicate that there was a failure during encoding/decoding an entity or related dataEntityException This exception is used to indicate that a problem occurred attempting to get an entity, the reference to the failed entity should be returned in the exception along with the response code which is indicative of the failure (if possible) HTTP Response Codes (http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
Client Error
400 Bad Request The request could not be understood by the server due to malformed syntax.EntityFieldRequired Marks a getter method or field as required to be non-null and non-empty for an entity, this can be used many times in a class, this is mostly for documentation purposes and has little effect on operationsEntityHttpParam This annotation indicates that this method parameter should be replaced by the value in the HTTP query parameter, header, or form parameter whose name matches the name set in the annotation
Binds the value(s) of a HTTP query parameter to a resource method parameter.EntityId Marks a getter method or field as the unique local Id for an entity, the convention is to run toString on the return from the "getId" method or the value in the "id" field
NOTE: This annotation should only be used once in a class, the getter method must take no arguments and return an objectEntityLastModified Marks a getter method or field as the last modified time code (unix time code) for an entity, this can be aDate,Long, long, orString(will attempt to convert this to a long)
the convention is to try to convert the return from the "getLastModified" method or the value in the "lastModified" field
NOTE: This annotation should only be used once in a class, the getter method must take no arguments and return an objectEntityModifiedBy Marks a getter method or field as the user ref of the last user to modify an entity
the convention is to run toString on the return from the "getModifiedBy" method or the value in the "modifiedBy" field
NOTE: This annotation should only be used once in a class, the getter method must take no arguments and return an objectEntityNotFoundException Throw to indicate that there was a failure finding an entity or collection of entitiesEntityOwner Marks a getter method or field as the user ref of the creator/owner of an entity, the convention is to run toString on the return from the "getOwner" method or the value in the "owner" field
NOTE: This annotation should only be used once in a class, the getter method must take no arguments and return an objectEntityParameters This annotation indicates that this method is accepts or expects certain parameters to be present before it can be executed, these parameters are accessible in the params map
Any parameters included in this annotation can be documented using the i18n properties files by placing a message at: prefix.action.actionname.field.fieldname OR prefix.view.viewkey.field.fieldname
NOTE: there is no need to list the field names of the fields which are included in the entity class or map here, this is for additional parameters only
EntityPropertiesService This provides the entity system with a way to access properties (and then exposes this to others via the developer helper service)EntityProvider Beans may implement this interface directly to provide "extension" capabilities to an existingCoreEntityProvider.EntityProviderListener<T extends EntityProvider> This allows a developer to be notified whenever a provider is registered, it will also ensure that it calls the listener method for any providers that are already registered when it is first registered if desired
Usage:
Just implement this class and useEntityProviderManager#registerNotifier(EntityProviderNotifier)to register it with the system.EntityProviderManager Handles all internal work of managing and working with the entity providers
Registration of entity brokers happens via spring, see theEntityProviderinterface for detailsEntityProviderMethodStore This is the interface for handling storage of methods (related to custom actions and the like), this is for internal usage only and should not be accessed or used by other developersEntityReference The class of all Entity references handled by the EntityBroker system.EntityRequestHandler Handles the URL/request processing for an entity in a central locationEntityResponse This is here to contain the information we get back from an entity (http) request fired by theEntityBroker.fireEntityRequest(String, String, String, Map, Object)method
This object and the data in it should be considered immutableEntityRESTProvider Handles anything REST based that is not part of the core EB registration pieceEntitySummary Marks a getter method or field as the summary or description text for an entity, Example: the summary for a blog entry or email, the instructions text for a test or survey the convention is to run toString on the return from the "getSummary" method or the value in the "summary" field
NOTE: This annotation should only be used once in a class, the getter method must take no arguments and return an objectEntityTitle Marks a getter method or field as the display title for an entity, the convention is to run toString on the return from the "getTitle" method or the value in the "title" field
NOTE: This annotation should only be used once in a class, the getter method must take no arguments and return an objectEntityURLRedirect This annotation indicates that this method will handle an incoming URL and do some processing to turn it into an outgoing URL OR just do some processing OR indicate that a failure has occurred
Define the URL pattern to match AFTER the /prefix using {name} to indicate variables
Example: /{thing}/site/{siteId} will match the following URL:
/myprefix/123/site/456, the variables will be {prefix => myprefix, thing => 123, siteId => 456}
NOTE: all incoming URL templates must start with "/{prefix}" (TemplateParseUtil.TEMPLATE_PREFIX)
NOTE: The method template patterns will be compared in the order they appear in your source code so be careful that you do not have a really simple redirect pattern as the first one as this can cause the other patterns to never be reached
The methods that this annotates should return aStringor void
They can have the following parameter types:
(type => data which will be given to the method)
String: incoming URL
EntityView.Method: the submission method (GET,POST,etc)
String[] : incoming URL segments, Example: /myprefix/123/apple => {'prefix','123','apple'}
Map(String=>String) : a map of the variable values in the {}, Example: pattern: /{prefix}/{thing}/apple, url: /myprefix/123/apple, would yield: {'thing' => '123','prefix' => 'mypreifx'}
Don't forget to handle the extensions as they will not automatically pass through, use theTemplateParseUtil.DOT_EXTENSIONandTemplateParseUtil.EXTENSIONvalues from the variable map which will contain the extension that was passed in
Return should be one of the following:
1) the URL to redirect to, will be processed as an external redirect if it starts with "http" or "/" (unless it starts with "/{prefix}"), otherwise it will be processed as an internal forward
2) "" (empty string) to not redirect and return an empty success response
3) null to not redirect and allow standard processing of the URL to continue
For failures: if there is a failure you should throw an IllegalStateException to indicate failure
This is the convention part of theRedirectablecapabilityEntityView Defines an entity view (a specific way to looking at entity data, e.g.EntityView.Method Represents HTTP methods (GET, POST, etc.)EntityViewAccessProvider Represents a bean which is capable of handling access for anEntityView, this replaces theHttpServletAccessProvideras all entity URLs are now being parsed so more information can be provided through theEntityView
This interface would be typically implemented from a tool (webapp) context, and registered with theEntityViewAccessProviderManagerin a context loader listener
If the implementation throws aSecurityExceptionduring the course of this method, the access will be directed to a login page or authentication method before being redirected back to the implementation method
If you want to control the requests which make it through to this by format type you can optionally implementAccessFormatsEntityViewAccessProviderManager Manages all the access providers for the entity views in the system
Use this to register yourself as handling the entity views for a set of entites (based on the prefix) This will be used by the entity broker to determine if anyone is handling entity views for an entity typeEntityViewUrlCustomizable Indicates that the entity URLs for the types of entities handled by this provider are customized by the set of entity templates returned
These will be usedEventReceiver Allows a developer to create a method which will be called when specific events occur by implementing this interface, this uses the Sakai event servicesExportable Indicates an entity provider has the capability of exporting entity data which is related to other entities, note that the decision about which data to export is left up to the implementor based on the reference supplied
This is one of the capability extensions for theEntityProviderinterfaceExternalIntegrationProvider Formats Defines a list of possible format types (extensions) which can be handled and indicates which are handled internallyFormatUnsupportedException Throw to indicate that there was a failure during formatting an entity (input or output), use the message to indicate more information about the failure, place the reference and format into the exceptionHttpServletAccessProvider Deprecated. UseEntityViewAccessProviderinsteadHttpServletAccessProviderManager Deprecated. UseEntityViewAccessProviderManagerinsteadIdEntityReference Deprecated. UseEntityReferencedirectly, this will be removed eventuallyImportable Indicates an entity provider has the capability of importing entity data that was previously exported via theExportablecapability which will be related to other entities, note that the way to associate the data is left up to the implementor based on the reference supplied
This is one of the capability extensions for theEntityProviderinterfaceInputable These entities can be entered as certain input formats which are handled automatically and translated into entity objects (of the type defined bySampleable)
If you want to define the way the input is translated instead of using the internal methods then useInputTranslatable
NOTE: By default all entity view requests go through to the available access providers:EntityViewAccessProviderorHttpServletAccessProviderInputTranslatable Allows this entity to define the way to translate data for a reference into an entity object depending on the format requested, if you just want to use the internal methods to handle formatting the input into an entity then simply useInputable
NOTE: throwingFormatUnsupportedExceptionwill pass control over to the internal handlers for formatting, if you want to stop the request for this format type entirely then throw anIllegalStateExceptionand the processing will be haltedLearningTrackable This capability is for tracking learning events (LRS statements) related to this entity
If more advanced control is needed then use of the full LRS_Statement in then LearningResourceStoreService.LearningTrackingProvider This provides for tracking learning events (LRS statements) related to an entity (by prefix)
If more advanced control is needed then use of the full LRS_Statement in then LearningResourceStoreService.Order A simple bean which defines the order to return the results of a search
Example usage:
Order ota = new Order("title"); // order by title ascending
Order otd = new Order("title", false); // order by title descendingOrderedBean This sets the order of a bean when it is grabbed by the bean collector and ensures a guaranteed priority order of collected beans, lower orders (numbers) will be loaded first and the orders do not have to be consecutive (there can be gaps)Outputable These entities can be returned as certain output formats which are handled automatically
If you want to define the data that is returned instead of using the internal methods then useOutputFormattable
NOTE: By default all entity view requests go through to the available access providers:EntityViewAccessProviderorHttpServletAccessProviderNOTE: there is no internal handling of HTML, it will always redirect to the the available access provider if there is one (if there is not one then the entity will be toStringed)OutputFormattable Allows this entity to define the output data format for a reference or a list of entity objects depending on the format requested, if you just want to use the internal methods to handle formatting the output then simply useOutputable
NOTE: throwingFormatUnsupportedExceptionwill pass control over to the internal handlers for formatting, if you want to stop the request for this format type entirely then throw anIllegalStateExceptionand the processing will be haltedOutputSerializable Allows this entity to better control the data that is going to be output by allowing it to intercept the entities and return them as whatever objects which should be serialized for output, if you just want to use the internal methods to handle formatting the output then simply useOutputablePropertiesProvider This simple defines the methods correctly which are shared between a set of interfaces, seePropertyProvideablefor more informationPropertyable Allows entities handled by the entity provider which implements this interface to have meta properties attached to them, properties can be accessed via theEntityBroker, properties will be stored and retrieved using the internal entity property retrieval implementation
For our usage, meta properties are extra or additional properties that are attached to an entity at runtime but are persisted so they can be retrieved later
WARNING: this should be used only for properties of entities which will be accessed very lightly, for production level access OR the ability to control how properties are stored on your own entities, you should use thePropertyProvideableinstead
This is one of the capability extensions for theEntityProviderinterfacePropertyProvideable Allows entities handled by the entity provider which implements this interface to have meta properties attached to them, these properties can be accessed via theEntityBroker, properties will be stored and retrieved via the methods which are implemented in this interface
For our usage, meta properties are extra or additional properties that are attached to an entity at runtime but are persisted so they can be retrieved later
Allows the entity provider to define and control the way properties are stored on its own entities, if you would prefer to use the internal storage and only have lightweight property storage needs then usePropertyableinstead
NOTE: the validity of references and parameters is checked in the broker before the call goes to the provider
This is one of the capability extensions for theEntityProviderinterfaceQuerySearch An extension of the standard search object which allows for custom constructors to make it easier to build up the search for the search queryRedirectable This entity type has the ability to define and handle configurable URLs, URLs like this can be handled and supported:
/gradebook/7890/student/70987 to view all the grades for a student from a course
/gradebook/6758/item/Quiz1 to view a particular item in a gradebook by it's human readable name
/gradebook/item/6857657 to maybe just a view an item by its unique id.RedirectControllable This entity type has the ability to define and handle configurable URLs
This adds the ability to control all redirects via a central method
URLs like this can be handled and supported:
/gradebook/7890/student/70987 to view all the grades for a student from a course
/gradebook/6758/item/Quiz1 to view a particular item in a gradebook by it's human readable name
/gradebook/item/6857657 to maybe just a view an item by its unique id.RedirectDefinable This entity type has the ability to define and handle configurable URLs
This adds the ability to supply a large set of simple redirects
URLs like this can be handled and supported:
/gradebook/7890/student/70987 to view all the grades for a student from a course
/gradebook/6758/item/Quiz1 to view a particular item in a gradebook by it's human readable name
/gradebook/item/6857657 to maybe just a view an item by its unique id.ReferenceParseable Indicates an entity provider has the capability of parsing its own reference string.RequestAware Indicates that this entity provider needs to be request aware, this allows the entity provider to get hold of information from the request at any time by directly accessing the request and response objects (if we are inside a request), if there is no current request then this method will fail to return anything
This is primarily intended to provide access to request parameters while operating inside the entity providerRequestGetter Allows for getting to the request and response objects for the current threadRequestGetterWrite Allows for getting to the request and response objects for the current threadRequestHandler Indicates that this entity provider will handle its own entity view requests, this would be very unusual but it allows the entity provider itself to redirect requests to a tool and normally would be used if there is some special circumstance only
WARNING: This will be called before any other request handling and before the access provider is called and will cause all other processing to be skipped (includes REST calls, custom actions, formatting, etc.)
NOTE: if you want to stop certain requests from coming through then a better option is to useRequestInterceptorwhich is triggered just before this would be calledRequestInterceptor Allows actions to be taken before a direct request is handled or after it has been handled, will only affect requests coming in via the direct servletRequestStorable Indicates that this entity provider is aware of the requests and can get to the stored values in the request or can store its own, this allows the entity provider to get hold of information from the request at any time
This is primarily intended to provide access to request data while operating inside the entity provider without depending on servlet knowledge
This provides access to the special indicator values which can be used to see what kind of request is operating and get information about it, see theRequestStorageobject for more info
If you need to get to the servlet data seeRequestAwareandRequestInterceptorRequestStorage This allows access to values which are stored in the current request thread, these values are inaccessible outside of a request and will be destroyed when the thread ends
This also "magically" exposes all the values in the request (attributes and params) as if they were stored in the map as well, if there are conflicts then locally stored data always wins over data from the request
Standard reserved keys have values that are always available:
_locale :Locale_requestEntityReference : String _requestActive : [true,false] _requestOrigin : ['REST','EXTERNAL','INTERNAL']RequestStorage.RequestOrigin Indicates the origin of the current requestRequestStorage.ReservedKeys Reserved keys with special data in them, seeRequestStorageRequestStorageWrite This allows write access to values which are stored in the current request thread, these values are inaccessible outside of a request and will be destroyed when the thread ends
This also "magically" exposes all the values in the request (attributes and params) as if they were stored in the map as well, if there are conflicts then locally stored data always wins over data from the request
Standard reserved keys have values that are always available:
_locale :Locale_requestEntityReference : String _requestActive : [true,false] _requestOrigin : ['REST','EXTERNAL','INTERNAL']Resolvable Allows the entities handled by this provider to be accessed directly as objects, this is also the interface for "reading" entities (this is the R in CRUD)
This is also used for resolving the type of entities
This is one of the capability extensions for theEntityProviderinterfaceRESTful Indicates that entities handled by this provider are RESTful as defined by the REST microformat:
http://microformats.org/wiki/rest/urls
Requires all CRUD functionality, Collection handling, HTML handling, and ability to support output formats
This is mostly a convenience interface to make sure that everything needed to support REST has been implemented, it also includes the marker to indicate that RESTful URLs should work for entities of this typeRestriction A simple bean which defines a restriction in a search, this is like saying: where userId = '123'; OR where userId like '%aaronz%';
Example usage:
Restriction rteq = new Restriction("title", curTitle); // restrict search to title equals value of curTitle
Restriction rtne = new Restriction("title", curTitle, Restriction.NOT_EQUALS); // restrict search to title not equals value of curTitleSakaiToolData This contains an abstraction of the information about a tool in SakaiSampleable This entity type can be known and this allows access to a sample object which represents it, the sample object can be of any type including a POJO, aMap, etc.
This is one of the capability extensions for theEntityProviderinterfaceSaveable Convenience interface to indicates that an entity is can be saved, i.e. it is creatable and updateableSearch This is a simple class which allows the passing of a set of search parameters in a nice way
Example usage:
Search s1 = new Search("title", curTitle); // search where title equals value of curTitle
Search s2 = new Search("title", curTitle, Restriction.NOT_EQUALS); // search where title not equals value of curTitle
Search s2 = new Search(
new Restriction("title", curTitle),
new Order("title")
); // search where title equals value of curTitle and order is by title ascending
Most searches can be modeled this way fairly easily.Searchable Indicates an entity provider has the capability of allowing the entities associated with it to be searchable, entities which implement this will be linked to the core search functionality
If you need to force an entity or entities to be added to the search indexes then you should use theSearchProvider.add(String, org.sakaiproject.entitybroker.entityprovider.extension.SearchContent)method in the system core to cause immediate indexing
This is one of the capability extensions for theEntityProviderinterfaceSearchContent Represents a set of data to put into the search index, this should represent the data of a single entity which should be indexed into the search engine NOTE: summary is the major piece of content which is being indexed, this may be an entire HTML page or just a bit of text, it is the part that will be searched when normal searches are executedSearchProvider Defines the methods related to searching for entities (shared between interfaces), implementing this allows for support for the core EB search functionalitySearchResult This is a single search resultSearchResults This represents the return data from a searchStatisticable This capability is for tracking statistics of events for entities related to a tool, it will be used by the site stats service for event tracking and reporting
Contact Nuno Fernandes (nuno@ufp.edu.pt) if you have questions
This is one of the capability extensions for theEntityProviderinterfaceTaggable Allows an entity to have tags associated with it which can be searched for or simply used as a way to link to this entity
This uses the internal tag storage mechanism or a central tag storage mechanism to store the tag applications
This is one of the capability extensions for theEntityProviderinterfaceTagProvideable Allows an entity to control and provide tag storage and searching, this overrides internal tag storage and any existing tag storage will be ignored in favor of the provided tags
This is the provider interface forTaggable, inherits all methods fromTagProvider
This is one of the capability extensions for theEntityProviderinterfaceTagProvider Defines the methods related to tagging entities (shared between interfaces)TagSearchable Deprecated. no longer functional, useTagProvideableTagSearchProvider Deprecated. useTagProvideableandTagProviderinsteadTagSearchService Defines the methods necessary for searching for entities by tags (shared interface)TemplateMap An object to hold the incoming and outgoing templates in pairs, used withRedirectDefinableTemplateParseUtil Utility class to handle the URL template parsing (entity template parsing)TemplateParseUtil.PreProcessedTemplate Contains the data for templates, each template must have a template key and the template itselfTemplateParseUtil.ProcessedTemplate Contains the processed template with the values from the processed input string that was determined to be related to this templateTemplateParseUtil.Template Represents a parseable template (which is basically a key and the template string), the array which defines the set of template keys isTemplateParseUtil.PARSE_TEMPLATE_KEYS
Rules for parse templates: 1) "{","}", andTemplateParseUtil.SEPARATORare special characters and must be used as indicated only 2) Must begin with aTemplateParseUtil.SEPARATOR, must not end with aTemplateParseUtil.SEPARATOR3) must begin with "/{prefix}" (use theTemplateParseUtil.SEPARATORandTemplateParseUtil.PREFIXconstants) 3) each {var} can only be used once in a template 4) {var} can never touch each other (i.e /{var1}{var2}/{id} is invalid) 5) each {var} can only have the chars fromTemplateParseUtil.VALID_VAR_CHARS6) parse templates can only have the chars fromTemplateParseUtil.VALID_TEMPLATE_CHARS7) Empty braces ({}) cannot appear in the templateUpdateable This entity type can be updated (this is the U in CRUD), the current user id should be used for permissions checking in most cases
This is one of the capability extensions for theEntityProviderinterfaceURLRedirect Storage for the redirects