Die folgenden Seiten geben einen Überblick über die Funktionen des API (Programmierschnittstelle) des hyper Content & Digital Asset Management Servers.
Bitte beachten Sie, dass Sie in der Regel nur wenige Funktionen für die Entwicklung von Plugins oder speziellen Template-Funktionen, wie automatische Erstellung einer Navigation, Sitemap und so weiter, benötigen. Bitte studieren Sie den Template Designers Guide und Programers Guide für eine bessere Einsicht in die Handhabung dieser Funktionen.
Das API dient primär für die Umsetzung eigenständiger Anwendungen, die die Funktionen des hyper Content & Digital Asset Management Servers nutzen. Das API ist nicht mit dem OpenAPI zu verwechseln, welchen auf einer SOA (Service Oriented Architecture) basiert und nicht Bestandteil der Free Edition ist.
Fragen und Antworten bitte innerhalb der 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
▲ Metadata API Functions
importCSVtextcontent
Description
Imports metadata from a CSV file for various assets linked by name or conatiner ID. Empty rows or rows without a delimiter will be ignored.
In order to identify an asset the file name as "Name" or the container ID as "containerID" must be provided in the first row before the content rows.
Syntax
importCSVtextcontent ($site, $location, $file_csv, $user, $type="", $delimiter=";", $enclosure='"', $charset="utf-8", $createfolders=false, $createobject=false, $template="default", $updateobject=true, $report=false, $set_headers=false)
Input parameters
- $site ... publication name [string]
- $location ... location [string]
- $file_csv ... path to CSV file [string]
- $user ... user name [string]
- $type ... type array or string [u, f, l, c, d, k] (optional)
- $delimiter ... delimiter [string] (optional)
- $enclosure ... enclosure [string] (optional)
- $charset ... character set [string] (optional)
- $createfolders ... create folders if missing [boolean] (optional)
- $createobject ... create new object if the object can not be found [bollean] (optional)
- $template ... template name without extension to be used for the new object [string] (optional)
- $updateobject ... update content of existing objects [boolean] (optional)
- $report ... print report [boolean] (optional)
- $set_headers ... set PHP ini and headers for output buffering [bollean] (optional)
global input parameters
- $mgmt_config
$eventsystem
Output
importtaxonomy
Description
Executes the import job for the taxonomy of a publication.
Syntax
importtaxonomy ($site, $recreate=false)
Input parameters
- $site ... publication name [string]
- $recreate ... recreate taxonomy relations for all objects of the publication [boolean] (optional)
global input parameters
Output
loadtaxonomy
Description
Generates an array from a taxonomy definition file located in data/include/ to be used for presentation or CSV export.
Syntax
loadtaxonomy ($site, $start=1, $perpage=100000, $count=false, $load_default=false)
Input parameters
- $site ... publication name [string]
- $start ... return rows starting with row number [integer] (optional)
- $perpage ... return number of rows [integer] (optional)
- $count ... return total number of rows [boolean] (optional)
- $load_default ... load default taxonomy [bollean] (optional)
global input parameters
Output
savetaxonomy
Description
Generates an array from a taxonomy definition file located in data/include/ to be used for presentation or CSV export.
Syntax
savetaxonomy ($site, $taxonomy, $saveindex_start, $saveindex_stop, $text_ids="*Null*")
Input parameters
- $site ... publication name [string]
- $taxonomy ... new taxonomy with row number and languages as keys [array]
- $saveindex_start ... replace rows starting with row number [integer]
- $saveindex_stop ... replace rows ending with row number [integer]
- $text_ids ... text IDs to analyze [array] (optional)
global input parameters
Output
createtaxonomy
Description
Generates an array from a taxonomy definition file (CSV) and saves the PHP file in data/include/publication-name.taxonomy.inc.php.
Recreates the taxonomy for all objects if the taxonomy defintion has been uodated.
Syntax
createtaxonomy ($site_name="", $recreate=false)
Input parameters
- $site_name ... publication name [string] (optional)
- $recreate ... recreate taxonomy file [boolean] (optional)
global input parameters
Output
deletetaxonomy
Description
Deletes the taxonomy definition file (CSV) and PHP file in data/include/publication-name.taxonomy.inc.php.
Removes the index of the taxonomy for all objects.
Syntax
deletetaxonomy ($site)
Input parameters
- $site ... publication name [string]
global input parameters
Output
splitkeywords
Description
Generates a keyword list from a text by splitting and transforming the comma separated string.
Syntax
splitkeywords ($keywords, $charset="UTF-8")
Input parameters
- $keywords ... comma seperated keywords [string]
- $charset ... character set [string] (optional)
Output
- keywords as array / false on error
copymetadata
Description
Copies all meta data from source to destination file using EXIFTOOL
Syntax
copymetadata ($file_source, $file_dest)
Input parameters
- $file_source ... path to source file [string]
- $file_dest ... path to destination file [string]
global input parameters
- $mgmt_config
$mgmt_mediametadata
$user
Output
extractmetadata
Description
Extracts all meta data from a file using EXIFTOOL
Syntax
extractmetadata ($file)
Input parameters
- $file ... path to image file [string]
global input parameters
- $user
$mgmt_config
$mgmt_mediametadata
Output
- result array / false on error
xmlobject2array
Description
Converts an xmlobject to an array, provided by xaviered at gmail dot com
Syntax
xmlobject2array ($obj, $namespace="")
Input parameters
- $obj ... XML [object]
- $namespace ... namespace [array] (optional)
Output
id3_getdata
Description
Requires getID3 library since EXIFTOOL cannot write ID3 tags so far
Syntax
id3_getdata ($file)
Input parameters
- $file ... path to audio file [string]
global input parameters
Output
- result array / false on error
id3_writefile
Description
Writes ID3 tags into audio file for supported file types and keeps the existing ID3 tags
Syntax
id3_writefile ($file, $id3, $keep_data=true, $movetempfile=true)
Input parameters
- $file ... abs. path to audio file [string]
- $id3 ... ID3 tag [array]
- $keep_data ... keep existing ID3 data of file [boolean] (optional)
- $movetempfile ... move tempoarary file from unecrypted to encrypted [boolean] (optional)
global input parameters
- $user
$mgmt_config
$mgmt_mediametadata
$hcms_ext
Output
id3_create
Description
Defines ID3 tag array based on the media mapping of a publication.
Syntax
id3_create ($site, $text)
Input parameters
- $site ... publication name [string]
- $text ... text from content container [array]
global input parameters
Output
- ID3 tag array / false on error
xmp_getdata
Syntax
xmp_getdata ($file)
Input parameters
- $file ... path to image file [string]
global input parameters
- $user
$mgmt_config
$hcms_ext
Output
- result array / false on error
xmp_writefile
Description
Writes XMP tags into image file for supported file types and keeps the existing XMP tags
Syntax
xmp_writefile ($file, $xmp, $keep_data=true, $movetempfile=true)
Input parameters
- $file ... abs. path to image file [string]
- $xmp ... XMP tag [array]
- $keep_data ... keep existing XMP data of file [boolean] (optional)
- $movetempfile ... move tempoarary file from unecrypted to encrypted [boolean] (optional)
global input parameters
- $user
$mgmt_config
$mgmt_mediametadata
$hcms_ext
Output
xmp_create
Description
Defines XMP tag array based on the media mapping of a publication
Syntax
xmp_create ($site, $text)
Input parameters
- $site ... publication name [string]
- $text ... text from content container [array]
global input parameters
Output
- XMP tag array / false on error
geo2decimal
Syntax
geo2decimal ($coordinate, $hemisphere)
Input parameters
- $coordinate ... GPS location [degrees, minutes, seconds]
- $hemisphere ... hemisphere [N, O, S, W]
Output
krita_getdata
Syntax
krita_getdata ($file)
Input parameters
- $file ... path to image file [string]
global input parameters
- $user
$mgmt_config
$mgmt_uncompress
$hcms_ext
Output
- result array / false on error
krita_create
Description
Defines XMP tag array based on the media mapping of a publication
Syntax
krita_create ($site, $text)
Input parameters
- $site ... publication name [string]
- $text ... text from content container [array]
global input parameters
Output
- KRA tag array / false on error
exif_getdata
Syntax
exif_getdata ($file)
Input parameters
- $file ... path to image file [string]
global input parameters
- $user
$mgmt_config
$hcms_ext
Output
iptc_getdata
Syntax
iptc_getdata ($file)
Input parameters
- $file ... path to image file [string]
global input parameters
- $user
$mgmt_config
$hcms_ext
Output
iptc_getcharset
Description
Copied from MediaWiki!
Warning, this function does not (and is not intended to) detect all iso 2022 escape codes.
In practise, the code for utf-8 is the only code that seems to have wide use. It does detect that code.
According to iim standard, charset is defined by the tag 1:90.
in which there are iso 2022 escape sequences to specify the character set.
the iim standard seems to encourage that all necessary escape sequences are
in the 1:90 tag, but says it doesn't have to be.
This is in need of more testing probably. This is definitely not complete.
however reading the docs of some other iptc software, it appears that most iptc software
only recognizes utf-8. If 1:90 tag is not present content is
usually ascii or iso-8859-1 (and sometimes utf-8), but no guarantee.
This also won't work if there are more than one escape sequence in the 1:90 tag
or if something is put in the G2, or G3 charsets, etc. It will only reliably recognize utf-8.
This is just going through the charsets mentioned in appendix C of the iim standard.
Syntax
iptc_getcharset ($tag)
Input parameters
- $tag ... iptc tag that holds character set information [string]
Output
- character set as string / false on error
iptc_maketag
Description
Convert the IPTC tag to binary code
Syntax
iptc_maketag ($record=2, $tag=0, $value="")
Input parameters
- $record ... type of tag (e.g. 2) [integer]
- $tag ... code of tag (e.g. 025) [string]
- $value ... value of tag [string]
Output
- binary IPTC tag / false on error
iptc_writefile
Description
Writes IPTC tags into image file for supported file types and keeps the existing IPTC tags
Syntax
iptc_writefile ($file, $iptc, $keep_data=true, $movetempfile=true)
Input parameters
- $file ... abs. path to image file [string]
- $iptc ... IPTC tag [array]
- $keep_data ... keep existing IPTC data of file [boolean] (optional)
- $movetempfile ... move tempoarary file from unecrypted to encrypted [boolean] (optional)
global input parameters
- $user
$mgmt_config
$mgmt_mediametadata
Output
iptc_create
Description
Defines IPTC tag array based on the media mapping of a publication
Syntax
iptc_create ($site, $text)
Input parameters
- $site ... publication name [string]
- $text ... text from content container [array]
global input parameters
Output
- IPTC tag array / false on error
createmapping
Description
Prepares the PHP mapping array from the provided mapping definition and saves the media mapping file
Syntax
createmapping ($site, $mapping)
Input parameters
- $site ... publication name [string]
- $mapping ... mapping definition [string]
global input parameters
Output
getmapping
Description
Load the mapping file of the provided publication.
Syntax
getmapping ($site)
Input parameters
- $site ... publication name [string]
global input parameters
Output
- mapping code for display / false
metadata_exists
Description
Verifies if the content of a specific text ID that triggers a Cloud API call exists already.
This function is used to reduce/trigger Cloud API calls in case the content exists already and the media file does not need to be analyzed by a cloud service.
Syntax
metadata_exists ($mapping, $text_array)
Input parameters
- $mapping ... mapping [array:metadata-tag-name => text-id]
- $text_array ... text content [array:metadata-text-id => content]
Output
setmetadata
Description
Saves meta data of a multimedia file using a provided mapping in the proper fields of the content container.
If no mapping is given a default mapping will be used.
Syntax
setmetadata ($site, $location="", $object="", $mediafile="", $mapping="", $containerdata="", $user="", $savecontainer=true)
Input parameters
- $site ... publication name [string]
- $location ... location path [string] (optional)
- $object ... object name [string] (optional)
- $mediafile ... media file name [string] (optional)
- $mapping ... mapping [array:metadata-tag-name => text-id] (optional)
- $containerdata ... container content as XML [string] (optional)
- $user ... user name [string]
- $savecontainer ... save content container [boolean] (optional)
global input parameters
- $eventsystem
$mgmt_config
$hcms_ext
Output
- container content as XML string / false