* * 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
* String[] altIDs - Alternative IDs for the datastream, if any.
* String[] altIDs - Alternative IDs for the datastream, if any.
* String label - The Label of the datastream.
* String label - The Label of the datastream.
* boolean versionable - Whether the datastream is versionable.
* boolean versionable - Whether the datastream is versionable.
* String MIMEType - The mime-type for the datastream, if set.
* String MIMEType - The mime-type for the datastream, if set.
* String formatURI - The format uri 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.
* 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.
* 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 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 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 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.
* String checksum - The value of the checksum represented as a hexadecimal string.
*
*
* @param string $dsid
* @param string $dsid
* @return datastream object
* @return datastream object
* get the mimetype size etc. in one shot. instead of iterating throught the datastream list for what we need
* get the mimetype size etc. in one shot. instead of iterating throught the datastream list for what we need
*/
*/
function get_datastream_info($dsid,$as_of_date_time = ""){
function get_datastream_info($dsid,$as_of_date_time = ""){
@ -101,7 +101,8 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label
if (!validPid($collection_pid)) {
if (!validPid($collection_pid)) {
if (validPid(urldecode($collection_pid))) {
if (validPid(urldecode($collection_pid))) {
$collection_pid = urldecode($collection_pid);
$collection_pid = urldecode($collection_pid);
} else {
}
else {
drupal_set_message(t("This collection PID $collection_pid is not valid"), 'error');
drupal_set_message(t("This collection PID $collection_pid is not valid"), 'error');
return ' ';
return ' ';
}
}
@ -202,10 +203,11 @@ function fedora_repository_ingest_form_validate($form, &$form_state) {
if (!empty($file)) {
if (!empty($file)) {
if (!in_array($dformat, $allowedMimeTypes)) {
if (!in_array($dformat, $allowedMimeTypes)) {
form_set_error('ingest-file-location', t('The uploaded file\'s mimetype (' . $dformat . ') is not associated with this Content Model. The allowed types are ' .
form_set_error('ingest-file-location', t('The uploaded file\'s mimetype (' . $dformat . ') is not associated with this Content Model. The allowed types are ' .
@ -262,7 +264,8 @@ function fedora_repository_purge_object_form(&$form_state, $pid, $referrer) {
//$form['#redirect'] = $referrer;
//$form['#redirect'] = $referrer;
return $form;
return $form;
} else {
}
else {
// ALSO do $form definition here. Your final submit handler (after user clicks Yes, I Confirm) will only see $form_state info defined here. Form you create here passed as param1 to confirm_form
// ALSO do $form definition here. Your final submit handler (after user clicks Yes, I Confirm) will only see $form_state info defined here. Form you create here passed as param1 to confirm_form
return confirm_form($form, 'Confirm Purge Object', $referrer, 'Are you sure you want to delete this object? This action cannot be undone.', 'Delete', 'Cancel'); //Had better luck leaving off last param 'name'
return confirm_form($form, 'Confirm Purge Object', $referrer, 'Are you sure you want to delete this object? This action cannot be undone.', 'Delete', 'Cancel'); //Had better luck leaving off last param 'name'
@ -366,9 +369,9 @@ function add_stream_form_validate($form, &$form_state) {
@ -768,8 +774,8 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
if (user_access('access administration pages')) {
if (user_access('access administration pages')) {
drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'warning');
drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'warning');
'#value' => '<p>If you install the ' . l('fedora demo objects', 'https://wiki.duraspace.org/display/FCR30/Demonstration+Objects') . ' Islandora can display them as a collection.</p>'
'#value' => '<p>If you install the ' . l('fedora demo objects', 'https://wiki.duraspace.org/display/FCR30/Demonstration+Objects') . ' Islandora can display them as a collection.</p>'
@ -1746,9 +1763,9 @@ function theme_add_to_basket_link($pid, $type = 'object') {
*/
*/
if (!_is_added_to_basket($pid)) {
if (!_is_added_to_basket($pid)) {
return l(
return l(
theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $save, t("Add to basket"), t("Add this @object to my basket", array('@object' => $object))),
theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $save, t("Add to basket"), t("Add this @object to my basket", array('@object' => $object))),
"fedora/repository/addToBasket/" . $path,
"fedora/repository/addToBasket/" . $path,
array('html' => TRUE)
array('html' => TRUE)
);
);
}
}
@ -1764,7 +1781,8 @@ function fedora_repository_display_schema($file) {
'#description' => t('The URL to use for REST-type connections'),
'#description' => t('The URL to use for REST-type connections'),
'#required' => TRUE,
'#required' => TRUE,
'#weight' => 0,
'#weight' => 0,
);
);
$form['fedora_soap_manage_url'] = array(
$form['fedora_soap_manage_url'] = array(
'#type' => 'textfield',
'#type' => 'textfield',
'#title' => t('Fedora SOAP management URL'),
'#title' => t('Fedora SOAP management URL'),
'#default_value' => variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl'), '#description' => t('The URL to use for SOAP API-M connections'),
'#default_value' => variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl'), '#description' => t('The URL to use for SOAP API-M connections'),
'#required' => TRUE,
'#required' => TRUE,
'#weight' => 0
'#weight' => 0
);
);
$form['fedora_solr_search_url'] = array(
$form['fedora_solr_search_url'] = array(
'#type' => 'textfield',
'#type' => 'textfield',
'#title' => t('Fedora Solr search URL'),
'#title' => t('Fedora Solr search URL'),
'#default_value' => variable_get('fedora_solr_search_url', 'http://localhost:8080/solr'), '#description' => t('The URL to use for Solr searching'),
'#default_value' => variable_get('fedora_solr_search_url', 'http://localhost:8080/solr'), '#description' => t('The URL to use for Solr searching'),
'#required' => TRUE,
'#required' => TRUE,
'#weight' => 0
'#weight' => 0
);
);
// will allow admin user to remove namepsace restrictions if not explicitly disallowed in settings.php
'#description' => t('A space separated list PID namespaces that users are permitted to access from this Drupal installation. <br/> This could be more than a simple namespace ie demo:mydemos.'),
'#description' => t('A space separated list PID namespaces that users are permitted to access from this Drupal installation. <br/> This could be more than a simple namespace ie demo:mydemos.'),
'#weight' => 0
'#weight' => 0
);
/*
$form['fedora_admin_user'] = array(
'#type' => 'textfield',
'#title' => t('A user with the Drupal role administrator'),
'#description' => t('A user with the administrator role. This is the user the Islandora module will use when admin access is needed for a task, such as creating a collection object for a new user.'),
'#required' => TRUE, '#weight' => 0
);
);
}
$form['fedora_searchterms_location'] = array(
else {
'#type' => 'file',
$form['fedora_pids_allowed'] = array(
'#title' => 'SearchTerms.xml file location',
'#type' => 'textfield',
'#title' => t('PID namespaces allowed in this Drupal install'),
'#description' => t('A space separated list PID namespaces that users are permitted to access from this Drupal installation. <br/> This could be more than a simple namespace ie demo:mydemos.'),
'#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'),
'#description' => t('The title displayed when viewing collections and objects in /fedora/repository. Leave blank to display no title. Note that the menus must be rebuilt after changing this variable.'),
'#options' => array(ObjectHelper::$DISPLAY_ALWAYS=>t('Always'),ObjectHelper::$DISPLAY_NEVER=>t('Never'),ObjectHelper::$DISPLAY_NO_MODEL_OUTPUT=>t('Only if no Content Model display output.')),
'#options' => array(ObjectHelper::$DISPLAY_ALWAYS=>t('Always'),ObjectHelper::$DISPLAY_NEVER=>t('Never'),ObjectHelper::$DISPLAY_NO_MODEL_OUTPUT=>t('Only if no Content Model display output.')),
'#description' => t('Determines when to display the object (or collection) title when viewing an object/collection page.'),
'#description' => t('Determines when to display the object (or collection) title when viewing an object/collection page.'),
'#options' => array(ObjectHelper::$DISPLAY_ALWAYS=>t('Always'),ObjectHelper::$DISPLAY_NEVER=>t('Never'),ObjectHelper::$DISPLAY_NO_MODEL_OUTPUT=>t('Only if no Content Model display output.')),
'#options' => array(ObjectHelper::$DISPLAY_ALWAYS=>t('Always'),ObjectHelper::$DISPLAY_NEVER=>t('Never'),ObjectHelper::$DISPLAY_NO_MODEL_OUTPUT=>t('Only if no Content Model display output.')),
'#description' => t('Determines when to display the default object (or collection) description fieldset when viewing an object/collection page.'),
'#description' => t('Determines when to display the default object (or collection) description fieldset when viewing an object/collection page.'),
'#description' => t('When enabled, restricts access to fedora object datastreams that are not listed in the Islandora Content Model for the object (unless the user is an administrator).'),
'#description' => t('When enabled, restricts access to fedora object datastreams that are not listed in the Islandora Content Model for the object (unless the user is an administrator).'),
);
);
$form['fedora_collection_display_list'] = array(
$form['fedora_collection_display_list'] = array(
'#type' => 'select',
'#type' => 'select',
'#title' => t('Display Collection List Behaviour'),
'#title' => t('Display Collection List Behaviour'),
'#options' => array(ObjectHelper::$DISPLAY_ALWAYS=>t('Always'),ObjectHelper::$DISPLAY_NEVER=>t('Never'),ObjectHelper::$DISPLAY_NO_MODEL_OUTPUT=>t('Only if no Content Model display output.')),
'#options' => array(ObjectHelper::$DISPLAY_ALWAYS=>t('Always'),ObjectHelper::$DISPLAY_NEVER=>t('Never'),ObjectHelper::$DISPLAY_NO_MODEL_OUTPUT=>t('Only if no Content Model display output.')),
'#description' => t('Determines when to display the list of objects when viewing a collection page.'),
'#description' => t('Determines when to display the list of objects when viewing a collection page.'),
'#title' => t('Ingest digital object into collection_pid !collection_label Step #1', array('collection_pid' => $collection_pid, '!collection_label' => $collection_label))
'#title' => t('Ingest digital object into collection_pid !collection_label Step #1', array('collection_pid' => $collection_pid, '!collection_label' => $collection_label))
);
);
$form['indicator']['models'] = array(// content models available
$form['indicator']['models'] = array(// content models available
'#type' => 'select',
'#type' => 'select',
'#title' => t('Content models available'),
'#title' => t('Content models available'),
'#options' => $modelsForForm,
'#options' => $modelsForForm,
//'#description' => t('Content models available in this collection. A content model defines what is allowed in a collection and what to do with a file when it is uploaded (An example may creating a thumbnail from an image.).')
//'#description' => t('Content models available in this collection. A content model defines what is allowed in a collection and what to do with a file when it is uploaded (An example may creating a thumbnail from an image.).')
'#description' => t('Content models define datastream composition, relationships between this and other content models, and the mandatory behaviors associated with each digital object.<br/> Additional information may be found <ahref="https://wiki.duraspace.org/display/FEDORACREATE/Content+Models+Overview">here.</a> ')
'#description' => t('Content models define datastream composition, relationships between this and other content models, and the mandatory behaviors associated with each digital object.<br/> Additional information may be found <ahref="https://wiki.duraspace.org/display/FEDORACREATE/Content+Models+Overview">here.</a> ')
'#description' => t('Datastream IDs defined by the content model.'),
'#description' => t('Datastream IDs defined by the content model.'),
);
);
$form['stream_id']['#options'] = $unused_dsids;
$form['stream_id']['#options'] = $unused_dsids;
}
}
else {
else {
$form['stream_id'] = array(
$form['stream_id'] = array(
'#title' => 'Datastream ID',
'#title' => 'Datastream ID',
'#required' => 'TRUE',
'#required' => 'TRUE',
'#description' => t('An ID for this stream that is unique to this object. Must start with a letter and contain only alphanumeric characters and dashes and underscores.'),
'#description' => t('An ID for this stream that is unique to this object. Must start with a letter and contain only alphanumeric characters and dashes and underscores.'),