Gets the default DSID to use for ContentModel datastreams.
static string
getDefaultDSID
()
Ingests a minimum Content Model to the specified pid/dsid.
Returns false on failure.
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
Ingests a Content Model from a file to the specified pid/dsid .
Returns false on failure.
static
ContentModel
ingestFromFile
(
string $pid,
string $name,
string $modelDsid,
string $file)
-
string
$pid
-
string
$name
-
string
$modelDsid
-
string
$file
Ingests a Content Model from an existing model to the specified pid/dsid .
Returns false on failure.
static
ContentModel
ingestFromModel
(
string $pid,
string $name,
string $modelDsid,
string $copy_model_pid)
-
string
$pid
-
string
$name
-
string
$modelDsid
-
string
$copy_model_pid
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.\
static
ContentModel
loadFromModel
(
string $pid, [
string $dsid =
NULL], [
string $pid_namespace =
NULL], [
string $name =
NULL])
-
string
$pid
-
string
$dsid
-
string
$pid_namespace
-
string
$name
Constructs a ContentModel object from a Fedora item by getting the first content model from the hasModel relationship.
Returns false on failure.
Constructor NOTE: Use the static constructor methods whenever possible.
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.
void
addAppliesTo
( $rule_id, $type)
Adds an authority list item to a form element.
void
addAuthListItem
( $elementName, $value, [ $label = ''])
-
$elementName
-
$value
-
$label
void
addDispMeth
( $dsid, $module, $file, $class, $method, [ $default = FALSE])
-
$dsid
-
$module
-
$file
-
$class
-
$method
-
$default
void
addDs
( $dsid, [ $display_in_fieldset = FALSE])
-
$dsid
-
$display_in_fieldset
addElementToForm
( $element, $parent_element, $element_definition)
-
$element_definition
-
$parent_element
-
$element
Adds the named form.
boolean
addForm
(string $element)
-
string
$element: Name of the form to add.
Add an ingest form element to the model.
boolean
addIngestFormElement
(String $name, String $label, String $type, boolean $required, [String $description = ''])
-
String
$name
-
String
$label
-
String
$type
-
boolean
$required
-
String
$description
void
addIngestMethod
( $rule_id, $module, $file, $class, $method, $dsid, $modified_files_ext)
-
$rule_id
-
$module
-
$file
-
$class
-
$method
-
$dsid
-
$modified_files_ext
void
addIngestMethodParam
( $rule_id, $module, $file, $class, $method, $name, $value)
-
$rule_id
-
$module
-
$file
-
$class
-
$method
-
$name
-
$value
void
addIngestRule
( $applies_to, $module, $file, $class, $method, $dsid, $modified_files_ext)
-
$applies_to
-
$module
-
$file
-
$class
-
$method
-
$dsid
-
$modified_files_ext
Adds an allowed mimetype to the model.
boolean
addMimetype
(String $type)
Builds an edit metadata form using the method specified in the <edit_metadata_method> element
$form
buildEditMetadataForm
( $pid, string $dsid)
Builds an ingest form using the method specified in <form_builder_method> element of <ingest_form> Returns FALSE on failure.
string
buildIngestForm
(&$form &$form, &$form_state &$form_state)
-
&$form
&$form
-
&$form_state
&$form_state
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..
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..
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.
boolean
decAuthListItem
(String $elementName, String $value)
-
String
$elementName
-
String
$value
decFormElement
( $form_element)
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.
boolean
decIngestFormElement
(String $name)
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.
string
displayExtraFieldset
(string $pid, $page_number)
void
displayInFieldset
( $dsid)
Edits a form element with attribute name='$name' from the 'forms' element.
void
editForm
(String $name, $element)
void
editFormElement
( $new_element, $edit_element, $element_definition, $parent_element)
-
$element_definition
-
$parent_element
-
$new_element
-
$edit_element
void
editIngestFormAttributes
( $dsid, $page, [ $hide_file_chooser = FALSE], [ $redirect = TRUE])
-
$dsid
-
$page
-
$hide_file_chooser
-
$redirect
void
editIngestFormBuilderMethod
( $module, $file, $class, $method, $handler)
-
$module
-
$file
-
$class
-
$method
-
$handler
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.
boolean
editIngestFormElement
(String $name, String $label, String $type, boolean $required, String $description)
-
String
$name
-
String
$label
-
String
$type
-
boolean
$required
-
String
$description: description
Executes the add datastream method for the specified datastream on the specified file.
Returns FALSE on failure.
$result
execAddDatastreamMethods
(string $dsid, $file, string $filen)
-
string
$dsid
-
string
$filen
-
$file
Executes the form handler from the <form_builder_method> element of <ingest_form>.
boolean
execFormHandler
(&$formData &$data, &$form_state &$form_state)
-
&$formData
&$data
-
&$form_state
&$form_state
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.
$result
execIngestRules
(string $file, string $mimetype, [boolean $preview = FALSE])
-
string
$file
-
string
$mimetype
-
boolean
$preview
void
getAddDsMethod
( $ds)
void
getDisplayMethods
( $ds)
array
getEditFormNames
()
Gets an associative array describing the edit metadata method.
Array has the following keys: 'file', 'class', 'method', 'handler', 'dsid'
String[]
getEditMetadataMethod
()
Find the form element with name $name.
DOMElement
getForm
(string $name)
-
string
$name: The name of the form element to find.
void
getIngestFormAttributes
()
void
getIngestFormBuilderMethod
()
Gets a list of all parameters that belong to the specified ingest form element.
boolean
getIngestFormElementParams
( $name, String $elementName)
-
String
$elementName
-
$name
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'
string[]
getIngestFormElements
()
array
getIngestFormNames
()
void
getIngestRule
( $rule_id)
Gets a list of valid mimetypes that can apply to this model.
Returns FALSE on failure.
string[]
getMimetypes
()
Gets the name of the ContentModel Returns false on failure.
String
getName
()
Gets a list of service deployments that this model has.
NOTE: Not currently being used.
String[]
getServices
()
Handles the edit metadata form using the handler specified in the <edit_metadata_method> element Returns FALSE on failure.
$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
Increments (or decrements) an authority list item from a form element in the list of elements.
Updates the "order".
boolean
incAuthListItem
(String $elementName, String $value, [ $reorder = 'inc'], String $direction)
-
String
$elementName
-
String
$value
-
String
$direction
-
$reorder
incFormElement
( $form_element)
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.
boolean
incIngestFormElement
(String $name, [String $reorder = 'inc'])
-
String
$name
-
String
$reorder
Gets a list of datastreams from the ContentModel (not including the QDC ds if it is listed).
Returns FALSE on failure.
string[]
listDatastreams
()
void
removeAppliesTo
( $rule_id, $type)
Removes an authority list item from a form element.
void
removeAuthListItem
( $elementName, $value)
void
removeDispMeth
( $dsid, $module, $file, $class, $method)
-
$dsid
-
$module
-
$file
-
$class
-
$method
Removes the edit data method from the Content Model.
boolean
removeEditMetadataMethod
()
Removes the named form.
boolean
removeForm
(string $name)
-
string
$name: Name of the form to remove.
Removes an ingest form element from the list of ingest form elements.
boolean
removeIngestFormElement
(String $name)
void
removeIngestMethod
( $rule_id, $module, $file, $class, $method)
-
$rule_id
-
$module
-
$file
-
$class
-
$method
void
removeIngestMethodParam
( $rule_id, $module, $file, $class, $method, $name)
-
$rule_id
-
$module
-
$file
-
$class
-
$method
-
$name
void
removeIngestRule
( $rule_id)
Removes an allowed mimetype from the model.
boolean
removeMimetype
(String $type)
void
setDefaultDispMeth
( $dsid, $module, $file, $class, $method)
-
$dsid
-
$module
-
$file
-
$class
-
$method
void
setDisplayInFieldset
( $dsid, [ $value = TRUE])
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").
boolean
setIngestFormElementParam
( $name, String $paramName, String $paramValue, String $elementName)
-
String
$elementName
-
String
$paramName
-
String
$paramValue
-
$name
Update the Edit Metadata Method defined in the Content Model
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()