Content Service

Definition

Sakai content is hosted by a service based on the Content Hosting API, which is an extention of the Entity model. Entities (Resources) provide a set of functionality common to any resource used in the system, such as Users, Groups, etc. Content objects may have metadata and attachments associated with them. This means that content objects cannot be directly modeled using a file system without handling the fact that some files (and other data) cannot be separated.

Mutable vs. Immutable

Resources, collections, and property sets all come in mutable and immutable forms.

Common Data Elements

The following data elements are included the ContentResource object:

Element

Description

Content Length

Length in bytes of the content stream.

Content Type

MIME Type of the content.

Content

A byte array.

Content

An input stream.

The following data elements are included in the ContentCollection object:

Element

Description

Members

A list of reference strings.

Member Resources

A list of Content Resource objects.

Body Size

Aggregate size of the collection in 1024 units.

Metadata

Both resources and collections are entities and as such 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 Content Hosting Service

The content hosting service extends entity producer.

Methods are provided to work with:

  • Resources
  • Collections
  • Attachments
  • Properties
  • Locks
  • Special dropbox collection

A resource may have attachements, which are done by reference. Currently, the resource tool creates copies of all attachments uploaded, so all such references are unique. However, this is NOT required by the CH Service. An attachment may be shared by more than one resource.

Group Awareness

Group (Section) awareness is being added to the content hosting service for Sakai 2.2.
Two objects are added: GroupAwareEntity and GroupAwareEdit

Locking Resources

Content hosting includes a lock manager that allows long term locks to be applied to resources and collections.
It consists of the following objects: Lock and LockService. Locks can have a date to be added or revoved, qualifiers, and reasons for being added.

Objects

The following objects are included in the Sakai entity interface:

ContentCollection.java
ContentCollectionEdit.java
ContentHostingService.java
ContentResource.java
ContentResourceEdit.java
ContentResourceFilter.java
ContentTypeImageService.java
Lock.java
LockManager.java

Exceptions moved or added for 2.2:
(none)

Objects included in this package for 2.2:
FilePickerHelper.java
GroupAwareEdit.java
GroupAwareEntity.java
ResourceEditingHelper.java