watchdog(t("Fedora_Repository"), "No roles found in security policy, could not parse policy stream.", NULL, WATCHDOG_ERROR);
watchdog(t("fedora_repository"), "No roles found in security policy, could not parse policy stream.", NULL, WATCHDOG_ERROR);
//we may not want to send this to the screen.
//we may not want to send this to the screen.
drupal_set_message(t('No roles found in security policy, could not parse policy stream: !message', array('!message' => check_plain($e->getMessage()))), 'error');
drupal_set_message(t('No roles found in security policy, could not parse policy stream: !message', array('!message' => check_plain($e->getMessage()))), 'error');
drupal_set_message("$datastream_file not found<br/>", 'warning');
drupal_set_message(t('The datastream file %datastream_file could not found! (or is not a regular file...)', array('%datastream_file' => $datastream_file)), 'warning');
return;
}
elseif (!is_readable($datastream_file)) {
drupal_set_message(t('The datastream file %datastream_file could not be read! (likely due to permissions...)', array('%datastream_file' => $datastream_file)), 'warning');
if ( //If either no object is specified, or the object matches (in either the literal or URI case), remove this node from it's parent, and mark as changed.
//Return whether or not we've introduced any changes.
return $modified;
}
/**
/**
* Removes the given relationship from the item's RELS-EXT and re-saves it.
* Removes the given relationship from the item's RELS-EXT and re-saves it.
*
* @deprecated
* 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
*/
*/
@ -300,7 +408,7 @@ class Fedora_Item {
break;
break;
}
}
if (substr($object, 0, 12) != 'info:fedora/') {
if (!empty($object) &&substr($object, 0, 12) != 'info:fedora/') {
$requirements['fedora-repository']['description'] = t('Ensure that Fedora is running and that the <a href="@collection-settings">collection settings</a> are correct.', array('@collection-settings' => $base_url . '/admin/settings/fedora_repository'));
$requirements['fedora-repository']['description'] = $t('Ensure that Fedora is running and that the <a href="@collection-settings">collection settings</a> are correct.', array('@collection-settings' => url('admin/settings/fedora_repository')));
$dsLabel = $form_state['values']['stream_label'] . substr($file, strrpos($file, '.')); // Add the file extention to the end of the label.;
$dsLabel = $form_state['values']['stream_label'] . substr($form_state['storage']['stream_url'], strrpos($form_state['storage']['stream_url'], '.')); // Add the file extention to the end of the label.;
'#description' => t('The Name of the Root Collection Object'),
'#required' => TRUE,
'#weight' => -20
);
$form['fedora_repository_pid'] = array(
$form['fedora_repository_pid'] = array(
'#type' => 'textfield',
'#type' => 'textfield',
'#title' => t('Root Collection PID'),
'#title' => t('Root Collection PID'),
@ -249,9 +245,12 @@ class formClass {
'#description' => t('The URL to use for SOAP connections'),
'#description' => t('The URL to use for SOAP connections'),
'#required' => TRUE,
'#required' => TRUE,
'#weight' => -12,
'#weight' => -12,
'#suffix' => '<p>' . (fedora_available() ? '<imgsrc="' . url('misc/watchdog-ok.png') . '"/>' . t('Successfully connected to Fedora server at !fedora_soap_url', array('!fedora_soap_url' => variable_get('fedora_soap_url', ''))) : '<imgsrc="' . url('misc/watchdog-error.png') . '"/> ' . t('Unable to connect to Fedora server at !fedora_soap_url</p>', array('!fedora_soap_url' => variable_get('fedora_soap_url', '')))),
'#suffix' => '<p>' . (
fedora_available() ?
theme('image', 'misc/watchdog-ok.png') . t('Successfully connected to Fedora server at @fedora_soap_url', array('@fedora_soap_url' => variable_get('fedora_soap_url', ''))) :
theme('image', 'misc/watchdog-error.png') . t('Unable to connect to Fedora server at @fedora_soap_url', array('@fedora_soap_url' => variable_get('fedora_soap_url', '')))) . '</p>',
);
);
$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'),
@ -259,7 +258,7 @@ class formClass {
'#required' => TRUE,
'#required' => TRUE,
'#weight' => -10
'#weight' => -10
);
);
// will allow admin user to remove namepsace restrictions if not explicitly disallowed in settings.php
// will allow admin user to remove namepsace restrictions if not explicitly disallowed in settings.php
'#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.'),
);
//have tabs options (like disable)
//have tabs options (like disable)
$form['tabs'] = array(
$form['tabs'] = array(
'#type' => 'fieldset',
'#type' => 'fieldset',
'#title' => t('Tabs Configuration'),
'#title' => t('Tabs Configuration'),
'#description' => t('Configure the tabs avaialble when viewing Fedora objects.'),
'#description' => t('Configure the tabs available when viewing Fedora objects.'),
'#description' => t("When enabled, the 'Object Details' tab will be visible to users with the correct permissions when viewing an object in the repository"),
'#description' => t("When enabled, the 'Object Details' tab will be visible to users with the correct permissions when viewing an object in the repository"),
'#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).'),
'#title' => t('Allow control groups select in datastream ingest'),
'#description' => t('Whether or not we should allow the user to select which control group to ingest a stream as, or to follow the old paradigm--to add stream IDed as XML as inline, and everything else as managed.'),
'#description' => t('The file to upload. (Only for Managed and Inline)')
);
);
if (variable_get('fedora_control_group_control_during_ingest', FALSE)) {
$form['fieldset']['ds_reference'] = array(
'#type' => 'textfield',
'#title' => t('Datastream reference'),
'#size' => 48,
'#description' => t('A URL reference to resolve for the contents of the datastream. (Required for External and Redirect, but will still work for Managed and Inline.)'),
'#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.'),
@ -732,6 +788,21 @@ class formClass {
'#weight' => -1,
'#weight' => -1,
);
);
}
}
if (variable_get('fedora_control_group_control_during_ingest', FALSE)) {
'#description' => t('The manner in which the datastream will be stored. "Inline XML" must be XML and will be placed directly into the FOXML for the object. "Managed" datastreams are made to live on the filesystem as discrete files in the Fedora data directory. Both "Redirect" and "External" streams are URL references; the difference being the redirect stream instruct clients to perform an HTTP redirect, such that the data does not pass though Fedora (useful for streaming). External streams are mediated (by which I mean loaded and streamed from) the Fedora server.'),
'#weight' => 0,
);
}
return $form;
return $form;
}
}
@ -746,15 +817,12 @@ class formClass {
* @return string
* @return string
*/
*/
function createQDCEditForm($pid, $dsid, $client, &$form_state) {
function createQDCEditForm($pid, $dsid, $client, &$form_state) {
watchdog('fedora_repository', "Error - could not find object details display function @function", array('@function' => $details_function), WATCHDOG_WARNING);
'#value' => $objectHelper->get_formatted_datastream_list($this->pid, NULL, $this->item), //XXX: The function called here could be cleaned up a fair bit as well...
'#weight' => $i++,
),
),
'purge' => array(
'#type' => 'markup',
'#value' => $purge_form,
'#weight' => $i++
)
);
}
if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
if (fedora_repository_access(OBJECTHELPER :: $EDIT_FEDORA_METADATA, $this->pid, $user)) {
$content .= '<divid="player' . $this->pid . 'FLV"><ahref="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>';
$div_id = "player' . $this->pid . 'FLV";
drupal_add_js('var s1 = new SWFObject("' . $fullPath . '/flash/flvplayer.swf","single","320","240","7");
$content .= <<<EOH
s1.addParam("allowfullscreen","TRUE");
<divid="$div_id"><ahref="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<!-- This was how the metadata in the 'Fedora Object Details' tab was rendered. Can be renamed back to 'convertQDC.xsl' (without '.deprecated') to make it be used again. -->