Mapper
From DISMARC Help
(Difference between revisions)
Line 6: | Line 6: | ||
Class [ <user> abstract class AbstractDismarcMapper extends AbstractMapper ] { | Class [ <user> abstract class AbstractDismarcMapper extends AbstractMapper ] { | ||
- | |||
- | + | Method [ <user, overwrites AbstractMapper, ctor> public method __construct ] | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | Method [ <user, overwrites AbstractMapper, ctor> public method __construct ] | + | |
- | + | ||
- | + | ||
/** | /** | ||
Line 31: | Line 15: | ||
* @return String | * @return String | ||
*/ | */ | ||
- | Method [ <user> protected method getYearForDmEras ] | + | Method [ <user> protected method getYearForDmEras ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | Method [ <user, inherits AbstractMapper> public method setAdditionalSubstFile ] | |
- | + | ||
- | + | ||
/** | /** | ||
Line 60: | Line 33: | ||
* @return boolean | * @return boolean | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> public method lookupThesaurus ] | + | Method [ <user, inherits AbstractMapper> public method lookupThesaurus ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
/** | /** | ||
Line 80: | Line 40: | ||
* @param String $lang iso3 | * @param String $lang iso3 | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> public method setLang ] | + | Method [ <user, inherits AbstractMapper> public method setLang ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | Method [ <user, inherits AbstractMapper> public method getLang ] | + | Method [ <user, inherits AbstractMapper> public method getLang ] |
- | + | ||
- | + | ||
/** | /** | ||
Line 99: | Line 51: | ||
* @return [DOMDocument] | * @return [DOMDocument] | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> public method map ] | + | Method [ <user, inherits AbstractMapper> public method map ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
/** | /** | ||
Line 113: | Line 58: | ||
* @param DOMDocument $doc | * @param DOMDocument $doc | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> private method checkDoc ] | + | Method [ <user, inherits AbstractMapper> private method checkDoc ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
/** | /** | ||
Line 125: | Line 64: | ||
* @return MdmMappedDocument | * @return MdmMappedDocument | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> abstract protected method map_ ] | + | Method [ <user, inherits AbstractMapper> abstract protected method map_ ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
/** | /** | ||
Line 138: | Line 71: | ||
* | * | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> public method setFieldHierarchy ] | + | Method [ <user, inherits AbstractMapper> public method setFieldHierarchy ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
/** | /** | ||
Line 151: | Line 78: | ||
* @param String $collection | * @param String $collection | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> public method setDefaultCollection ] | + | Method [ <user, inherits AbstractMapper> public method setDefaultCollection ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
/** | /** | ||
* @param String $string | * @param String $string | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> public method stdout ] | + | Method [ <user, inherits AbstractMapper> public method stdout ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
/** | /** | ||
* @param String $string | * @param String $string | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> public method stderr ] | + | Method [ <user, inherits AbstractMapper> public method stderr ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
/** | /** | ||
* @param Boolean $verbose | * @param Boolean $verbose | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> public method setVerbose ] | + | Method [ <user, inherits AbstractMapper> public method setVerbose ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
/** | /** | ||
* @return MdmMappedDocument | * @return MdmMappedDocument | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> protected method getNewMappedDoc ] | + | Method [ <user, inherits AbstractMapper> protected method getNewMappedDoc ] |
- | + | ||
- | + | ||
- | + | ||
/** | /** | ||
* @param NamedArray $array | * @param NamedArray $array | ||
Line 209: | Line 110: | ||
* @return Boolean if something was found | * @return Boolean if something was found | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> protected method findInString ] | + | Method [ <user, inherits AbstractMapper> protected method findInString ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
/** | /** | ||
Line 231: | Line 120: | ||
* @return Boolean if something was found | * @return Boolean if something was found | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> protected method replaceInString ] | + | Method [ <user, inherits AbstractMapper> protected method replaceInString ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
/** | /** | ||
Line 247: | Line 126: | ||
* @param boolean $override shall old files be overwritten | * @param boolean $override shall old files be overwritten | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> public method loadSubstitutionfile ] | + | Method [ <user, inherits AbstractMapper> public method loadSubstitutionfile ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
/** | /** | ||
Line 264: | Line 136: | ||
* @return Array | * @return Array | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> public method getFromSubstitution ] | + | Method [ <user, inherits AbstractMapper> public method getFromSubstitution ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
/** | /** | ||
Line 283: | Line 146: | ||
* @param array $ioKeey | * @param array $ioKeey | ||
*/ | */ | ||
- | Method [ <user, inherits AbstractMapper> public method getForFindInStringFromSubstitution ] | + | Method [ <user, inherits AbstractMapper> public method getForFindInStringFromSubstitution ] |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } |
Revision as of 08:10, 20 August 2008
Mappers are part of an Importer. They convert the XML they get from a Reader and try to create an XML that fulfills the DISMARC application profile.
Each archive needs it's own mapper, except if they use a predefined format like MAB, OAI and so on.
A mapper is capable of doing some things to your XML. This topic is quite technical for the AbstractDismarcImporter is discussed here.
Class [ <user> abstract class AbstractDismarcMapper extends AbstractMapper ] { Method [ <user, overwrites AbstractMapper, ctor> public method __construct ] /** * Parses a string into a date and returns a value suitable for the dmEras thesaurus or empty string * * @param String $date * @return String */ Method [ <user> protected method getYearForDmEras ]
Method [ <user, inherits AbstractMapper> public method setAdditionalSubstFile ] /** * Adds the approriate thesaurus fields to the record * * @param String $thesaurus * @param String $term * @param MdmMappedDocument $mdoc * @param String $section * @param String $fieldname * @param String $setAtt which attribute shall hold the thesaurus name * @param boolean $addIfNotFound add the searchterm if the thesaurusterm was not found * @param GetTreeNodeScope $scopeNode * @return boolean */ Method [ <user, inherits AbstractMapper> public method lookupThesaurus ] /** * language for thesaurus terms * * @param String $lang iso3 */ Method [ <user, inherits AbstractMapper> public method setLang ] Method [ <user, inherits AbstractMapper> public method getLang ] /** * Maps records gathered from AbstractRecordReader to valid MDM Docs * * @param DOMDocument $doc * @param Boolean $appendRawData * @return [DOMDocument] */ Method [ <user, inherits AbstractMapper> public method map ] /** * checks if the document is valid or not by writing the XML and pasing it again * * @param DOMDocument $doc */ Method [ <user, inherits AbstractMapper> private method checkDoc ] /** * @param DOMDocument $doc * @return MdmMappedDocument */ Method [ <user, inherits AbstractMapper> abstract protected method map_ ] /** * * @param array $descrDoc * */ Method [ <user, inherits AbstractMapper> public method setFieldHierarchy ] /** * Is no collection specified during the mapping, this collection will be used * * @param String $collection */ Method [ <user, inherits AbstractMapper> public method setDefaultCollection ] /** * @param String $string */ Method [ <user, inherits AbstractMapper> public method stdout ] /** * @param String $string */ Method [ <user, inherits AbstractMapper> public method stderr ] /** * @param Boolean $verbose */ Method [ <user, inherits AbstractMapper> public method setVerbose ] /** * @return MdmMappedDocument */ Method [ <user, inherits AbstractMapper> protected method getNewMappedDoc ]
/** * @param NamedArray $array * @param String &$io_text * @param String[] &$io_found * @param String[] $keep * @param String $seperator * @param String $lencl * @param String $rencl * @return Boolean if something was found */ Method [ <user, inherits AbstractMapper> protected method findInString ] /** * @param NamedArray $array * @param String &$io_text * @param String $seperator * @param String $lencl * @param String $rencl * @return Boolean if something was found */ Method [ <user, inherits AbstractMapper> protected method replaceInString ] /** * @param String $filename filename of the substitutionfile * @param boolean $override shall old files be overwritten */ Method [ <user, inherits AbstractMapper> public method loadSubstitutionfile ] /** * returns the substituted value of if $defualt is set to null and no term was found, the term will be returned * * @param String $field * @param String $namespace * @param String $term * @return Array */ Method [ <user, inherits AbstractMapper> public method getFromSubstitution ] /** * Returns the array needed for the findInString function from the substitutiontable * * @param String $field * @param String $namespace * @param Array $ioArray * @param array $ioKeey */ Method [ <user, inherits AbstractMapper> public method getForFindInStringFromSubstitution ] }