/**
* Constructor
* @param array $configuration An array of the configuration options
* nessisary to load this manager. To use the a specific manager store, a
* store data source must be configured as noted in the class of said
* manager store.
* manager.
* @access public
*/
function HarmoniRepositoryManager($configuration = NULL)
{
// Define the type to use as a key for Identifying repositories
$this->repositoryKeyType = new HarmoniType("Repository", "edu.middlebury.harmoni", "Repository", "Nodes with this type are by definition Repositories.");
// Cache any created repositories so that we can pass out references to them.
$this->_createdRepositories = array();
$schemaMgr = Services::getService("SchemaManager");
$ids = Services::getService("Id");
$recordStructureId = $ids->getId("edu.middlebury.harmoni.repository.asset_content");
$recordDesc = "A RecordStructure for the generic content of an asset.";
if (!$schemaMgr->schemaExists($recordStructureId->getIdString())) {
// Create the Schema
$schema = new Schema($recordStructureId->getIdString(), "Repository Asset Content", 1, $recordDesc);
$schema->addField(new SchemaField("Content", "Content", "blob", "The binary content of the Asset"));
$schemaMgr->synchronize($schema);
// The SchemaManager only allows you to use Schemas created by it for use with Records.
$schema = $schemaMgr->getSchemaByID($recordStructureId->getIdString());
debug::output("RecordStructure is being created from Schema with Id: '" . $schema->getID() . "'");
$nullRepositoryId = $ids->getId('null');
$this->_createdRecordStructures[$schema->getID()] = new HarmoniRecordStructure($this, $schema, $nullRepositoryId);
// Add the parts to the schema
// $partStructureType = new Type("Repository", "edu.middlebury.harmoni", "Blob", "");
// $this->_createdRecordStructures[$schema->getID()]->createPartStructure(
// "Content",
// "The binary content of the Asset",
// $partStructureType,
// FALSE,
// FALSE,
// FALSE,
// $ids->getId("edu.middlebury.harmoni.repository.asset_content.Content")
// );
}
}