dba/files  library module
R

Summary

Stop jobs.
Tags

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

__source : files/file-stop.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 1 modules.

(None)
imports
this
imports

Variables

3.1 $dba:CAT

Summary
Top category
Type
xs:string

Functions

4.1 dba:file-stop

Arities: dba:file-stop#1R

Summary
Stops jobs.
Signature
dba:file-stop ( $id as xs:string )  as element(rest:response)
Parameters
  • id as xs:strings session ids
Return
  • element(rest:response)redirection
Invokes 3 functions from 3 modules
  • util:info#3
  • {http://basex.org/modules/jobs}stop#1
  • {http://basex.org/modules/web}redirect#2
Invoked by 0 functions from 0 modules
    Annotations
    %rest:GET()
    %rest:path('/dba/file-stop')
    %rest:query-param('id','{$id}')
    Source ( 11 lines)
    function dba:file-stop(
      $id  as xs:string
    ) as element(rest:response) {
      let $params := try {
        jobs:stop($id),
        map { 'info': util:info($id, 'job', 'stopped') }
      } catch * {
        map { 'error': $err:description }
      }
      return web:redirect($dba:CAT, $params)
    }

    Namespaces

    The following namespaces are defined:

    PrefixUri
    dbadba/files 2 3 4 5 6 7 8
    resthttp://exquery.org/ns/restxq
    utildba/util

    6 RestXQ

    Paths defined 1.

    PathMethodFunction
    /dba/file-stopGETdba:file-stop#1

    Source Code

    (:~
     : Stop jobs.
     :
     : @author Christian Grün, BaseX Team 2005-21, BSD License
     :)
    module namespace dba = 'dba/files';
    
    import module namespace util = 'dba/util' at '../lib/util.xqm';
    
    (:~ Top category :)
    declare variable $dba:CAT := 'files';
    
    (:~
     : Stops jobs.
     : @param  $ids  session ids
     : @return redirection
     :)
    declare
      %rest:GET
      %rest:path('/dba/file-stop')
      %rest:query-param('id',  '{$id}')
    function dba:file-stop(
      $id  as xs:string
    ) as element(rest:response) {
      let $params := try {
        jobs:stop($id),
        map { 'info': util:info($id, 'job', 'stopped') }
      } catch * {
        map { 'error': $err:description }
      }
      return web:redirect($dba:CAT, $params)
    };