Last modified 2 years ago
Virtual Documents RESTful methods (/restful/vd/...)
Adding a VD file system entity
Method
- URL: /vd/content/<path>
- Method: PUT
- Query parameters:
- skpath: Path of a VD Spec
- parname: optional parameter name to be associated with a VD
- parvalue: optional list of values for the parname parameter
- Returns: text/xml
- Description: Creates a VD FS entity under path <path> associated with a VD Spec under path skpath. Optionally, only one parameter can be added upon creation. To add other parameters, use special RESTful methods (see below). Returns XML with success, or throws an exception if something went wrong, e.g. if VD Spec does not exist under the provided path.
Example
- URL: http://localhost:8080/TNTBase/restful/vd/content/docs/vd.xml?skpath=/vdspecs/vdspec1.xml&parname=file&parvalue=/docs/doc1.xml&parvalue=/docs/doc2.xml
- Method: PUT
- Description: Creates a VD under path /docs/vd.xml and associates it with a VD Spec /vdspecs/vdspec1.xml. Additionally parameter file is set, with values (/docs/doc1.xml, /docs/doc2.xml)
Deleting a VD file system entity
Method
- URL: /vd/content/<path>
- Method: DELETE
- Returns: text/xml
- Description: Deletes a VD FS entity under path <path>. Returns XML with success code, or throws an exception if something went wrong.
Example
- URL: http://localhost:8080/TNTBase/restful/vd/content/docs/vd.xml
- Method: DELETE
- Description: Deletes a VD under path /docs/vd.xml.
Getting VD content
Method
- URL: /vd/content/<path>
- Method: GET
- Query parameters:
- matpath: Where to materialize a VD
- Returns: text/xml
- Description: Returns VD content and, optionally, materializes it (if matpath parameter is provided). If matpath is already exists, then a new version of document is committed to a repository. If matpath does not exists, then the whole folder structure is created and committed to a repository.
Example
- URL: http://localhost:8080/TNTBase/restful/vd/content/docs/vd.xml?matpath=/materialized/mat-vd.xml
- Method: GET
- Description: Returns the content of a VD under path '/docs/vd.xml' and materializes it into /materialized/mat-vd.xml document
Adding/replacing a VD parameter
Method
- URL: /vd/params/<path>
- Method: POST
- Query parameters:
- parname: parameter name to be associated with a VD
- parvalue: list of values for the parname parameter
- Returns: text/xml
- Description: Add/replaces the parname parameter. Values are obtained from parvalue parameter.
Example
- URL: http://localhost:8080/TNTBase/restful/vd/params/docs/vd.xml?parname=file&parvalue=/docs/doc1.xml&parvalue=/docs/doc2.xml
- Method: POST
- Description: Adds a parameter 'file' with values (/docs/doc1.xml, /docs/doc2.xml) to a VD under path /docs/vd.xml. A parameter is replaced if it already existed
Deleting a VD parameter
Method
- URL: /vd/params/<path>
- Method: DELETE
- Query parameters:
- parname: parameter name to be deleted from a VD
- Returns: text/xml
- Description: Deletes the parname parameter from a VD under path <path>.
Example
- URL: http://localhost:8080/TNTBase/restful/vd/params/docs/vd.xml?parname=file
- Method: DELETE
- Description: Deletes a parameter 'file' from a VD under path /docs/vd.xml. Nothing is done if parameter did not exist.
Submitting an edited VD
Method
- URL: /vd/submit/<path>
- Method: POST
- Query parameters:
- logmsg: xSVN log message if commit is successful
- Body: edited VD content
- Returns: text/xml
- Description: Submits a VD under path <path> for editing. Content of an edited VD is taken from a request body.
Example
- URL: http://localhost:8080/TNTBase/restful/vd/submit/docs/vd.xml?logmsg="First editing"
- Method: POST
- Body: <authors>.... </authors>
- Description: Tries to propagate edited parts to original files. Commits changes in case of success.
