• Main Page
  • Modules
  • Classes
  • Files
  • File List

plugins/metadata/mods34/filter/Mods34SchemaMonographAdapter.inc.php

00001 <?php
00002 
00022 import('lib.pkp.plugins.metadata.mods34.filter.Mods34SchemaSubmissionAdapter');
00023 
00024 class Mods34SchemaMonographAdapter extends Mods34SchemaSubmissionAdapter {
00029    function Mods34SchemaMonographAdapter(&$filterGroup) {
00030       // Configure the submission adapter
00031       parent::Mods34SchemaSubmissionAdapter($filterGroup);
00032    }
00033 
00034 
00035    //
00036    // Implement template methods from Filter
00037    //
00041    function getClassName() {
00042       return 'plugins.metadata.mods34.filter.Mods34SchemaMonographAdapter';
00043    }
00044 
00045 
00046    //
00047    // Implement template methods from MetadataDataObjectAdapter
00048    //
00054    function &injectMetadataIntoDataObject(&$mods34Description, &$monograph) {
00055       assert(is_a($monograph, 'Monograph'));
00056       $monograph =& parent::injectMetadataIntoDataObject($mods34Description, $monograph, 'classes.monograph.Author');
00057 
00058       // Publication date
00059       $publicationDate = $mods34Description->getStatement('originInfo/dateIssued[@keyDate="yes" @encoding="w3cdtf"]');
00060       if ($publicationDate) {
00061          $monograph->setDatePublished($publicationDate);
00062       }
00063 
00064       // ...
00065       // FIXME: go through MODS schema and see what context-specific
00066       // information needs to be added, e.g. from Press, press settings
00067       // or site settings.
00068 
00069       return $monograph;
00070    }
00071 
00076    function &extractMetadataFromDataObject(&$monograph) {
00077       assert(is_a($monograph, 'Monograph'));
00078 
00079       // Define the role of the author(s) of the monograph object
00080       // depending on the work type.
00081       if ($monograph->getWorkType() == WORK_TYPE_EDITED_VOLUME) {
00082          // Marcrelator editor role
00083          $authorMarcrelatorRole = 'edt';
00084       } else {
00085          // Marcrelator author role
00086          $authorMarcrelatorRole = 'aut';
00087       }
00088       $mods34Description =& parent::extractMetadataFromDataObject($monograph, $authorMarcrelatorRole);
00089 
00090       // Publication date
00091       $publicationDate = $monograph->getDatePublished();
00092       if ($publicationDate) {
00093          $mods34Description->addStatement('originInfo/dateIssued[@keyDate="yes" @encoding="w3cdtf"]', $publicationDate);
00094       }
00095 
00096       // ...
00097       // FIXME: go through MODS schema and see what context-specific
00098       // information needs to be added, e.g. from Press, press settings
00099       // or site settings.
00100 
00101       return $mods34Description;
00102    }
00103 }
00104 ?>

Generated on Mon Sep 17 2012 13:58:56 for Open Monograph Press by  doxygen 1.7.1