Changes

Jump to navigation Jump to search
30 bytes added ,  13:29, 11 July 2019
no edit summary
=Conventions=
* The module will be available if the {{Code|basex-api}} package must be included library is found in the classpath. This is always the case if you use one of the complete distributions of BaseX (zip, exe, war) of BaseX.* All functions and errors are assigned to of the <code><nowiki>http://basex.org/modules/sessions</nowiki></code> namespace, which is statically bound to the {{Code|sessions}} prefix. Prior to {{Version|9. The 2}}, the module must needed to be imported in the query prolog:
<pre class="brush:xquery">
import module namespace sessions = "http://basex.org/modules/sessions";
...
</pre>
* In this documentation, If any of the namespace functions is bound to the {{Code|sessions}} prefix.* Errors are assigned to called outside the servlet context, <code><nowiki>[[XQuery Errors#BaseX Errors|basex:http://basex.org/errors</nowiki>]]</code> namespace, which is statically bound to the {{Code|bxerr}} prefixraised.* If any of the functions a specified session id is called outside the servlet contextnot found, the error {{Error|BXSE0003|<code>[[#Errors}} |not-found]]</code> is raised.* As sessions are side-effecting operations, all functions are flagged as ''non-deterministic''. This means that the functions As a result, some query optimizations will not be reordered by the compilersuppressed.
=Functions=
==sessions:ids==
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|sessions:ids||xs:string*}}
|-
| '''Summary'''
==sessions:created==
 
{| width='100%'
|-
==sessions:accessed==
 
{| width='100%'
|-
==sessions:names==
 
{| width='100%'
|-
|-
| '''Summary'''
|Returns the names of all variables attributes bound to the session specified by {{Mono|$id}}.
|}
==sessions:get==
 
{{Mark|Updated with Version 9.3:}} Values that have no XQuery type will be returned as strings.
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|sessions:get|$id as xs:string, $key name as xs:string|xs:string?item()*}}<br/>{{Func|sessions:get|$id as xs:string, $key name as xs:string, $default as xs:stringitem()*|xs:stringitem()*}}
|-
| '''Summary'''
|Returns the value of a variable bound to an attribute with the specified {{Code|$name}} from the session with the specified by {{Mono|$id}}. If the variable does not existattribute is unknown, an empty sequence or the optionally specified default value is returned instead.|-| '''Errors'''|{{ErrorCode|BXSE0002|#Errors$default}} the value of a session variable could not will be retrievedreturned instead.
|}
==sessions:set==
 
{{Mark|Updated with Version 8.4}}: Allow sequences as session values.
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|sessions:set|$id as xs:string, $key name as xs:string, $value as item()*|empty-sequence()}}
|-
| '''Summary'''
|Binds Returns the specified key/{{Code|value pair }} to the attribute with the specified {{Code|$name}} from the session with the specified by {{Mono|$id}}.
|-
| '''Errors'''
|{{Error|BXSE0001set|#Errors}} a function item was specified as The supplied value of a session variablecannot be materialized.
|}
 
==sessions:delete==
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|sessions:delete|$id as xs:string, $key name as xs:string|empty-sequence()}}
|-
| '''Summary'''
|Deletes a variable bound to an attribute with the specified {{Code|$name}} from the session with the specified by {{Mono|$id}}.
|}
==sessions:close==
 
{| width='100%'
|-
|Description
|-
|{{Code|BXSE0001set}}|A function item was specified as The supplied value of a session attributecannot be materialized.
|-
|{{Code|BXSE0002}}|An error occurred while retrieving the value of a session attribute.|not-|{{Code|BXSE0003}}|A function was called outside the servlet context.|-|{{Code|BXSE0004found}}
|The specified session was not found.
|}
=Changelog=
 
;Version 9.3
 
* Updated: [[#sessions:get|sessions:get]]: Values that have no XQuery type will be returned as strings.
 
;Version 9.0
 
* Updated: error codes updated; errors now use the module namespace
;Version 8.4
 
* Updated: Allow sequences as session values.
This module was introduced with Version 7.5.
 
[[Category:XQuery]]
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu