Class ContentModel

Description

Located in /ContentModel.inc (line 11)

XMLDatastream
   |
   --ContentModel
Variable Summary
 static mixed $DEFAULT_DSID
 static mixed $SCHEMA_URI
 mixed $name
Method Summary
 static string getDefaultDSID ()
 static ContentModel ingestBlankModel (string $pid, string $name, string $modelDsid, string $defaultMimetype,  $ingestFormDsid, integer $ingestFormPage,  $ingestFormHideChooser, string $ingestFormModule, string $ingestFormFile, string $ingestFormClass, string $ingestFormMethod, string $ingestFormHandler, string $ingestFromDsid, boolean $ingestFormHideFileChooser)
 static ContentModel ingestFromFile (string $pid, string $name, string $modelDsid, string $file)
 static ContentModel ingestFromModel (string $pid, string $name, string $modelDsid, string $copy_model_pid)
 static ContentModel loadFromModel (string $pid, [string $dsid = NULL], [string $pid_namespace = NULL], [string $name = NULL])
 static ContentModel loadFromObject (string $pid)
 XMLDatastream __construct (string $xmlStr, [string $pid = NULL], [string $dsid = NULL], [string $pid_namespace = NULL], [string $name = NULL])
 void addAppliesTo ( $rule_id,  $type)
 void addAuthListItem ( $elementName,  $value, [ $label = ''])
 void addDispMeth ( $dsid,  $module,  $file,  $class,  $method, [ $default = FALSE])
 void addDs ( $dsid, [ $display_in_fieldset = FALSE])
 addElementToForm ( $element,  $parent_element,  $element_definition)
 boolean addForm (string $element)
 boolean addIngestFormElement (String $name, String $label, String $type, boolean $required, [String $description = ''])
 void addIngestMethod ( $rule_id,  $module,  $file,  $class,  $method,  $dsid,  $modified_files_ext)
 void addIngestMethodParam ( $rule_id,  $module,  $file,  $class,  $method,  $name,  $value)
 void addIngestRule ( $applies_to,  $module,  $file,  $class,  $method,  $dsid,  $modified_files_ext)
 boolean addMimetype (String $type)
 $form buildEditMetadataForm ( $pid, string $dsid)
 string buildIngestForm (&$form &$form, &$form_state &$form_state)
 boolean decAuthListItem (String $elementName, String $value)
 decFormElement ( $form_element)
 boolean decIngestFormElement (String $name)
 string displayExtraFieldset (string $pid,  $page_number)
 void displayInFieldset ( $dsid)
 void editForm (String $name,  $element)
 void editFormElement ( $new_element,  $edit_element,  $element_definition,  $parent_element)
 void editIngestFormAttributes ( $dsid,  $page, [ $hide_file_chooser = FALSE], [ $redirect = TRUE])
 void editIngestFormBuilderMethod ( $module,  $file,  $class,  $method,  $handler)
 boolean editIngestFormElement (String $name, String $label, String $type, boolean $required, String $description)
 $result execAddDatastreamMethods (string $dsid,  $file, string $filen)
 boolean execFormHandler (&$formData &$data, &$form_state &$form_state)
 $result execIngestRules (string $file, string $mimetype, [boolean $preview = FALSE])
 void getAddDsMethod ( $ds)
 void getDisplayMethods ( $ds)
 array getEditFormNames ()
 String[] getEditMetadataMethod ()
 DOMElement getForm (string $name)
 array getFormNames ()
 boolean getIngestFormElementParams ( $name, String $elementName)
 string[] getIngestFormElements ()
 void getIngestRule ( $rule_id)
 void getIngestRules ()
 string[] getMimetypes ()
 String getName ()
 String[] getServices ()
 $result handleEditMetadataForm (&$form_id &$form_id, &$form_values &$form_state, &$soap_client &$soap_client)
 boolean incAuthListItem (String $elementName, String $value, [ $reorder = 'inc'], String $direction)
 incFormElement ( $form_element)
 boolean incIngestFormElement (String $name, [String $reorder = 'inc'])
 string[] listDatastreams ()
 void removeAppliesTo ( $rule_id,  $type)
 void removeAuthListItem ( $elementName,  $value)
 void removeDispMeth ( $dsid,  $module,  $file,  $class,  $method)
 void removeDs ( $dsid)
 boolean removeForm (string $name)
 boolean removeIngestFormElement (String $name)
 void removeIngestMethod ( $rule_id,  $module,  $file,  $class,  $method)
 void removeIngestMethodParam ( $rule_id,  $module,  $file,  $class,  $method,  $name)
 void removeIngestRule ( $rule_id)
 boolean removeMimetype (String $type)
 void setDefaultDispMeth ( $dsid,  $module,  $file,  $class,  $method)
 void setDisplayInFieldset ( $dsid, [ $value = TRUE])
 boolean setIngestFormElementParam ( $name, String $paramName, String $paramValue, String $elementName)
 boolean updateEditMetadataMethod (String $module, String $file, String $class, String $method, String $handler, String $dsid)
Variables
static mixed $DEFAULT_DSID = 'ISLANDORACM' (line 13)
static mixed $SCHEMA_URI = 'http://localhost/islandoracm.xsd' (line 12)
mixed $name (line 17)
  • access: public
mixed $pid_namespace (line 16)
  • access: public

Inherited Variables

Inherited from XMLDatastream

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

Gets the default DSID to use for ContentModel datastreams.

static string getDefaultDSID ()
static ingestBlankModel (line 131)

Ingests a minimum Content Model to the specified pid/dsid.

Returns false on failure.

  • access: public
static ContentModel ingestBlankModel (string $pid, string $name, string $modelDsid, string $defaultMimetype,  $ingestFormDsid, integer $ingestFormPage,  $ingestFormHideChooser, string $ingestFormModule, string $ingestFormFile, string $ingestFormClass, string $ingestFormMethod, string $ingestFormHandler, string $ingestFromDsid, boolean $ingestFormHideFileChooser)
  • string $pid
  • string $name
  • string $modelDsid
  • string $defaultMimetype
  • string $ingestFromDsid
  • integer $ingestFormPage
  • boolean $ingestFormHideFileChooser
  • string $ingestFormModule
  • string $ingestFormFile
  • string $ingestFormClass
  • string $ingestFormMethod
  • string $ingestFormHandler
  • $ingestFormDsid
  • $ingestFormHideChooser
static ingestFromFile (line 63)

Ingests a Content Model from a file to the specified pid/dsid .

Returns false on failure.

  • access: public
static ContentModel ingestFromFile (string $pid, string $name, string $modelDsid, string $file)
  • string $pid
  • string $name
  • string $modelDsid
  • string $file
static ingestFromModel (line 91)

Ingests a Content Model from an existing model to the specified pid/dsid .

Returns false on failure.

  • access: public
static ContentModel ingestFromModel (string $pid, string $name, string $modelDsid, string $copy_model_pid)
  • string $pid
  • string $name
  • string $modelDsid
  • string $copy_model_pid
static loadFromModel (line 198)

Constructs a ContentModel object from the PID of the model in Fedora.

If DSID is specified it will use that datastream as the model, otherwise it will use the default (usually ISLANDORACM). PID_NAMESPACE and name can also be initialized from the collection policy. Returns false on failure.

NOTE: $name will be overwritten with the content model name found in the datastream when the model is first validated.\

  • access: public
static ContentModel loadFromModel (string $pid, [string $dsid = NULL], [string $pid_namespace = NULL], [string $name = NULL])
  • string $pid
  • string $dsid
  • string $pid_namespace
  • string $name
static loadFromObject (line 36)

Constructs a ContentModel object from a Fedora item by getting the first content model from the hasModel relationship.

Returns false on failure.

  • access: public
static ContentModel loadFromObject (string $pid)
  • string $pid
Constructor __construct (line 228)

Constructor NOTE: Use the static constructor methods whenever possible.

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

Redefinition of:
XMLDatastream::__construct()
Constructor NOTE: Use the static constructor methods whenever possible.
addAppliesTo (line 1761)
  • access: public
void addAppliesTo ( $rule_id,  $type)
  • $rule_id
  • $type
addAuthListItem (line 960)

Adds an authority list item to a form element.

  • access: public
void addAuthListItem ( $elementName,  $value, [ $label = ''])
  • $elementName
  • $value
  • $label
