The following pages provide an overview about all functions of the API (Application Programming Interface) of the hyper Content & Digital Asset Management Server.
Please note, that you might usually only require few functions for the development of Plugins, template functions like navigation, sitemap and so on. Please read the Template Designers Guide and Programers Guide for a better insight.
The API is primarily used for the implementation of standalone applications that leverage the capabilities of the hyper Content & Digital Asset Management Server. The API is not to be confused with the OpenAPI, which is based on a SOA (Service Oriented Architecture), and is not part of the Free Edition.
For Questions & Answers please visit the Google Group.
hyperCMS API Function Reference
- Main API Functions
- Get API Functions
- Set API Functions
- Connect API Functions
- Security API Functions
- Media API Functions
- Metadata API Functions
- Link API Functions
- Plugin API Functions
- User Interface API Functions
- Template Engine API Functions
- XML API Functions
- Report API Functions
- Project API Functions
- Task API Functions
- Workflow API Functions
- Cloud Storage API Functions
- Import/Export API Functions
▲ XML API Functions
valid_tagname
Description
Verifies a tag name
Syntax
valid_tagname ($tagname)
Input parameters
- $tagname ... tag name [string]
Output
escape_xmltags
Description
Escapes all XML tags used in containers, templates, user, and usergroup since they could be used in the unescaped CDATA sections.
Syntax
escape_xmltags ($xmldata, $schema="container")
Input parameters
- $xmldata ... XML content [string]
- $schema ... XML schema [container, template, user, usergroup] (optional)
Output
- escaped hyperCMS tags in XML content [string] / false on error
setxmlparameter
Description
Set parameter values in XML declaration (e.g. encoding): encoding="UTF-8"
Syntax
setxmlparameter ($xmldata, $parameter, $value)
Input parameters
- $xmldata ... XML content container [string]
- $parameter ... paramater name [string]
- $value ... paramater value [string]
Output
- XML content container / false on error
getcontent
Description
<tagname>content</tagname>
Extracts the content between the given $starttagname xml-tags.
Only this function will decode special characters (&, <, >) in the content and removes CDATA.
Function getcontent will only decode values if they are non-xml and non_html. so content inside child nodes including tags won't be decoded.
Wild card character "*" can be used at the end of $starttagname.
Syntax
getcontent ($xmldata, $starttagname, $unescape_content=false)
Input parameters
- $xmldata ... XML content container [string]
- $starttagname ... tag name [string]
- $unescape_content ... unescape content [boolean] (optional)
Output
- result array with the content of the requested XML node (tag) / false on error
geticontent
Description
CASE-Insensitive version (XML parser are however always case-sensitive!)
<tagname>content</tagname>
Extracts the content between the given $starttagname xml-tags.
Only this function will decode special characters (&, <, >) in the content and removes CDATA.
getcontent will only decode values if they are non-xml and non_html. so content inside child nodes including tags won't be decoded.
Wild card character "*" can be used at the end of $starttagname
Syntax
geticontent ($xmldata, $starttagname, $unescape_content=false)
Input parameters
- $xmldata ... XML content container [string]
- $starttagname ... tag name [string]
- $unescape_content ... unescape content [boolean] (optional)
Output
- result array with the content of the requested XML node (tag) / false on error
getxmlcontent
Description
<tagname>content</tagname>
Extracts the content together with the $starttagname xml tags.
This function will NOT decode special characters like function getcontent!
Wild card character "*" can be used at the end of $starttagname.
Syntax
getxmlcontent ($xmldata, $starttagname)
Input parameters
- $xmldata ... XML content container [string]
- $starttagname ... tag name [string]
Output
- result array with the content of the requested XML node (tag) / false on error
getxmlicontent
Description
CASE-Insensitive version (XML parser are always case-sensitive!)
<tagname>content</tagname>
Extracts the content together with the $starttagname xml tags.
This function will NOT decode special characters like function getcontent!
Wild card character "*" can be used at the end of $starttagname.
Syntax
getxmlicontent ($xmldata, $starttagname)
Input parameters
- $xmldata ... XML content container [string]
- $starttagname ... tag name [string]
Output
- result array with the content of the requested XML node (tag) / false on error
selectcontent
Description
<tagname>
.......
<condtag>condvalue</condtag>
.........
</tagname>
Extracts the content between the given $starttagname xml tags where the child xml tag $startcondtag value is equal with the target value $condvalue.
Wild card character "*" can be used at the end of $starttagname.
Wild card character "*" can be used at begin and end of $condvalue.
Be Aware: $startcondtag must be a child of $starttagname!
Syntax
selectcontent ($xmldata, $starttagname, $startcondtag, $condvalue)
Input parameters
- $xmldata ... XML content container [string]
- $starttagname ... tag name of requested XML node [string]
- $startcondtag ... tag holding the conditional value inside the given starttagname [string]
- $condvalue ... conditional value [string]
Output
- result array with the content of the requested XML node (tag) / false on error
selecticontent
Description
CASE-Insensitive version (XML parser are always case-sensitive!)
<tagname>
.......
<condtag>condvalue</condtag>
.........
</tagname>
Extracts the content between the given $starttagname xml tags where the child xml tag $startcondtag value is equal with the target value $condvalue.
Wild card character "*" can be used at the end of $starttagname.
Wild card character "*" can be used at begin and end of $condvalue.
Be Aware: $startcondtag must be a child of $starttagname!
Syntax
selecticontent ($xmldata, $starttagname, $startcondtag, $condvalue)
Input parameters
- $xmldata ... XML content container [string]
- $starttagname ... tag name of requested XML node [string]
- $startcondtag ... tag holding the conditional value inside the given starttagname [string]
- $condvalue
Output
- result array with the content of the requested XML node (tag) / false on error
selectxmlcontent
Description
<tagname>
.......
<condtag>condvalue</condtag>
.......
</tagname>
Extracts the content between the given $starttagname xml tags where the child xml tag $startcondtag value is equal with the target value $condvalue
Wild card character "*" can be used at begin and end of $condvalue.
Be Aware: $startcondtag must be a child of $starttagname!
Syntax
selectxmlcontent ($xmldata, $starttagname, $startcondtag, $condvalue)
Input parameters
- $xmldata ... XML content container [string]
- $starttagname ... tag name of requested XML node [string]
- $startcondtag ... tag holding the conditional value inside the given starttagname
- $condvalue
Output
- result array with the content of the requested XML node (tag) / false on error
selectxmlicontent
Description
CASE-Insensitive version (XML parser are always case-sensitive!)
<tagname>
.......
<condtag>condvalue</condtag>
.......
</tagname>
Extracts the content between the given $starttagname xml tags where the child xml tag $startcondtag value is equal with the target value $condvalue.
Wild card character "*" can be used at begin and end of $condvalue.
Be Aware: $startcondtag must be a child of $starttagname!
Syntax
selectxmlicontent ($xmldata, $starttagname, $startcondtag, $condvalue)
Input parameters
- $xmldata ... XML content container [string]
- $starttagname ... tag name of requested XML node [string]
- $startcondtag ... tag holding the conditional value inside the given starttagname [string]
- $condvalue ... conditional value [string]
Output
- result array with the content of the requested XML node (tag) / false on error
deletecontent
Description
<tagname>
<condtag>condvalue</condtag>
</tagname>
Deletes the whole xml content including <tagname>.
Wild card character "*" can be used at begin and end of $condvalue.
Syntax
deletecontent ($xmldata, $starttagname, $startcondtag="", $condvalue="")
Input parameters
- $xmldata ... XML content container [string]
- $starttagname ... tag name of requested XML node [string]
- $startcondtag ... tag holding the conditional value inside the given starttagname [string] (optional)
- $condvalue ... conditional value [string] (optional)
Output
- XML content container / false on error
deleteicontent
Description
CASE-Insensitive version (XML parser are always case-sensitive!)
<tagname>
<condtag>condvalue</condtag>
</tagname>
Deletes the whole xml content including <tagname>.
Wild card character "*" can be used at begin and end of $condvalue.
Syntax
deleteicontent ($xmldata, $starttagname, $startcondtag="", $condvalue="")
Input parameters
- $xmldata ... XML content container [string]
- $starttagname ... tag name of requested XML node [string]
- $startcondtag ... tag holding the conditional value inside the given starttagname [string] (optional)
- $condvalue ... conditional value [string] (optional)
Output
- XML content container / false on error
setcontent
Description
<parenttagname>
<condtag>condvalue</condtag>
<tagname>contentnew</tagname>
</parenttagname>
$xmldata = data string to be parsed
$startparenttagname = name of the tag that is a parent node of starttagname (necessary if condition has been set!)
$starttagname = name of the tag (child node)
$contentnew = the content that will be inserted between the child tags $starttagname
$startcondtag = child xml tag where condition will be set
$condvalue = value of the condition
Wild card character "*" can be used at begin and end of $condvalue.
Syntax
setcontent ($xmldata, $startparenttagname="", $starttagname="", $contentnew="", $startcondtag="", $condvalue="", $escape_content=false)
Input parameters
- $xmldata ... XML content container [string]
- $startparenttagname ... parent tag name [string]
- $starttagname ... tag name of XML node for the new content [string]
- $contentnew ... new XML node to be inserted
- $startcondtag ... tag holding the conditional value inside the given starttagname [string]
- $condvalue ... conditional value [string]
- $escape_content ... escape content [boolean] (optional)
Output
- XML content container / false on error
seticontent
Description
CASE-Insensitive version (XML parser are always case-sensitive!)
<parenttagname>
<condtag>condvalue</condtag>
<tagname>contentnew</tagname>
</parenttagname>
$xmldata = data string to be parsed
$startparenttagname = name of the tag that is the parent node of starttagname (necessary if condition has been set!)
$starttagname = name of the tag (child node)
$contentnew = the content that will be inserted between the child tags $starttagname
$startcondtag = child xml tag where condition will be set
$condvalue = value of the condition
Wild card character "*" can be used at begin and end of $condvalue.
Syntax
seticontent ($xmldata, $startparenttagname="", $starttagname="", $contentnew="", $startcondtag="", $condvalue="", $escape_content=false)
Input parameters
- $xmldata ... XML content container [string]
- $startparenttagname ... parent tag name [string]
- $starttagname ... tag name of XML node for the new content [string]
- $contentnew ... new XML node to be inserted [string]
- $startcondtag ... tag holding the conditional value inside the given starttagname [string]
- $condvalue ... conditional value [string]
- $escape_content ... escape content [boolean] (optional)
Output
- XML content container / false on error
setcontent_fast
Description
function designed for link management, extremely fast but with limitations (only CASE-Sensitive!)
<parenttagname>
<condtag>condvalue</condtag>
<tagname>contentnew</tagname>
</parenttagname>
$xmldata = data string to be parsed
$startparenttagname = name of the tag that is the parent node of starttagname (necessary if condition has been set!)
$starttagname = name of the tag (child node)
$contentnew = the content that will be inserted between the child tags $starttagname
$startcondtag = child xml tag where condition will be set
$condvalue = value of the condition
Wild card character "*" can be used at begin and end of $condvalue.
Syntax
setcontent_fast ($xmldata, $startparenttagname="", $starttagname="", $contentnew="", $startcondtag="", $condvalue="", $escape_content=false)
Input parameters
- $xmldata ... XML content container [string]
- $startparenttagname ... parent tag name [string]
- $starttagname ... tag name of XML node for the new content [string]
- $contentnew ... new XML node to be inserted
- $startcondtag ... tag holding the conditional value inside the given starttagname [string]
- $condvalue ... conditional value [string]
- $escape_content ... escape content [boolean] (optional)
Output
- XML content container / false on error
updatecontent
Description
Updates a given xml string $xmlnode in $xmldata with the content $xmlnodenew.
This method provides a faster way to update xml nodes when the node was selected before.
Syntax
updatecontent ($xmldata, $xmlnode, $xmlnodenew)
Input parameters
- $xmldata ... XML content container [string]
- $xmlnode ... XML node to be replaced [string]
- $xmlnodenew ... new XML node [string]
Output
- XML content container / false on error
insertcontent
Description
.....................
.......................
<tagname> <- list start
......................
......................
insertxmldata <- insertxmldata
</tagname> <- list end
.....................
Inserts $insertxmldata string at the end of all child between the parent $tagname .
Syntax
insertcontent ($xmldata, $insertxmldata, $starttagname)
Input parameters
- $xmldata ... XML content container [string]
- $insertxmldata ... XML node to be inserted in starttagname [string]
- $starttagname ... tag name of the parent XML node [string]
Output
- XML content container / false on error
inserticontent
Description
CASE-Insensitive version (XML parser are always case-sensitive!)
.....................
.......................
<tagname> <- list start
......................
......................
insertxmldata <- insertxmldata
</tagname> <- list end
.....................
Inserts $insertxmldata string at the end of all child between the parent $tagname.
Syntax
inserticontent ($xmldata, $insertxmldata, $starttagname)
Input parameters
- $xmldata ... XML content container [string]
- $insertxmldata ... XML node to be inserted in starttagname [string]
- $starttagname ... tag name of the parent XML node [string]
Output
- XML content container / false on error
addcontent
Description
<grandtagname>
<condtag>condvalue</condtag>
<parenttagname> <- list start
......................
......................
...................... }
<tagname>contentnew</tagname> } <- sub_xmldata
...................... }
</parenttagname> <- list end
</grandtagname>
$xmldata = data string to be parsed
$sub_xmldata = xml node to be inserted
$startgrandtagname (optional) = name of the grand xml tag of parent xml tag where (article)
$startcondtag (optional) = xml tag inside the parent xml tags where condition will be set
$condvalue (optional) = value of the condition
$startparenttagname (optional) = name of the parent xml tag where the xml subschema should be added (list)
$starttagname (optional) = name of the tag (child)
$contentnew (optional) = the content that will be inserted between the child tags
Syntax
addcontent ($xmldata, $sub_xmldata, $startgrandtagname, $startcondtag, $condvalue, $startparenttagname, $starttagname, $contentnew)
Input parameters
- $xmldata ... XML content container [string]
- $sub_xmldata ... xml node to be inserted [string]
- $startgrandtagname ... grandparent tag name [string]
- $startcondtag ... tag holding the conditional value inside the given starttagname [string]
- $condvalue ... conditional value [string]
- $startparenttagname ... parent tag name [string]
- $starttagname ... tag name of XML node for the new content [string]
- $contentnew ... new XML node to be inserted [string]
Output
- XML content container / false on error
addicontent
Description
CASE-Insensitive version (XML parser are always case-sensitive!)
<grandtagname>
<condtag>condvalue</condtag>
<parenttagname> <- list start
......................
......................
...................... }
<tagname>contentnew</tagname> } <- sub_xmldata
...................... }
</parenttagname> <- list end
</grandtagname>
$xmldata = data string to be parsed
$sub_xmldata = xml subschema to be inserted
$startgrandtagname (optional) = name of the grand xml tag of parent xml tag where (article)
$startcondtag (optional) = xml tag inside the parent xml tags where condition will be set
$condvalue (optional) = value of the condition
$startparenttagname (optional) = name of the parent xml tag where the xml subschema should be added (list)
$starttagname (optional) = name of the tag (child)
$contentnew (optional) = the content that will be inserted between the child tags
Syntax
addicontent ($xmldata, $sub_xmldata, $startgrandtagname, $startcondtag, $condvalue, $startparenttagname, $starttagname, $contentnew)
Input parameters
- $xmldata ... XML content container [string]
- $sub_xmldata ... xml node to be inserted [string]
- $startgrandtagname ... grandparent tag name [string]
- $startcondtag ... tag holding the conditional value inside the given starttagname [string]
- $condvalue ... conditional value [string]
- $startparenttagname ... parent tag name [string]
- $starttagname ... tag name of XML node for the new content [string]
- $contentnew ... new XML node to be inserted [string]
Output
- XML content container / false on error