This document describes classes from Sioux namespace and Nemerle.Xml namespace.

Creates a cookie, a small amount of information sent by a web application to a Web browser, saved by the browser, and later sent back to the server.

Constructors:

  • public this (name : string, value : string)

    constructs a cookie with given name and value

  • public this (name : string, value : string, expires : DateTime)

    constructs a cookie with given name, value and expiration date

  • Public properties:

  • public Name : string

    get - returns the name of the cookie. The name cannot be changed after creation.

  • public Value : string

    set - assigns a new value to a cookie after the cookie is created
    get - return value of cookie

  • public Path : string

    set - setting a virtual path of cookie to which client should return cookie
    get - getting a path of cookie to which client should return cookie

  • public Domain : string

    set - specifies a path for the cookie to which the client should return the cookie
    get - returns the domain name set for this cookie

  • public Expires : DateTime

    set - sets the expiration date and time for cookie
    get - gets the expiration date and time for cookie

  • public Secure : bool

    set - sets a value indicating the browser whether the cookie should only be sent using a secure protocol, such as HTTPS or SSL.
    get - gets ----||----

  • public Header : string * string

    get - get a header pair representing cookie, where first element is header name and second is header value

  • Public methods:

  • public override ToString() : string

    Returns string representation of cookie

  • Provides a way to identify a user across more than one page request or visit to a Web site and to store information about that user.

    Public properties:

  • public SessionID : string

    get - returns a string containing the unique identifier assigned to this session.

  • public Timeout : int

    set - specifies the time, in minutes, between client requests before Sioux will invalidate this session.
    get - returns the maximum time interval, in minutes, that sioux will keep this session open between client accesses. After this interval, sioux will invalidate the session. A -1 time indicates the session should never timeout.

  • public CreationTime : DateTime

    get - returns time when session was created

  • public LastAccesedTime : string

    get - returns time when client last sent request associated with session

  • public IsNew : bool

    get - returns true when session was created with last client request

  • public IsValid : bool

    get - gets a value indicating if session is stall valid

  • public Attributes : list <string * object >

    get - returns a list of all attributes associated with session, where first element of pair is attribute name, and second is attribute

  • Public methods:

  • public Invalidate() : void

    Invalidates this session

  • public AddAttribute(name : string,attribute : object) : void

    Adds attribute to session using specified name

  • public RemoveAttribute(name : string) : void

    Removes attribute with specified name from session

  • public ContainsAttribute(name : string) : bool

    Returns true if session contains attribute with given name, else returns false

  • public GetAttribute(name : string) : option <object>

    Returns Some(attribute) if session contains attribute with specified name, else returns None

  • Class representing Nemerle web application.

    Public methods:

  • public virtual HandleRequest (request : Request , response : Response) : void

    Handles an HTTP request. Recognizes type of request. Puts get and post variables into hashtables, finally runs application (calling DoPost() or DoGet() method) and sends response.

  • public ReportInternalError <'a> (msg : string) : <'a>

    Reports internal error and dies.

  • Protected methods:

  • protected virtual DoGet()

    Called by Sioux to handle GET request.

  • protected virtual DoPost()

    Called by Sioux to handle POST request.

  • Protected fields:

  • protected mutable PageName : string

    Name of page that is requested.

  • protected mutable FormTemplate : option <XmlTemplate>

    XmlTemplate object to be sent to the response stream.

  • protected mutable GetVars : Hashtable <string , string>

    Contains all request parameters, if request type is DynamicGet.

  • protected mutable PostVars : Hashtable <string , string>

    Contains all request parameters, if request type is Post.

  • protected mutable PostedFiles : Hashtable <string , string * string * int>

    Hashtable containing informations about posted files. Key is the value of "name" attribute in the input field, and value is a tuple (filename,tempname,filesize). "filename" is original name of file, "tempname" is temporary name of file (file's name on server uploads directory) and "filesize" is the size of uploaded file.

  • protected mutable request : Request

    Request used to access this application.

  • protected mutable response : Response

    Response object, that application uses for sending response to browser.

  • Class that parses request stream and provides information about HTTP request.

    Public properties:

  • public RequestInfo : RequestInfo

    get - returns request info associated with this instance

  • public RequestUri : string

    get - returns request uri as a string

  • public Cookies : list <Cookie>

    get - returns list of cookies sent with this request

  • public Protocol : string

    get - returns request's protocol

  • Public methods:

  • public GetCookie (name : string) : option <Cookie>

    Returns Some(Cookie), if browser sent cookie with given name, else returns None.

  • public GetSession() : Session

    Return session associated with this request.

  • public GetSession(create : bool) : Session

    Return session associated with this request, if create is true creates new session.

  • public GetHeader(name : string) : option <string>

    Returns value of specified header.

  • Class representing HTTP server response.

    Public methods:

  • public Write (s : string) : void

    Writes a string to the response stream

    .
  • public WriteLine () : void

    Writes a CR/LF pair to the response stream.

  • public WriteLine (s : string) : void

    Writes a string followed by CR/LF pair to the response stream.

  • public WriteServerName () : void

    Writes server's name to the response stream.

  • public WriteRedirect (url : string) : void

    Redirects browser to given url.

  • public WriteInvalid () : void

    Writes an error message concerning an invalid request

  • public WriteNotFound () : void

    Writes an error message concerning not being found.

  • public WriteMimeType (file_name : string) : void

    Writes the MIME content type header to the response stream.

  • public WriteXml (document : XmlDocument , content_type : string , charset : string) : void

    Writes the contents of an XML document to the response stream.

  • public WriteXhtml (document : XmlDocument) : void

    Writes the contents of an XHTML document to the response stream.

  • public static CheckUrl(url : string) : string

    Checks if the url from a request is valid.

  • public static GetLocalFileName(url : string) : string

    Converts an URL from request into a local file name with the path relative to the server repository.

  • public ServeStaticFile(url : string) : void

    Serves a static file.

  • public AddHeader(name : string , value : string) : void

    Adds a response header with given name and value.

  • public AddCookie(cookie : Cookie) : void

    Adds the specified cookie to the response. This method can b called multiple times to set more than one cookie.

  • This variant describes HTTP request

    Values:

  • StaticGet {url : string;}

    This option is used when request type is static GET. It can carry only the url string used in request.

  • DynamicGet {url : string; get_params : list <string * string>;}

    This option is used when some application is opened. It contains request url and all parameters used in the request.

  • Post {url : string; post_params : list <string * string>;}

    This option is used when we send POST request to some application. It contains request url and all parameters used in the request.

  • Invalid

    This option is used when request is invalid, for example dynamic GET request to simple, static html page.

  • An XML document with easy node identification.

    Constructors:

  • public this (document : XmlDocument)

    Creates an XmlTemplate basing on an XmlDocument and fills the IDs.

  • public this (filename: string)

    Reads an XML document from a file and fills the IDs.

  • Public methods:

  • public NodeById (id : string) : XmlElement

    Returns a node given it's ID.

  • public SetText (id : string, text : string) : void

    Put specified [text] as the only content of node [id].

  • public GetDocument () : XmlDocument

    Returns the XML document associated with this object.

  • Interface to be implemented by all generators used in XmlPipeline.Process method.

    Methods:

  • Generate () : XmlTemplate

    Generates XmlTemplate.

  • Description of xml template transformer.

    Values:

  • Xsl { style : XslTransform; }

    Option used when transformer is xsl stylesheet.

  • Handler { handler : XmlTemplate -> XmlTemplate; }

    Option used when transformer is XmlTemplate -> XmlTemplate function.

  • Description of xml pipeline, used to process (generate and transform) xml files.

    Public methods:

  • public static Process(generator : IGenerator , transformers : list <XmlTransformer>) : XmlTemplate

    Method used to generate xml templates and transform it using page handlers and xsl styles

  • Class used to generate xml templates using xml files.
    Implements IGenerator.

    Constructors:

  • public this(xml_file_name : string)

    Reads an XML document from a file and creates xml template.

  • public this(doc : XmlDocument)

    Constructs xml template using xml document.

  • Public methods:

  • public Generate () : XmlTemplate

    Generates XmlTemplate.

  • Class used to generate xml templates using xml files.
    Implements IGenerator.

    Constructors:

  • public this(path : string)

    Generates xml directory listing from [path] directory.

  • Public methods:

  • public Generate () : XmlTemplate

    Generates XmlTemplate.

  • Contains transformers used in XmlPipeline process

    Public methods:

  • public EncodeUrlTransformer ( include : string, exclude : string) : XmlTransformer

    Encodes urls using [include] pattern for including attributes from encode URL rewriting and [exclude] pattern for excluding attributes from encode URL rewriting. The attribute values are encoded, if an expressions of the form element-name/attribute-name matches. The same for excluding. element-name and attribute-value can have * value.

  • public EncodeUrlTransformer () : XmlTransformer

    Encodes all href and action attributes of any element. Includes from encoding src attribute of form element. Excludes from encoding src attribute of img element.