addDispMeth (line 1698)
  • access: public
void addDispMeth ( $dsid,  $module,  $file,  $class,  $method, [ $default = FALSE])
  • $dsid
  • $module
  • $file
  • $class
  • $method
  • $default
addDs (line 1586)
  • access: public
void addDs ( $dsid, [ $display_in_fieldset = FALSE])
  • $dsid
  • $display_in_fieldset
addElementToForm (line 2169)
  • access: public
addElementToForm ( $element,  $parent_element,  $element_definition)
  • $element_definition
  • $parent_element
  • $element
addForm (line 2120)

Adds the named form.

  • return: TRUE on success, FALSE otherwise.
  • access: public
boolean addForm (string $element)
  • string $element: Name of the form to add.
addIngestFormElement (line 819)

Add an ingest form element to the model.

  • access: public
boolean addIngestFormElement (String $name, String $label, String $type, boolean $required, [String $description = ''])
  • String $name
  • String $label
  • String $type
  • boolean $required
  • String $description
addIngestMethod (line 1779)
  • access: public
void addIngestMethod ( $rule_id,  $module,  $file,  $class,  $method,  $dsid,  $modified_files_ext)
  • $rule_id
  • $module
  • $file
  • $class
  • $method
  • $dsid
  • $modified_files_ext
addIngestMethodParam (line 1817)
  • access: public
void addIngestMethodParam ( $rule_id,  $module,  $file,  $class,  $method,  $name,  $value)
  • $rule_id
  • $module
  • $file
  • $class
  • $method
  • $name
  • $value
addIngestRule (line 1906)
  • access: public
void addIngestRule ( $applies_to,  $module,  $file,  $class,  $method,  $dsid,  $modified_files_ext)
  • $applies_to
  • $module
  • $file
  • $class
  • $method
  • $dsid
  • $modified_files_ext
addMimetype (line 1522)

Adds an allowed mimetype to the model.

  • access: public
boolean addMimetype (String $type)
  • String $type
buildEditMetadataForm (line 1092)

Builds an edit metadata form using the method specified in the <edit_metadata_method> element

  • access: public
$form buildEditMetadataForm ( $pid, string $dsid)
  • string $dsid
  • $pid
buildIngestForm (line 1011)

Builds an ingest form using the method specified in <form_builder_method> element of <ingest_form> Returns FALSE on failure.

  • return: identifier
  • access: public
string buildIngestForm (&$form &$form, &$form_state &$form_state)
  • &$form &$form
  • &$form_state &$form_state
convertFromOldSchema (line 243)

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..
decAuthListItem (line 851)

Decrements an authority list item from a form element in the list of elements.

Updates the "order". This method is simply an overload to the incAuthListItem which has a direction parameter.

  • access: public
boolean decAuthListItem (String $elementName, String $value)
  • String $elementName
  • String $value
decFormElement (line 2233)
  • access: public
decFormElement ( $form_element)
  • $form_element
decIngestFormElement (line 571)

Decrements an ingest form element in the list of elements.

Updates the "order". This method is simply an overload to the incIngestFormElement which has a direction parameter.

TODO: Might be useful to move multiple places at once, or define a method to move to an absolute position.

  • access: public
boolean decIngestFormElement (String $name)
  • String $name
displayExtraFieldset (line 1447)

Calls all defined display methods for the ContentModel.

The PID specified is passed to the constructor of the display class(es) specified in the Content Model.

  • access: public
string displayExtraFieldset (string $pid,  $page_number)
  • string $pid
  • $page_number
displayInFieldset (line 1621)
  • access: public
void displayInFieldset ( $dsid)
  • $dsid
editForm (line 2144)

Edits a form element with attribute name='$name' from the 'forms' element.

  • access: public
void editForm (String $name,  $element)
  • String $name
  • $element
editFormElement (line 2180)
  • access: public
void editFormElement ( $new_element,  $edit_element,  $element_definition,  $parent_element)
  • $element_definition
  • $parent_element
  • $new_element
  • $edit_element
editIngestFormAttributes (line 1974)
  • access: public
