ILIAS
Release_3_10_x_branch Revision 61812
|
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 |
Class NestedSetXML functions for storing XML-Data into nested-set-database-strcture.
public
Definition at line 36 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 1397 of file class.ilNestedSetXML.php.
References $ilBench, $in, $res, and DB_FETCHMODE_OBJECT.
ilNestedSetXML::_deleteAllChildMetaData | ( | $a_ids | ) |
Delete meta data of a content object (pages, chapters)
public
array | of child ids |
Definition at line 1407 of file class.ilNestedSetXML.php.
References $ilBench, $in, $res, DB_FETCHMODE_OBJECT, and ilUtil\quoteArray().
ilNestedSetXML::_getAllChildIds | ( | $a_obj_id | ) |
Get all child ids of a content object
public
int | obj_id |
Definition at line 1442 of file class.ilNestedSetXML.php.
References $res, and DB_FETCHMODE_OBJECT.
ilNestedSetXML::_getAllChildIds | ( | $a_obj_id | ) |
Get all child ids of a content object
public
int | obj_id |
Definition at line 1447 of file class.ilNestedSetXML.php.
References $res, and DB_FETCHMODE_OBJECT.
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 727 of file class.ilNestedSetXML.php.
References 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 738 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 613 of file class.ilNestedSetXML.php.
References getXpathNodes().
Referenced by updateDomNode().
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 625 of file class.ilNestedSetXML.php.
References getXpathNodes().
ilNestedSetXML::clean | ( | & | $meta | ) |
Definition at line 753 of file class.ilNestedSetXML.php.
References ilUtil\stripSlashes().
Referenced by clean(), startElement(), and updateDomNode().
ilNestedSetXML::clean | ( | & | $meta | ) |
Definition at line 764 of file class.ilNestedSetXML.php.
References clean().
ilNestedSetXML::deleteAllDbData | ( | ) |
deletes current db-data of $this->obj_id and $this->obj_type
private
Definition at line 1373 of file class.ilNestedSetXML.php.
References $ilBench, $res, and DB_FETCHMODE_ASSOC.
Referenced by import(), and updateFromDom().
ilNestedSetXML::deleteAllDbData | ( | ) |
deletes current db-data of $this->obj_id and $this->obj_type
private
Definition at line 1383 of file class.ilNestedSetXML.php.
References $ilBench, $res, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::deleteDomNode | ( | $xPath, | |
$name, | |||
$index = 0 |
|||
) |
deletes node
string | xPath path |
string | name name |
integer | index index |
Definition at line 672 of file class.ilNestedSetXML.php.
References getXpathNodes().
ilNestedSetXML::deleteDomNode | ( | $xPath, | |
$name, | |||
$index = 0 |
|||
) |
deletes node
string | xPath path |
string | name name |
integer | index index |
Definition at line 683 of file class.ilNestedSetXML.php.
References 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 216 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 312 of file class.ilNestedSetXML.php.
References $result, DB_FETCHMODE_ASSOC, and ilDBx\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 $obj_id, $result, 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 1200 of file class.ilNestedSetXML.php.
References getXpathNodes().
ilNestedSetXML::getDomContent | ( | $xPath, | |
$name = "" , |
|||
$index = 0 |
|||
) |
returns all contents of this node
string | xPath |
string | name |
integer | index |
Definition at line 1210 of file class.ilNestedSetXML.php.
References getXpathNodes().
ilNestedSetXML::getFirstDomContent | ( | $xPath | ) |
returns first content of this node
string | xPath path |
Definition at line 638 of file class.ilNestedSetXML.php.
References getXpathNodes().
ilNestedSetXML::getFirstDomContent | ( | $xPath | ) |
returns first content of this node
string | xPath path |
Definition at line 652 of file class.ilNestedSetXML.php.
References getXpathNodes().
ilNestedSetXML::getFirstDomNode | ( | $xPath | ) |
first dom-node
string | xPath path |
Definition at line 1351 of file class.ilNestedSetXML.php.
References getXpathNodes().
ilNestedSetXML::getFirstDomNode | ( | $xPath | ) |
first dom-node
string | xPath path |
Definition at line 1361 of file class.ilNestedSetXML.php.
References getXpathNodes().
ilNestedSetXML::getTagName | ( | ) |
find first tag-name
public
Definition at line 428 of file class.ilNestedSetXML.php.
References $result, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::getTagName | ( | ) |
find first tag-name
public
Definition at line 435 of file class.ilNestedSetXML.php.
References $result, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::getTagValue | ( | ) |
get tag content
Definition at line 469 of file class.ilNestedSetXML.php.
References $obj_id, $obj_type, $result, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::getTagValue | ( | ) |
get tag content
Definition at line 478 of file class.ilNestedSetXML.php.
References $obj_id, $obj_type, $result, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::getXpathNodes | ( | & | $doc, |
$qry | |||
) |
get node in dom-structure
object | doc |
string | qry path to node |
Definition at line 551 of file class.ilNestedSetXML.php.
References $result.
Referenced by addDomNode(), addXMLNode(), deleteDomNode(), getDomContent(), getFirstDomContent(), getFirstDomNode(), replaceDomContent(), updateDomContent(), and updateDomNode().
ilNestedSetXML::getXpathNodes | ( | & | $doc, |
$qry | |||
) |
get node in dom-structure
object | doc |
string | qry path to node |
Definition at line 563 of file class.ilNestedSetXML.php.
References $result.
ilNestedSetXML::ilNestedSetXML | ( | ) |
Constructor initilize netsed-set variables public.
Definition at line 98 of file class.ilNestedSetXML.php.
References $ilias.
ilNestedSetXML::ilNestedSetXML | ( | ) |
Constructor initilize netsed-set variables public.
Definition at line 98 of file class.ilNestedSetXML.php.
References $ilias.
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 233 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 DB_FETCHMODE_ASSOC.
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 $obj_id, $obj_type, $result, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::initDom | ( | ) |
inits dom-object from given xml-content
Definition at line 573 of file class.ilNestedSetXML.php.
References domxml_open_mem(), and export().
ilNestedSetXML::initDom | ( | ) |
inits dom-object from given xml-content
Definition at line 585 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 1285 of file class.ilNestedSetXML.php.
Referenced by replaceDomContent().
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 1295 of file class.ilNestedSetXML.php.
ilNestedSetXML::replaceDomContent | ( | $xPath, | |
$name = "" , |
|||
$index = 0 , |
|||
$newNode | |||
) |
updates content of this node
string | xPath |
string | name |
integer | index |
array | newNode public |
Definition at line 1244 of file class.ilNestedSetXML.php.
References 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 1254 of file class.ilNestedSetXML.php.
References getXpathNodes(), and replace_content().
ilNestedSetXML::setParameterModifier | ( | & | $a_object, |
$a_method | |||
) |
obj | a_object |
String | a_method Function-Name |
Definition at line 295 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 448 of file class.ilNestedSetXML.php.
References $result, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::setTagName | ( | $tagName | ) |
set tag-name
string | tagName name of tag to be changed |
public
Definition at line 456 of file class.ilNestedSetXML.php.
References $result, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::setTagValue | ( | $value | ) |
set tag-content
string | value public |
add new
Definition at line 509 of file class.ilNestedSetXML.php.
References $result, and DB_FETCHMODE_ASSOC.
ilNestedSetXML::setTagValue | ( | $value | ) |
set tag-content
string | value public |
add new
Definition at line 519 of file class.ilNestedSetXML.php.
References $result, and DB_FETCHMODE_ASSOC.
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 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 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 1313 of file class.ilNestedSetXML.php.
References 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 1323 of file class.ilNestedSetXML.php.
References getXpathNodes().
ilNestedSetXML::updateDomNode | ( | $xPath, | |
$meta, | |||
$no = 0 |
|||
) |
updates dom node
string | xPath |
string | meta |
integer | no public |
Definition at line 783 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 793 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 1361 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 1371 of file class.ilNestedSetXML.php.
References $obj_id, $obj_type, and deleteAllDbData().
ilNestedSetXML::$db |
Datenbank-handle.
Definition at line 43 of file class.ilNestedSetXML.php.
ilNestedSetXML::$DEPTH = 0 |
Nesting level of the tags.
stored in database
Definition at line 55 of file class.ilNestedSetXML.php.
ilNestedSetXML::$dom |
Definition at line 89 of file class.ilNestedSetXML.php.
ilNestedSetXML::$ilias |
Definition at line 82 of file class.ilNestedSetXML.php.
Referenced by ilNestedSetXML().
ilNestedSetXML::$lastTag = "" |
last Tag-Name found
Definition at line 75 of file class.ilNestedSetXML.php.
ilNestedSetXML::$LEFT = 0 |
Left and right edge tags.
Definition at line 48 of file class.ilNestedSetXML.php.
ilNestedSetXML::$obj_id |
book-Obj-ID
Definition at line 60 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 65 of file class.ilNestedSetXML.php.
Referenced by getTagValue(), import(), init(), and updateFromDom().
ilNestedSetXML::$RIGHT = 0 |
Definition at line 49 of file class.ilNestedSetXML.php.
ilNestedSetXML::$xml_parser |
SAX-Parser-Handle.
Definition at line 70 of file class.ilNestedSetXML.php.