Browse Source

Merge pull request #1 from ppound/ISLANDORA-680

minor changes to fits integration
pull/152/head
Nick Ruest 12 years ago
parent
commit
9787af147d
  1. 4
      formClass.inc
  2. 6
      plugins/fits.inc

4
formClass.inc

@ -373,7 +373,7 @@ class formClass {
'#type' => 'checkbox',
'#title' => t('Enable FITS support?'),
'#description' => t('Whether or not we should create a FITS datastream upon object ingest.'),
'#default_value' => variable_get('enable_fits', TRUE),
'#default_value' => variable_get('enable_fits', FALSE),
);
//FITS Path
@ -389,7 +389,7 @@ class formClass {
'#type' => 'textfield',
'#title' => t('Export area'),
'#default_value' => variable_get('export_area', file_directory_path() . '/fedora_export_area'),
'#description' => t("Path to the export area. It must be accessible by druapl (i.e. apache user)."),
'#description' => t("Path to the export area. It must be accessible by drupal (i.e. apache user)."),
'#required' => TRUE,
);

6
plugins/fits.inc

@ -41,16 +41,18 @@ class fits {
* @return type
*/
function extractFits($parameterArray, $dsid, $file, $file_ext) {
if (variable_get('enable_fits', TRUE) == 1) {
if (variable_get('enable_fits', FALSE) == 1) {
$file_name = '_' . $dsid . '.xml';
$output = array();
exec(variable_get('fits_path', '/usr/local/bin/fits.sh') .' -i ' . escapeshellarg($file) . '', $output);
if ( !file_put_contents($file . $file_name, implode("\n", $output)) ) {
exit("Error writing file: ". $file.$file_name);
//drupal_set_message(t("error writing fits file %s", array('%s' => "$file.$file_name")));
return FALSE;
}
$_SESSION['fedora_ingest_files']["$dsid"] = $file . $file_name;
return TRUE;
}
return TRUE; //this prevents getting the error following content model rules message when fits generation is turned off
}
/**

Loading…
Cancel
Save