Author: peter
Date: Mon Sep 14 16:19:58 2009
New Revision: 3286
Log:
move Dublin Core XML export to a standard Symfony template in the
informationobject module
Added:
trunk/apps/qubit/modules/informationobject/actions/exportDcAction.class.php
(contents, props changed)
trunk/apps/qubit/modules/informationobject/templates/exportDcSuccess.xml.php
(contents, props changed)
Modified:
trunk/apps/qubit/config/routing.yml
trunk/apps/qubit/modules/informationobject/templates/_dublinCoreSimple.xml.php
Modified: trunk/apps/qubit/config/routing.yml
==============================================================================
--- trunk/apps/qubit/config/routing.yml Mon Sep 14 16:08:15 2009 (r3285)
+++ trunk/apps/qubit/config/routing.yml Mon Sep 14 16:19:58 2009 (r3286)
@@ -86,6 +86,10 @@
url: /:module/export/ead/:id
param: { action: exportEad }
+exportDc:
+ url: /:module/export/dc/:id
+ param: { action: exportDc }
+
actorCreate:
url: /actor/create/:actor_template
param: { module: actor, action: create }
Added:
trunk/apps/qubit/modules/informationobject/actions/exportDcAction.class.php
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/apps/qubit/modules/informationobject/actions/exportDcAction.class.php
Mon Sep 14 16:19:58 2009 (r3286)
@@ -0,0 +1,39 @@
+<?php
+
+/*
+ * This file is part of Qubit Toolkit.
+ *
+ * Qubit Toolkit is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Qubit Toolkit is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Qubit Toolkit. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * Information Object - exportDcXml
+ *
+ * @package qubit
+ * @subpackage informationObject - initialize an exportDcXml template for
exporting an information object
+ * @author Peter Van Garderen <[email protected]>
+ * @version SVN: $Id$
+ */
+
+class InformationObjectExportDcAction extends InformationObjectShowAction
+{
+ public function execute($request)
+ {
+ // run the core informationObject show action commands
+ parent::execute($request);
+
+ // set request format to xml
+ $request->setRequestFormat('xml');
+ }
+}
Modified:
trunk/apps/qubit/modules/informationobject/templates/_dublinCoreSimple.xml.php
==============================================================================
---
trunk/apps/qubit/modules/informationobject/templates/_dublinCoreSimple.xml.php
Mon Sep 14 16:08:15 2009 (r3285)
+++
trunk/apps/qubit/modules/informationobject/templates/_dublinCoreSimple.xml.php
Mon Sep 14 16:19:58 2009 (r3286)
@@ -1,80 +1,60 @@
-<!-- This is a Qubit export for the 15 Dublin Core elements know collectively
as 'simple Dublin Core'.
- It uses a template that follows the best practices outlined in 'Using
Dublin Core - The Elements', see
- http://dublincore.org/documents/usageguide/elements.shtml. Since Dublin
Core does not prescribe a specific
- order for the 15 elements, they are ordered according to the OAI DC
schema see http://www.openarchives.org/OAI/2.0/oai_dc.xsd -->
-
- <dc:title><?php echo htmlentities($informationObject->getTitle())
?></dc:title>
-
+<dc:title><?php echo htmlentities($informationObject->getTitle()) ?></dc:title>
<?php foreach ($informationObject->getCreators() as $creator): ?>
- <dc:creator><?php echo htmlentities($creator) ?></dc:creator>
+<dc:creator><?php echo htmlentities($creator) ?></dc:creator>
<?php endforeach; ?>
-
<?php if (count($dcSubjects = QubitDc::getSubjects($informationObject)) > 0):
?>
<?php foreach ($dcSubjects as $dcSubject): ?>
- <dc:subject><?php echo htmlentities($dcSubject) ?></dc:subject>
+<dc:subject><?php echo htmlentities($dcSubject) ?></dc:subject>
<?php endforeach; ?>
<?php endif; ?>
-
<?php if ($informationObject->getScopeAndContent()): ?>
- <dc:description><?php echo
htmlentities($informationObject->getScopeAndContent()) ?></dc:description>
+<dc:description><?php echo
htmlentities($informationObject->getScopeAndContent()) ?></dc:description>
<?php endif; ?>
-
<?php foreach ($informationObject->getPublishers() as $publisher): ?>
- <dc:publisher><?php echo htmlentities($publisher) ?></dc:publisher>
+<dc:publisher><?php echo htmlentities($publisher) ?></dc:publisher>
<?php endforeach; ?>
-
<?php foreach ($informationObject->getContributors() as $contributor): ?>
- <dc:contributor><?php echo htmlentities($contributor)
?></dc:contributor>
+<dc:contributor><?php echo htmlentities($contributor) ?></dc:contributor>
<?php endforeach; ?>
-
<?php foreach (QubitDc::getDates($informationObject) as $dcDate): ?>
- <dc:date><?php echo htmlentities($dcDate) ?></dc:date>
+<dc:date><?php echo htmlentities($dcDate) ?></dc:date>
<?php endforeach; ?>
-
<?php if (count($dcTypes = QubitDc::getTypes($informationObject)) > 0): ?>
<?php foreach ($dcTypes as $dcType): ?>
- <dc:type><?php echo htmlentities($dcType) ?></dc:type>
+<dc:type><?php echo htmlentities($dcType) ?></dc:type>
<?php endforeach; ?>
<?php endif; ?>
-
<?php if (count($dcFormats = QubitDc::getFormats($informationObject)) > 0): ?>
<?php foreach ($dcFormats as $dcFormat): ?>
- <dc:format><?php echo htmlentities($dcFormat) ?></dc:format>
+<dc:format><?php echo htmlentities($dcFormat) ?></dc:format>
<?php endforeach; ?>
<?php endif; ?>
-
<?php if ($informationObject->getIdentifier()): ?>
- <dc:identifier><?php echo
htmlentities(QubitDc::getIdentifier($informationObject)) ?></dc:identifier>
+<dc:identifier><?php echo
htmlentities(QubitDc::getIdentifier($informationObject)) ?></dc:identifier>
<?php endif; ?>
-
<?php if ($source = $informationObject->getLocationOfOriginals()): ?>
- <dc:source><?php echo htmlentities($source) ?></dc:source>
+<dc:source><?php echo htmlentities($source) ?></dc:source>
<?php endif; ?>
-
<?php if (count($languages = $informationObject->getProperties($name =
'information_object_language')) > 0): ?>
<?php foreach ($languages as $languageCode): ?>
- <dc:language><?php echo htmlentities($languageCode->getValue())
?></dc:language>
+<dc:language><?php echo htmlentities($languageCode->getValue())
?></dc:language>
<?php endforeach; ?>
<?php endif; ?>
-
<?php if ($dcRelation['text'] !== ''): ?>
- <dc:relation><?php echo htmlentities($dcRelation['text'])
?></dc:relation>
+<dc:relation><?php echo htmlentities($dcRelation['text']) ?></dc:relation>
<?php endif; ?>
<?php if ($dcRelation['identifier']): ?>
- <dc:relation><?php echo htmlentities($dcRelation['identifier'])
?></dc:relation>
+<dc:relation><?php echo htmlentities($dcRelation['identifier'])
?></dc:relation>
<?php endif; ?>
-
<?php foreach (QubitDc::getCoverage($informationObject, array('temporal' =>
true)) as $coverageTemporal): ?>
- <dc:coverage><?php echo htmlentities($coverageTemporal)
?></dc:coverage>
+<dc:coverage><?php echo htmlentities($coverageTemporal) ?></dc:coverage>
<?php endforeach; ?>
<?php foreach (QubitDc::getCoverage($informationObject, array('spatial' =>
true)) as $coverageSpatial): ?>
- <dc:coverage><?php echo htmlentities($coverageSpatial)
?></dc:coverage>
+<dc:coverage><?php echo htmlentities($coverageSpatial) ?></dc:coverage>
<?php endforeach; ?>
-
<?php if ($accessConditions = $informationObject->getAccessConditions()): ?>
- <dc:rights><?php echo htmlentities($accessConditions) ?></dc:rights>
+<dc:rights><?php echo htmlentities($accessConditions) ?></dc:rights>
<?php endif; ?>
-
<?php if ($reproductionConditions =
$informationObject->getReproductionConditions()): ?>
- <dc:rights><?php echo htmlentities($reproductionConditions)
?></dc:rights>
+<dc:rights><?php echo htmlentities($reproductionConditions) ?></dc:rights>
<?php endif; ?>
Added:
trunk/apps/qubit/modules/informationobject/templates/exportDcSuccess.xml.php
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++
trunk/apps/qubit/modules/informationobject/templates/exportDcSuccess.xml.php
Mon Sep 14 16:19:58 2009 (r3286)
@@ -0,0 +1,10 @@
+<?php echo '<?' ?>xml version="1.0" encoding="utf-8" ?>
+
+<metadata
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://dublincore.org/schemas/xmls/simpledc20021212.xsd"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+
+<?php include_component('informationobject', 'dublinCoreSimple') ?>
+
+</metadata>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---