ILIAS
Release_4_0_x_branch Revision 61816
|
Class NestedSetXML functions for storing XML-Data into nested-set-database-strcture. More...
Public Member Functions | |
ilNestedSetXML () | |
Constructor initilize netsed-set variables public. | |
startElement ($parser, $name, $attrs) | |
Method is called, at an introductory TAG private. | |
endElement ($parser, $name) | |
method called at a closing tag private | |
import ($xmldata, $obj_id, $obj_type) | |
Import-Function. | |
setParameterModifier (&$a_object, $a_method) | |
export ($obj_id, $type) | |
Export-Function. | |
init ($obj_id, $obj_type) | |
initilialize Nested-Set-Structur | |
getTagName () | |
find first tag-name | |
setTagName ($tagName) | |
set tag-name | |
getTagValue () | |
get tag content | |
setTagValue ($value) | |
set tag-content | |
getXpathNodes (&$doc, $qry) | |
get node in dom-structure | |
initDom () | |
inits dom-object from given xml-content | |
addXMLNode ($xPath, $xml, $index=0) | |
parse XML code and add it to a given DOM object as a new node | |
getFirstDomContent ($xPath) | |
returns first content of this node | |
deleteDomNode ($xPath, $name, $index=0) | |
deletes node | |
addDomNode ($xPath, $name, $value="", $attributes="", $index=0) | |
adds node to DOM-Structure | |
clean (&$meta) | |
updateDomNode ($xPath, $meta, $no=0) | |
updates dom node | |
getDomContent ($xPath, $name="", $index=0) | |
returns all contents of this node | |
replaceDomContent ($xPath, $name="", $index=0, $newNode) | |
updates content of this node | |
replace_content (&$node, &$new_content) | |
Replace node contents. | |
updateDomContent ($xPath, $name="", $index=0, $newNode) | |
updates content of this node | |
getFirstDomNode ($xPath) | |
first dom-node | |
updateFromDom () | |
imports new xml-data from dom into nested set | |
deleteAllDbData () | |
deletes current db-data of $this->obj_id and $this->obj_type | |
_deleteAllChildMetaData ($a_ids) | |
Delete meta data of a content object (pages, chapters) | |
_getAllChildIds ($a_obj_id) | |
Get all child ids of a content object | |
ilNestedSetXML () | |
Constructor initilize netsed-set variables public. | |
startElement ($parser, $name, $attrs) | |
Method is called, at an introductory TAG private. | |
endElement ($parser, $name) | |
method called at a closing tag private | |
import ($xmldata, $obj_id, $obj_type) | |
Import-Function. | |
setParameterModifier (&$a_object, $a_method) | |
export ($obj_id, $type) | |
Export-Function. | |
init ($obj_id, $obj_type) | |
initilialize Nested-Set-Structur | |
getTagName () | |
find first tag-name | |
setTagName ($tagName) | |
set tag-name | |
getTagValue () | |
get tag content | |
setTagValue ($value) | |
set tag-content | |
getXpathNodes (&$doc, $qry) | |
get node in dom-structure | |
initDom () | |
inits dom-object from given xml-content | |
addXMLNode ($xPath, $xml, $index=0) | |
parse XML code and add it to a given DOM object as a new node | |
getFirstDomContent ($xPath) | |
returns first content of this node | |
deleteDomNode ($xPath, $name, $index=0) | |
deletes node | |
addDomNode ($xPath, $name, $value="", $attributes="", $index=0) | |
adds node to DOM-Structure | |
clean (&$meta) | |
updateDomNode ($xPath, $meta, $no=0) | |
updates dom node | |
getDomContent ($xPath, $name="", $index=0) | |
returns all contents of this node | |
replaceDomContent ($xPath, $name="", $index=0, $newNode) | |
updates content of this node | |
replace_content (&$node, &$new_content) | |
Replace node contents. | |
updateDomContent ($xPath, $name="", $index=0, $newNode) | |
updates content of this node | |
getFirstDomNode ($xPath) | |
first dom-node | |
updateFromDom () | |
imports new xml-data from dom into nested set | |
deleteAllDbData () | |
deletes current db-data of $this->obj_id and $this->obj_type | |
_deleteAllChildMetaData ($a_ids) | |
Delete meta data of a content object (pages, chapters) | |
_getAllChildIds ($a_obj_id) | |
Get all child ids of a content object |
Data Fields | |
$db | |
Datenbank-handle. | |
$LEFT = 0 | |
Left and right edge tags. | |
$RIGHT = 0 | |
$DEPTH = 0 | |
Nesting level of the tags. | |
$obj_id | |
book-Obj-ID | |
$obj_type | |
The type of the data to those this entry belongs. | |
$xml_parser | |
SAX-Parser-Handle. | |
$lastTag = "" | |
last Tag-Name found | |
$ilias | |
$dom |
Private Attributes | |
$unique_import_id = '' |
Class NestedSetXML functions for storing XML-Data into nested-set-database-strcture.
public
Definition at line 16 of file class.ilNestedSetXML.php.
ilNestedSetXML::_deleteAllChildMetaData | ( | $a_ids | ) |
Delete meta data of a content object (pages, chapters)
public
array | of child ids |
Definition at line 1410 of file class.ilNestedSetXML.php.
References $ilBench, $ilDB, $in, $query, $res, $row, DB_FETCHMODE_OBJECT, and ilUtil\quoteArray().
ilNestedSetXML::_deleteAllChildMetaData | ( | $a_ids | ) |
Delete meta data of a content object (pages, chapters)
public
array | of child ids |
Definition at line 1441 of file class.ilNestedSetXML.php.
References $ilBench, $ilDB, $in, $query, $res, and $row.
ilNestedSetXML::_getAllChildIds | ( | $a_obj_id | ) |
Get all child ids of a content object
public
int | obj_id |
Definition at line 1450 of file class.ilNestedSetXML.php.
References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.
ilNestedSetXML::_getAllChildIds | ( | $a_obj_id | ) |
Get all child ids of a content object
public
int | obj_id |
Definition at line 1486 of file class.ilNestedSetXML.php.
ilNestedSetXML::addDomNode | ( | $xPath, | |
$name, | |||
$value = "" , |
|||
$attributes = "" , |
|||
$index = 0 |
|||
) |
adds node to DOM-Structure
string | xPath |
string | name |
string | value |
array | attributes |
integer | index |
Definition at line 741 of file class.ilNestedSetXML.php.
References $name, and getXpathNodes().
ilNestedSetXML::addDomNode | ( | $xPath, | |
$name, | |||
$value = "" , |
|||
$attributes = "" , |
|||
$index = 0 |
|||
) |
adds node to DOM-Structure
string | xPath |
string | name |
string | value |
array | attributes |
integer | index |
Definition at line 767 of file class.ilNestedSetXML.php.
References $name, and getXpathNodes().
ilNestedSetXML::addXMLNode | ( | $xPath, | |
$xml, | |||
$index = 0 |
|||
) |
parse XML code and add it to a given DOM object as a new node
string | xPath path |
string | xml xml to add |
integer | index index to add |
Definition at line 628 of file class.ilNestedSetXML.php.
References getXpathNodes().
ilNestedSetXML::addXMLNode | ( | $xPath, | |
$xml, | |||
$index = 0 |
|||
) |
parse XML code and add it to a given DOM object as a new node
string | xPath path |
string | xml xml to add |
integer | index index to add |
Definition at line 653 of file class.ilNestedSetXML.php.
References getXpathNodes().
Referenced by updateDomNode().
ilNestedSetXML::clean | ( | & | $meta | ) |
Definition at line 767 of file class.ilNestedSetXML.php.
ilNestedSetXML::clean | ( | & | $meta | ) |
Definition at line 793 of file class.ilNestedSetXML.php.
References $key, and ilUtil\stripSlashes().
Referenced by clean(), startElement(), and updateDomNode().
ilNestedSetXML::deleteAllDbData | ( | ) |
deletes current db-data of $this->obj_id and $this->obj_type
private
Definition at line 1386 of file class.ilNestedSetXML.php.
References $ilBench, $ilDB, $res, $row, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::deleteAllDbData | ( | ) |
deletes current db-data of $this->obj_id and $this->obj_type
private
Definition at line 1413 of file class.ilNestedSetXML.php.
References $ilBench, $res, and $row.
Referenced by import(), and updateFromDom().
ilNestedSetXML::deleteDomNode | ( | $xPath, | |
$name, | |||
$index = 0 |
|||
) |
deletes node
string | xPath path |
string | name name |
integer | index index |
Definition at line 686 of file class.ilNestedSetXML.php.
References $name, and getXpathNodes().
ilNestedSetXML::deleteDomNode | ( | $xPath, | |
$name, | |||
$index = 0 |
|||
) |
deletes node
string | xPath path |
string | name name |
integer | index index |
Definition at line 712 of file class.ilNestedSetXML.php.
References $name, and getXpathNodes().
ilNestedSetXML::endElement | ( | $parser, | |
$name | |||
) |
method called at a closing tag private
parser | parser xml-parser-handle |
string | name name of the closing tag |
Definition at line 209 of file class.ilNestedSetXML.php.
ilNestedSetXML::endElement | ( | $parser, | |
$name | |||
) |
method called at a closing tag private
parser | parser xml-parser-handle |
string | name name of the closing tag |
Definition at line 219 of file class.ilNestedSetXML.php.
ilNestedSetXML::export | ( | $obj_id, | |
$type | |||
) |
Export-Function.
creates xml out of nested-set-structure
int | obj_id book-id |
string | type Object-Type of XML-Struktur |
@access public
Definition at line 304 of file class.ilNestedSetXML.php.
References $method, $obj_id, $q, $result, $row, $type, and ilDB\isDbError().
Referenced by initDom().
ilNestedSetXML::export | ( | $obj_id, | |
$type | |||
) |
Export-Function.
creates xml out of nested-set-structure
int | obj_id book-id |
string | type Object-Type of XML-Struktur |
@access public
Definition at line 315 of file class.ilNestedSetXML.php.
References $ilDB, $method, $obj_id, $query, $result, $row, $type, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::getDomContent | ( | $xPath, | |
$name = "" , |
|||
$index = 0 |
|||
) |
returns all contents of this node
string | xPath |
string | name |
integer | index |
Definition at line 1213 of file class.ilNestedSetXML.php.
References $name, and getXpathNodes().
ilNestedSetXML::getDomContent | ( | $xPath, | |
$name = "" , |
|||
$index = 0 |
|||
) |
returns all contents of this node
string | xPath |
string | name |
integer | index |
Definition at line 1240 of file class.ilNestedSetXML.php.
References $name, and getXpathNodes().
ilNestedSetXML::getFirstDomContent | ( | $xPath | ) |
returns first content of this node
string | xPath path |
Definition at line 655 of file class.ilNestedSetXML.php.
References getXpathNodes().
ilNestedSetXML::getFirstDomContent | ( | $xPath | ) |
returns first content of this node
string | xPath path |
Definition at line 678 of file class.ilNestedSetXML.php.
References getXpathNodes().
ilNestedSetXML::getFirstDomNode | ( | $xPath | ) |
first dom-node
string | xPath path |
Definition at line 1364 of file class.ilNestedSetXML.php.
References getXpathNodes().
ilNestedSetXML::getFirstDomNode | ( | $xPath | ) |
first dom-node
string | xPath path |
Definition at line 1391 of file class.ilNestedSetXML.php.
References getXpathNodes().
ilNestedSetXML::getTagName | ( | ) |
find first tag-name
public
Definition at line 436 of file class.ilNestedSetXML.php.
ilNestedSetXML::getTagName | ( | ) |
find first tag-name
public
Definition at line 436 of file class.ilNestedSetXML.php.
References $ilDB, $query, $result, $row, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::getTagValue | ( | ) |
get tag content
Definition at line 481 of file class.ilNestedSetXML.php.
References $ilDB, $obj_id, $obj_type, $query, $result, $row, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::getTagValue | ( | ) |
get tag content
Definition at line 497 of file class.ilNestedSetXML.php.
References $obj_id, $obj_type, $result, and $row.
ilNestedSetXML::getXpathNodes | ( | & | $doc, |
$qry | |||
) |
get node in dom-structure
object | doc |
string | qry path to node |
Definition at line 566 of file class.ilNestedSetXML.php.
References $result.
ilNestedSetXML::getXpathNodes | ( | & | $doc, |
$qry | |||
) |
get node in dom-structure
object | doc |
string | qry path to node |
Definition at line 591 of file class.ilNestedSetXML.php.
References $result.
Referenced by addDomNode(), addXMLNode(), deleteDomNode(), getDomContent(), getFirstDomContent(), getFirstDomNode(), replaceDomContent(), updateDomContent(), and updateDomNode().
ilNestedSetXML::ilNestedSetXML | ( | ) |
Constructor initilize netsed-set variables public.
Definition at line 85 of file class.ilNestedSetXML.php.
ilNestedSetXML::ilNestedSetXML | ( | ) |
ilNestedSetXML::import | ( | $xmldata, | |
$obj_id, | |||
$obj_type | |||
) |
Import-Function.
String | xmldata xml-structure |
int | obj_id book-ID |
string | obj_type Object-Type @access public |
drop temporary table
initialize XML-Parser
transfer nested-set-structure ito table and drop temp-Table
Definition at line 226 of file class.ilNestedSetXML.php.
References $obj_id, $obj_type, and deleteAllDbData().
ilNestedSetXML::import | ( | $xmldata, | |
$obj_id, | |||
$obj_type | |||
) |
Import-Function.
String | xmldata xml-structure |
int | obj_id book-ID |
string | obj_type Object-Type @access public |
drop temporary table
create new temp-Table
initialize XML-Parser
transfer nested-set-structure ito table and drop temp-Table
Definition at line 236 of file class.ilNestedSetXML.php.
References $obj_id, $obj_type, and deleteAllDbData().
ilNestedSetXML::init | ( | $obj_id, | |
$obj_type | |||
) |
initilialize Nested-Set-Structur
integer | obj_id object-id |
string | obj_type type of object public |
Definition at line 405 of file class.ilNestedSetXML.php.
References $obj_id, $obj_type, $result, and $row.
ilNestedSetXML::init | ( | $obj_id, | |
$obj_type | |||
) |
initilialize Nested-Set-Structur
integer | obj_id object-id |
string | obj_type type of object public |
Definition at line 410 of file class.ilNestedSetXML.php.
References $ilDB, $obj_id, $obj_type, $query, $result, $row, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::initDom | ( | ) |
inits dom-object from given xml-content
Definition at line 588 of file class.ilNestedSetXML.php.
References domxml_open_mem(), and export().
ilNestedSetXML::initDom | ( | ) |
inits dom-object from given xml-content
Definition at line 613 of file class.ilNestedSetXML.php.
References domxml_open_mem(), and export().
ilNestedSetXML::replace_content | ( | & | $node, |
& | $new_content | ||
) |
Replace node contents.
Needed as a workaround for bug/feature of set_content This version puts the content as the first child of the new node. If you need it somewhere else, simply move $newnode->set_content() where you want it.
Definition at line 1298 of file class.ilNestedSetXML.php.
ilNestedSetXML::replace_content | ( | & | $node, |
& | $new_content | ||
) |
Replace node contents.
Needed as a workaround for bug/feature of set_content This version puts the content as the first child of the new node. If you need it somewhere else, simply move $newnode->set_content() where you want it.
Definition at line 1325 of file class.ilNestedSetXML.php.
Referenced by replaceDomContent().
ilNestedSetXML::replaceDomContent | ( | $xPath, | |
$name = "" , |
|||
$index = 0 , |
|||
$newNode | |||
) |
updates content of this node
string | xPath |
string | name |
integer | index |
array | newNode public |
Definition at line 1257 of file class.ilNestedSetXML.php.
References $key, $name, getXpathNodes(), and replace_content().
ilNestedSetXML::replaceDomContent | ( | $xPath, | |
$name = "" , |
|||
$index = 0 , |
|||
$newNode | |||
) |
updates content of this node
string | xPath |
string | name |
integer | index |
array | newNode public |
Definition at line 1284 of file class.ilNestedSetXML.php.
References $key, $name, getXpathNodes(), and replace_content().
ilNestedSetXML::setParameterModifier | ( | & | $a_object, |
$a_method | |||
) |
obj | a_object |
String | a_method Function-Name |
Definition at line 287 of file class.ilNestedSetXML.php.
ilNestedSetXML::setParameterModifier | ( | & | $a_object, |
$a_method | |||
) |
obj | a_object |
String | a_method Function-Name |
Definition at line 298 of file class.ilNestedSetXML.php.
ilNestedSetXML::setTagName | ( | $tagName | ) |
set tag-name
string | tagName name of tag to be changed |
public
Definition at line 458 of file class.ilNestedSetXML.php.
References $ilDB, $query, $result, $row, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::setTagName | ( | $tagName | ) |
set tag-name
string | tagName name of tag to be changed |
public
Definition at line 466 of file class.ilNestedSetXML.php.
ilNestedSetXML::setTagValue | ( | $value | ) |
set tag-content
string | value public |
add new
Definition at line 522 of file class.ilNestedSetXML.php.
References $ilDB, $query, $result, $row, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::setTagValue | ( | $value | ) |
set tag-content
string | value public |
add new
Definition at line 546 of file class.ilNestedSetXML.php.
ilNestedSetXML::startElement | ( | $parser, | |
$name, | |||
$attrs | |||
) |
Method is called, at an introductory TAG private.
parser | parser xml-parser-handle |
string | name the tag-name |
array | attrs assoziativ-array of all attributes inside the tag |
Insert Tag-Name
Definition at line 111 of file class.ilNestedSetXML.php.
References $key, $name, and clean().
ilNestedSetXML::startElement | ( | $parser, | |
$name, | |||
$attrs | |||
) |
Method is called, at an introductory TAG private.
parser | parser xml-parser-handle |
string | name the tag-name |
array | attrs assoziativ-array of all attributes inside the tag |
Insert Tag-Name
Definition at line 123 of file class.ilNestedSetXML.php.
References $ilDB, $key, $name, $row, and clean().
ilNestedSetXML::updateDomContent | ( | $xPath, | |
$name = "" , |
|||
$index = 0 , |
|||
$newNode | |||
) |
updates content of this node
string | xPath |
string | name |
integer | index |
array | newNode public |
Definition at line 1326 of file class.ilNestedSetXML.php.
References $key, $name, and getXpathNodes().
ilNestedSetXML::updateDomContent | ( | $xPath, | |
$name = "" , |
|||
$index = 0 , |
|||
$newNode | |||
) |
updates content of this node
string | xPath |
string | name |
integer | index |
array | newNode public |
Definition at line 1353 of file class.ilNestedSetXML.php.
References $key, $name, and getXpathNodes().
ilNestedSetXML::updateDomNode | ( | $xPath, | |
$meta, | |||
$no = 0 |
|||
) |
updates dom node
string | xPath |
string | meta |
integer | no public |
Definition at line 796 of file class.ilNestedSetXML.php.
References addXMLNode(), clean(), getXpathNodes(), and ilUtil\stripSlashes().
ilNestedSetXML::updateDomNode | ( | $xPath, | |
$meta, | |||
$no = 0 |
|||
) |
updates dom node
string | xPath |
string | meta |
integer | no public |
Definition at line 823 of file class.ilNestedSetXML.php.
References addXMLNode(), clean(), getXpathNodes(), and ilUtil\stripSlashes().
ilNestedSetXML::updateFromDom | ( | ) |
imports new xml-data from dom into nested set
public
Definition at line 1374 of file class.ilNestedSetXML.php.
References $obj_id, $obj_type, and deleteAllDbData().
ilNestedSetXML::updateFromDom | ( | ) |
imports new xml-data from dom into nested set
public
Definition at line 1401 of file class.ilNestedSetXML.php.
References $obj_id, $obj_type, and deleteAllDbData().
ilNestedSetXML::$db |
Datenbank-handle.
Definition at line 23 of file class.ilNestedSetXML.php.
ilNestedSetXML::$DEPTH = 0 |
Nesting level of the tags.
stored in database
Definition at line 35 of file class.ilNestedSetXML.php.
ilNestedSetXML::$dom |
Definition at line 69 of file class.ilNestedSetXML.php.
ilNestedSetXML::$ilias |
Definition at line 62 of file class.ilNestedSetXML.php.
Referenced by ilNestedSetXML().
ilNestedSetXML::$lastTag = "" |
last Tag-Name found
Definition at line 55 of file class.ilNestedSetXML.php.
ilNestedSetXML::$LEFT = 0 |
Left and right edge tags.
Definition at line 28 of file class.ilNestedSetXML.php.
ilNestedSetXML::$obj_id |
book-Obj-ID
Definition at line 40 of file class.ilNestedSetXML.php.
Referenced by export(), getTagValue(), import(), init(), and updateFromDom().
ilNestedSetXML::$obj_type |
The type of the data to those this entry belongs.
Definition at line 45 of file class.ilNestedSetXML.php.
Referenced by getTagValue(), import(), init(), and updateFromDom().
ilNestedSetXML::$RIGHT = 0 |
Definition at line 29 of file class.ilNestedSetXML.php.
|
private |
Definition at line 76 of file class.ilNestedSetXML.php.
ilNestedSetXML::$xml_parser |
SAX-Parser-Handle.
Definition at line 50 of file class.ilNestedSetXML.php.