Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Note

With the implementation of JSR-170 in the Sakai Content Hosting Service, the need for yet another implementation is unneeded.

Content Hosting (CH) is currently implemented via a two-tier set of objects: one to store content and properties in a datbase, the other to store content in files. If content is saved in files and properties are kept in the database, this presents a serious problem with resource integrity. For example, if a file is deleted in Sakai, and the user asks their IT people to restore it, the metadata is lost, potentially corrupting the Content Hosting system. Also, the implementation uses an internally defined method of naming files and directories that makes restoring files nearly impossible.

...

See also, CH Project Notes

Planned Approach

...

File Structure

The plan is to map resources to files in a file system and collections to directories. Simple enough until we try to associated properties and attachements.

Properties

Save properties in a file called file-name.properties, where file name corresponds to the base file name. Filter out all files that end in .properties from the list of resources contained in a collection.

It's not clear that collection properties are used in Sakai at this time, but clearly they could be useful. Since there is only one collection properties file in a given directory, it can be given a unique name

...

, "collection.properties". As long as this file is filtered from the list of files in a directory, all will be fine.

A base implementation of ResourceProperties exists in the entity model. An FSProperties will be created to extend this implementation primarily to handle storage into and out of a .properties file.

Attachments

Sakai content hosting supports the concept of resources having attachments. These attachments (like MIME attachments) are separate objects (files) that are appended (or attached) to the main resource. Three approaches to file-based attachments are being considered:

Locally Referenced Files

Attachment objects exist as local resources in the same collection. Attaching is accomplished either via a file-name.attachments file, or via multi-valued property in .properties (favored). While this is a simple approach, it does mean that attachment objects will be visible in tools that list files in a collection. Does the resource tool show attachments as files?

Files in Collections

Attachment objects could be contained in a special collection as a child of the current collection. This is a bit ugly, since these sub-collections either needed to be treated specially or filtered out. However, this roughly corresponds to the way JSR-170 handles attached objects.

Files in an Archive

Attachment objects could be contained in an archive format (like zip). Some overhead is added getting them in and out of the archive format.

Identifiers

Content resources are identified by a file name. In most cases, this name will have a file extention separated by a period, from which the MIME type may be deduced (via an extention map). All files also have a metadata file associated with it named the same, with a file extension of .properties. These properties may optionally be cached in a database to allow faster access to them.

...

Collection paths are defined against a local root. This root is associated with a context (usually a site). Local roots branch from a Sakai global root, which in turn is mapped to a file system location. Context specific roots cause problems, however. Unless the context is included in a resource or collection id, it is no longer globally unique. This might not be a problem as long as methods that resolve against the id are done in the current context.

Regardless of how resources and collections are identified, let's declare that directories immediately below the root are associated with a context, such as a site. This allows for hidden context use as well.

Things To Do

Item

Status

Notes

Move the work to contrib

 

 

Resource metadata

(error)

 

Collection metadata

(error)

 

Attachments

(error)

Need to figure out how to include these.

Attachment metadata

(error)

 

File types

(error)

Need a mapping function.

Drop Box

(error)

Has this been changed for 2.2?

...

Note: Sakai 2.2 defines a ContentEntity.

...

ContentCollection Methods

Method Name

Status

Notes

getLabelgetUrl();

 (tick)

 

willArchiveMergegetReference();

 (tick)

 

willImportgetUrl(root-prop);

 

 

