Browse Source

Merge branch 'ISLANDORA-117' of github.com:Islandora/islandora into ISLANDORA-117

pull/105/head
Alexander O'Neill 14 years ago
parent
commit
c0954d9b93
  1. 19
      ObjectHelper.inc
  2. 654
      content_models/islandora_largeimages.xml
  3. 90
      fedora_repository.module
  4. 2
      formClass.inc
  5. 2
      plugins/pidfield/pidfield.module
  6. 72
      workflow_client/plugins/exif.inc

19
ObjectHelper.inc

@ -60,20 +60,6 @@ class ObjectHelper {
drupal_access_denied();
return ' ';
}
if (($cm = ContentModel::loadFromObject($pid)) == FALSE) {
drupal_set_message(t("You do not have access to objects without an Islandora Content Model."), 'error');
drupal_access_denied();
return ' ';
}
$cmDatastreams = $cm->listDatastreams();
if ( !((isset($user) && in_array('administrator',$user->roles)) || in_array($dsID,$cmDatastreams))) {
drupal_set_message(t("You do not have access to the specified datastream."), 'error');
drupal_access_denied();
return ' ';
}
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
$item = new Fedora_Item($pid);
@ -488,8 +474,9 @@ class ObjectHelper {
$allow= fedora_fesl_check_roles($object_pid,'write');
}
if ($allow) {
$purgeObject = '<a title="' . t('Purge Object ') . $object_pid . '" href="' . base_path() . 'fedora/repository/purgeObject/' .
$object_pid . '"><img src="' . $base_url . '/' . $path . '/images/purge_big.png" alt="' . t('Purge Object') . '" class="icon">' . t('Purge Object') . '</a>';
//$purgeObject = '<a title="' . t('Purge Object ') . $object_pid . '" href="' . base_path() . 'fedora/repository/purgeObject/' .
//$object_pid . '"><img src="' . $base_url . '/' . $path . '/images/purge_big.png" alt="' . t('Purge Object') . '" class="icon">' . t('Purge Object') . '</a>';
$purgeObject = drupal_get_form('fedora_repository_purge_object_form', $object_pid, check_plain(request_uri()));
}
} else {
$purgeObject = '&nbsp;';

654
content_models/islandora_largeimages.xml

@ -1,298 +1,358 @@
<?xml version="1.0" encoding="UTF-8"?>
<foxml:digitalObject VERSION="1.1" PID="islandora:largeimages"
xmlns:foxml="info:fedora/fedora-system:def/foxml#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
<foxml:objectProperties>
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="Large Image Collection"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2010-01-26T21:29:20.416Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2010-03-11T21:01:44.921Z"/>
</foxml:objectProperties>
<foxml:datastream ID="AUDIT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="false">
<foxml:datastreamVersion ID="AUDIT.0" LABEL="Audit Trail for this object" CREATED="2010-01-26T21:29:20.416Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit">
<foxml:xmlContent>
<audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#">
<audit:record ID="AUDREC1">
<audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action>
<audit:componentID></audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-01-26T21:29:20.416Z</audit:date>
<audit:justification>Created with Admin GUI &quot;New Object&quot; command</audit:justification>
</audit:record>
<audit:record ID="AUDREC2">
<audit:process type="Fedora API-M"/>
<audit:action>addDatastream</audit:action>
<audit:componentID>COLLECTION_POLICY</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-01-26T21:30:55.607Z</audit:date>
<audit:justification>DatastreamsPane generated this logMessage.</audit:justification>
</audit:record>
<audit:record ID="AUDREC3">
<audit:process type="Fedora API-M"/>
<audit:action>addDatastream</audit:action>
<audit:componentID>RELS-EXT</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-01-26T21:33:14.125Z</audit:date>
<audit:justification></audit:justification>
</audit:record>
<audit:record ID="AUDREC4">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>COLLECTION_POLICY</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-03-04T12:50:05.983Z</audit:date>
<audit:justification></audit:justification>
</audit:record>
<audit:record ID="AUDREC5">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>COLLECTION_POLICY</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-03-11T21:01:44.921Z</audit:date>
<audit:justification></audit:justification>
</audit:record>
</audit:auditTrail>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream ID="DC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="DC1.0" LABEL="Dublin Core Record for this object" CREATED="2010-01-26T21:29:20.416Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="396">
<foxml:xmlContent>
<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:title>Large Image Collection</dc:title>
<dc:identifier>islandora:largeimages</dc:identifier>
</oai_dc:dc>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream ID="COLLECTION_POLICY" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="COLLECTION_POLICY.0" LABEL="Collection Policy.xml" CREATED="2010-01-26T21:30:55.607Z" MIMETYPE="text/xml" SIZE="1558">
<foxml:xmlContent>
<collection_policy>
<contentmodels>
<contentmodel name="SLIDE_CMODEL">
<pid_namespace>islandora:slide</pid_namespace>
<pid>islandora:slideCModel</pid>
<dsid>ISLANDORACM</dsid>
</contentmodel>
</contentmodels>
<relationship>isMemberOfCollection</relationship>
<search_terms>
<default>dc.description</default>
<term>
<field>dc.title</field>
<value>dc.title</value>
</term>
<term>
<field>dc.creator</field>
<value>dc.creator</value>
</term>
<term>
<field>dc.description</field>
<value>dc.description</value>
</term>
<term>
<field>dc.date</field>
<value>dc.date</value>
</term>
<term>
<field>dc.identifier</field>
<value>dc.identifier</value>
</term>
<term>
<field>dc.language</field>
<value>dc.language</value>
</term>
<term>
<field>dc.publisher</field>
<value>dc.publisher</value>
</term>
<term>
<field>dc.rights</field>
<value>dc.rights</value>
</term>
<term>
<field>dc.subject</field>
<value>dc.subject</value>
</term>
<term>
<field>dc.relation</field>
<value>dc.relation</value>
</term>
<term>
<field>dcterms.temporal</field>
<value>dcterms.temporal</value>
</term>
<term>
<field>dcterms.spatial</field>
<value>dcterms.spatial</value>
</term>
<term>
<field>fgs.DS.first.text</field>
<value>Full Text</value>
</term>
</search_terms>
</collection_policy>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion ID="COLLECTION_POLICY.1" LABEL="Collection Policy.xml" CREATED="2010-03-04T12:50:05.983Z" MIMETYPE="text/xml" SIZE="1739">
<foxml:xmlContent>
<collection_policy>
<contentmodels>
<contentmodel name="SLIDE_CMODEL">
<pid_namespace>islandora:slide</pid_namespace>
<pid>islandora:slideCModel</pid>
<dsid>ISLANDORACM</dsid>
</contentmodel>
<contentmodel name="HERBARIUM_CMODEL">
<pid_namespace>islandora:herb</pid_namespace>
<pid>islandora:herbCModel</pid>
<dsid>ISLANDORACM</dsid>
</contentmodel>
</contentmodels>
<relationship>isMemberOfCollection</relationship>
<search_terms>
<default>dc.description</default>
<term>
<field>dc.title</field>
<value>dc.title</value>
</term>
<term>
<field>dc.creator</field>
<value>dc.creator</value>
</term>
<term>
<field>dc.description</field>
<value>dc.description</value>
</term>
<term>
<field>dc.date</field>
<value>dc.date</value>
</term>
<term>
<field>dc.identifier</field>
<value>dc.identifier</value>
</term>
<term>
<field>dc.language</field>
<value>dc.language</value>
</term>
<term>
<field>dc.publisher</field>
<value>dc.publisher</value>
</term>
<term>
<field>dc.rights</field>
<value>dc.rights</value>
</term>
<term>
<field>dc.subject</field>
<value>dc.subject</value>
</term>
<term>
<field>dc.relation</field>
<value>dc.relation</value>
</term>
<term>
<field>dcterms.temporal</field>
<value>dcterms.temporal</value>
</term>
<term>
<field>dcterms.spatial</field>
<value>dcterms.spatial</value>
</term>
<term>
<field>fgs.DS.first.text</field>
<value>Full Text</value>
</term>
</search_terms>
</collection_policy>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion ID="COLLECTION_POLICY.2" LABEL="Collection Policy.xml" CREATED="2010-03-11T21:01:44.921Z" MIMETYPE="text/xml" SIZE="1915">
<foxml:xmlContent>
<collection_policy>
<contentmodels>
<contentmodel name="SLIDE_CMODEL">
<pid_namespace>islandora:slide</pid_namespace>
<pid>islandora:slideCModel</pid>
<dsid>ISLANDORACM</dsid>
</contentmodel>
</contentmodels>
<relationship>isMemberOfCollection</relationship>
<search_terms>
<default>dc.description</default>
<term>
<field>dc.title</field>
<value>dc.title</value>
</term>
<term>
<field>dc.creator</field>
<value>dc.creator</value>
</term>
<term>
<field>dc.description</field>
<value>dc.description</value>
</term>
<term>
<field>dc.date</field>
<value>dc.date</value>
</term>
<term>
<field>dc.identifier</field>
<value>dc.identifier</value>
</term>
<term>
<field>dc.language</field>
<value>dc.language</value>
</term>
<term>
<field>dc.publisher</field>
<value>dc.publisher</value>
</term>
<term>
<field>dc.rights</field>
<value>dc.rights</value>
</term>
<term>
<field>dc.subject</field>
<value>dc.subject</value>
</term>
<term>
<field>dc.relation</field>
<value>dc.relation</value>
</term>
<term>
<field>dcterms.temporal</field>
<value>dcterms.temporal</value>
</term>
<term>
<field>dcterms.spatial</field>
<value>dcterms.spatial</value>
</term>
<term>
<field>fgs.DS.first.text</field>
<value>Full Text</value>
</term>
</search_terms>
</collection_policy>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream ID="RELS-EXT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="RELS-EXT.0" LABEL="RDF Statements about this object" CREATED="2010-01-26T21:33:14.125Z" MIMETYPE="application/rdf+xml" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0" SIZE="439">
<foxml:xmlContent>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/islandora:largeimages">
<isMemberOfCollection xmlns="info:fedora/fedora-system:def/relations-external#" rdf:resource="info:fedora/islandora:demos"></isMemberOfCollection>
<hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:collectionCModel"></hasModel>
</rdf:Description>
</rdf:RDF>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
</foxml:digitalObject>
<foxml:digitalObject PID="islandora:largeimages" VERSION="1.1" xmlns:foxml="info:fedora/fedora-system:def/foxml#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
<foxml:objectProperties>
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="Large Image Collection"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2010-01-26T21:29:20.416Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2010-12-10T17:32:17.345Z"/>
</foxml:objectProperties>
<foxml:datastream CONTROL_GROUP="X" ID="AUDIT" STATE="A" VERSIONABLE="false">
<foxml:datastreamVersion CREATED="2010-01-26T21:29:20.416Z"
FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit" ID="AUDIT.0" LABEL="Audit Trail for this object" MIMETYPE="text/xml">
<foxml:xmlContent>
<audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#">
<audit:record ID="AUDREC1">
<audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action>
<audit:componentID/>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-01-26T21:29:20.416Z</audit:date>
<audit:justification>Created with Admin GUI "New Object" command</audit:justification>
</audit:record>
<audit:record ID="AUDREC2">
<audit:process type="Fedora API-M"/>
<audit:action>addDatastream</audit:action>
<audit:componentID>COLLECTION_POLICY</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-01-26T21:30:55.607Z</audit:date>
<audit:justification>DatastreamsPane generated this logMessage.</audit:justification>
</audit:record>
<audit:record ID="AUDREC3">
<audit:process type="Fedora API-M"/>
<audit:action>addDatastream</audit:action>
<audit:componentID>RELS-EXT</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-01-26T21:33:14.125Z</audit:date>
<audit:justification/>
</audit:record>
<audit:record ID="AUDREC4">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>COLLECTION_POLICY</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-03-04T12:50:05.983Z</audit:date>
<audit:justification/>
</audit:record>
<audit:record ID="AUDREC5">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>COLLECTION_POLICY</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-03-11T21:01:44.921Z</audit:date>
<audit:justification/>
</audit:record>
<audit:record ID="AUDREC6">
<audit:process type="Fedora API-M"/>
<audit:action>ingest</audit:action>
<audit:componentID/>
<audit:responsibility>admin</audit:responsibility>
<audit:date>2010-12-10T17:29:47.073Z</audit:date>
<audit:justification>Fedora Object Ingested</audit:justification>
</audit:record>
<audit:record ID="AUDREC7">
<audit:process type="Fedora API-M"/>
<audit:action>addDatastream</audit:action>
<audit:componentID>TN</audit:componentID>
<audit:responsibility>admin</audit:responsibility>
<audit:date>2010-12-10T17:29:47.200Z</audit:date>
<audit:justification>Ingested object TN</audit:justification>
</audit:record>
<audit:record ID="AUDREC8">
<audit:process type="Fedora API-M"/>
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>COLLECTION_POLICY</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2010-12-10T17:32:17.345Z</audit:date>
<audit:justification/>
</audit:record>
</audit:auditTrail>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="DC" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-01-26T21:29:20.416Z" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/"
ID="DC1.0" LABEL="Dublin Core Record for this object" MIMETYPE="text/xml" SIZE="396">
<foxml:xmlContent>
<oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:title>Large Image Collection</dc:title>
<dc:identifier>islandora:largeimages</dc:identifier>
</oai_dc:dc>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="COLLECTION_POLICY" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-01-26T21:30:55.607Z" ID="COLLECTION_POLICY.0" LABEL="Collection Policy.xml"
MIMETYPE="text/xml" SIZE="1558">
<foxml:xmlContent>
<collection_policy>
<contentmodels>
<contentmodel name="SLIDE_CMODEL">
<pid_namespace>islandora:slide</pid_namespace>
<pid>islandora:slideCModel</pid>
<dsid>ISLANDORACM</dsid>
</contentmodel>
</contentmodels>
<relationship>isMemberOfCollection</relationship>
<search_terms>
<default>dc.description</default>
<term>
<field>dc.title</field>
<value>dc.title</value>
</term>
<term>
<field>dc.creator</field>
<value>dc.creator</value>
</term>
<term>
<field>dc.description</field>
<value>dc.description</value>
</term>
<term>
<field>dc.date</field>
<value>dc.date</value>
</term>
<term>
<field>dc.identifier</field>
<value>dc.identifier</value>
</term>
<term>
<field>dc.language</field>
<value>dc.language</value>
</term>
<term>
<field>dc.publisher</field>
<value>dc.publisher</value>
</term>
<term>
<field>dc.rights</field>
<value>dc.rights</value>
</term>
<term>
<field>dc.subject</field>
<value>dc.subject</value>
</term>
<term>
<field>dc.relation</field>
<value>dc.relation</value>
</term>
<term>
<field>dcterms.temporal</field>
<value>dcterms.temporal</value>
</term>
<term>
<field>dcterms.spatial</field>
<value>dcterms.spatial</value>
</term>
<term>
<field>fgs.DS.first.text</field>
<value>Full Text</value>
</term>
</search_terms>
</collection_policy>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-03-04T12:50:05.983Z" ID="COLLECTION_POLICY.1" LABEL="Collection Policy.xml"
MIMETYPE="text/xml" SIZE="1739">
<foxml:xmlContent>
<collection_policy>
<contentmodels>
<contentmodel name="SLIDE_CMODEL">
<pid_namespace>islandora:slide</pid_namespace>
<pid>islandora:slideCModel</pid>
<dsid>ISLANDORACM</dsid>
</contentmodel>
<contentmodel name="HERBARIUM_CMODEL">
<pid_namespace>islandora:herb</pid_namespace>
<pid>islandora:herbCModel</pid>
<dsid>ISLANDORACM</dsid>
</contentmodel>
</contentmodels>
<relationship>isMemberOfCollection</relationship>
<search_terms>
<default>dc.description</default>
<term>
<field>dc.title</field>
<value>dc.title</value>
</term>
<term>
<field>dc.creator</field>
<value>dc.creator</value>
</term>
<term>
<field>dc.description</field>
<value>dc.description</value>
</term>
<term>
<field>dc.date</field>
<value>dc.date</value>
</term>
<term>
<field>dc.identifier</field>
<value>dc.identifier</value>
</term>
<term>
<field>dc.language</field>
<value>dc.language</value>
</term>
<term>
<field>dc.publisher</field>
<value>dc.publisher</value>
</term>
<term>
<field>dc.rights</field>
<value>dc.rights</value>
</term>
<term>
<field>dc.subject</field>
<value>dc.subject</value>
</term>
<term>
<field>dc.relation</field>
<value>dc.relation</value>
</term>
<term>
<field>dcterms.temporal</field>
<value>dcterms.temporal</value>
</term>
<term>
<field>dcterms.spatial</field>
<value>dcterms.spatial</value>
</term>
<term>
<field>fgs.DS.first.text</field>
<value>Full Text</value>
</term>
</search_terms>
</collection_policy>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-03-11T21:01:44.921Z" ID="COLLECTION_POLICY.2" LABEL="Collection Policy.xml"
MIMETYPE="text/xml" SIZE="1555">
<foxml:xmlContent>
<collection_policy>
<contentmodels>
<contentmodel name="SLIDE_CMODEL">
<pid_namespace>islandora:slide</pid_namespace>
<pid>islandora:slideCModel</pid>
<dsid>ISLANDORACM</dsid>
</contentmodel>
</contentmodels>
<relationship>isMemberOfCollection</relationship>
<search_terms>
<default>dc.description</default>
<term>
<field>dc.title</field>
<value>dc.title</value>
</term>
<term>
<field>dc.creator</field>
<value>dc.creator</value>
</term>
<term>
<field>dc.description</field>
<value>dc.description</value>
</term>
<term>
<field>dc.date</field>
<value>dc.date</value>
</term>
<term>
<field>dc.identifier</field>
<value>dc.identifier</value>
</term>
<term>
<field>dc.language</field>
<value>dc.language</value>
</term>
<term>
<field>dc.publisher</field>
<value>dc.publisher</value>
</term>
<term>
<field>dc.rights</field>
<value>dc.rights</value>
</term>
<term>
<field>dc.subject</field>
<value>dc.subject</value>
</term>
<term>
<field>dc.relation</field>
<value>dc.relation</value>
</term>
<term>
<field>dcterms.temporal</field>
<value>dcterms.temporal</value>
</term>
<term>
<field>dcterms.spatial</field>
<value>dcterms.spatial</value>
</term>
<term>
<field>fgs.DS.first.text</field>
<value>Full Text</value>
</term>
</search_terms>
</collection_policy>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion CREATED="2010-12-10T17:32:17.345Z" ID="COLLECTION_POLICY.3" LABEL="Collection Policy.xml"
MIMETYPE="text/xml" SIZE="1152">
<foxml:xmlContent>
<collection_policy name="" xmlns="http://www.islandora.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.islandora.ca http://syn.lib.umanitoba.ca/collection_policy.xsd">
<content_models>
<content_model dsid="ISLANDORACM" name="SLIDE_CMODEL" namespace="islandora:slide" pid="islandora:slideCModel"/>
</content_models>
<search_terms>
<term field="dc.title">dc.title</term>
<term field="dc.creator">dc.creator</term>
<term default="true" field="dc.description">dc.description</term>
<term field="dc.date">dc.date</term>
<term field="dc.identifier">dc.identifier</term>
<term field="dc.language">dc.language</term>
<term field="dc.publisher">dc.publisher</term>
<term field="dc.rights">dc.rights</term>
<term field="dc.subject">dc.subject</term>
<term field="dc.relation">dc.relation</term>
<term field="dcterms.temporal">dcterms.temporal</term>
<term field="dcterms.spatial">dcterms.spatial</term>
<term field="fgs.DS.first.text">Full Text</term>
</search_terms>
<relationship>isMemberOfCollection</relationship>
</collection_policy>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="X" ID="RELS-EXT" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-01-26T21:33:14.125Z" FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0"
ID="RELS-EXT.0" LABEL="RDF Statements about this object" MIMETYPE="application/rdf+xml" SIZE="441">
<foxml:xmlContent>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/islandora:largeimages">
<isMemberOfCollection rdf:resource="info:fedora/islandora:demos" xmlns="info:fedora/fedora-system:def/relations-external#"/>
<hasModel rdf:resource="info:fedora/islandora:collectionCModel" xmlns="info:fedora/fedora-system:def/model#"/>
</rdf:Description>
</rdf:RDF>
</foxml:xmlContent>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream CONTROL_GROUP="M" ID="TN" STATE="A" VERSIONABLE="true">
<foxml:datastreamVersion CREATED="2010-12-10T17:29:47.200Z" ID="TN.0" LABEL="Thumbnail.png" MIMETYPE="image/png">
<foxml:contentLocation REF="http://localhost:8080/fedora/get/islandora:largeimages/TN/2010-12-10T17:29:47.200Z" TYPE="INTERNAL_ID"/>
</foxml:datastreamVersion>
</foxml:datastream>
</foxml:digitalObject>

90
fedora_repository.module

@ -62,6 +62,7 @@ function fedora_repository_purge_object($pid = NULL, $name = NULL) {
'%name' => $name,
'%pid' => $pid)
);
$output .= drupal_get_form('fedora_repository_purge_object_form', $pid);
return $output;
}
@ -233,20 +234,40 @@ function fedora_repository_ingest_form(&$form_state, $collection_pid, $collectio
return $ingestForm->createIngestForm($collection_pid, $collection_label, $form_state);
}
function fedora_repository_purge_object_form(&$form_state, $pid, $collectionPid = NULL) {
function fedora_repository_purge_object_form(&$form_state, $pid, $referrer) {
global $base_url;
// $form['#redirect'] = "fedora/repository/$collectionPid/";
$form['pid'] = array(
'#type' => 'hidden',
'#value' => "$pid"
);
if (!strstr( drupal_get_destination(), urlencode('fedora/repository'))) {
$form['referrer'] = array(
'#type' => 'hidden',
'#value' => $referrer,
);
}
if(!isset($form_state['storage']['confirm'])) {
// do your normal $form definition here
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Purge')
);
if ($collectionPid == NULL) {
$collectionPid = $_SESSION['fedora_collection'];
$form['submit'] = array(
'#type' => 'image_button',
'#src' => drupal_get_path('module', 'fedora_repository').'/images/purge_big.png',
'#value' => t('Purge')
);
if ($collectionPid == NULL) {
$collectionPid = $_SESSION['fedora_collection'];
}
//$form['#redirect'] = $referrer;
return $form;
}
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
return confirm_form($form,'You Sure?', $base_url.$referrer, 'Description text','Yes, nuke it','Cancel'); //Had better luck leaving off last param 'name'
}
// $form['#redirect'] = "fedora/repository/$collectionPid/";
return $form;
}
@ -384,31 +405,40 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) {
module_load_include('inc', 'fedora_repository', 'ConnectionHelper');
//$client = getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl'));
$pid = $form_state['values']['pid'];
$params = array(
"pid" => $pid,
"logMessage" => "Purged",
"force" => ""
);
try {
$soapHelper = new ConnectionHelper();
$client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl'));
$object = $client->__soapCall('purgeObject', array(
$params
)
if (!isset($form_state['storage']['confirm'])) {
$form_state['storage']['confirm'] = TRUE; // this will cause the form to be rebuilt, entering the confirm part of the form
$form_state['rebuild'] = TRUE; // along with this
}
else {
// this is where you do your processing after they have pressed the confirm button
$params = array(
"pid" => $pid,
"logMessage" => "Purged",
"force" => ""
);
} catch (exception $e) {
if (preg_match('/org\.fcrepo\.server\.security\.xacml\.pep\.AuthzDeniedException/',$e->getMessage())) {
drupal_set_message(t('Error: Insufficient permissions to purge object.'), 'error');
} else {
drupal_set_message(t($e->getMessage()), 'error');
try {
$soapHelper = new ConnectionHelper();
$client = $soapHelper->getSoapClient(variable_get('fedora_soap_manage_url', 'http://localhost:8080/fedora/services/management?wsdl'));
$object = $client->__soapCall('purgeObject', array($params));
unset($form_state['storage']['confirm']);
} catch (exception $e) {
if (preg_match('/org\.fcrepo\.server\.security\.xacml\.pep\.AuthzDeniedException/', $e->getMessage())) {
drupal_set_message(t('Error: Insufficient permissions to purge object.'), 'error');
} else {
drupal_set_message(t($e->getMessage()), 'error');
}
return;
}
if (empty($collectionPid)) {
$collectionPid = $_SESSION['fedora_collection'];
}
if (!empty($form_state['values']['referrer'])) {
$form_state['redirect'] = substr($form_state['values']['referrer'], 1);
}
else {
$form_state['redirect'] = "fedora/repository/$collectionPid/";
}
return;
}
if (empty($collectionPid)) {
$collectionPid = $_SESSION['fedora_collection'];
}
$form_state['redirect'] = "fedora/repository/$collectionPid/";
}
function fedora_repository_purge_stream_form(&$form_state, $pid, $dsId) {

2
formClass.inc

@ -78,7 +78,7 @@ class formClass {
// 'access' => TRUE
);
$items['fedora/repository'] = array(
// 'title' => t('Digital repository'),
'title' => t('Digital repository'),
'page callback' => 'repository_page',
'type' => MENU_NORMAL_ITEM,
// 'page arguments'=>array(1),

2
plugins/pidfield/pidfield.module

@ -281,7 +281,7 @@ function theme_pidfield_formatter_default($element) {
$item = new Fedora_Item($pid);
return fedora_repository_get_items($pid);
//return $item->objectProfile->objLabel;
}
return null;
}

72
workflow_client/plugins/exif.inc

@ -0,0 +1,72 @@
<?php
// $Id$
module_load_include('inc', 'islandora_workflow_client', 'process');
class exif extends Process {
protected function process($pid, $parameters) {
$required_params = array('dsid');
$missing_params = array();
foreach ($required_params as $param)
if (!isset($parameters[$param]))
$missing_params[]=$param;
if (count($missing_params) > 0) {
$this->setMessage(t('Missing parameter(s) "%params" for exif process on "%pid"', array('%params' => join(',', $missing_params), '%pid' => $pid)));
return FALSE;
}
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
module_load_include('inc', 'fedora_repository', 'ObjectHelper');
$item = new fedora_item($pid);
$dslist = $item->get_datastreams_list_as_array();
if (!isset($dslist[$parameters['dsid']])) {
$this->setMessage(t('Datastream "%dsid" could not be found for exif process on "%pid"', array('%dsid' => $parameters['dsid'], '%pid' => $pid)));
return FALSE;
}
$ds = $dslist[$parameters['dsid']];
$file = '/tmp/'. $ds['label'];
$dest_ds = isset($parameters['dest_ds']) ? $parameters['dest_ds'] : 'EXIF';
$objectHelper = new ObjectHelper();
$objectHelper->makeObject($pid, $parameters['dsid'], FALSE, NULL, $file);
if (!file_exists($file)) {
$this->setMessage('couldnt get datastream '. $parameters['dsid'] .' as '. $file);
return FALSE;
}
$system = getenv('System');
$returnValue=TRUE;
$output=array();
$command = '/usr/local/exif/exiftool -X '. $file;
exec($command, $output, $returnValue);
if (!file_exists($file . $file_suffix)) {
$this->setMessage('command failed: '. htmlentities($command ."\n" . join("\n", $output) ."\n return value: $returnValue"));
@unlink($file);
return FALSE;
}
if ($returnValue == '0') {
if (isset($dslist[$dest_ds])) {
$item->purge_datastream($dest_ds);
}
$ret = $item->add_datastream_from_string(join("\n",$output), $dest_ds, $ds['label'] . $file_suffix, 'text/xml', 'X','Added by workflow process EXIF.');
@unlink($file);
@unlink($file . $file_suffix);
if (!$ret) {
$this->setMessage(t('Unable to add datastream "%dsid" to "%pid".', array('%dsid' => $dest_ds, '%pid' => $pid)));
return FALSE;
}
return TRUE;
}
}
}
Loading…
Cancel
Save