Class HarmoniRepository

Description

Repository manages Assets of various Types and information about the Assets.

Assets are created, persisted, and validated by the Repository. When initially created, an Asset has an immutable Type and unique Id and its validation status is false. In this state, all methods can be called, but integrity checks are not enforced. When the Asset and its Records are ready to be validated, the validateAsset method checks the Asset and sets the validation status. When working with a valid Asset, all methods include integrity checks and an exception is thrown if the activity would result in an inappropriate state. Optionally, the invalidateAsset method can be called to release the requirement for integrity checks, but the Asset will not become valid again, until validateAsset is called and the entire Asset is checked.

<p> OSID Version: 2.0 </p>

  • version: $Id: HarmoniRepository.class.php,v 1.62 2007/09/04 20:25:43 adamfranco Exp $
  • license: GNU General Public License
  • copyright: Copyright &copy;2005, Middlebury College

Located in /harmoni/core/oki2/repository/HarmoniRepository.class.php (line 54)

Repository
   |
   --HarmoniRepositoryInterface
      |
      --HarmoniRepository
Variable Summary
Method Summary
HarmoniRepository HarmoniRepository (mixed $hierarchy, mixed $id, mixed $configuration)
boolean assetExists (object Id $assetId)
object Id copyAsset (mixed $asset, object Asset $asset )
object Asset createAsset (string $displayName, string $description, mixed $assetType, [mixed $id = NULL], object Type $assetType )
object RecordStructure createRecordStructure (string $displayName, string $description, string $format, string $schema, [optional $theID = null], [boolean $isGlobal = FALSE])
void deleteAsset (mixed $assetId, [mixed $parentId = null], object Id $assetId )
void deleteRecordStructure (object Id $recordStructureId, [mixed $statusStars = null])
void duplicateRecordStructure (object Id $recordStructureId, [boolean $copyRecords = FALSE], [optional $id = null], [optional $isGlobal = FALSE], [optional $statusStars = null])
object Asset getAsset (object Id $assetId, [option $verifyExistance = TRUE])
object Asset getAssetByDate (object Id $assetId, mixed $date, object DateAndTime $date )
object LongValueIterator getAssetDates (mixed $assetId, object Id $assetId )
object AssetIterator getAssets ()
object AssetIterator getAssetsBySearch (object mixed $searchCriteria, object Type $searchType, mixed $searchProperties, object Properties $searchProperties )
object AssetIterator getAssetsByType (mixed $assetType, object Type $assetType )
object TypeIterator getAssetTypes ()
string getDisplayName ()
object Id getId ()
object PropertiesIterator getProperties ()
object Properties getPropertiesByType (mixed $propertiesType, object Type $propertiesType )
object TypeIterator getPropertyTypes ()
object RecordStructure getRecordStructure (object $infoStructureId)
object RecordStructureIterator getRecordStructures ()
object RecordStructure getRecordStructuresByType (mixed $recordStructureType, object Type $recordStructureType )
object TypeIterator getSearchTypes ()
object Type getStatus (mixed $assetId, object Id $assetId )
object TypeIterator getStatusTypes ()
object Type getType ()
void invalidateAsset (mixed $assetId, object Id $assetId )
bool isAssetValid (object assetId $assetId)
boolean supportsUpdate ()
boolean supportsVersioning ()
void updateDescription (mixed $description, string $description )
void updateDisplayName (mixed $displayName, string $displayName )
boolean validateAsset (mixed $assetId, object Id $assetId )
void _copyAsset (mixed $asset, mixed $newParentId)
Variables
mixed $_assetValidFlags (line 66)
mixed $_configuration (line 58)
mixed $_createdAssets (line 63)
mixed $_createdRecordStructures (line 65)
mixed $_hierarchy (line 62)
mixed $_node (line 60)
mixed $_searchTypes (line 59)
mixed $_type (line 61)
Methods
Constructor HarmoniRepository (line 71)

Constructor

HarmoniRepository HarmoniRepository (mixed $hierarchy, mixed $id, mixed $configuration)
assetExists (line 957)

Answer true if the asset exists

WARNING: NOT IN OSID

  • since: 1/22/07
  • access: public
boolean assetExists (object Id $assetId)
  • object Id $assetId
copyAsset (line 1201)

Create a copy of an Asset. The Id, AssetType, and Repository for the new Asset is set by the implementation. All Records are similarly copied.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID
object Id copyAsset (mixed $asset, object Asset $asset )
  • object Asset $asset

