Class CollectionPolicy

Description

Located in /CollectionPolicy.inc (line 11)

XMLDatastream
   |
   --CollectionPolicy
Variable Summary
 static mixed $DEFAULT_DSID
 static mixed $SCHEMA_URI
Method Summary
 static string getDefaultDSID ()
 static CollectionPolicy ingestBlankPolicy (string $pid, string $name,  $policyDsid, string $model_pid, string $model_namespace,  $relationship, string $searchField, string $searchValue, string $cpDsid, string $relationshiop)
 static CollectionPolicy ingestFromCollection (string $pid, string $name, string $cpDsid, string $copy_collection_pid)
 static CollectionPolicy ingestFromFile (string $pid, string $name, string $cpDsid, string $file)
 static CollectionPolicy loadFromCollection (string $pid, [boolean $preFetch = TRUE])
 XMLDatastream __construct (string $xmlStr, [string $pid = NULL], [string $dsid = NULL])
 void addModel ( $cm,  $namespace)
 boolean addTerm (string $field, string $value)
 ContentModel[] getContentModels ()
 void getName ()
 string getNextPid (string $dsid)
 string getRelationship ()
 string[] getSearchTerms ([boolean $asArray = FALSE], [boolean $recurse = FALSE], [boolean $cache = FALSE])
 string getStagingArea ([BOOLEAN $recurse = TRUE])
 boolean removeModel (ContentModel $cm)
 boolean removeTerm (string $field)
 void setDefaultTerm ( $field)
 boolean setRelationship (string $relationship)
 string setStagingArea (string $path)
Variables
static mixed $DEFAULT_DSID = 'COLLECTION_POLICY' (line 14)
static mixed $SCHEMA_URI = 'http://syn.lib.umanitoba.ca/collection_policy.xsd' (line 13)

Inherited Variables

Inherited from XMLDatastream

XMLDatastream::$dsid
XMLDatastream::$errors
XMLDatastream::$forceSchema
XMLDatastream::$pid
XMLDatastream::$xml
XMLDatastream::$XMLNS
Methods
static getDefaultDSID (line 23)

Gets the default DSID to use for ContentModel datastreams.

static string getDefaultDSID ()
static ingestBlankPolicy (line 138)

Ingests a new minimum Collection Policy datastream to the specified PID with the DSID specified. Initializes the policy with the specified values.

Returns false on failure

  • access: public
static CollectionPolicy ingestBlankPolicy (string $pid, string $name,  $policyDsid, string $model_pid, string $model_namespace,  $relationship, string $searchField, string $searchValue, string $cpDsid, string $relationshiop)
  • string $pid
  • string $name
  • string $cpDsid
  • string $model_pid
  • string $model_namespace
  • string $relationshiop
  • string $searchField
  • string $searchValue
  • $policyDsid
  • $relationship
static ingestFromCollection (line 104)

Ingests a new Collection Policy datastream to the specified PID with the DSID specified. Clones the collection policy from the source collection pid. Returns false on failure.

  • access: public
static CollectionPolicy ingestFromCollection (string $pid, string $name, string $cpDsid, string $copy_collection_pid)
  • string $pid
  • string $name
  • string $cpDsid
  • string $copy_collection_pid
static ingestFromFile (line 76)

Ingests a new Collection Policy datastream to the specified PID with the DSID specified. The file should be a valid collection policy XML. Returns false on failure.

  • access: public
static CollectionPolicy ingestFromFile (string $pid, string $name, string $cpDsid, string $file)
  • string $pid
  • string $name
  • string $cpDsid
  • string $file
static loadFromCollection (line 37)

Constructs a new CollectionPolicy object from the specified collection PID. If preFetch is disabled, then Islandora will not get the datastream until needed.

(useful when cacheing) Returns FALSE on failure.

static CollectionPolicy loadFromCollection (string $pid, [boolean $preFetch = TRUE])
  • string $pid
  • boolean $preFetch: = TRUE
