wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
XMLUtil Class Reference
+ Inheritance diagram for XMLUtil:

Public Member Functions

 getErrorMsg ()
 
 getRootNodeName ()
 
 getRootOID ()
 
 GetNodeData ($oid, $elementName)
 
 GetChildData ($oid)
 
 GetOIDs ($nodeQuery)
 
 InsertNode (&$node, $parentOID)
 
 UpdateNode (&$node)
 
 RemoveNode ($oid)
 
 GetNextInsertId ()
 
 _GetNodeData ($oid, $elementName)
 
 _GetChildData ($oid)
 
 _InsertNode (&$node, $parentOID)
 
 _UpdateNode (&$node)
 
 _RemoveNode ($oid)
 
 _CheckAction ($action)
 
 _GetNodePath ($oid)
 
 _GetTypes ($path)
 
 _GetOID ($nodePath)
 

Public Attributes

 $_errorMsg = ''
 
 $_idName = 'id'
 

Detailed Description

XMLUtil helps in using XML files as storage. XMLUtil is a subclass of CXmlDb that is customized for use with the wemove cms framework.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 44 of file class.XMLUtil.php.

Member Function Documentation

XMLUtil::getErrorMsg ( )

Get last error message.

Returns
The error string

Definition at line 53 of file class.XMLUtil.php.

References $_errorMsg.

XMLUtil::getRootNodeName ( )

Get the root node name.

Returns
The root node name

Definition at line 61 of file class.XMLUtil.php.

References ROOT_NODE_NAME.

Referenced by _GetNodePath().

XMLUtil::getRootOID ( )

Get the object id of the root node.

Returns
The object id of the root node

Definition at line 69 of file class.XMLUtil.php.

References PersistenceFacade\composeOID(), and ROOT_NODE_NAME.

Referenced by _InsertNode().

+ Here is the call graph for this function:

XMLUtil::GetNodeData (   $oid,
  $elementName 
)

Load Node data.

Parameters
oidThe OID of the Node to load the data for.
elementNameThe name of the DATATYPE_ELEMENT field of the Node (content will be mapped here).
Returns
An assoziative array holding key value pairs of all Node data (attributes and content) 0 on failure / error string provided by getErrorMsg()

Definition at line 81 of file class.XMLUtil.php.

References _CheckAction(), and _GetNodeData().

+ Here is the call graph for this function:

XMLUtil::GetChildData (   $oid)

Load Node child data.

Parameters
oidThe OID of the Node to load the child data for.
Returns
An array holding assoziative arrays with key value pairs of child data (keys 'type', 'id') 0 on failure / error string provided by getErrorMsg()

Definition at line 102 of file class.XMLUtil.php.

References _CheckAction(), and _GetChildData().

+ Here is the call graph for this function:

XMLUtil::GetOIDs (   $nodeQuery)

Get Node OID from a XPath query.

Parameters
nodeQueryThe XPath query.
Returns
Array of OIDs on success, 0 on failure / error string provided by getErrorMsg()

Definition at line 122 of file class.XMLUtil.php.

References _GetOID().

+ Here is the call graph for this function:

XMLUtil::InsertNode ( $node,
  $parentOID 
)

Add a new Node to the Node with given parentOID.

Parameters
nodeThe Node to add
parentOIDThe OID of the parent Node [maybe null to add to root].
Returns
The ID of the new Node that was added on success, 0 on failure / error string provided by getErrorMsg()

Definition at line 137 of file class.XMLUtil.php.

References _CheckAction(), and _InsertNode().

+ Here is the call graph for this function:

XMLUtil::UpdateNode ( $node)

Save a Node to the XmlDb.

Parameters
nodeThe Node to save
Returns
1 on success, 0 on failure / error string provided by getErrorMsg()

Definition at line 161 of file class.XMLUtil.php.

References _CheckAction(), and _UpdateNode().

+ Here is the call graph for this function:

XMLUtil::RemoveNode (   $oid)

Remove a Node from the XmlDb.

Parameters
oidThe OID of the Node to remove
Returns
1 on success, 0 on failure / error string provided by getErrorMsg()

Definition at line 185 of file class.XMLUtil.php.

References _CheckAction(), and _RemoveNode().

+ Here is the call graph for this function:

XMLUtil::GetNextInsertId ( )

Get the next record id.

Returns
The next ID for insertion

