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) Implement
AutoRegisterEntityProvider or register this implementation some other way
Recommended best practices: (example: Thing entity)
1) Create an interface called
ThingEntityProvider which extends
EntityProvider in 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.
org.sakaiproject.evaluation.logic.impl.entity.EvaluationEntityProviderImpl.java)
4) Implement
CoreEntityProvider in ThingEntityProviderImpl
5) Implement
AutoRegisterEntityProvider in ThingEntityProviderImpl
6) Add a spring bean
definition in the Sakai application context (components.xml), use the api name as the id
Example:
7) Add the needed maven dependendencies to api/logic and impl/logic project.xml
files
Exmaple:
sakaiproject
sakai-entitybroker-api
${sakai.version}
That should do it. You should now be able to use the
EntityBroker to access information about your entities and register events for your
entities (among other things).