Dreisam Operators

Package http

http_request properties

OPERATOR the_method(req http.http_request) RETURNS string;

Returns the name of the HTTP method with which this request was made.

OPERATOR the_session_active(req http.http_request) RETURNS boolean;

Returns TRUE if an active session is associated with the request req, FALSE otherwise.

OPERATOR the_session_id(req http.http_request) RETURNS string;

Returns the session ID of the session associated with the request req, if an active session is associated with that request. Otherwise, the return value is undefined.

OPERATOR the_session_last_access(req http.http_request) RETURNS datetime;

Returns last access time the session associated with the request req, if an active session is associated with that request. Otherwise, the return value is undefined.

http_response properties

OPERATOR the_status(resp http.http_response) RETURNS string;

Returns the response status.

OPERATOR the_headers(resp http.http_response) RETURNS ARRAY TUPLE { name string, value string };

Returns the response headers.

put_line

OPERATOR put_line(resp http.http_response, s string) UPDATES { resp };

Writes s as response data, followed by a newline.

put_err_line

OPERATOR put_err_line(resp http.http_response, s string) UPDATES { resp };

Writes s as error data, followed by a newline. This data will usually appear in the webserver error log.

put

OPERATOR put(resp http.http_response, s string) UPDATES { resp };

Writes s as response data.

put_err

OPERATOR put_err(resp http.http_response, s string) UPDATES { resp };

Writes s as error data.

send_headers

OPERATOR send_headers(resp http.http_response) UPDATES { resp };

Sends the HTTP headers.

set_status

OPERATOR set_status(resp http.http_response, status int, reason string) updates { resp };

Sets the HTTP status.

OPERATOR set_status(resp http.http_response, status int) UPDATES { resp };

Sets the HTTP status using the specified status code.

set_response_header

OPERATOR set_response_header(resp http.http_response, name string, value string) UPDATES { resp };

Sets the HTTP response header name. An existing header with that name is overwritten.

add_response_header

OPERATOR add_response_header(resp http.http_response, name string, value string) UPDATES { resp };

Adds a HTTP response header.

send_json_response

OPERATOR send_json_response(resp http.http_response, tp tup { * }) UPDATES { resp };

Converts tp to JSON and writes it as a HTTP response.

session

OPERATOR session(req http.http_request, resp http.http_response, tp tup { * }) UPDATES { req, resp };

Makes tp the data associated with the session associated with the request req. Creates a session if no such session exists.

destroy_session

OPERATOR destroy_session(req http.http_request) UPDATES { req };

Destroys the session associated with the request req, if such a session exists.

Package json

to_json

OPERATOR to_json(ANY) RETURNS string;

Converts the argument to JSON.

Package template

template_to_op

OPERATOR template_to_op (tfilename string, view_op string, ostrm io.iostream_id) UPDATES updates { ostrm };

Reads a template from file tfilename, converts it to an update operator named view_op and writes the operator definition to ostrm.

Package net

hescape

OPERATOR hescape(s string) RETURNS string;

Performs HTML escaping, converting the following characters to HTML entities: < > & " '

This operator is provided by DuroDBMS.