ILIAS
Release_3_10_x_branch Revision 61812
|
SAX based XML parser for record import files. More...
Public Member Functions | |
__construct ($a_file) | |
Constructor. | |
setMode ($a_mode) | |
set parsing mode | |
getMode () | |
get mode | |
startParsing () | |
stores xml data in array | |
setHandlers ($a_xml_parser) | |
set event handlers |
Data Fields | |
const | MODE_UPDATE = 1 |
const | MODE_INSERT = 2 |
const | MODE_UPDATE_VALIDATION = 3 |
const | MODE_INSERT_VALIDATION = 4 |
Protected Member Functions | |
handlerBeginTag ($a_xml_parser, $a_name, $a_attribs) | |
Handler for start tags. | |
handlerEndTag ($a_xml_parser, $a_name) | |
Handler for end tags. | |
handlerCharacterData ($a_xml_parser, $a_data) | |
handler for character data |
Private Member Functions | |
initRecordObject ($a_id) | |
Init record object. | |
initFieldObject ($a_id) | |
Init field definition object. | |
getCurrentRecord () | |
get current record | |
getCurrentField () | |
get current field definition private | |
extractRecordId ($a_id_string) | |
Extract id. | |
appendErrorMessage ($a_msg) | |
private | |
storeRecords () | |
Store Record. |
Private Attributes | |
$mode | |
$fields = array() | |
$is_error = false | |
$error_msg = array() |
SAX based XML parser for record import files.
Definition at line 37 of file class.ilAdvancedMDRecordParser.php.
ilAdvancedMDRecordParser::__construct | ( | $a_file | ) |
Constructor.
public
string | xml file |
Definition at line 57 of file class.ilAdvancedMDRecordParser.php.
|
private |
private
Definition at line 360 of file class.ilAdvancedMDRecordParser.php.
Referenced by handlerBeginTag().
|
private |
Extract id.
private
Definition at line 340 of file class.ilAdvancedMDRecordParser.php.
References ilAdvancedMDRecord\_lookupRecordIdByImportId().
Referenced by initRecordObject().
|
private |
get current field definition private
Definition at line 328 of file class.ilAdvancedMDRecordParser.php.
Referenced by handlerBeginTag(), and handlerEndTag().
|
private |
get current record
private
Definition at line 318 of file class.ilAdvancedMDRecordParser.php.
Referenced by handlerBeginTag(), handlerEndTag(), and storeRecords().
ilAdvancedMDRecordParser::getMode | ( | ) |
get mode
public
Definition at line 80 of file class.ilAdvancedMDRecordParser.php.
References $mode.
Referenced by initFieldObject(), initRecordObject(), and storeRecords().
|
protected |
Handler for start tags.
protected
Definition at line 121 of file class.ilAdvancedMDRecordParser.php.
References appendErrorMessage(), getCurrentField(), getCurrentRecord(), initFieldObject(), initRecordObject(), ilAdvancedMDFieldDefinition\TYPE_DATE, ilAdvancedMDFieldDefinition\TYPE_DATETIME, ilAdvancedMDFieldDefinition\TYPE_SELECT, and ilAdvancedMDFieldDefinition\TYPE_TEXT.
|
protected |
handler for character data
resource | $a_xml_parser | xml parser |
string | $a_data | character data |
Definition at line 252 of file class.ilAdvancedMDRecordParser.php.
|
protected |
Handler for end tags.
protected
Definition at line 200 of file class.ilAdvancedMDRecordParser.php.
References getCurrentField(), getCurrentRecord(), and storeRecords().
|
private |
Init field definition object.
private
string | import id |
Definition at line 293 of file class.ilAdvancedMDRecordParser.php.
References getMode().
Referenced by handlerBeginTag().
|
private |
Init record object.
string | import id private |
Definition at line 270 of file class.ilAdvancedMDRecordParser.php.
References ilAdvancedMDRecord\_getInstanceByRecordId(), extractRecordId(), and getMode().
Referenced by handlerBeginTag().
ilAdvancedMDRecordParser::setHandlers | ( | $a_xml_parser | ) |
set event handlers
resource | reference to the xml parser private |
Definition at line 109 of file class.ilAdvancedMDRecordParser.php.
ilAdvancedMDRecordParser::setMode | ( | $a_mode | ) |
set parsing mode
public
int | MODE_VALIDATION, MODE_UPDATE or MODE_INSERT |
Definition at line 69 of file class.ilAdvancedMDRecordParser.php.
Referenced by ilAdvancedMDSettingsGUI\importRecord().
ilAdvancedMDRecordParser::startParsing | ( | ) |
stores xml data in array
ilSaxParserException |
Definition at line 93 of file class.ilAdvancedMDRecordParser.php.
|
private |
Store Record.
private
Definition at line 373 of file class.ilAdvancedMDRecordParser.php.
References getCurrentRecord(), and getMode().
Referenced by handlerEndTag().
|
private |
Definition at line 49 of file class.ilAdvancedMDRecordParser.php.
|
private |
Definition at line 46 of file class.ilAdvancedMDRecordParser.php.
|
private |
Definition at line 48 of file class.ilAdvancedMDRecordParser.php.
|
private |
Definition at line 44 of file class.ilAdvancedMDRecordParser.php.
Referenced by getMode().
const ilAdvancedMDRecordParser::MODE_INSERT = 2 |
Definition at line 40 of file class.ilAdvancedMDRecordParser.php.
Referenced by ilAdvancedMDSettingsGUI\importRecord().
const ilAdvancedMDRecordParser::MODE_INSERT_VALIDATION = 4 |
Definition at line 42 of file class.ilAdvancedMDRecordParser.php.
Referenced by ilAdvancedMDSettingsGUI\importRecord().
const ilAdvancedMDRecordParser::MODE_UPDATE = 1 |
Definition at line 39 of file class.ilAdvancedMDRecordParser.php.
const ilAdvancedMDRecordParser::MODE_UPDATE_VALIDATION = 3 |
Definition at line 41 of file class.ilAdvancedMDRecordParser.php.