docs.roxen.comView this page in a printer friendly mode
DocsRoxenWebServer 5.4System Developer Manual JavaReference for Roxen Java classes
Copyright © 2018, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com
 DEMO  DOCS  PIKE
 COMMUNITY  DOWNLOAD
www.roxen.com

   

AbstractLocationModule
ExperimentalModule
FileExtensionModule
Frame
HTTP
LastResortModule
LocationModule
Module
ParserModule
ProviderModule
RXML
RXML.Backtrace
RoxenClassLoader
RoxenConfiguration
RoxenFileResponse
RoxenLib
RoxenRXMLResponse
RoxenRequest
RoxenResponse
RoxenStringResponse
SecurityModule
SimpleTagCaller
UniqueModule

RoxenLib

: Class RoxenLib

com.roxen.roxen
Class RoxenLib


java.lang.Object
  |
  +--com.roxen.roxen.HTTP
        |
        +--com.roxen.roxen.RoxenLib
public class RoxenLib
extends HTTP

A support class containing useful methods for interpreting requests and synthesizing responses.

Method Summary
static java.lang.String doOutputTag(java.util.Map args, java.util.Map[] varArr, java.lang.String contents, RoxenRequest id)
          Produce repeated output with variable subsitutions.
static java.lang.String htmlDecodeString(java.lang.String str)
          Decoded HTML entities.
static java.lang.String htmlEncodeString(java.lang.String str)
          Quotes characters that are unallowed in HTML text or attributes.
static java.lang.String makeContainer(java.lang.String s, java.util.Map in, java.lang.String contents)
          Creates an HTML/XML tag with content given the tag name and attributes
static java.lang.String makeEmptyElemTag(java.lang.String s, java.util.Map in)
          Creates an XML empty element tag given the tag name and attributes
static java.lang.String makeTag(java.lang.String s, java.util.Map in)
          Creates an HTML tag given the tag name and attributes
static java.lang.String makeTagAttributes(java.util.Map in)
          Formats key and value paris for use as HTML tag attributes.
static java.lang.String parseRXML(java.lang.String what, RoxenRequest id)
          Perform RXML parsing on a string
 
Methods inherited from class com.roxen.roxen.HTTP
httpAuthRequired, httpAuthRequired, httpEncodeString, httpFileAnswer, httpFileAnswer, httpFileAnswer, httpFileAnswer, httpFileAnswer, httpFileAnswer, httpFileAnswer, httpFileAnswer, httpFileAnswer, httpLowAnswer, httpLowAnswer, httpProxyAuthRequired, httpProxyAuthRequired, httpRedirect, httpRXMLAnswer, httpRXMLAnswer, httpStringAnswer, httpStringAnswer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

htmlEncodeString


public static java.lang.String htmlEncodeString(java.lang.String str)
Quotes characters that are unallowed in HTML text or attributes.

The following characters are replaced with HTML entities: &, <, >, ", ', NUL.

Parameters:
str - the string to quote
Returns:
the quoted result

htmlDecodeString


public static java.lang.String htmlDecodeString(java.lang.String str)
Decoded HTML entities.

All HTML 4.0 entities are replaced with their literal equivalent.

Parameters:
str - the string to unquote
Returns:
the unquoted result

doOutputTag


public static java.lang.String doOutputTag(java.util.Map args,
                                           java.util.Map[] varArr,
                                           java.lang.String contents,
                                           RoxenRequest id)
Produce repeated output with variable subsitutions.

This method is used to create tags such as database query tags, where zero or more results in the form of variable bindings are applied to a fixed template, and the results of the subsitutions are concatenated to form the total result.

Parameters:
args - attributes for the output tag itself
varArr - an array of variable subsitution mappings
contents - body text in which to substitute variables
id - a request object associated with the parse
Returns:
the resulting string

parseRXML


public static java.lang.String parseRXML(java.lang.String what,
                                         RoxenRequest id)
Perform RXML parsing on a string
Parameters:
what - the RXML code to parse
id - a request object associated with the parse
Returns:
the result of the parse

makeTagAttributes


public static java.lang.String makeTagAttributes(java.util.Map in)
Formats key and value paris for use as HTML tag attributes. If the set of pairs is non-empty, the result will contain an extra space at the end.
Parameters:
in - map from attribute name to attribute value
Returns:
a string suitable for inclusion in an HTML tag

makeTag


public static java.lang.String makeTag(java.lang.String s,
                                       java.util.Map in)
Creates an HTML tag given the tag name and attributes
Parameters:
s - name of tag element
in - map from attribute name to attribute value
Returns:
a string representation of the tag

makeEmptyElemTag


public static java.lang.String makeEmptyElemTag(java.lang.String s,
                                                java.util.Map in)
Creates an XML empty element tag given the tag name and attributes
Parameters:
s - name of tag element
in - map from attribute name to attribute value
Returns:
a string representation of the tag

makeContainer


public static java.lang.String makeContainer(java.lang.String s,
                                             java.util.Map in,
                                             java.lang.String contents)
Creates an HTML/XML tag with content given the tag name and attributes
Parameters:
s - name of tag element
in - map from attribute name to attribute value
contents - the text contents of the tag
Returns:
a string representation of the tag, contents, and end tag