archive(2.2 method

getReference(root-prop);

 

 

merge2.2 method

getId();

 (tick)

 

importEntitiesgetProperties();

 

 

parseEntityReferencetoXml();

 

 

 

getEntityDescription 

 

getMembers();

 

 

getEntityResourcePropertiesgetMemberResources();

 

 

getEntitygetBodySizeK();

 

 

getEntityUrlgetReleaseDate();

 

 

getEntityAuthzGroups2.2 method

getRetractDate();

 

 

 

 

 

getCollection(String id2.2 method

ContentCollectionEdit Methods

Method Name

Status

Notes

isActiveEdit();

(tick) 

 

getPropertiesEdit(many more collection methods);

 

 

 

 

 

setReleaseDate(many resource methods);

 

2.2 method

setRetractDate();

 

...

2.2 method

ContentResource Methods

Method Name

Status

Notes

getUrl();

 (tick)

 

getReference();

(tick)

 

getUrl(root-prop);

  

2.2 method

getReference(root-prop);

  

2.2 method

getId();

(tick)

 

getProperties();

 

 

toXml();

 

 

 

 

 

getMembersgetContentLength();

 (tick)

 

getMemberResourcesString getContentType();

 

 

getBodySizeKgetContent();

 (tick)

 

getReleaseDate();

 

2.2 method

getRetractDate();

 

2.2 method

...

streamContent();

(tick)

 

ContentResourceEdit Methods

Method Name

Status

Notes

isActiveEdit();

 

 

getPropertiesEdit();

 

 

 

 

 

setContentLength();

 

 

setContentType();

 

 

setContent();

 

 

setReleaseDate();

 

2.2 method

setRetractDate();

 

2.2 method

...

ContentHostingService Methods

getUrl

Method Name

Status

Notes

Entity methods

 

 

getLabel();

 

 

willArchiveMerge();

 

 

willImport();

 

 

archive();

 

 

merge();

 

 

importEntities();

 

 

parseEntityReference();

 

 

getEntityDescription();

 

 

getEntityResourceProperties();

 

 

getEntity();

 

 

getEntityUrl();

 

 

getEntityAuthzGroups();

 

 

Collection methods

 

 

allowAddCollection();

 

 

addCollection(id + props);

 

 

addCollection(id);

 

 

allowGetCollection();

 

 

checkCollection();

 

 

getReferencegetCollection();

(tick)

 

getUrl(root-prop

 

getCollectionSize();

 

 

getAllResources();

 

 

allowUpdateCollection();

 

 

editCollection();

 

 

allowRemoveCollection();

 

 

removeCollection(id);

 

 

removeCollection(obj);

 

 

commitCollection();

 

 

cancelCollection();

 

 

getContainingCollectionId();

 

 

getDepth();

 

 

isRootCollection();

 

 

getCollectionMap();

 

 

eliminateDuplicates();

 

 

Resource methods

 

 

allowAddResource(String id);

 

 

addResource(id + stuff);

 

 

addResource(id + collection + stuff);

 

 

addResource(id);

 

 

allowUpdateResource();

 

 

updateResource();

 

 

editResource();

 

 

allowGetResource();

 

 

getReferencecheckResource(root-prop);

 

 

getIdgetResource();

(tick)

 

allowRemoveResource();

 

 

removeResource(id);

 

 

removeResource(obj);

 

 

allowRename();

 

 

rename();

 

 

allowCopy();

 

 

copy();

 

 

copyIntoFolder();

 

 

moveIntoFolder();

 

 

commitResource(id);

 

 

commitResource(obj);

 

 

cancelResource();

 

 

findResources();

 

 

Attachment methods

 

 

allowAddAttachmentResource();

 

 

isAttachmentResource();

 

 

addAttachmentResource(name + stuff);

 

 

addAttachmentResource(name + tool + stuff);

 

 

addAttachmentResource(name);

 

 

Property methods

 

 

allowGetProperties();

 

 

getProperties();

 

 

allowAddProperty();

 

 

toXmladdProperty();

 

 

allowRemoveProperty();

 

 

removeProperty();

 

 

getContentLengthnewResourceProperties();(tick)

 

 

Locking methods

 

 

String getContentTypegetLocks();

 

 

getContentlockObject();

 

 

getReleaseDateremoveLock();

 

2.2 method

getRetractDate 

isLocked();

 

2.2 method

streamContent 

containsLockedNode();

 

 

ContentResourceEdit Methods

Method Name

Status

Notes

isActiveEditremoveAllLcks();

 

 

Dropbox methods

 

 

createDropboxCollection();

 

 

getPropertiesEditcreateDropboxCollection();

 

 

getDropboxCollection();

 

 

getDropboxCollection();

 

setContentLength 

isDropboxMaintainer();

 

 

setContentTypeisDropboxMaintainer();

 

 

setContentgetDropboxDisplayName();

 

 

setReleaseDategetDropboxDisplayName();

 

2.2 method

setRetractDate 

Misc. methods

 

 

getUuid();

 

 

resolveUuid();

 

 

getUrl();

 

 

getReference();

 

 

getSiteCollection();

 

 

archiveResources();

 

 

isPubView();

 

 

isInheritingPubView();

 

 

setPubView();

 

2.2 method 

You can track progress via my CH Project Notes.

Things to Do

...

.

Joining

Send me email if you are interested in participating in this project.

Seth Theriot (sp?) of Columbia indicated interest in participating.