void editIngestFormAttributes ( $dsid,  $page, [ $hide_file_chooser = FALSE], [ $redirect = TRUE])
  • $dsid
  • $page
  • $hide_file_chooser
  • $redirect
editIngestFormBuilderMethod (line 2010)
  • access: public
void editIngestFormBuilderMethod ( $module,  $file,  $class,  $method,  $handler)
  • $module
  • $file
  • $class
  • $method
  • $handler
editIngestFormElement (line 760)

Edits the ingest form element specified.

NOTE: The element name can not be changed. To update an elements name it must be deleted and added with the new name.

  • return: success
  • access: public
boolean editIngestFormElement (String $name, String $label, String $type, boolean $required, String $description)
  • String $name
  • String $label
  • String $type
  • boolean $required
  • String $description: description
execAddDatastreamMethods (line 1258)

Executes the add datastream method for the specified datastream on the specified file.

Returns FALSE on failure.

  • access: public
$result execAddDatastreamMethods (string $dsid,  $file, string $filen)
  • string $dsid
  • string $filen
  • $file
execFormHandler (line 1385)

Executes the form handler from the <form_builder_method> element of <ingest_form>.

  • access: public
boolean execFormHandler (&$formData &$data, &$form_state &$form_state)
  • &$formData &$data
  • &$form_state &$form_state
execIngestRules (line 1311)

Executes the ingest rules that apply to the specified file/mimetype.

Returns FALSE on failure.

If $preview is TRUE, then only execute rules with a parameter 'preview'. Used to generate previews for the file chooser.

  • access: public
$result execIngestRules (string $file, string $mimetype, [boolean $preview = FALSE])
  • string $file
  • string $mimetype
  • boolean $preview
getAddDsMethod (line 1715)
  • access: public
void getAddDsMethod ( $ds)
  • $ds
getDisplayMethods (line 1570)
  • access: public
void getDisplayMethods ( $ds)
  • $ds
getEditFormNames (line 2079)
  • return: An array of form names that exist in this content model.
  • access: public
array getEditFormNames ()
getEditMetadataMethod (line 1183)

Gets an associative array describing the edit metadata method.

Array has the following keys: 'file', 'class', 'method', 'handler', 'dsid'

  • access: public
String[] getEditMetadataMethod ()
getForm (line 2032)

Find the form element with name $name.

  • return: The form element $name, if found FALSE otherwise.
  • access: public
DOMElement getForm (string $name)
  • string $name: The name of the form element to find.
getFormNames (line 2042)
  • return: An array of form names that exist in this content model.
  • access: public
array getFormNames ()
getIngestFormAttributes (line 1961)
  • access: public
void getIngestFormAttributes ()
getIngestFormBuilderMethod (line 1997)
  • access: public
void getIngestFormBuilderMethod ()
getIngestFormElementParams (line 720)

Gets a list of all parameters that belong to the specified ingest form element.

  • return: success
  • access: public
boolean getIngestFormElementParams ( $name, String $elementName)
  • String $elementName
  • $name
getIngestFormElements (line 503)

Gets an array of form elements to use in the ingest form. The results of this array are passed to the specified ingest form builder. The form builder can optionally not use the elements as defined in the form builder if more complex forms or behaviour is required.

Each element has the following keys: 'label', 'type', 'required', 'description', and if defined, 'authoritative_list' and/or 'parameters'

  • access: public
string[] getIngestFormElements ()
getIngestFormNames (line 2061)
  • return: An array of form names that exist in this content model.
  • access: public
array getIngestFormNames ()
getIngestRule (line 1732)
  • access: public
void getIngestRule ( $rule_id)
  • $rule_id
getIngestRules (line 1920)
  • access: public
void getIngestRules ()
getMimetypes (line 1423)

Gets a list of valid mimetypes that can apply to this model.

Returns FALSE on failure.

  • access: public
string[] getMimetypes ()
getName (line 458)

Gets the name of the ContentModel Returns false on failure.

  • access: public
String getName ()
getServices (line 428)

Gets a list of service deployments that this model has.

NOTE: Not currently being used.

  • access: public
String[] getServices ()
handleEditMetadataForm (line 1134)

Handles the edit metadata form using the handler specified in the <edit_metadata_method> element Returns FALSE on failure.

  • access: public
