dba/databases  library module
R

Summary

Resource handling.
Tags

Author: Christian Grün, BaseX Team 2005-21, BSD License

__source : databases/resources/resource.xqm

Related documents
ViewDescriptionFormat
xqdocxqDoc xml file from the source modulexml
xqparsexqparse xml file from the source modulexml

Imports

This module is imported by 0 modules. It imports 0 modules.

Variables

3.1 $dba:CAT

Summary
Top category
Type
xs:string

3.2 $dba:SUB

Summary
Sub category
Type
xs:string

Functions

4.1 dba:resource-redirect

Arities: dba:resource-redirect#3R

Summary
Redirects to the specified action.
Signature
dba:resource-redirect ( $action as xs:string, $name as xs:string, $resource as xs:string* )  as element(rest:response)
Parameters
  • action as xs:string action to perform
  • name as xs:string name of resource
  • resource as xs:string* resource
Return
  • element(rest:response)redirection
Invokes 1 functions from 1 modules
  • {http://basex.org/modules/web}redirect#2
Invoked by 0 functions from 0 modules
    Annotations
    %rest:POST()
    %rest:path('/dba/resource')
    %rest:form-param('action','{$action}')
    %rest:form-param('name','{$name}')
    %rest:form-param('resource','{$resource}')
    Source ( 7 lines)
    function dba:resource-redirect(
      $action    as xs:string,
      $name      as xs:string,
      $resource  as xs:string*
    ) as element(rest:response) {
      web:redirect($action, map { 'name': $name, 'resource': $resource })
    }

    Namespaces

    The following namespaces are defined:

    PrefixUri
    dbadba/databases 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
    resthttp://exquery.org/ns/restxq

    6 RestXQ

    Paths defined 1.

    PathMethodFunction
    /dba/resourcePOSTdba:resource-redirect#3

    Source Code

    (:~
     : Resource handling.
     :
     : @author Christian Grün, BaseX Team 2005-21, BSD License
     :)
    module namespace dba = 'dba/databases';
    
    (:~ Top category :)
    declare variable $dba:CAT := 'databases';
    (:~ Sub category :)
    declare variable $dba:SUB := 'database';
    
    (:~
     : Redirects to the specified action.
     : @param  $action    action to perform
     : @param  $name      name of resource
     : @param  $resource  resource
     : @return redirection
     :)
    declare
      %rest:POST
      %rest:path('/dba/resource')
      %rest:form-param('action',   '{$action}')
      %rest:form-param('name',     '{$name}')
      %rest:form-param('resource', '{$resource}')
    function dba:resource-redirect(
      $action    as xs:string,
      $name      as xs:string,
      $resource  as xs:string*
    ) as element(rest:response) {
      web:redirect($action, map { 'name': $name, 'resource': $resource })
    };