Redefinition of:
Repository::copyAsset()
Create a copy of an Asset. The Id, AssetType, and Repository for the new Asset is set by the implementation. All Records are similarly copied.
createAsset (line 311)

Create a new Asset of this AssetType in this Repository. The implementation of this method sets the Id for the new object.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE
object Asset createAsset (string $displayName, string $description, mixed $assetType, [mixed $id = NULL], object Type $assetType )
  • string $displayName
  • string $description
  • object Type $assetType

Redefinition of:
Repository::createAsset()
Create a new Asset of this AssetType in this Repository. The implementation of this method sets the Id for the new object.
createRecordStructure (line 1292)

Create a new RecordStructure

WARNING: NOT IN OSID

  • since: 2/17/05
  • access: public
object RecordStructure createRecordStructure (string $displayName, string $description, string $format, string $schema, [optional $theID = null], [boolean $isGlobal = FALSE])
  • string $displayName
  • string $description
  • string $format
  • string $schema
  • boolean $isGlobal
  • optional $theID: object $theID
deleteAsset (line 367)

Delete an Asset from this Repository.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID
void deleteAsset (mixed $assetId, [mixed $parentId = null], object Id $assetId )
  • object Id $assetId

Redefinition of:
Repository::deleteAsset()
Delete an Asset from this Repository.
deleteRecordStructure (line 1336)

Delete a RecordStructure all Records in the repository that use it.

WARNING: NOT IN OSID

  • since: 6/6/06
  • access: public
void deleteRecordStructure (object Id $recordStructureId, [mixed $statusStars = null])
  • object Id $recordStructureId
duplicateRecordStructure (line 1398)

Duplicate a RecordStructure, optionally duplicating the records as well, also optionally deleting the records in the original RecordStructure.

Use this method to convert from data stored in a 'global' RecordStructure such as DublinCore into a 'local' version of the RecordStructure Core in which the user has the option of customizing fields.

As well, this method can be used to convert a RecordStructure and associated Records to a local version if the RecordStructure was accidentally created as a 'global' one.

WARNING: NOT IN OSID

  • since: 6/7/06
  • access: public
void duplicateRecordStructure (object Id $recordStructureId, [boolean $copyRecords = FALSE], [optional $id = null], [optional $isGlobal = FALSE], [optional $statusStars = null])
  • object Id $recordStructureId: The id of the RecordStructure to duplicate
  • boolean $copyRecords: If true, existing records will be duplicated under the new RecordStructure.
  • optional $id: object $id An optional id for the new RecordStructure
  • optional $isGlobal: boolean $isGlobal If true the new RecordStructure will be made a global one.
  • optional $statusStars: object $statusStars A status indicator to use if passed.
getAsset (line 918)

Get the Asset with the specified unique Id.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID
object Asset getAsset (object Id $assetId, [option $verifyExistance = TRUE])
  • object Id $assetId
  • option $verifyExistance: boolean $verifyExistance WARNING: not in OSID. This parameter is used to allow calls to getAsset() from inside this implementation to avoid re-checking the existance of the asset as by their nature, that existance is ensured.

Redefinition of:
Repository::getAsset()
Get the Asset with the specified unique Id.
getAssetByDate (line 996)

Get the Asset with the specified unique Id that is appropriate for the date specified. The specified date allows a Repository implementation to support Asset versioning.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, NO_OBJECT_WITH_THIS_DATE
object Asset getAssetByDate (object Id $assetId, mixed $date, object DateAndTime $date )

Redefinition of:
Repository::getAssetByDate()
Get the Asset with the specified unique Id that is appropriate for the date specified. The specified date allows a Repository implementation to support Asset versioning.
getAssetDates (line 1030)

Get all the dates for the Asset with the specified unique Id. These dates allows a Repository implementation to support Asset versioning.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT
object LongValueIterator getAssetDates (mixed $assetId, object Id $assetId )
  • object Id $assetId

Redefinition of:
Repository::getAssetDates()
Get all the dates for the Asset with the specified unique Id. These dates allows a Repository implementation to support Asset versioning.
getAssets (line 440)

Get all the Assets in this Repository. Iterators return a set, one at a time.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object AssetIterator getAssets ()

Redefinition of:
Repository::getAssets()
Get all the Assets in this Repository. Iterators return a set, one at a time.
getAssetsBySearch (line 1075)

Perform a search of the specified Type and get all the Assets that satisfy the SearchCriteria. Iterators return a set, one at a time.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE
object AssetIterator getAssetsBySearch (object mixed $searchCriteria, object Type $searchType, mixed $searchProperties, object Properties $searchProperties )
  • object mixed $searchCriteria: (original type: java.io.Serializable)
  • object Type $searchType
  • object Properties $searchProperties

