By means of the Content Service interface available from version 6.5.0, individual CMS files or hierarchy branches can be transferred from one Fiona instance to another one. The Content Service functionality is an extension to CMS Fiona which is to be licensed separately.
This interface is based on HTTP, i.e. by means of HTTP requests using a well-formed URL you can
- query the list of the available CMS files,
- download a CMS file from a Fiona instance,
- upload a CMS file to a Fiona instance, and
- deactivate a CMS file.
Example:
https://localhost:8080/default/NPS/cs/released/index
When downloading files, only their released versions are taken into account. When uploading files, these versions are created as draft versions. If a file on the target system already has a draft version, it is updated. Released versions present on the target system are not modified.
The base URL of the interface is /instanceName/NPS/cs. The Content Service
interface can be reached via the HTTP port of the server application. The
method used for authenticating is "Basic Authentication".
An HTTP client and an instance of the Content Management Servers can
communicate with each other using the GET, POST
(or PUT), and DELETE commands.
If the action was performed successfully, the server's response contains
the status code 200 (OK), otherwise the corresponding error
code.
In the following, the four available request types are explained.
Querying the List of Available CMS Files
Request Syntax
GET /default/NPS/cs/released/index
Server Response
A UTF-8-encoded text stream containing file paths. Each line of this stream corresponds to exactly one path of a CMS file and consists of four values separated by spaces:
lastChanged: The value of thelastChangedfield of the released version (time stamp in ISO format, 14 digits) or00000000000000if the file does not have a released version.sourceLastChanged: The value of thesourceLastChangedfield of the file. The fieldsourceLastChangedis set when a file is created or updated via the Content Service (see below). This causes thelastChangedvalue of the source file to be assigned to the field.objType: The file type, i.e. one of the valuesdocument,publication,image,generic, ortemplate.path: The path of the file.
The first line contains the column names.
Example:
lastChanged sourceLastChanged objType path 20100211123055 00000000000000 publication / 20100211123055 00000000000000 publication /company 20110103130455 20091111060623 image /company/logo 20110101220723 00000000000000 document /company/information
A script could process this response line by line in order to download the CMS files from their respective paths using further requests, and store the files.
Downloading CMS Files
Request Syntax
GET /default/NPS/cs/released/file/Path_to_CMS_file
Using URLs according to this scheme returns the CMS file with the path
/Path_to_CMS_file as stream. The stream has the MIME
type application/octet-stream. If the file has no released
version, the stream only includes the relevant file information and no
content data.
Request Examples:
GET /default/NPS/cs/released/file/ returns the base folder.
GET /default/NPS/cs/released/file/index also returns the base folder
(as opposed to GET /default/NPS/cs/released/index).
GET /default/NPS/cs/released/file/Internet/company/information returns
the file information available in the path
/Internet/company.
Uploading Files
Request Syntax
PUT /default/NPS/cs/edited/file/Path_to_CMS_file
This creates the CMS file with the specified path using the stream as the data of the file to be created. If the file already exists, its file information and its draft version are updated.
Alternatively, the HTTP method POST can be used.
Deactivating CMS Files
Request Syntax
DELETE /default/NPS/cs/edited/file/Path_to_CMS_file
This deactivates the file under the specified path.