classes/plugins/OAIMetadataFormatPlugin.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00015 // $Id$
00016 
00017 
00018 import('plugins.Plugin');
00019 import('oai.OAIStruct');
00020 
00021 class OAIMetadataFormatPlugin extends Plugin {
00022    function OAIMetadataFormatPlugin() {
00023       parent::Plugin();
00024    }
00025 
00032    function register($category, $path) {
00033       if (parent::register($category, $path)) {
00034          $this->addLocaleData();
00035          HookRegistry::register('OAI::metadataFormats', array(&$this, 'callback_formatRequest'));
00036          return true;
00037       }
00038       return false;
00039    }
00040 
00047    function getName() {
00048       return 'Base OAIMetadata plugin class: abstract function getName()';
00049    }
00050 
00054    function getDisplayName() {
00055       return 'Base OAIMetadata plugin class: abstract function getDisplayName()';
00056    }
00057 
00061    function getDescription() {
00062       return 'Base OAIMetadata plugin class: abstract function getDescription()';
00063    }
00064 
00068    function getMetadataPrefix() {
00069       return 'Base OAIMetadata plugin class: abstract function getMetadataPrefix()';
00070    }
00071 
00072    function getSchema() {
00073       return '';
00074    }
00075 
00076    function getNamespace() {
00077       return '';
00078    }
00079 
00083    function getFormatClass() {
00084       return 'Base OAIMetadata plugin class: abstract function getFormatClass()';
00085    }
00086 
00087    function callback_formatRequest($hookName, $args) {
00088       $namesOnly = $args[0];
00089       $identifier = $args[1];
00090       $formats =& $args[2];
00091 
00092       if ($namesOnly) {
00093          $formats = array_merge($formats,array($this->getMetadataPrefix()));
00094       } else {
00095          $formatClass = $this->getFormatClass();
00096          $formats = array_merge(
00097             $formats,
00098             array($this->getMetadataPrefix() => new $formatClass($this->getMetadataPrefix(), $this->getSchema(), $this->getNamespace()))
00099          );
00100       }
00101       return false;
00102    }
00103 }
00104 
00105 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7