Redefinition of:
Repository::getAssetsBySearch()
Perform a search of the specified Type and get all the Assets that satisfy the SearchCriteria. Iterators return a set, one at a time.
getAssetsByType (line 515)

Get all the Assets of the specified AssetType in this Asset. Iterators return a set, one at a time.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE
object AssetIterator getAssetsByType (mixed $assetType, object Type $assetType )
  • object Type $assetType

Redefinition of:
Repository::getAssetsByType()
Get all the Assets of the specified AssetType in this Asset. Iterators return a set, one at a time.
getAssetTypes (line 550)

Get all the AssetTypes in this Repository. AssetTypes are used to categorize Assets. Iterators return a set, one at a time.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object TypeIterator getAssetTypes ()

Redefinition of:
Repository::getAssetTypes()
Get all the AssetTypes in this Repository. AssetTypes are used to categorize Assets. Iterators return a set, one at a time.
getDescription (line 254)

NOT IN OSID??? Get the description for this Repository.

  • return: the name
  • throws: osid.dr.DigitalRepositoryException An exception with one of the following messages defined in osid.dr.DigitalRepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
String getDescription ()

Redefinition of:
Repository::getDescription()
Get the description for this Repository.
getDisplayName (line 168)

Get the display name for this Repository.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
string getDisplayName ()

Redefinition of:
Repository::getDisplayName()
Get the display name for this Repository.
getId (line 191)

Get the unique Id for this Repository.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object Id getId ()

Redefinition of:
Repository::getId()
Get the unique Id for this Repository.
getProperties (line 648)

Get the Properties associated with this Repository.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object PropertiesIterator getProperties ()

Redefinition of:
Repository::getProperties()
Get the Properties associated with this Repository.
getPropertiesByType (line 602)

Get the Properties of this Type associated with this Repository.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE
object Properties getPropertiesByType (mixed $propertiesType, object Type $propertiesType )
  • object Type $propertiesType

Redefinition of:
Repository::getPropertiesByType()
Get the Properties of this Type associated with this Repository.
getPropertyTypes (line 625)

Get all the Property Types for Repository.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object TypeIterator getPropertyTypes ()

Redefinition of:
Repository::getPropertyTypes()
Get all the Property Types for Repository.
getRecordStructure (line 738)

Get the RecordStructure in this DigitalRepository with the specified Id. RecordStructures are used to categorize information about Assets.

Note: This method is a Harmoni addition to the OSID and at the time of this writing, was not a part of the DR OSID.

  • return: The RecordStructure of the requested Id.
  • throws: osid.dr.DigitalRepositoryException An exception with one of the following messages defined in osid.dr.DigitalRepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object RecordStructure getRecordStructure (object $infoStructureId)
  • object $infoStructureId
getRecordStructures (line 773)

Get all the RecordStructures in this Repository. RecordStructures are used to categorize information about Assets. Iterators return a set, one at a time.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object RecordStructureIterator getRecordStructures ()

Redefinition of:
Repository::getRecordStructures()
Get all the RecordStructures in this Repository. RecordStructures are used to categorize information about Assets. Iterators return a set, one at a time.
getRecordStructuresByType (line 677)

Get all the RecordStructures with the specified RecordStructureType in this Repository. RecordStructures are used to categorize information about Assets. Iterators return a set, one at a time.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object RecordStructure getRecordStructuresByType (mixed $recordStructureType, object Type $recordStructureType )
  • object Type $recordStructureType

Redefinition of:
Repository::getRecordStructuresByType()
Get all the RecordStructures with the specified RecordStructureType in this Repository. RecordStructures are used to categorize information about Assets. Iterators return a set, one at a time.
getSearchTypes (line 701)

Get all the SearchTypes supported by this Repository. Iterators return a set, one at a time.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object TypeIterator getSearchTypes ()

Redefinition of:
Repository::getSearchTypes()
Get all the SearchTypes supported by this Repository. Iterators return a set, one at a time.
getStatus (line 824)

Get the StatusType of the Asset with the specified unique Id.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID
object Type getStatus (mixed $assetId, object Id $assetId )
  • object Id $assetId

Redefinition of:
Repository::getStatus()
Get the StatusType of the Asset with the specified unique Id.
getStatusTypes (line 726)

Get all the StatusTypes supported by this Repository. Iterators return a set, one at a time.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object TypeIterator getStatusTypes ()

