Author: jablko
Date: Fri Sep 18 16:51:33 2009
New Revision: 3418
Log:
Take advantage of sf_format request parameter and rename export actions to show
Added:
trunk/apps/qubit/modules/informationobject/actions/showEadAction.class.php
- copied, changed from r3414,
trunk/apps/qubit/modules/informationobject/actions/exportEadAction.class.php
trunk/apps/qubit/modules/informationobject/templates/showDcSuccess.xml.php
- copied unchanged from r3414,
trunk/apps/qubit/modules/informationobject/templates/exportDcSuccess.xml.php
trunk/apps/qubit/modules/informationobject/templates/showEadSuccess.xml.php
- copied, changed from r3414,
trunk/apps/qubit/modules/informationobject/templates/exportEadSuccess.xml.php
trunk/apps/qubit/modules/informationobject/templates/showModsSuccess.xml.php
- copied unchanged from r3414,
trunk/apps/qubit/modules/informationobject/templates/exportModsSuccess.xml.php
Deleted:
trunk/apps/qubit/modules/informationobject/actions/exportDcAction.class.php
trunk/apps/qubit/modules/informationobject/actions/exportEadAction.class.php
trunk/apps/qubit/modules/informationobject/actions/exportModsAction.class.php
trunk/apps/qubit/modules/informationobject/templates/exportDcSuccess.xml.php
trunk/apps/qubit/modules/informationobject/templates/exportEadSuccess.xml.php
trunk/apps/qubit/modules/informationobject/templates/exportModsSuccess.xml.php
Modified:
trunk/apps/qubit/config/routing.yml
trunk/apps/qubit/modules/informationobject/templates/_contextMenu.php
Modified: trunk/apps/qubit/config/routing.yml
==============================================================================
--- trunk/apps/qubit/config/routing.yml Fri Sep 18 16:41:54 2009 (r3417)
+++ trunk/apps/qubit/config/routing.yml Fri Sep 18 16:51:33 2009 (r3418)
@@ -34,6 +34,12 @@
action: showDc
informationobject_template: dc
+showEad:
+ url: /:module/show/ead/:id
+ param:
+ action: showEad
+ informationobject_template: ead
+
createIsaar:
url: /:module/create/isaar
param:
@@ -124,20 +130,6 @@
action: showRad
informationobject_template: rad
-exportEad:
- url: /:module/export/ead/:id
- param:
- action: exportEad
-
-exportDc:
- url: /:module/export/dc/:id
- param:
- action: exportDc
-
-exportMods:
- url: /:module/export/mods/:id
- param: { action: exportMods }
-
actorCreate:
url: /actor/create/:actor_template
param:
Copied and modified:
trunk/apps/qubit/modules/informationobject/actions/showEadAction.class.php
(from r3414,
trunk/apps/qubit/modules/informationobject/actions/exportEadAction.class.php)
==============================================================================
---
trunk/apps/qubit/modules/informationobject/actions/exportEadAction.class.php
Fri Sep 18 14:35:51 2009 (r3414, copy source)
+++ trunk/apps/qubit/modules/informationobject/actions/showEadAction.class.php
Fri Sep 18 16:51:33 2009 (r3418)
@@ -26,7 +26,7 @@
* @version SVN: $Id$
*/
-class InformationObjectExportEadAction extends InformationObjectShowAction
+class InformationObjectShowEadAction extends InformationObjectShowAction
{
public function execute($request)
{
@@ -47,8 +47,5 @@
// Set array with valid EAD level values (see ead.dtd line 2220)
$this->eadLevels = array('class', 'collection', 'file', 'fonds', 'item',
'otherlevel', 'recordgrp', 'series', 'subfonds', 'subgrp', 'subseries');
-
- // set request format to xml
- $request->setRequestFormat('xml');
}
}
Modified: trunk/apps/qubit/modules/informationobject/templates/_contextMenu.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/_contextMenu.php
Fri Sep 18 16:41:54 2009 (r3417)
+++ trunk/apps/qubit/modules/informationobject/templates/_contextMenu.php
Fri Sep 18 16:51:33 2009 (r3418)
@@ -49,10 +49,10 @@
<?php include_component('physicalobject', 'contextMenu',
array('physicalObjects' => $physicalObjects, 'informationObject' =>
$informationObject)) ?>
<?php endif; ?>
<div class="label"><?php echo __('export') ?></div>
- <ul><li><?php echo link_to(__('Dublin Core 1.1 XML'), array('module' =>
'informationobject', 'action' => 'exportDc', 'id' => $informationObject->id))
?></li>
- <li><?php echo link_to(__('EAD 2002 XML'), array('module' =>
'informationobject', 'action' => 'exportEad', 'id' => $informationObject->id))
?></li>
- <li><?php echo link_to(__('MODS 3.3 XML'), array('module' =>
'informationobject', 'action' => 'exportMods', 'id' => $informationObject->id))
?></li>
+ <ul><li><?php echo link_to(__('Dublin Core 1.1 XML'), array('module' =>
'informationobject', 'action' => 'showDc', 'id' => $informationObject->id,
'sf_format' => 'xml')) ?></li>
+ <li><?php echo link_to(__('EAD 2002 XML'), array('module' =>
'informationobject', 'action' => 'showEad', 'id' => $informationObject->id,
'sf_format' => 'xml')) ?></li>
+ <li><?php echo link_to(__('MODS 3.3 XML'), array('module' =>
'informationobject', 'action' => 'showMods', 'id' => $informationObject->id,
'sf_format' => 'xml')) ?></li>
</ul>
</div>
-</div>
\ No newline at end of file
+</div>
Copied:
trunk/apps/qubit/modules/informationobject/templates/showDcSuccess.xml.php
(from r3414,
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/showDcSuccess.xml.php
Fri Sep 18 16:51:33 2009 (r3418, copy of r3414,
trunk/apps/qubit/modules/informationobject/templates/exportDcSuccess.xml.php)
@@ -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>
Copied and modified:
trunk/apps/qubit/modules/informationobject/templates/showEadSuccess.xml.php
(from r3414,
trunk/apps/qubit/modules/informationobject/templates/exportEadSuccess.xml.php)
==============================================================================
---
trunk/apps/qubit/modules/informationobject/templates/exportEadSuccess.xml.php
Fri Sep 18 14:35:51 2009 (r3414, copy source)
+++ trunk/apps/qubit/modules/informationobject/templates/showEadSuccess.xml.php
Fri Sep 18 16:51:33 2009 (r3418)
@@ -5,7 +5,7 @@
<eadheader langencoding="iso639-2b" countryencoding="iso3166-1"
dateencoding="iso8601" repositoryencoding="iso15511" scriptencoding="iso15924"
relatedencoding="DC">
-<eadid countrycode="<?php if ($informationObject->getRepository()): ?><?php
if(0 < strlen($country =
$informationObject->getRepository()->getCountryCode())): ?><?php echo $country
?><?php endif; ?><?php endif; ?>" mainagencycode="<?php if
($informationObject->getRepository()): ?><?php if (0 < strlen($country)):
?><?php echo $country.'-' ?><?php endif; ?><?php if (0 < strlen($agency =
$informationObject->getRepository()->getIdentifier())): ?><?php echo $agency
?><?php endif; ?><?php endif; ?>" url="<?php echo url_for(array('module' =>
'informationobject', 'action' => 'exportEad', 'id'
=>$informationObject->getId()), $absolute = true) ?>"
encodinganalog="Identifier"><?php echo $informationObject->getId() ?></eadid>
+<eadid countrycode="<?php if ($informationObject->getRepository()): ?><?php
if(0 < strlen($country =
$informationObject->getRepository()->getCountryCode())): ?><?php echo $country
?><?php endif; ?><?php endif; ?>" mainagencycode="<?php if
($informationObject->getRepository()): ?><?php if (0 < strlen($country)):
?><?php echo $country.'-' ?><?php endif; ?><?php if (0 < strlen($agency =
$informationObject->getRepository()->getIdentifier())): ?><?php echo $agency
?><?php endif; ?><?php endif; ?>" url="<?php echo url_for(array('module' =>
'informationobject', 'action' => 'show', 'id' =>$informationObject->getId(),
'sf_format' => 'xml'), $absolute = true) ?>" encodinganalog="Identifier"><?php
echo $informationObject->getId() ?></eadid>
<filedesc>
<titlestmt>
Copied:
trunk/apps/qubit/modules/informationobject/templates/showModsSuccess.xml.php
(from r3414,
trunk/apps/qubit/modules/informationobject/templates/exportModsSuccess.xml.php)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++
trunk/apps/qubit/modules/informationobject/templates/showModsSuccess.xml.php
Fri Sep 18 16:51:33 2009 (r3418, copy of r3414,
trunk/apps/qubit/modules/informationobject/templates/exportModsSuccess.xml.php)
@@ -0,0 +1,56 @@
+<?php echo '<?' ?>xml version="1.0" encoding="utf-8" ?>
+
+<mods xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://www.loc.gov/mods/v3"
+ xsi:schemaLocation="http://www.loc.gov/standards/mods/v3/mods-3-3.xsd"
+ version="3.3">
+
+<titleInfo><title><?php echo htmlspecialchars($informationObject->getTitle())
?></title></titleInfo>
+<?php if (count($modsNames = QubitMods::getNames($informationObject)) > 0): ?>
+ <?php foreach ($modsNames as $modsName): ?>
+<name type="<?php echo $modsName->getActor()->getEntityType()?>">
+ <namePart><?php echo htmlspecialchars($modsName->getActor()) ?></namePart>
+ <role><?php echo $modsName->getType()->getRole() ?></role>
+</name><?php endforeach; ?><?php endif; ?>
+<?php if (count($modsTypes = QubitMods::getTypes($informationObject)) > 0): ?>
+ <?php foreach ($modsTypes as $modsType): ?>
+<typeOfResource><?php echo htmlspecialchars($modsType->getTerm())
?></typeOfResource><?php endforeach; ?><?php endif; ?>
+<?php if (count($dates = $informationObject->getDates()) > 0) : ?>
+<originInfo><?php foreach ($dates as $date): ?><?php if ($place =
$date->getPlace()): ?>
+<place><?php echo $place ?></place><?php endif; ?>
+ <?php if ($date->getTypeId() == QubitTerm::CREATION_ID): ?>
+<dateCreated><?php echo $date->getDateDisplay(array('cultureFallback' =>
true)) ?></dateCreated>
+ <?php elseif ($date->getTypeId() == QubitTerm::PUBLICATION_ID): ?>
+<dateIssued><?php echo $date->getDateDisplay(array('cultureFallback' => true))
?></dateIssued>
+ <?php else: ?>
+<dateOther><?php echo $date->getDateDisplay(array('cultureFallback' => true))
?><?php echo ' ('.$date->getType().')' ?></dateOther><?php endif; ?><?php
endforeach; ?>
+</originInfo><?php endif; ?>
+<?php if (count($languageCodes =
QubitMods::getLanguageCodes($informationObject)) > 0) : ?>
+ <?php foreach ($languageCodes as $languageCode): ?>
+<language><?php echo
format_language($languageCode->getValue(array('sourceCulture'=>true)));
?></language><?php endforeach; ?><?php endif; ?>
+<?php if ($digitalObject = QubitMODS::getDigitalObject($informationObject)):
?><?php if ($digitalObject->getMimeType()): ?>
+<physicalDescription><internetMediaType><?php echo
$digitalObject->getMimeType() ?></internetMediaType></physicalDescription><?php
endif; ?><?php endif; ?>
+<?php if (count($subjectAccessPoints =
$informationObject->getSubjectAccessPoints()) > 0) : ?>
+ <?php foreach ($subjectAccessPoints as $subject): ?>
+<subject><?php echo htmlspecialchars($subject->getTerm()) ?></subject><?php
endforeach; ?><?php endif; ?>
+<?php if ($informationObject->getIdentifier()): ?>
+<identifier><?php echo
htmlspecialchars(QubitDc::getIdentifier($informationObject))
?></identifier><?php endif; ?>
+<?php if ((QubitMODS::getDigitalObject($informationObject)) ||
($informationObject->getRepository())): ?>
+<location><?php if ($digitalObject =
QubitMODS::getDigitalObject($informationObject)): ?><url usage="primary
display">http://<?php echo
$sf_request->getHost().$sf_request->getRelativeUrlRoot().$digitalObject->getFullPath()
?></url><?php endif; ?>
+ <?php if ($repository = $informationObject->getRepository()): ?>
+ <?php if ($repository->getIdentifier()): ?>
+<physicalLocation><?php echo $repository->getIdentifier()
?></physicalLocation><?php endif; ?><?php if ($repository->__toString()): ?>
<physicalLocation><?php echo htmlspecialchars($repository->__toString())
?></physicalLocation><?php endif; ?>
+<?php if ($contactInformation = $repository->getPrimaryContact()): ?>
+<physicalLocation><?php echo $contactInformation->getCity() ?><?php if
($contactInformation->getCity()): ?><?php echo ', '?><?php endif; ?><?php echo
$contactInformation->getRegion() ?><?php if ($contactInformation->getRegion()
&& $contactInformation->getCountryCode()): ?><?php echo ', ' ?><?php endif;
?><?php echo format_country($contactInformation->getCountryCode())
?></physicalLocation><?php endif; ?><?php endif; ?>
+</location><?php endif; ?>
+<?php if (count($children = $informationObject->getChildren()) > 0): ?>
+ <?php foreach ($children as $relatedItem): ?>
+<relatedItem type="constituent" ID="<?php echo $relatedItem->getIdentifier()
?>"><?php echo htmlspecialchars(QubitMods::getLabel($relatedItem));
?></relatedItem> <?php endforeach; ?><?php endif; ?>
+<?php if (strlen($value =
$informationObject->getAccessConditions(array('cultureFallback' => true))) > 0)
: ?><accessCondition><?php echo htmlspecialchars(nl2br($value))
?></accessCondition><?php endif; ?>
+<recordInfo>
+<recordCreationDate><?php echo $informationObject->getCreatedAt()
?></recordCreationDate>
+<?php if ($informationObject->getCreatedAt() !=
$informationObject->getUpdatedAt()): ?>
+<recordChangeDate><?php echo $informationObject->getUpdatedAt()
?></recordChangeDate><?php endif; ?>
+</recordInfo>
+</mods>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---