dba/databases
library moduleR
Summary
Resource handling.
- Tags
Author: Christian Grün, BaseX Team 2005-21, BSD License
__source : databases/resources/resource.xqm
Imports
This module is imported by 0 modules. It imports 0 modules.
Variables
Functions
4.1 dba:resource-redirect
Arities: dba:resource-redirect#3R
dba:resource-redirect
(
$action
as
xs:string
, $name
as
xs:string
, $resource
as
xs:string*
)
as
element(rest:response)
- action
as
xs:string
action to perform - name
as
xs:string
name of resource - resource
as
xs:string*
resource
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:
Prefix | Uri |
---|---|
dba | dba/databases 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
rest | http://exquery.org/ns/restxq |
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 })
};