Entity Broker

Main page moved

The main page is here Entity Provider and Broker
The data on these pages is out of date and only here for archival purposes

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

Basic Usage

  1. Implement the EntityProvider 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 the provider implementation manually using the Entity Broker

Usage instructions and recommended best practices

example: Thing entity

  1. 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
  2. Add a public static string which contains the entity prefix (called ENTITY_PREFIX),
    Example:
    public final static String ENTITY_PREFIX = "eval-evaluation";
  3. Implement your ThingEntityProvider in impl logic as ThingEntityProviderImpl (add an entity package for it),
    Example: 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:
    <bean id="org.sakaiproject.evaluation.logic.entity.EvaluationEntityProvider"
    	class="org.sakaiproject.evaluation.logic.impl.entity.EvaluationEntityProviderImpl">
    </bean>
    
  7. Add the needed maven dependendencies to api/logic and impl/logic project.xml files
    Exmaple:
    <dependency>
    	<groupId>sakaiproject</groupId>
    	<artifactId>sakai-entitybroker-api</artifactId>
    	<version>${sakai.version}</version>
    </dependency>
    
    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).

Usage with presentation frameworks (for URLs)