Author: peter
Date: Thu Sep 10 15:04:33 2009
New Revision: 3222
Log:
convert @level attributes to always use English values and use @otherlevel
attribute if no match is found in the required attribute list value to ensure
EAD DTD validation
Modified:
trunk/apps/qubit/modules/informationobject/actions/exportEadAction.class.php
trunk/apps/qubit/modules/informationobject/templates/exportEadSuccess.xml.php
Modified:
trunk/apps/qubit/modules/informationobject/actions/exportEadAction.class.php
==============================================================================
---
trunk/apps/qubit/modules/informationobject/actions/exportEadAction.class.php
Thu Sep 10 13:18:09 2009 (r3221)
+++
trunk/apps/qubit/modules/informationobject/actions/exportEadAction.class.php
Thu Sep 10 15:04:33 2009 (r3222)
@@ -33,18 +33,12 @@
// run the core informationObject show action commands
parent::execute($request);
- // Omit title & publication notes from ISAD note list
- $this->notes = $this->informationObject->getNotesByType(
- array('exclude' => array(QubitTerm::TITLE_NOTE_ID,
QubitTerm::PUBLICATION_NOTE_ID)));
-
- // Split notes into "Notes" (general notes), Title notes and Publication
notes
- $this->notes = $this->informationObject->getNotesByType(array('noteTypeId'
=> QubitTerm::GENERAL_NOTE_ID));
- $this->archivistsNotes =
$this->informationObject->getNotesByType(array('noteTypeId' =>
QubitTerm::ARCHIVIST_NOTE_ID));
- $this->publicationNotes =
$this->informationObject->getNotesByType(array('noteTypeId' =>
QubitTerm::PUBLICATION_NOTE_ID));
-
// Instantiate Object to use in Converting ISO 639-1 language codes to
639-2
$this->iso639convertor = new fbISO639_Map;
+ // 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/exportEadSuccess.xml.php
==============================================================================
---
trunk/apps/qubit/modules/informationobject/templates/exportEadSuccess.xml.php
Thu Sep 10 13:18:09 2009 (r3221)
+++
trunk/apps/qubit/modules/informationobject/templates/exportEadSuccess.xml.php
Thu Sep 10 15:04:33 2009 (r3222)
@@ -66,7 +66,11 @@
<frontmatter></frontmatter>
-<archdesc <?php if (0 < strlen($level =
$informationObject->getLevelOfDescription()->__toString())) ?><?php echo
'level="'.strtolower($level).'"' ?>>
+
+
+
+
+<archdesc <?php if (0 < strlen($levelOfDescription =
$informationObject->getLevelOfDescription()->getName(array('culture' =>
'en')))): ?>level="<?php if (in_array(strtolower($levelOfDescription),
$eadLevels)): ?><?php echo strtolower($levelOfDescription).'"' ?><?php else:
?><?php echo 'otherlevel" otherlevel="'.$levelOfDescription.'"' ?><?php endif;
?><?php endif; ?>>
<did>
<?php if (0 < strlen($value = $informationObject->getTitle())): ?>
<unittitle><?php echo $value ?></unittitle><?php endif; ?>
@@ -181,7 +185,7 @@
<otherfindaid><p><?php echo $value ?></p></otherfindaid><?php endif; ?>
<dsc type="combined"><?php $nestedRgt = array() ?><?php foreach
($informationObject->getDescendants()->orderBy('lft') as $descendant): ?>
- <c level="<?php echo strtolower($descendant->getLevelOfDescription()) ?>">
+ <c <?php if (0 < strlen($levelOfDescription =
$descendant->getLevelOfDescription()->getName(array('culture' => 'en')))):
?>level="<?php if (in_array(strtolower($levelOfDescription), $eadLevels)):
?><?php echo strtolower($levelOfDescription).'"' ?><?php else: ?><?php echo
'otherlevel" otherlevel="'.$levelOfDescription.'"' ?><?php endif; ?><?php
endif; ?>>
<did>
<?php foreach ($descendant->getPhysicalObjects() as $physicalObject):
?><?php if ($physicalObject->getLocation()): ?>
<physloc><?php echo $physicalObject->getLocation() ?></physloc><?php
endif; ?>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---