Entity Service

Definition

An entity is a managed piece of data in Sakai. Sakai best practice is to manange data via services with a well-defined, published API. While entities can be slit into application and framework entities, this doesn't matter from a system perspective. Entities provide base-level data elements that all managed data in Sakai is expected to have. This allows information to be proceessed and handled generically.

Mutable vs. Immutable

Entity definition is divided between the immutable Entity interface and the mutable Edit interface. Since Edit extends Entity, it includes all of it's access methods.

Common Data Elements

The followin data elements are considerd to be common to all managed Sakai objects (entities):

Element

Description

URL

A URL that can be used to access this entity.

Reference

An internal reference.

Id

A globally unique (UUID) identifier.

Properties

A set of resource properties associated with the entity.

XML Form

The entity in serialized XML form.

References

References are intended to provide a simple and structured way to refer to Sakai entities. References have two forms: a string and a object. The string form includes a container id and an object identifier. The object form provides methods to get the authz groups associated with the reference, it's entity manager, the entity itself, etc.

The string form of references often end up being part of a URL.

Properties

All Sakai entities may have an arbitrary number of properties associated with them. While all of these properties are optional, certain properties are commonly used such as who created or modified, creation or modified time-date, etc.

The Entity Producer

The entity producer API serves as a base to define a service or manager class that produces objects that are entities (User and UserDirectoryService, for example). Given a reference to an entity, the produce can get the entity itself, it's properties and provide support for other functions such as archiving, merging, etc.

The Entity Manager

The entity manager allows entity producers to be registered and listed. It provides a simple way to get a reference to an entity from it's reference string, check references, and create lists of references.

Objects

The following objects are included in the Sakai entity interface:

AttachmentContainer
AttachmentContainerEdit
ContextObserver
Edit
Entity
EntityManager
EntityProducer
EntityTransferrer - new for 2.2, removes dependency on Site in Entity.
HttpAccess
Reference
ResourceProperties
ResourcePropertiesEdit

Exceptions moved or added for 2.2:

EntityAccessOverloadException
EntityCopyrightException
EntityNotDefinedException
EntityPermissionException
EntityPropertyNotDefinedException
EntityPropertyTypeException

See also Using the EntityManager Service.