Redefinition of:
Repository::getStatusTypes()
Get all the StatusTypes supported by this Repository. Iterators return a set, one at a time.
getType (line 214)

Get the RepositoryType of this Repository.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
object Type getType ()

Redefinition of:
Repository::getType()
Get the RepositoryType of this Repository.
invalidateAsset (line 884)

Set the Asset's status Type accordingly and relax validation checking when creating Records and Parts or updating Parts' values.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID
void invalidateAsset (mixed $assetId, object Id $assetId )
  • object Id $assetId

Redefinition of:
Repository::invalidateAsset()
Set the Asset's status Type accordingly and relax validation checking when creating Records and Parts or updating Parts' values.
isAssetValid (line 119)

Returns if this Asset is valid or not.

WARNING: NOT IN OSID - Method no longer in OSID

bool isAssetValid (object assetId $assetId)
  • object assetId $assetId
supportsUpdate (line 1273)

This method indicates whether this implementation supports Repository

methods: copyAsset, deleteAsset, invalidateAsset, updateDescription, updateDisplayName. Asset methods: addAsset, copyRecordStructure, createRecord, deleteRecord, inheritRecordStructure, removeAsset, updateContent, updateDescription, updateDisplayName, updateEffectiveDate, updateExpirationDate. Part methods: createPart, deletePart, updateDisplayName, updateValue. PartStructure methods: updateDisplayName, validatePart. Record methods: createPart, deletePart, updateDisplayName. RecordStructure methods: updateDisplayName, validateRecord.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
boolean supportsUpdate ()

Redefinition of:
Repository::supportsUpdate()
This method indicates whether this implementation supports Repository
supportsVersioning (line 1241)

This method indicates whether this implementation supports Repository methods getAssetsDates() and getAssetByDate()

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED
boolean supportsVersioning ()

Redefinition of:
Repository::supportsVersioning()
This method indicates whether this implementation supports Repository methods getAssetsDates() and getAssetByDate()
updateDescription (line 279)

Update the description for this Repository.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT
void updateDescription (mixed $description, string $description )
  • string $description

Redefinition of:
Repository::updateDescription()
Update the description for this Repository.
updateDisplayName (line 145)

Update the display name for this Repository.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT
void updateDisplayName (mixed $displayName, string $displayName )
  • string $displayName

Redefinition of:
Repository::updateDisplayName()
Update the display name for this Repository.
validateAsset (line 855)

Validate all the Records for an Asset and set its status Type accordingly. If the Asset is valid, return true; otherwise return false. The implementation may throw an Exception for any validation failures and use the Exception's message to identify specific causes.

  • access: public
  • throws: object RepositoryException An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID
boolean validateAsset (mixed $assetId, object Id $assetId )
  • object Id $assetId

Redefinition of:
Repository::validateAsset()
Validate all the Records for an Asset and set its status Type accordingly. If the Asset is valid, return true; otherwise return false. The implementation may throw an Exception for any validation failures and use the Exception's message to identify specific causes.
_copyAsset (line 1474)

Recursively copies an asset and its children to a new parent.

  • access: private
void _copyAsset (mixed $asset, mixed $newParentId)
_registerSearchTypes (line 1553)

Sets up an array of supported searchTypes for the DR.

  • access: private
void _registerSearchTypes ()

Inherited Methods

Inherited From HarmoniRepositoryInterface

HarmoniRepositoryInterface::load()
HarmoniRepositoryInterface::save()

Inherited From Repository

Repository::copyAsset()
Repository::createAsset()
Repository::deleteAsset()
Repository::getAsset()
Repository::getAssetByDate()
Repository::getAssetDates()
Repository::getAssets()
Repository::getAssetsBySearch()
Repository::getAssetsByType()
Repository::getAssetTypes()
Repository::getDescription()
Repository::getDisplayName()
Repository::getId()
Repository::getMandatoryRecordStructures()
Repository::getProperties()
Repository::getPropertiesByType()
Repository::getPropertyTypes()
Repository::getRecordStructures()
Repository::getRecordStructuresByType()
Repository::getSearchTypes()
Repository::getStatus()
Repository::getStatusTypes()
Repository::getType()
Repository::invalidateAsset()
Repository::supportsUpdate()
Repository::supportsVersioning()
Repository::updateDescription()
Repository::updateDisplayName()
Repository::validateAsset()

Documentation generated on Wed, 19 Sep 2007 10:24:17 -0400 by phpDocumentor 1.3.0RC3