Permalink
Browse files

Initial Commit

  • Loading branch information...
0 parents commit 32519d90f8a728690e56134d70d42e46abe08b68 Alan Stanley committed Sep 8, 2011
3 README
@@ -0,0 +1,3 @@
+Basic IOmage Solution Pack for Islandora
+Load all required Fedora Objects, and creates empty collection object
+to accept ingested JPegs, pngs and gifs's.
@@ -0,0 +1,57 @@
+
+<?php
+
+// $Id$
+
+/*
+ *
+ *
+ * This Class implements the methods defined in the basic image solution content model
+ */
+
+class ImageProcessor {
+
+ function ImageProcessor() {
+ module_load_include('inc', 'fedora_repository', 'ObjectHelper');
+ }
+
+ //use imagemapi to manipulate images instead of going directly to imagemagick or whatever
+ function manipulateImage($parameterArray = NULL, $dsid, $file, $file_ext) {
+ $height = $parameterArray['height'];
+ $width = $parameterArray['width'];
+
+ $file_suffix = '_' . $dsid . '.' . $file_ext;
+ $returnValue = TRUE;
+
+
+ $image = imageapi_image_open($file);
+
+ if (!$image) {
+ drupal_set_message(t("Error opening image."));
+ return FALSE;
+ }
+
+ if (!empty($height) || !empty($width)) {
+ $returnValue = imageapi_image_scale($image, $height, $width);
+ }
+
+ if (!$returnValue) {
+ drupal_set_message(t("Error scaling image."));
+ return $returnValue;
+ }
+ $filename = substr(strrchr($file, '/'), 1);
+ $output_path = $_SERVER['DOCUMENT_ROOT'] . base_path() . file_directory_path() . '/' . $filename . $file_suffix;
+ $returnValue = imageapi_image_close($image, $output_path);
+ if ($returnValue) {
+ $_SESSION['fedora_ingest_files']["$dsid"] = $file . $file_suffix;
+ return TRUE;
+ }
+ else {
+ return $returnValue;
+ }
+ }
+
+
+
+}
+
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,8 @@
+; $Id$
+name = Islandora Basic image Solution Pack
+description = Islandora configurations for persisting and retrieving basic images
+dependencies[] = fedora_repository
+
+package = Islandora
+version = 6.1dev
+core = 6.x
@@ -0,0 +1,49 @@
+<?php
+
+// $Id$
+
+
+function islandora_image_sp_required_fedora_objects() {
+
+
+ $module_path = drupal_get_path('module', 'islandora_image_sp');
+
+ // array( 'path-to-foxml-file', 'pid', 'dsid', 'path-to-datastream-file', int dsversion, boolean required)
+ // make database insertions here.
+
+
+ return array(
+ 'islandora_image_sp' => array(
+ 'module' => 'islandora_image_sp',
+ 'title' => 'Islandora Basic image Solution Pack',
+ 'objects' => array(
+ array(
+ 'pid' => 'islandora:sp_basic_image',
+ 'label' => 'Islandora basic image content model',
+ 'dsid' => 'ISLANDORACM',
+ 'datastream_file' => "$module_path/xml/BASIC_IMAGE_SP_CMODEL.xml",
+ 'cmodel' => 'fedora-system:ContentModel-3.0',
+ ),
+
+ array(
+ 'pid' => 'islandora:sp_basic_image_collection',
+ 'label' => 'Islandora Basic Image Collection',
+ 'cmodel' => 'islandora:collectionCModel',
+ 'parent' => 'islandora:top',
+ 'datastreams' => array(
+ array(
+ 'dsid' => 'TN',
+ 'datastream_file' => "$module_path/images/Crystal_Clear_filesystem_folder_grey.png",
+ 'mimetype' => 'image/png',
+ ),
+ array(
+ 'dsid' => 'COLLECTION_POLICY',
+ 'datastream_file' => "$module_path/xml/IMAGE-COLLECTION POLICY.xml",
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+}
+
@@ -0,0 +1,119 @@
+
+<content_model xmlns="http://www.islandora.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ name="Web Image Content Model"
+ xsi:schemaLocation="http://www.islandora.ca http://localhost/islandoracm.xsd">
+ <mimetypes>
+ <type>image/jpeg</type>
+ <type>image/jpg</type>
+ <type>image/png</type>
+ <type>image/gif</type>
+ </mimetypes>
+ <ingest_rules>
+ <rule>
+ <applies_to>image/jpeg</applies_to>
+ <applies_to>image/jpg</applies_to>
+ <applies_to>image/png</applies_to>
+ <applies_to>image/gif</applies_to>
+ <ingest_methods>
+ <ingest_method class="ImageProcessor" dsid="MEDIUM_SIZE"
+ file="image_process.inc" method="manipulateImage"
+ modified_files_ext="jpg" module="islandora_image_sp">
+ <parameters>
+ <parameter name="width">500</parameter>
+ <parameter name="height">700</parameter>
+ </parameters>
+ </ingest_method>
+ <ingest_method class="ImageProcessor" dsid="TN"
+ file="image_process.inc" method="manipulateImage"
+ modified_files_ext="jpg" module="islandora_image_sp">
+ <parameters>
+ <parameter name="width">200</parameter>
+ <parameter name="height">200</parameter>
+ </parameters>
+ </ingest_method>
+ </ingest_methods>
+ </rule>
+ </ingest_rules>
+ <datastreams>
+ <datastream dsid="FULL_SIZE">
+ <add_datastream_method class="ImageProcessor" dsid="MEDIUM_SIZE"
+ file="image_process.inc" method="manipulateImage"
+ modified_files_ext="jpg" module="islandora_image_sp">
+ <parameters>
+ <parameter name="width">120</parameter>
+ <parameter name="height">160</parameter>
+ </parameters>
+ </add_datastream_method>
+ </datastream>
+ <datastream dsid="MEDIUM_SIZE">
+ <display_method class="ShowDemoStreamsInFieldSets"
+ file="plugins/ShowDemoStreamsInFieldSets.inc" method="showMediumSize"
+ module="fedora_repository"/>
+ </datastream>
+ <datastream dsid="QDC">
+ <display_method class="ShowStreamsInFieldSets" file="plugins/ShowStreamsInFieldSets.inc"
+ method="showQdc" module="fedora_repository"/>
+ </datastream>
+ </datastreams>
+ <ingest_form dsid="QDC" page="2">
+ <form_builder_method class="DemoFormBuilder" file="plugins/DemoFormBuilder.inc"
+ handler="handleQDCForm" method="buildQDCForm" module=""/>
+ <form_elements>
+ <element label="Title/Caption/Image Name" name="dc:title" required="true"
+ type="textfield">
+ <description>The name given to the resource</description>
+ </element>
+ <element label="Creator/Photographer" name="dc:creator" type="textfield">
+ <description>An entity primarily responsible for making the content of the resource
+ such as a person, organization or service.</description>
+ </element>
+ <element label="Subject" name="dc:subject" type="textfield">
+ <description>The topic of the content of the resource. Typically, a Subject will be
+ expressed as keywords or key phrases or classification codes that describe the
+ topic of the resource. Recommended best practice is to select a value from a
+ controlled vocabulary or formal classification scheme.</description>
+ </element>
+ <element label="Description" name="dc:description" required="true" type="textarea">
+ <description>Description of the Image</description>
+ </element>
+ <element label="Publisher" name="dc:publisher" type="textfield">
+ <description>An entity, (including persons, organizations, or services), responsible
+ for making the resource available.</description>
+ </element>
+ <element label="Contributor" name="dc:contributor" type="textfield">
+ <description>An entity responsible for contributing to the content of the resource
+ such as a person, organization or service.</description>
+ </element>
+ <element label="Date" name="dc:date" type="textfield">
+ <description>Temporal scope of the content if known. Date format is YYYY-MM-DD (e.g.
+ 1890,1910-10,or 2007-10-23)</description>
+ </element>
+ <element label="Resource Type" name="dc:type" type="textfield">
+ <description>Genre of the content of the resource. Examples include: home page,
+ novel, poem, working paper, technical report, essay, dictionary.</description>
+ </element>
+ <element label="Source" name="dc:source" type="textfield">
+ <description>A reference to a resource from which the present resource is
+ derived.</description>
+ </element>
+ <element label="Identifier" name="dc:identifier" type="textfield">
+ <description>A unique reference to the resource; In this instance, the accession
+ number or collection number.</description>
+ </element>
+ <element label="Language" name="dc:language" type="select">
+ <description>The language of the intellectual content of the resource.</description>
+ <authoritative_list>
+ <item field="eng">English</item>
+ <item field="fre">French</item>
+ </authoritative_list>
+ </element>
+ <element label="Relation" name="dc:relation" type="textfield">
+ <description>Reference to a related resource.</description>
+ </element>
+ <element label="Rights Management" name="dc:rights" type="textarea">
+ <description>Information about intellectual property rights, copyright, and various
+ property rights.</description>
+ </element>
+ </form_elements>
+ </ingest_form>
+</content_model>
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+
+<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">
+ <content_models>
+ <content_model dsid="ISLANDORACM" name="New Image" namespace="image:collection"
+ pid="islandora:sp_basic_image"/>
+ <content_model dsid="ISLANDORACM" name="New Collection" namespace="image:collections"
+ pid="islandora:collectionCModel"/>
+ </content_models>
+ <search_terms/>
+ <relationship>isMemberOfCollection</relationship>
+</collection_policy>

0 comments on commit 32519d9

Please sign in to comment.