Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
DBDataXMLParser Class Reference

Public Member Functions

 _getFieldData ($fieldNode)
 
 DBDataXMLParser ()
 
 destroy ()
 
 executeData ($continueOnError=false)
 
 getSQL ()
 
 parseData ($file)
 
 quoteString ($str)
 
 setDBConn (&$dbconn)
 

Detailed Description

Class to import and export database data from an XML format. See dbscripts/xml/dtd/xmldata.dtd for the XML schema used.

Definition at line 20 of file DBDataXMLParser.inc.php.

Member Function Documentation

DBDataXMLParser::_getFieldData (   $fieldNode)

retrieve a field name and value from a field node

Parameters
$fieldNodeXMLNode
Returns
array an array with two entries: the field name and the field value

Definition at line 230 of file DBDataXMLParser.inc.php.

References quoteString().

Referenced by parseData().

DBDataXMLParser::DBDataXMLParser ( )

Constructor.

Definition at line 34 of file DBDataXMLParser.inc.php.

DBDataXMLParser::destroy ( )

Perform required clean up for this object.

Definition at line 215 of file DBDataXMLParser.inc.php.

DBDataXMLParser::executeData (   $continueOnError = false)

Execute the parsed SQL statements.

Parameters
$continueOnErrorboolean continue to execute remaining statements if a failure occurs
Returns
boolean success

Definition at line 183 of file DBDataXMLParser.inc.php.

References DBConnection\getConn().

DBDataXMLParser::getSQL ( )

Return the parsed SQL statements.

Returns
array

Definition at line 199 of file DBDataXMLParser.inc.php.

DBDataXMLParser::parseData (   $file)

Parse an XML data file into SQL statements.

Parameters
$filestring path to the XML file to parse
Returns
array the array of SQL statements parsed

Definition at line 53 of file DBDataXMLParser.inc.php.

References _getFieldData().

DBDataXMLParser::quoteString (   $str)

Quote a string to be appear as a value in an SQL INSERT statement.

Parameters
$strstring
Returns
string

Definition at line 208 of file DBDataXMLParser.inc.php.

Referenced by _getFieldData().

DBDataXMLParser::setDBConn ( $dbconn)

Set the database connection to use for executeData(). If the connection is not set, the default system database connection will be used.

Parameters
$dbconnADOConnection the database connection

Definition at line 44 of file DBDataXMLParser.inc.php.


The documentation for this class was generated from the following file: