Repository

From Harmoni

Jump to: navigation, search

Contents

Overview

The Harmoni Repository service is an implementation of the Repository OSID (version 2). Like other Harmoni services is configured and accessed through the Services API.

Repository OSID documents on the O.K.I. site:

At the time of this writing, the OSID service with the most focus and largest number of implementations is the Repository OSID. This is with good reason, as the Repository OSID can be used to provide access for many kinds of data storage and retrieval systems. One Repository OSID implementaion might provide access to data stored in "institutional repository" system (such as DSpace). Another implementation may provide access to files in a local file-system. An LDAP directory, a database table, or an XML document could be wrapped in and worked with via an appropriate Repository implementation. Along with the Repository OSID the Authentication OSID plays a critical role in the ability to provide controlled access to data.

Similar to its flexibility in covering up many different data storage techniques, the Repository OSID can also be useful for many different client applications. While images and documents are obvious candidates for treatment as Repository 'Assets', other types of data such as blog posts, comment text, wiki pages, web-page hierarchies, configuration information, emails, entries in a course-catalog, and much more can all be mapped to storage in a hierarchy of Repository Assets.

To ease the development of stand-alone applications that do not rely on the existence of external data sources, Harmoni ships with a local-storage implementation of the Repository OSID that provides support for application-defined RecordStructures. In many cases it may be desirable to swap the existing Repository implementation with one that provides a feature set more optimized for a given use.

Configuration

$configuration = new ConfigurationProperties;
$configuration->addProperty('database_index', 0);
$configuration->addProperty('hierarchy_id', "edu.middlebury.authorization.hierarchy");
$configuration->addProperty('default_parent_id', "edu.middlebury.repositories_root");
$configuration->addProperty('version_control_all', TRUE);
$configuration->addProperty('use_filesystem_for_files', FALSE);
// $configuration->addProperty('file_data_path', '/my/path/to/my/files/');
Services::startManagerAsService("RepositoryManager", $context, $configuration);

Implementation Notes

The current Harmoni Repository OSID implementation makes use of the DataManager for storing RecordStructures and Records, and marries this with the Hierarchy in order to provide hierarchical arrangements of Repositories and Assets.

Hierarchy and Id

The Repository implementation makes use of the Hierarchy and Id OSID implementations to provide needed functionality. The Repository implementation expects to be able to access the managers via the Services API, but otherwise only calls the methods listed in their OSIDs. This means that alternate implementations of the Hierarchy and/or Id OSIDs may be swapped in for the current implementations with no negative effect on the Repository.

Authorization

The current Repository implementation does not do any internal authorization checking. If an authorization-checking repository implementation is desired, a Repository wrapper could be made that just passes all calls through to the existing Repository implementation, after authorization checks are performed.

File Data

While most Asset Records are handled by the DataManager, file data is handled by a direct implementation. The file-RecordStructure id is 'FILE' and it is composed of the following PartStructures:

  • 'FILE_DATA'
  • 'FILE_NAME'
  • 'MIME_TYPE'
  • 'FILE_SIZE'
  • 'DIMENSIONS'
  • 'THUMBNAIL_DATA'
  • 'THUMBNAIL_MIME_TYPE'
  • 'THUMBNAIL_DIMENSIONS'

The Repository service can be configured to store file-data in the server's file-system or in the database. For database-storage of file data use the following configuration option:

$configuration->addProperty('use_filesystem_for_files', FALSE);

For file-system-based storage:

$configuration->addProperty('use_filesystem_for_files', TRUE);
$configuration->addProperty('file_data_path', '/my/path/to/my/files/');
Personal tools
applications and initiatives