Abstract Class XMLDatastream

Description
  • abstract:

Located in /XMLDatastream.inc (line 9)


	
			
Direct descendents
Class Description
 class CollectionPolicy
 class ContentModel
Variable Summary
 static mixed $errors
 static mixed $XMLNS
 mixed $dsid
 mixed $forceSchema
 mixed $pid
 mixed $xml
Method Summary
 static string getDSIDFromIdentifier (string $identifier)
 static string getPidFromIdentifier (string $identifier)
 static XMLDatastream loadFromFile (string $filename)
 static boolean validDsid ( $dsid, String $pid)
 static boolean validPid (String $pid)
 XMLDatastream __construct (string $xmlStr, [string $pid = NULL], [string $dsid = NULL])
 string dumpXml ()
 string[] getHistory ()
 string getIdentifier ()
 boolean purgeVersions (string $start_date, [string $end_date = NULL])
 boolean saveToFedora ()
 boolean validate ()
Variables
static mixed $errors = NULL (line 12)
static mixed $XMLNS = 'http://www.islandora.ca' (line 11)
mixed $dsid (line 18)
  • access: public
mixed $forceSchema = FALSE (line 15)
  • access: protected
mixed $pid (line 17)
  • access: public
mixed $xml = NULL (line 13)
  • access: protected
Methods
static getDSIDFromIdentifier (line 72)

Parses the DSID from an identifier.

TODO: combine this method with getPidFromIdentifier?

  • access: public
static string getDSIDFromIdentifier (string $identifier)
  • string $identifier
static getPidFromIdentifier (line 25)

Parses an PID from an identifier.

  • access: public
static string getPidFromIdentifier (string $identifier)
  • string $identifier
static loadFromFile (line 84)

Constructs an XMLDatastream object from the XML file specified.

Returns FALSE on failure.

  • access: public
static XMLDatastream loadFromFile (string $filename)
  • string $filename
static validDsid (line 57)

validDsid Validates a fedora Dsid based on the the allowed XML standard NCName.

The regexp is a "regular" subset of names allowed, it excludes some extended hex characters that are technically permitted. http://www.fedora-commons.org/confluence/display/FCR30/Fedora+Identifiers

  • access: public
static boolean validDsid ( $dsid, String $pid)
  • String $pid
  • $dsid
static validPid (line 38)

validPid Validates a fedora PID based on the regexp provided in the fedora 3.3 documentation.

http://www.fedora-commons.org/confluence/display/FCR30/Fedora+Identifiers

  • access: public
static boolean validPid (String $pid)
  • String $pid
Constructor __construct (line 97)

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

Redefined in descendants as:
convertFromOldSchema (line 273)

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..

  • abstract:
  • access: protected
void convertFromOldSchema ()

Redefined in descendants as:
  • CollectionPolicy::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..
  • ContentModel::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..
dumpXml (line 131)

Dumps the XMLDatastream as an XML String

  • return: xml
  • access: public
string dumpXml ()
getHistory (line 250)

Gets the history of the datastream from fedora.

Returns false on failure.

  • access: public
string[] getHistory ()
getIdentifier (line 121)

Gets the identifier for this XMLDatastream Returns FALSE on failure.

NOTE: not available if constructed directly from file.

  • return: identifier
  • access: public
string getIdentifier ()
purgeVersions (line 238)

Purges veersions of the datastream newer than and including the start_date. If End date is specified, it can be used to purge a range of versions instead. Date should be in DATE_RFC822 format

  • access: public
boolean purgeVersions (string $start_date, [string $end_date = NULL])
  • string $start_date
  • string $end_date
saveToFedora (line 219)

Saves the current XML datastream back to fedora. The XML must validate.

  • access: public
boolean saveToFedora ()
validate (line 151)

Validates the XMLDatastream against the schema location

defined by the xmlns:schemaLocation attribute of the root element. If the xmlns:schemaLocation attribute does not exist, then it is assumed to be the old schema and it attempts to convert using the convertFromOldSchema method.

TODO: Maybe change it so that it always validates against a known schema. This makes more sense because this class assumes the structure to be known after it has been validated.

  • access: public
boolean validate ()

Documentation generated on Thu, 14 Jul 2011 16:56:05 -0300 by phpDocumentor 1.4.3