Class XMLImporter

Description

This class and its children provide the ability to import objects into a Harmoni Based Application

  • version: $Id: XMLImporter.class.php,v 1.31 2007/09/19 14:04:47 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College
  • since: 10/5/05

Located in /polyphony/main/library/Importer/XMLImporters/XMLImporter.class.php (line 32)


	
			
Direct descendents
Class Description
XMLAssetImporter XMLAssetImporter imports an asset into a repository
XMLFileDataPartImporter imports the filedata of a file, how interesting
XMLFileDimensionsPartImporter imports the filedata of a file, how interesting
XMLFilePartImporter imports the mimetype of a file, how interesting
XMLFilepathPartImporter imports the filename, filedata, and mimetype of a file
XMLFileRecordImporter Imports a File Record
XMLPartImporter XMLPartImporter imports a part into a record
XMLPartStructureImporter XMLPartStructureImporter imports a PartStructure via delegation to subclasses
XMLRecordImporter XMLRecordImporter imports an record into an asset
XMLRecordStructureImporter XMLRecordStructureImporter imports a RecordStructure via delegation to subclasses
XMLRepositoryFileImporter XMLRepositoryFileImporter imports a repository via delegation to subclasses
XMLRepositoryImporter XMLRepositoryImporter imports a repository via delegation to subclasses
XMLThumbDataPartImporter imports the thumbnail data of a file, how interesting
XMLThumbDimensionsPartImporter imports the thumbnail data of a file, how interesting
XMLThumbMIMEPartImporter imports the thumbnail mime type of a file, how interesting
XMLThumbpathPartImporter imports the thumbnaildata, and thumbnailmimetype of a file
Method Summary
object XMLImporter XMLImporter (array $existingArray)
void addError (String $error)
void buildDescription (object DOMIT_Node $element)
void buildDimensions (object DOMIT_Node $element)
void buildEffectivedate (object DOMIT_Node $element)
void buildExpirationdate (object DOMIT_Node $element)
void buildFormat (object DOMIT_Node $element)
void buildName (mixed $element)
void buildType (object DOMIT_Node $element)
void canImportBelow (string $authZQString)
string decompress (mixed $filepath)
void doIdMatrix ()
void dropIdMatrix ()
array getErrors ()
void getNodeInfo ()
object getParentForImporter (mixed $importer, string $importerClass)
boolean hasErrors ()
object HarmoniId import (object mixed $topImporter, object DOMIT_Node $node, string $type, object mixed $parent)
object HarmoniId importBelow (object mixed $topImporter, [string $authZQString = null])
void importNode ()
void parseAndImport (string $granule, [int $detail = 50])
void parseAndImportBelow (string $granule, [int $detail = 50])
void printErrorMessages (array $goodAssetIds)
void relegateChildren (object mixed $topImporter)
void setParent (object $parent)
void setupSelf ()
void setupStatusBar (string $granule, int $detail)
void update ()
object mixed withFile (array $existingArray, string $filepath, string $type, [string $class = 'XMLImporter'])
object mixed withObject (array $existingArray, object mixed $object, string $filepath, string $type, [string $class = 'XMLImporter'])
Methods
Constructor XMLImporter (line 47)

Constructor

  • since: 10/5/05
  • access: public
object XMLImporter XMLImporter (array $existingArray)
  • array $existingArray: contains the idStrings of any objects that may be in the xml file but are not to be created.
addError (line 670)

adds an error to the error array

  • since: 7/26/05
  • access: public
void addError (String $error)
buildDescription (line 541)

Helper function for XML elements

  • since: 9/13/05
  • access: public
void buildDescription (object DOMIT_Node $element)
  • object DOMIT_Node $element
buildDimensions (line 516)

Builds a dimensions object from a type import node

  • since: 10/10/05
  • access: public
void buildDimensions (object DOMIT_Node $element)
  • object DOMIT_Node $element
buildEffectivedate (line 563)

Helper function for XML elements

  • since: 9/13/05
  • access: public
void buildEffectivedate (object DOMIT_Node $element)
  • object DOMIT_Node $element
buildExpirationdate (line 574)

Helper function for XML elements

  • since: 9/13/05
  • access: public
void buildExpirationdate (object DOMIT_Node $element)
  • object DOMIT_Node $element
buildFormat (line 552)

Helper function for XML elements

  • since: 9/13/05
  • access: public
void buildFormat (object DOMIT_Node $element)
  • object DOMIT_Node $element
buildName (line 530)
void buildName (mixed $element)
buildType (line 496)

Builds a type object from a type import node

  • since: 9/12/05
  • access: public
void buildType (object DOMIT_Node $element)
  • object DOMIT_Node $element
canImportBelow (line 298)

Checks if the user is able to import underneath this level

  • since: 11/3/05
  • access: public
  • todo: the authorizations could not keep up with the importer
void canImportBelow (string $authZQString)
  • string $authZQString: qualifier for authz checking

Redefined in descendants as:
decompress (line 585)
  • since: 7/20/05
  • access: public
string decompress (mixed $filepath)
doIdMatrix (line 346)

Does what is necessary to the temporary table for internal id association

  • since: 10/6/05
  • access: public
void doIdMatrix ()

Redefined in descendants as:
dropIdMatrix (line 356)

