コード例 #1
0
 /**
  * Constructor
  */
 function HarmoniAsset(RepositoryManager $manager, Hierarchy $hierarchy, Repository $repository, Id $id, ConfigurationProperties $configuration)
 {
     // Get the node coresponding to our id
     $this->manager = $manager;
     $this->_hierarchy = $hierarchy;
     $this->_node = $this->_hierarchy->getNode($id);
     $this->_repository = $repository;
     $this->_recordIDs = array();
     $this->_createdRecords = array();
     $this->_createdRecordStructures = array();
     // Store our configuration
     $this->_configuration = $configuration;
     $this->_versionControlAll = $configuration->getProperty('version_control_all') ? TRUE : FALSE;
     if (is_array($configuration->getProperty('version_control_types'))) {
         ArgumentValidator::validate($configuration->getProperty('version_control_types'), ArrayValidatorRuleWithRule::getRule(ExtendsValidatorRule::getRule("Type")));
         $this->_versionControlTypes = $configuration->getProperty('version_control_types');
     } else {
         $this->_versionControlTypes = array();
     }
     $this->_dbIndex = $configuration->getProperty('database_index');
 }
コード例 #2
0
 /**
  * Constructor
  */
 function HarmoniRepository(RepositoryManager $manager, Hierarchy $hierarchy, Id $id, ConfigurationProperties $configuration)
 {
     $this->manager = $manager;
     // Get the node coresponding to our id
     $this->_hierarchy = $hierarchy;
     $this->_node = $this->_hierarchy->getNode($id);
     // Cache any created Assets so that we can pass out references to them.
     $this->_createdAssets = array();
     $this->_assetValidFlags = array();
     //		$this->_assetDataSets = array();
     // Set up an array of searchTypes that this DR supports
     $this->_registerSearchTypes();
     // Define the type to use as a key for Identifying DRs
     $this->_repositoryKeyType = new HarmoniType("Repository", "edu.middlebury.harmoni", "Repository", "Nodes with this type are by definition Repositories.");
     // Set up an array of created RecordStructures so we can pass out references to them.
     $this->_createdRecordStructures = array();
     // Add the file RecordStructure to the DR
     $this->_createdRecordStructures['FILE'] = new HarmoniFileRecordStructure();
     $this->_createdRecordStructures['REMOTE_FILE'] = new RemoteFileRecordStructure();
     // Built-in Types
     // Keys of the array are the RecordStructure Ids,
     // Vals of the array are the record class-names to instantiate.
     $this->_builtInTypes = array();
     if ($configuration->getProperty('use_filesystem_for_files')) {
         $this->_builtInTypes['FILE'] = 'FileSystemFileRecord';
     } else {
         $this->_builtInTypes['FILE'] = 'FileRecord';
     }
     $this->_builtInTypes['REMOTE_FILE'] = 'RemoteFileRecord';
     // Store our configuration
     $this->_configuration = $configuration;
 }