Main page moved
The main page is here Entity Provider and Broker
Information
This contains information related to the Entity Broker system (entity 2.0) in Sakai. Ideally we want flexible entities which make development of integrated Sakai tools easier and more flexible. Our goals are to make the entity system easier on developers (easier to use and understand) and more powerful (easier to extend and improve).
The Entity Broker seamlessly integrates with the existing Entity system in Sakai (Entity Producers and Entities) and entities created using entity providers are accessible in Sakai as if they were created using the legacy system.
Entity Broker Design
Code
- Functional prototype code: https://source.sakaiproject.org/contrib/caret/entitybroker/trunk/
- Version 1.0 release: https://source.sakaiproject.org/contrib/caret/entitybroker/tags/1.0/
- Test application: https://source.sakaiproject.org/contrib/caret/entitybroker-test/
Basic Usage
- Implement the EntityProvider interface
- Implement any additional capabilities interfaces (optional)
- Create a spring bean definition in the Sakai application context (components.xml)
- Implement AutoRegisterEntityProvider or register the provider implementation manually using the Entity Broker
Usage instructions and recommended best practices
example: Thing entity
- Create an interface called ThingEntityProvider which extends EntityProvider in api logic (add an entity package for it)
Example: org.sakaiproject.evaluation.logic.entity.EvaluationEntityProvider.java - Add a public static string which contains the entity prefix (called ENTITY_PREFIX),
Example:public final static String ENTITY_PREFIX = "eval-evaluation";
- Implement your ThingEntityProvider in impl logic as ThingEntityProviderImpl (add an entity package for it),
Example: org.sakaiproject.evaluation.logic.impl.entity.EvaluationEntityProviderImpl.java - Implement CoreEntityProvider in ThingEntityProviderImpl
- Implement AutoRegisterEntityProvider in ThingEntityProviderImpl
- Add a spring bean definition in the Sakai application context (components.xml), use the api name as the id
Example:<bean id="org.sakaiproject.evaluation.logic.entity.EvaluationEntityProvider" class="org.sakaiproject.evaluation.logic.impl.entity.EvaluationEntityProviderImpl"> </bean>
- Add the needed maven dependendencies to api/logic and impl/logic project.xml files
Exmaple:That should do it. You should now be able to use the Entity Broker to access information about your entities and register events for your entities (among other things).<dependency> <groupId>sakaiproject</groupId> <artifactId>sakai-entitybroker-api</artifactId> <version>${sakai.version}</version> </dependency>