Constructor __construct (line 198)

Constructor NOTE: Use the static constructor methods whenever possible.

  • access: public
XMLDatastream __construct (string $xmlStr, [string $pid = NULL], [string $dsid = NULL])
  • string $xmlStr
  • string $pid
  • string $dsid

Redefinition of:
XMLDatastream::__construct()
Constructor NOTE: Use the static constructor methods whenever possible.
addModel (line 588)
void addModel ( $cm,  $namespace)
  • $cm
  • $namespace
addTerm (line 482)

Adds a search term to the collection policy.

Returns fase on failure.

boolean addTerm (string $field, string $value)
  • string $field
  • string $value
convertFromOldSchema (line 210)

Attempts to convert from the old XML schema to the new by traversing the XML DOM and building a new DOM. When done $this->xml is replaced by the newly created DOM..

  • access: protected
void convertFromOldSchema ()

Redefinition of:
XMLDatastream::convertFromOldSchema()
Attempts to convert from the old XML schema to the new by traversing the XML DOM and building a new DOM. When done $this->xml is replaced by the newly created DOM..
getContentModels (line 392)

Gets a list of ContentModel objects supported by this collection.

ContentModel[] getContentModels ()
getName (line 613)
void getName ()
getNextPid (line 368)

Gets the next available PID for the content model specified by the DSID parameter.

  • access: public
string getNextPid (string $dsid)
  • string $dsid
getRelationship (line 262)

Gets the name of the relationship to use for members of this collection.

Returns FALSE on failure.

  • access: public
string getRelationship ()
getSearchTerms (line 426)

Gets a list of search terms from the Collection Policy. If asArray is set it will return an associative array with the value, field name, and the default value.

If not set, an array of just the values will be returned. If $recurse is TRUE, it will recurseively return the parents search terms if it has none until it returns a set of terms or reaches the top level collection. If $cache is TRUE, it will return a cached version (if available).

string[] getSearchTerms ([boolean $asArray = FALSE], [boolean $recurse = FALSE], [boolean $cache = FALSE])
  • boolean $asArray
  • boolean $recurse
  • boolean $cache
getStagingArea (line 296)

Gets the path to the staging area to use for this collection. By default recurses to the parent collection if the staging area is undefined

  • access: public
string getStagingArea ([BOOLEAN $recurse = TRUE])
  • BOOLEAN $recurse
removeModel (line 565)

Removes the specified content model from the collection policy. This will only prevent future ingests of the removed model to the collection. $cm should be a valid ContentModel object. Returns false on failure or when the CM was not found in the collection policy.

boolean removeModel (ContentModel $cm)
removeTerm (line 510)

Removes the search term specified by the field parameter from the collection policy.

boolean removeTerm (string $field)
  • string $field
setDefaultTerm (line 531)
void setDefaultTerm ( $field)
  • $field
setRelationship (line 278)

Sets the name of the relationship to use for members of this collection.

Returns FALSE on failure.

  • access: public
boolean setRelationship (string $relationship)
  • string $relationship
setStagingArea (line 335)

Sets the path to the staging area to use for this collection. If specified path is blank (or false) it will remove the staging are path element from the collection policy.

  • access: public
string setStagingArea (string $path)
  • string $path

Inherited Methods

Inherited From XMLDatastream

 XMLDatastream::__construct()
 XMLDatastream::convertFromOldSchema()
 XMLDatastream::dumpXml()
 XMLDatastream::getDSIDFromIdentifier()
 XMLDatastream::getHistory()
 XMLDatastream::getIdentifier()
 XMLDatastream::getPidFromIdentifier()
 XMLDatastream::loadFromFile()
 XMLDatastream::purgeVersions()
 XMLDatastream::saveToFedora()
 XMLDatastream::validate()
 XMLDatastream::validDsid()
 XMLDatastream::validPid()

Documentation generated on Thu, 14 Jul 2011 16:29:53 -0300 by phpDocumentor 1.4.3