Definition at line 208 of file class.XMLUtil.php.

Referenced by _InsertNode().

XMLUtil::_GetNodeData (   $oid,
  $elementName 
)

Internal version of GetNodeData.

Parameters
oidThe OID of the Node to load the data for.
elementNameThe name of the DATATYPE_ELEMENT field of the Node (content will be mapped here).
Returns
An assoziative array holding key value pairs of all Node data (attributes and content) 0 on failure / error string provided by getErrorMsg()

Definition at line 243 of file class.XMLUtil.php.

References $_idName, _GetNodePath(), and _GetTypes().

Referenced by GetNodeData().

+ Here is the call graph for this function:

XMLUtil::_GetChildData (   $oid)

Internal version of GetChildData.

Parameters
oidThe OID of the Node to load the child data for.
Returns
An array holding assoziative arrays with key value pairs of child data (keys 'type', 'id') 0 on failure / error string provided by getErrorMsg()

Definition at line 270 of file class.XMLUtil.php.

References $_idName, _GetNodePath(), and _GetTypes().

Referenced by GetChildData().

+ Here is the call graph for this function:

XMLUtil::_InsertNode ( $node,
  $parentOID 
)

Internal version of InsertNode.

Parameters
nodeThe Node to add
parentOIDThe OID of the parent Node [maybe null to add to root].
Returns
The ID of the new Node that was added on success, 0 on failure / error string provided by getErrorMsg()

Definition at line 299 of file class.XMLUtil.php.

References $_idName, _GetNodePath(), PersistenceFacade\composeOID(), DATATYPE_ATTRIBUTE, DATATYPE_ELEMENT, PersistenceFacade\decomposeOID(), GetNextInsertId(), and getRootOID().

Referenced by InsertNode().

+ Here is the call graph for this function:

XMLUtil::_UpdateNode ( $node)

Internal version of UpdateNode.

Parameters
nodeThe Node to save
Returns
1 on success, 0 on failure / error string provided by getErrorMsg()

Definition at line 347 of file class.XMLUtil.php.

References _GetNodePath(), DATATYPE_ATTRIBUTE, and DATATYPE_ELEMENT.

Referenced by UpdateNode().

+ Here is the call graph for this function:

XMLUtil::_RemoveNode (   $oid)

Internal version of RemoveNode.

Parameters
oidThe OID of the Node to remove
Returns
1 on success, 0 on failure / error string provided by getErrorMsg()

Definition at line 380 of file class.XMLUtil.php.

References _GetNodePath().

Referenced by RemoveNode().

+ Here is the call graph for this function:

XMLUtil::_CheckAction (   $action)

Check if execution of an action is possible.

Parameters
actionThe action to execute
Returns
True/False whether execution is possible

Definition at line 393 of file class.XMLUtil.php.

Referenced by GetChildData(), GetNodeData(), InsertNode(), RemoveNode(), and UpdateNode().

XMLUtil::_GetNodePath (   $oid)

Get the path to a Node.

Parameters
oidThe OID of the Node
Returns
The path to the Node

Definition at line 419 of file class.XMLUtil.php.

References PersistenceFacade\decomposeOID(), and getRootNodeName().

Referenced by _GetChildData(), _GetNodeData(), _InsertNode(), _RemoveNode(), and _UpdateNode().

+ Here is the call graph for this function:

XMLUtil::_GetTypes (   $path)

Get the Node types contained in a path.

Parameters
pathThe path to get the types for
Returns
An array containing the types sorted from parent to children

Definition at line 439 of file class.XMLUtil.php.

Referenced by _GetChildData(), _GetNodeData(), and _GetOID().

XMLUtil::_GetOID (   $nodePath)

Get Node OID from a path.

Parameters
nodePathThe path to the Node
Returns
OID on success, 0 on failure / error string provided by getErrorMsg()

Definition at line 450 of file class.XMLUtil.php.

References $_idName, _GetTypes(), and PersistenceFacade\composeOID().

Referenced by GetOIDs().

+ Here is the call graph for this function:

Member Data Documentation

XMLUtil::$_errorMsg = ''

Definition at line 46 of file class.XMLUtil.php.

Referenced by getErrorMsg().

XMLUtil::$_idName = 'id'

Definition at line 47 of file class.XMLUtil.php.

Referenced by _GetChildData(), _GetNodeData(), _GetOID(), and _InsertNode().


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