Drops the temporary table for internal id association

  • since: 10/6/05
  • access: public
void dropIdMatrix ()

Redefined in descendants as:
getErrors (line 648)

gets error array

  • since: 7/26/05
  • access: public
array getErrors ()
getNodeInfo (line 447)

Populates _info array with data from the xml file

Retrieves all the necessary information to build the object that the current xml element represents.

  • since: 10/5/05
  • access: public
void getNodeInfo ()

Redefined in descendants as:
getParentForImporter (line 433)

Answer the parent for the importer. This allows importers such as the XMLRepositoryImporter to switch and import assets underneith another asset rather than just under themselves.

  • since: 4/3/07
  • access: public
object getParentForImporter (mixed $importer, string $importerClass)
  • string $importerClass

Redefined in descendants as:
hasErrors (line 659)

checks for errors

  • since: 7/26/05
  • access: public
boolean hasErrors ()
import (line 323)

Organizes the import

  • since: 10/5/05
  • access: public
object HarmoniId import (object mixed $topImporter, object DOMIT_Node $node, string $type, object mixed $parent)
  • object mixed $topImporter: is the importer instance that parsed the XML
  • object DOMIT_Node $node: domit node for importing
  • string $type: type of import (update/insert)
  • object mixed $parent: parent of object to be imported

Redefined in descendants as:
importBelow (line 273)

Starts an import below the qualifier passed

  • since: 10/11/05
  • access: public
object HarmoniId importBelow (object mixed $topImporter, [string $authZQString = null])
  • object mixed $topImporter: is the importer instance that parsed the XML
  • string $authZQString: string of the qualifier for the object
importNode (line 366)

Imports the node itself

  • since: 10/5/05
  • access: public
void importNode ()

Redefined in descendants as:
moreGranulesFromXML (line 683)

*******************************************************

STATUS BAR UTILITY *******************************************************

void moreGranulesFromXML ()
parseAndImport (line 214)

Creates the DOMIT Document and Imports the data including the top target

  • since: 10/5/05
  • access: public
void parseAndImport (string $granule, [int $detail = 50])
  • string $granule: the xml element to count for status
  • int $detail: the number of divisions for status
parseAndImportBelow (line 153)

Creates the DOMIT Document and Imports the data below the target

This is used to import data underneath an object that already exists in the system.

  • since: 10/5/05
  • access: public
void parseAndImportBelow (string $granule, [int $detail = 50])
  • string $granule: the xml element to count for status
  • int $detail: the number of divisions for status
printErrorMessages (line 632)

Print the AssetIds for Assets created properly by the importer

  • since: 7/29/05
void printErrorMessages (array $goodAssetIds)
  • array $goodAssetIds
relegateChildren (line 383)

Relegates child XML elements to their importer classes

By matching the xml elements with their importers the importer hierachy is able to import each element with much customization (detail) making it easier to handle new elements with new child classes. This function also passes any errors encountered in a child importer back up until the errors reach the top importer where they get printed at the end of the import

  • since: 10/5/05
  • access: public
void relegateChildren (object mixed $topImporter)
  • object mixed $topImporter: is the importer instance that parsed the XML

Redefined in descendants as:
setParent (line 135)

Set the parent of the child objects to be imported if it will be different from our object. This is used in importing assets into a repository, but under an asset in that repository

  • since: 4/3/07
  • access: public
void setParent (object $parent)
  • object $parent
setupSelf (line 117)

Sets up importer's self-knowledge

This knowledge is a list of importers that are available below this and the xml elements that correspond to these importers.

  • since: 10/5/05
  • access: public
void setupSelf ()

Redefined in descendants as:
setupStatusBar (line 739)

Sets up the status bar with appropriate granule

  • since: 2/27/06
  • access: public
void setupStatusBar (string $granule, int $detail)
  • string $granule: the xml element for status bar granule
  • int $detail: the number of divisions for the status bar
update (line 481)

Update

  • since: 10/10/05
  • access: public
void update ()

Redefined in descendants as:
withFile (line 68)

Constructor with XML File to parse

  • since: 10/11/05
  • access: public
object mixed withFile (array $existingArray, string $filepath, string $type, [string $class = 'XMLImporter'])
  • array $existingArray: contains the idStrings of any objects that may be in the xml file but are not to be created.
  • string $filepath: path to the xml file with importable data
  • string $type: type of the import (update/insert)
  • string $class: class of the importer to instantiate

Redefined in descendants as:
withObject (line 94)

Constructor with XMLFile and starting object

  • since: 10/11/05
  • access: public
object mixed withObject (array $existingArray, object mixed $object, string $filepath, string $type, [string $class = 'XMLImporter'])
  • array $existingArray: contains the idStrings of any objects that may be in the xml file but are not to be created.
  • object mixed $object: the object underneath which importer acts
  • string $filepath: path to the xml data file
  • string $type: type of the import (update/insert)
  • string $class: class of the import to instantiate

Redefined in descendants as:
_checkXMLStructure (line 621)

This function determines the structure wanted and makes sure it is so

sub-classes that can start an import should overwrite this function

  • since: 2/23/06
  • access: public
void _checkXMLStructure ()

Redefined in descendants as:

Documentation generated on Wed, 19 Sep 2007 10:28:38 -0400 by phpDocumentor 1.3.0RC3