Mapper

From DISMARC Help

(Difference between revisions)
Jump to: navigation, search
Line 6: Line 6:
Class [ <user> abstract class AbstractDismarcMapper extends AbstractMapper ] {
Class [ <user> abstract class AbstractDismarcMapper extends AbstractMapper ] {
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/mapper/dismarc/AbstractDismarcMapper.php 5-56
 
-
- Constants [0] {
+
Method [ <user, overwrites AbstractMapper, ctor> public method __construct ]
-
}
+
-
+
-
- Static properties [0] {
+
-
}
+
-
+
-
- Static methods [0] {
+
-
}
+
-
+
-
- Properties [0] {
+
-
}
+
-
+
-
- Methods [20] {
+
-
Method [ <user, overwrites AbstractMapper, ctor> public method __construct ] {
+
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/mapper/dismarc/AbstractDismarcMapper.php 7 - 9
+
-
}
+
/**
/**
Line 31: Line 15:
* @return String
* @return String
*/
*/
-
Method [ <user> protected method getYearForDmEras ] {
+
Method [ <user> protected method getYearForDmEras ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/mapper/dismarc/AbstractDismarcMapper.php 17 - 54
+
-
+
-
- Parameters [1] {
+
-
Parameter #0 [ <required> $date ]
+
-
}
+
-
}
+
-
+
-
Method [ <user, inherits AbstractMapper> public method setAdditionalSubstFile ] {
+
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 34 - 43
+
-
- Parameters [1] {
+
 
-
Parameter #0 [ <required> $file ]
+
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 ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 58 - 181
+
-
+
-
- Parameters [8] {
+
-
Parameter #0 [ <required> $thesaurus ]
+
-
Parameter #1 [ <required> $term ]
+
-
Parameter #2 [ <required> $mdoc ]
+
-
Parameter #3 [ <required> $section ]
+
-
Parameter #4 [ <required> $fieldname ]
+
-
Parameter #5 [ <optional> $setAtt = 'encoding' ]
+
-
Parameter #6 [ <optional> $addIfNotFound = false ]
+
-
Parameter #7 [ <optional> GetTreeNodeScope or NULL $scopeNode = NULL ]
+
-
}
+
-
}
+
/**
/**
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 ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 188 - 190
+
-
+
-
- Parameters [1] {
+
-
Parameter #0 [ <required> $lang ]
+
-
}
+
-
}
+
-
Method [ <user, inherits AbstractMapper> public method getLang ] {
+
Method [ <user, inherits AbstractMapper> public method getLang ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 192 - 194
+
-
}
+
/**
/**
Line 99: Line 51:
* @return [DOMDocument]
* @return [DOMDocument]
*/
*/
-
Method [ <user, inherits AbstractMapper> public method map ] {
+
Method [ <user, inherits AbstractMapper> public method map ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 203 - 229
+
-
+
-
- Parameters [2] {
+
-
Parameter #0 [ <required> DOMDocument $doc ]
+
-
Parameter #1 [ <optional> $appendRawData = true ]
+
-
}
+
-
}
+
/**
/**
Line 113: Line 58:
* @param DOMDocument $doc
* @param DOMDocument $doc
*/
*/
-
Method [ <user, inherits AbstractMapper> private method checkDoc ] {
+
Method [ <user, inherits AbstractMapper> private method checkDoc ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 236 - 250
+
-
+
-
- Parameters [1] {
+
-
Parameter #0 [ <required> $doc ]
+
-
}
+
-
}
+
/**
/**
Line 125: Line 64:
* @return MdmMappedDocument
* @return MdmMappedDocument
*/
*/
-
Method [ <user, inherits AbstractMapper> abstract protected method map_ ] {
+
Method [ <user, inherits AbstractMapper> abstract protected method map_ ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 256 - 256
+
-
+
-
- Parameters [1] {
+
-
Parameter #0 [ <required> DOMDocument $doc ]
+
-
}
+
-
}
+
/**
/**
Line 138: Line 71:
*
*
*/
*/
-
Method [ <user, inherits AbstractMapper> public method setFieldHierarchy ] {
+
Method [ <user, inherits AbstractMapper> public method setFieldHierarchy ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 263 - 275
+
-
+
-
- Parameters [1] {
+
-
Parameter #0 [ <required> $hierarchy ]
+
-
}
+
-
}
+
/**
/**
Line 151: Line 78:
* @param String $collection
* @param String $collection
*/
*/
-
Method [ <user, inherits AbstractMapper> public method setDefaultCollection ] {
+
Method [ <user, inherits AbstractMapper> public method setDefaultCollection ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 282 - 284
+
-
+
-
- Parameters [1] {
+
-
Parameter #0 [ <required> $collection ]
+
-
}
+
-
}
+
/**
/**
* @param String $string
* @param String $string
*/
*/
-
Method [ <user, inherits AbstractMapper> public method stdout ] {
+
Method [ <user, inherits AbstractMapper> public method stdout ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 289 - 295
+
-
+
-
- Parameters [1] {
+
-
Parameter #0 [ <required> $string ]
+
-
}
+
-
}
+
/**
/**
* @param String $string
* @param String $string
*/
*/
-
Method [ <user, inherits AbstractMapper> public method stderr ] {
+
Method [ <user, inherits AbstractMapper> public method stderr ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 299 - 305
+
-
+
-
- Parameters [1] {
+
-
Parameter #0 [ <required> $string ]
+
-
}
+
-
}
+
/**
/**
* @param Boolean $verbose
* @param Boolean $verbose
*/
*/
-
Method [ <user, inherits AbstractMapper> public method setVerbose ] {
+
Method [ <user, inherits AbstractMapper> public method setVerbose ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 310 - 312
+
-
+
-
- Parameters [1] {
+
-
Parameter #0 [ <required> $verbose ]
+
-
}
+
-
}
+
/**
/**
* @return MdmMappedDocument
* @return MdmMappedDocument
*/
*/
-
Method [ <user, inherits AbstractMapper> protected method getNewMappedDoc ] {
+
Method [ <user, inherits AbstractMapper> protected method getNewMappedDoc ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 317 - 322
+
 
-
}
+
-
+
/**
/**
* @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 ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 334 - 367
+
-
+
-
- Parameters [7] {
+
-
Parameter #0 [ <required> &$array ]
+
-
Parameter #1 [ <required> &$io_text ]
+
-
Parameter #2 [ <required> &$io_found ]
+
-
Parameter #3 [ <optional> $keep = Array ]
+
-
Parameter #4 [ <optional> $seperator = ',' ]
+
-
Parameter #5 [ <optional> $lencl = '[' ]
+
-
Parameter #6 [ <optional> $rencl = ']' ]
+
-
}
+
-
}
+
/**
/**
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 ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 377 - 410
+
-
+
-
- Parameters [5] {
+
-
Parameter #0 [ <required> &$array ]
+
-
Parameter #1 [ <required> &$io_text ]
+
-
Parameter #2 [ <optional> $seperator = ',' ]
+
-
Parameter #3 [ <optional> $lencl = '[' ]
+
-
Parameter #4 [ <optional> $rencl = ']' ]
+
-
}
+
-
}
+
/**
/**
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 ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 417 - 460
+
-
+
-
- Parameters [2] {
+
-
Parameter #0 [ <required> $filename ]
+
-
Parameter #1 [ <optional> $override = false ]
+
-
}
+
-
}
+
/**
/**
Line 264: Line 136:
* @return Array
* @return Array
*/
*/
-
Method [ <user, inherits AbstractMapper> public method getFromSubstitution ] {
+
Method [ <user, inherits AbstractMapper> public method getFromSubstitution ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 470 - 488
+
-
+
-
- Parameters [4] {
+
-
Parameter #0 [ <required> $field ]
+
-
Parameter #1 [ <required> $namespace ]
+
-
Parameter #2 [ <required> $term ]
+
-
Parameter #3 [ <optional> $default = NULL ]
+
-
}
+
-
}
+
/**
/**
Line 283: Line 146:
* @param array $ioKeey
* @param array $ioKeey
*/
*/
-
Method [ <user, inherits AbstractMapper> public method getForFindInStringFromSubstitution ] {
+
Method [ <user, inherits AbstractMapper> public method getForFindInStringFromSubstitution ]
-
@@ /srv/www/htdocs/dismarc/metastore/classes/importparser/AbstractMapper.php 498 - 514
+
-
+
-
- Parameters [4] {
+
-
Parameter #0 [ <required> $field ]
+
-
Parameter #1 [ <required> $namespace ]
+
-
Parameter #2 [ <required> &$ioArray ]
+
-
Parameter #3 [ <required> &$ioKeey ]
+
-
}
+
-
}
+
-
}
+
}
}

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 ] 
}
Personal tools