Browse Source

Added thumbnail to basic image collection object

pull/110/head
rwincewicz 13 years ago
parent
commit
a4d7cf1eee
  1. BIN
      islandora_basic_image/Crystal_Clear_filesystem_folder_grey.png
  2. 9
      islandora_basic_image/islandora_basic_image.install
  3. 29
      islandora_basic_image/xml/islandora_basic_image_collection.xml

BIN
islandora_basic_image/Crystal_Clear_filesystem_folder_grey.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

9
islandora_basic_image/islandora_basic_image.install

@ -40,9 +40,12 @@ function islandora_basic_image_install() {
$xml = file_get_contents(drupal_get_path('module', 'islandora_basic_image') . '/xml/islandora_basic_image_collection.xml'); $xml = file_get_contents(drupal_get_path('module', 'islandora_basic_image') . '/xml/islandora_basic_image_collection.xml');
$restConnection->api->m->ingest(array('string' => $xml)); $restConnection->api->m->ingest(array('string' => $xml));
$fedora_object = new FedoraObject('islandora:sp_basic_image_collection', $restConnection->repository); $fedora_object = new FedoraObject('islandora:sp_basic_image_collection', $restConnection->repository);
$datastream = new FedoraDatastream('COLLECTION_POLICY', $fedora_object, $restConnection->repository); $datastream = new NewFedoraDatastream('TN', 'M', $fedora_object, $restConnection->repository);
$datastream->setContentFromFile($base_root . '/' . drupal_get_path('module', 'islandora_basic_image') . '/xml/islandora_basic_image_collection_policy.xml'); $file_path = $base_root . '/' . drupal_get_path('module', 'islandora_basic_image') . '/Crystal_Clear_filesystem_folder_grey.png';
$datastream->controlGroup = 'M'; $datastream->label = 'Thumbnail';
$datastream->mimetype = 'image/png';
$datastream->setContentFromUrl($file_path);
$fedora_object->ingestDatastream($datastream);
} catch (Exception $e) { } catch (Exception $e) {
drupal_set_message(t('Unable to install collections %e', array('%e' => $e)), 'error'); drupal_set_message(t('Unable to install collections %e', array('%e' => $e)), 'error');

29
islandora_basic_image/xml/islandora_basic_image_collection.xml

@ -19,32 +19,27 @@ xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/
</oai_dc:dc> </oai_dc:dc>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> <foxml:datastreamVersion ID="RELS-EXT.0" LABEL="Fedora Object-to-Object Relationship Metadata" CREATED="2011-09-16T16:49:44.895Z" MIMETYPE="text/xml" SIZE="453">
<foxml:datastream ID="RELS-EXT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="RELS-EXT.0" LABEL="Fedora object-to-object relationship metadata" CREATED="2011-09-16T16:49:44.663Z" MIMETYPE="text/xml" SIZE="176">
<foxml:xmlContent>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/islandora:sp_basic_image_collection"></rdf:Description>
</rdf:RDF>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion ID="RELS-EXT.1" LABEL="Fedora Object-to-Object Relationship Metadata" CREATED="2011-09-16T16:49:44.791Z" MIMETYPE="text/xml" SIZE="304">
<foxml:xmlContent> <foxml:xmlContent>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="info:fedora/islandora:sp_basic_image_collection"> <rdf:Description rdf:about="info:fedora/islandora:sp_basic_image_collection">
<hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:collectionCModel"></hasModel> <hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:collectionCModel"></hasModel>
<isMemberOfCollection xmlns="info:fedora/fedora-system:def/relations-external#" rdf:resource="info:fedora/islandora:top"></isMemberOfCollection>
</rdf:Description> </rdf:Description>
</rdf:RDF> </rdf:RDF>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
<foxml:datastreamVersion ID="RELS-EXT.2" LABEL="Fedora Object-to-Object Relationship Metadata" CREATED="2011-09-16T16:49:44.895Z" MIMETYPE="text/xml" SIZE="453"> </foxml:datastream>
<foxml:datastream ID="COLLECTION_POLICY" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="COLLECTION_POLICY.0" LABEL="Collection policy" CREATED="2012-05-24T14:31:59.202Z" MIMETYPE="text/xml" SIZE="507">
<foxml:xmlContent> <foxml:xmlContent>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <collection_policy xmlns="http://www.islandora.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Islandora Image Collection" xsi:schemaLocation="http://www.islandora.ca http://syn.lib.umanitoba.ca/collection_policy.xsd">
<rdf:Description rdf:about="info:fedora/islandora:sp_basic_image_collection"> <content_models>
<hasModel xmlns="info:fedora/fedora-system:def/model#" rdf:resource="info:fedora/islandora:collectionCModel"></hasModel> <content_model dsid="ISLANDORACM" name="New Image" namespace="islandora:1" pid="islandora:sp_basic_image"></content_model>
<isMemberOfCollection xmlns="info:fedora/fedora-system:def/relations-external#" rdf:resource="info:fedora/islandora:top"></isMemberOfCollection> </content_models>
</rdf:Description> <search_terms></search_terms>
</rdf:RDF> <relationship>isMemberOfCollection</relationship>
</collection_policy>
</foxml:xmlContent> </foxml:xmlContent>
</foxml:datastreamVersion> </foxml:datastreamVersion>
</foxml:datastream> </foxml:datastream>

Loading…
Cancel
Save