* Dropped in favour of purge_relationships, which follows the same paradigm as add_relationship. This function tries to figure out the predicate URI based on the prefix/predicate given, which requires specific naming...
* Dropped in favour of purge_relationships, which follows the same paradigm as add_relationship. This function tries to figure out the predicate URI based on the prefix/predicate given, which requires specific naming...
* @param string $relationship
* @param string $relationship
* @param string $object
* @param string $object
* @return boolean
* True if object was modified
*/
*/
function purge_relationship($relationship, $object) {
function purge_relationship($relationship, $object) {
* Does a search using the "query" format followed by the Fedora REST APi.
* Does a search using the "query" format followed by the Fedora REST APi.
*
*
* @param string $pattern to search for, including wildcards.
* @param string $pattern
* @param string $field The field to search on, e.g. pid, title, cDate. See http://www.fedora-commons.org/confluence/display/FCR30/REST+API#RESTAPI-findObjects for details
* pattern to search for, including wildcards.
* @param int $max_results not used at this time
* @param string $field
* The field to search on, e.g. pid, title, cDate. See http://www.fedora-commons.org/confluence/display/FCR30/REST+API#RESTAPI-findObjects for details
* @param int $max_results
* not used at this time
*
*
* @return Array of pid => title pairs that match the results
* The DSID of the datastream to get the dissemination of.
* @param string $as_of_date_time
* The date/time stamp specifying the desired version of the object.
* If null, the current version of the object (the most recent time)
* is assumed.
* @param type $quiet
* @param type $quiet
* Squash errors?
*
*
* @return null
* @return mixed
* NULL if the DS is not present in Fedora Item's datastream list.
* The content of the DS (NULL if empty)
*/
*/
function get_datastream_dissemination($dsid, $as_of_date_time = "", $quiet=TRUE) {
function get_datastream_dissemination($dsid, $as_of_date_time = "", $quiet=TRUE) {
if (!array_key_exists($dsid, $this->datastreams)) {
if (!array_key_exists($dsid, $this->datastreams)) {
@ -703,10 +781,29 @@ RDF;
/**
/**
* Get datastream
* Get datastream
*
*
* @param type $dsid
* @param string $dsid
* datastream id
* @param type $as_of_date_time
* @param type $as_of_date_time
* The date/time stamp specifying the desired version of the object.
* If null, the current version of the object (the most recent time)
* is assumed.
*
*
* @return type
* @return type
* a datastream object
* DatastreamControlGroup controlGroup - String restricted to the values of "X", "M", "R", or "E" (InlineXML,Managed Content,Redirect, or External Referenced).
* String ID - The datastream ID (64 characters max).
* String versionID - The ID of the most recent datastream version
* String[] altIDs - Alternative IDs for the datastream, if any.
* String label - The Label of the datastream.
* boolean versionable - Whether the datastream is versionable.
* String MIMEType - The mime-type for the datastream, if set.
* String formatURI - The format uri for the datastream, if set.
* String createDate - The date the first version of the datastream was created.
* long size - The size of the datastream in Fedora. Only valid for inline XML metadata and managed content datastreams.
* String state - The state of the datastream. Will be "A" (active), "I" (inactive) or "D" (deleted).
* String location - If the datastream is an external reference or redirect, the url to the contents. TODO: Managed?
* String checksumType - The algorithm used to compute the checksum. One of "DEFAULT", "DISABLED", "MD5", "SHA-1", "SHA-256", "SHA-385", "SHA-512".
* String checksum - The value of the checksum represented as a hexadecimal string.
*/
*/
function get_datastream($dsid, $as_of_date_time = '', $quiet = TRUE) {
function get_datastream($dsid, $as_of_date_time = '', $quiet = TRUE) {
if (!array_key_exists($dsid, $this->datastreams)) {
if (!array_key_exists($dsid, $this->datastreams)) {
@ -724,10 +821,13 @@ RDF;
/**
/**
* Get datastream history
* Get datastream history
* Gets all versions of a datastream, sorted from most to least recent.
*
*
* @param type $dsid
* @param string $dsid
* the datastream id
*
*
* @return type
* @return array
* array of datastreams
*/
*/
function get_datastream_history($dsid) {
function get_datastream_history($dsid) {
$params = array(
$params = array(
@ -745,13 +845,18 @@ RDF;
/**
/**
* Get dissemination
* Get dissemination
* Calls a Fedora disseminator
*
*
* @param type $service_definition_pid
* @param string $service_definition_pid
* @param type $method_name
* the id of the service identifier object
* @param type $parameters
* @param string $method_name
* @param type $as_of_date_time
* The name of the method to be executed.
*
* @param array $parameters
* array of key value pairs
* @param string $as_of_date_time
* The versioning dateTime. If null, Fedora will use the most recent version.
* @return string
* @return string
* the content returned by the specified method
*/
*/
function get_dissemination($service_definition_pid, $method_name, $parameters = array(), $as_of_date_time = NULL) {
function get_dissemination($service_definition_pid, $method_name, $parameters = array(), $as_of_date_time = NULL) {
$params = array(
$params = array(
@ -776,7 +881,15 @@ RDF;
* Retrieves and returns a SimpleXML list of this item's datastreams,
* Retrieves and returns a SimpleXML list of this item's datastreams,
* and stores them as an instance variable for caching purposes.
* and stores them as an instance variable for caching purposes.
*
*
* @return SimpleXMLElement
* @return array
* an array of datastream definitions each element in the array contains an
* object with
* - String ID The datastream id - "DC" for the DC datastream
* - String label The datastream label
* - String MIMEType The mimetype of the datastream, if any
*
* @todo verify this documentation, previous version of this documentation
* stated this function returned a simpleXML object
*/
*/
function get_datastreams_list_as_SimpleXML() {
function get_datastreams_list_as_SimpleXML() {
//if ( empty( $this->datastreams_list ) ) {
//if ( empty( $this->datastreams_list ) ) {
@ -791,6 +904,7 @@ RDF;
}
}
/**
/**
* gets information regarding a datastream including
* DatastreamControlGroup controlGroup - String restricted to the values of "X", "M", "R", or "E" (InlineXML,Managed Content,Redirect, or External Referenced).
* DatastreamControlGroup controlGroup - String restricted to the values of "X", "M", "R", or "E" (InlineXML,Managed Content,Redirect, or External Referenced).
* String ID - The datastream ID (64 characters max).
* String ID - The datastream ID (64 characters max).
* String versionID - The ID of the most recent datastream version
* String versionID - The ID of the most recent datastream version
@ -868,7 +982,9 @@ RDF;
* Returns a MIME type string for the given Datastream ID.
* Returns a MIME type string for the given Datastream ID.
*
*
* @param string $dsid
* @param string $dsid
* the datastream id
* @return string
* @return string
* the mime type
*/
*/
function get_mimetype_of_datastream($dsid) {
function get_mimetype_of_datastream($dsid) {
$this->get_datastreams_list_as_SimpleXML();
$this->get_datastreams_list_as_SimpleXML();
@ -890,7 +1006,10 @@ RDF;
* exception so we will parse the RELS-EXT ourselves and simulate the
* exception so we will parse the RELS-EXT ourselves and simulate the
* documented behaviour.
* documented behaviour.
*
*
* @param String $relationship - filter the results to match this string.
* @param string $relationship
* - filter the results to match this string.
* @return array
* array of relationships
*/
*/
function get_relationships($relationship = NULL) {
function get_relationships($relationship = NULL) {
$relationships = array();
$relationships = array();
@ -969,14 +1088,22 @@ RDF;
return $relationships;
return $relationships;
}
}
/**
* @todo test and verify that this function is in use
* wrapper for the get_relationships function
* @return array
* returns an array of relationships
*/
function get_models() {
function get_models() {
//This is/was formerly just a copy/paste jobbie, without the parameter being passable...
//This is/was formerly just a copy/paste jobbie, without the parameter being passable...
return $this->get_relationships();
return $this->get_relationships();
}
}
/**
/**
* Creates a RELS-EXT XML stream from the supplied array and saves it to
* save_relationships
* the item on the server.
* This function looks like it does nothing except return false
*
* @todo complete function or remove function
*
*
* @param <type> $relationships
* @param <type> $relationships
*/
*/
@ -1000,7 +1127,15 @@ RDF;
}
}
/**
/**
* Set the object to a deleted state
* Set the Fedora object's state to deleted (does not remove the object from
* the repository)
*
* @param string $log_message
* a log message, this will be written to the fedora objects audit trail
* @param boolean $quiet
* TRUE to suppress drupal error messages
* @return string
* The timestamp of the operation according to the server, in ISO8601 format.
*/
*/
function move_to_trash($log_message = 'Flagged deleted using Islandora API.', $quiet = TRUE) {
function move_to_trash($log_message = 'Flagged deleted using Islandora API.', $quiet = TRUE) {
// Loop through the datastreams and mark them deleted.
// Loop through the datastreams and mark them deleted.
@ -1022,10 +1157,12 @@ RDF;
}
}
/**
/**
* Removes this object form the repository.
* Permanently removes an object from the repository.
* @param type $log_message
* @param string $log_message
* @param type $force
* @param type $force
* @return type
* force Force the purge, even if it would break a dependency
* @return string
* The timestamp of the operation according to the server, in ISO8601 format.
*/
*/
function purge($log_message = 'Purged using Islandora API.', $force = FALSE) {
function purge($log_message = 'Purged using Islandora API.', $force = FALSE) {
@ -1048,13 +1185,24 @@ RDF;
/**
/**
* Purge datastream
* Purge datastream
*
*
* @param type $dsID
* @param string $dsID
* @param type $start_date
* the datastream id
* @param type $end_date
* @param string $start_date
* @param type $log_message
* The (inclusive) start date-time stamp of the range. If null, this is
* @param type $force
* taken to be the lowest possible value, and thus, the entire version
* history up to the endDT be purged. *
* @param string $end_date
* The (inclusive) ending date-time stamp of the range. If null, this is
* taken to be the greatest possible value, and thus, the entire version
* history back to the startDT will be purged.
* @param string $log_message
* a log message, this will be written to the Fedora objects audit trail
* @param boolean $force
* force Deprecated. Force the update even if it would break a data contract.
* in most cases this should be left as FALSE
*
*
* @return type
* @return string
* The timestamp of the operation according to the server, in ISO8601 format.
*/
*/
function purge_datastream($dsID, $start_date = NULL, $end_date = NULL, $log_message = 'Purged datastream using Islandora API', $force = FALSE) {
function purge_datastream($dsID, $start_date = NULL, $end_date = NULL, $log_message = 'Purged datastream using Islandora API', $force = FALSE) {