wiki:VFResource

Working with Virtual Files (VFs)

Method

  • URL: /vfile/{path}
    • Method: PUT
    • Accepts: the XQuery query in the body of a request. This XQuery will stands for a basis of a VF. A VF contains the results of a provided XQuery.
    • Query parameters:
      • rev - revision which a virtual file will be associated to
      • description - a description of a VF. This will simplify the process of understanding what a VF does
      • mime-type (for now text/xml(default) or text/html) - mime-type of a VF. This should influence the presentation of a VF to a user
      • ns - a list of namespaces with prefixes that we want to use when querying. The format is the following: prefix:namespace. Note than prefixes can not be repeated
      • omdocNs (true or false): whether we want to bind OMDoc namespace to the empty prefix (default: true)
      • cache - whether we want results of a VF to be cached (default false)
    • Returns: text/xml
    • Description: add a VF to the TNTBase file system and returns the results of a newly created VF with metadata (like a description or a revision) to a user.

Example

Coming soon...

Method

  • URL: /vfile/{path}
    • Method: GET
    • Query parameters:
      • cache - whether we want to retrieve the content of VF from a cache (if such is existing)
    • Returns: text/xml
    • Description: Returns a VF content

Example

Coming soon...

Method

  • URL: /vfile/{path}
    • Method: DELETE
    • Returns: text/xml
    • Description: Deletes a specified in a path VF and returns an XML execution code: if VF was deleted then with code 9, if a VF did not exist before then with code 10.

Example

Coming soon...

Method

  • URL: /vfileHelper/names
    • Method: GET
    • Query parameters:
      • rev - revision which VFs operate on. If no revision provided then all revisions are taken into account.
    • Returns: text/xml
    • Description: Returns names and paths of VFs according to the rev parameter. XML result set is the output of this method.

Example

Coming soon...

Method

  • URL: /vfileHelper/names/{path}
    • Method: GET
    • Returns: text/xml
    • Description: Returns names and paths of VFs according to the path provided in the request. All revisions are taken into account here.

Example

Coming soon...

Method

  • URL: /vfileHelper/descriptions/{path}
    • Method: GET
    • Returns: text/xml
    • Description: Returns names and paths of VFs together with their descriptions according to the path provided in the request. All revisions are taken into account here. This method can help users which VFs do what. The path of VFs is returned as an attribute of a result in the results set.

Example

Coming soon...

Method

  • URL: /vfileHelper/revisions/{path}
    • Method: GET
    • Returns: text/xml
    • Description: Returns names and paths of VFs together with their revisions according to the path provided in the request. The path of VFs is returned as an attribute of a result in the results set.

Example

Coming soon...

Method

  • URL: /vfileHelper/cache/{path}
    • Method: GET
    • Returns: text/xml
    • Description: Caches the content of a VF which will be taken into account when one queries VFs. In a case of success an XML execution code 11 is returned.

Example

Coming soon...

Method

  • URL: /vfileHelper/query/{query}
    • Method: GET
    • Query parameters:
      • omdocNs (true or false): whether we want to bind OMDoc namespace to the empty prefix (default: true)
      • ns - a list of namespaces with prefixes that we want to use when querying. The format is the following: prefix:namespace. Note than prefixes can not be repeated
    • Returns: text/xml
    • Description: Queries VFs which content was cached. The XML result set is returned. In a query one should use the ususal TNTBase query syntax, but in this case XQuery will be applied only to VFs with cached content. Note that not all XQueries can be encoded to the url. If not, use the POST analogue of this method.

Example

Coming soon...

Method

  • URL: /vfileHelper/query
    • Method: POST
    • Accepts XQuery in a request body
    • Query parameters:
      • omdocNs (true or false): whether we want to bind OMDoc namespace to the empty prefix (default: true)
      • ns - a list of namespaces with prefixes that we want to use when querying. The format is the following: prefix:namespace. Note than prefixes can not be repeated
    • Returns: text/xml
    • Description: Queries VFs which content was cached. The XML result set is returned. In a query one should use the ususal TNTBase query syntax, but in this case XQuery will be applied only to VFs with cached content.

Example

Coming soon...