$result handleEditMetadataForm (&$form_id &$form_id, &$form_values &$form_state, &$soap_client &$soap_client)
  • &$form_id &$form_id
  • &$form_values &$form_state
  • &$soap_client &$soap_client
incAuthListItem (line 864)

Increments (or decrements) an authority list item from a form element in the list of elements.

Updates the "order".

  • access: public
boolean incAuthListItem (String $elementName, String $value, [ $reorder = 'inc'], String $direction)
  • String $elementName
  • String $value
  • String $direction
  • $reorder
incFormElement (line 2216)
  • access: public
incFormElement ( $form_element)
  • $form_element
incIngestFormElement (line 587)

Increments (or decrements) ingest form element in the list of elements.

Updates the "order". The $reorder parameter accepts 'inc' or 'dec' to specify the direction to move (defaults to increment.)

TODO: Might be useful to move multiple places at once, or define a method to move to an absolute position.

  • access: public
boolean incIngestFormElement (String $name, [String $reorder = 'inc'])
  • String $name
  • String $reorder
listDatastreams (line 1497)

Gets a list of datastreams from the ContentModel (not including the QDC ds if it is listed).

Returns FALSE on failure.

  • access: public
string[] listDatastreams ()
removeAppliesTo (line 1742)
  • access: public
void removeAppliesTo ( $rule_id,  $type)
  • $rule_id
  • $type
removeAuthListItem (line 914)

Removes an authority list item from a form element.

  • access: public
void removeAuthListItem ( $elementName,  $value)
  • $elementName
  • $value
removeDispMeth (line 1675)
  • access: public
void removeDispMeth ( $dsid,  $module,  $file,  $class,  $method)
  • $dsid
  • $module
  • $file
  • $class
  • $method
removeDs (line 1610)
  • access: public
void removeDs ( $dsid)
  • $dsid
removeEditMetadataMethod (line 1205)

Removes the edit data method from the Content Model.

  • access: public
boolean removeEditMetadataMethod ()
removeForm (line 2101)

Removes the named form.

  • return: TRUE on success, FALSE otherwise.
  • access: public
boolean removeForm (string $name)
  • string $name: Name of the form to remove.
removeIngestFormElement (line 621)

Removes an ingest form element from the list of ingest form elements.

  • access: public
boolean removeIngestFormElement (String $name)
  • String $name
removeIngestMethod (line 1797)
  • access: public
void removeIngestMethod ( $rule_id,  $module,  $file,  $class,  $method)
  • $rule_id
  • $module
  • $file
  • $class
  • $method
removeIngestMethodParam (line 1859)
  • access: public
void removeIngestMethodParam ( $rule_id,  $module,  $file,  $class,  $method,  $name)
  • $rule_id
  • $module
  • $file
  • $class
  • $method
  • $name
removeIngestRule (line 1898)
  • access: public
void removeIngestRule ( $rule_id)
  • $rule_id
removeMimetype (line 1550)

Removes an allowed mimetype from the model.

  • access: public
boolean removeMimetype (String $type)
  • String $type
setDefaultDispMeth (line 1644)
  • access: public
void setDefaultDispMeth ( $dsid,  $module,  $file,  $class,  $method)
  • $dsid
  • $module
  • $file
  • $class
  • $method
setDisplayInFieldset (line 1629)
  • access: public
void setDisplayInFieldset ( $dsid, [ $value = TRUE])
  • $dsid
  • $value
setIngestFormElementParam (line 650)

Sets a parameter of an ingest form element. If the value of the element is FALSE the parameter will be removed entirely (if you want to store false as a value, then send the String "false").

  • return: success
  • access: public
boolean setIngestFormElementParam ( $name, String $paramName, String $paramValue, String $elementName)
  • String $elementName
  • String $paramName
  • String $paramValue
  • $name
updateEditMetadataMethod (line 1228)

Update the Edit Metadata Method defined in the Content Model

  • access: public
boolean updateEditMetadataMethod (String $module, String $file, String $class, String $method, String $handler, String $dsid)
  • String $module
  • String $file
  • String $class
  • String $method
  • String $handler
  • String $dsid

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:56:04 -0300 by phpDocumentor 1.4.3