nu.staldal.lsp.servlet
Class ServletExtLib

java.lang.Object
  extended by nu.staldal.lsp.SimpleExtLib
      extended by nu.staldal.lsp.servlet.ServletExtLib
All Implemented Interfaces:
LSPExtLib, org.xml.sax.ContentHandler

public class ServletExtLib
extends SimpleExtLib

LSP extension library for Servlet environment. Namespace URI: "http://staldal.nu/LSP/ExtLib/Servlet"


Field Summary
 
Fields inherited from class nu.staldal.lsp.SimpleExtLib
extContext, myNamespaceURI, pageName
 
Constructor Summary
ServletExtLib()
           
 
Method Summary
 java.lang.Object _encodeURL(java.lang.Object _url)
          Extension function encodeURL(url).
 java.lang.Object _formatCustomDateTime(java.lang.Object _pattern, java.lang.Object _date)
          Extension function formatCustomDateTime(date).
 java.lang.Object _formatDate(java.lang.Object _date)
          Extension function formatDate(date).
 java.lang.Object _formatDateTime(java.lang.Object _date)
          Extension function formatDateTime(date).
 java.lang.Object _formatTime(java.lang.Object _date)
          Extension function formatTime(date).
 java.lang.Object _formatXMLDateTime(java.lang.Object _date)
          Extension function formatXMLDateTime(date).
 java.lang.Object _isUserInRole(java.lang.Object _role)
          Extension function isUserInRole(role).
 java.lang.Object _lang(java.lang.Object _key)
          Extension function lang(key).
 java.lang.String handleElement(java.lang.String localName, org.xml.sax.Attributes atts, org.xml.sax.ContentHandler out)
          Handle an extension element.
 
Methods inherited from class nu.staldal.lsp.SimpleExtLib
afterElement, beforeElement, characters, endDocument, endElement, endPage, endPrefixMapping, ignorableWhitespace, init, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPage, startPrefixMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletExtLib

public ServletExtLib()
Method Detail

handleElement

public java.lang.String handleElement(java.lang.String localName,
                                      org.xml.sax.Attributes atts,
                                      org.xml.sax.ContentHandler out)
                               throws org.xml.sax.SAXException
Description copied from class: SimpleExtLib
Handle an extension element.

Specified by:
handleElement in class SimpleExtLib
Parameters:
localName - the local name of the element
atts - the attributes of the element
out - where to write XML output
Returns:
the String to replace the extension element with, or null if out was used
Throws:
org.xml.sax.SAXException - may throw SAXException

_lang

public java.lang.Object _lang(java.lang.Object _key)
                       throws org.xml.sax.SAXException
Extension function lang(key).

Parameters:
_key - the key (String)
Returns:
[key] if not found (String)
Throws:
org.xml.sax.SAXException
See Also:
LSPServletContext.lang(String, String)

_encodeURL

public java.lang.Object _encodeURL(java.lang.Object _url)
                            throws org.xml.sax.SAXException
Extension function encodeURL(url).

Parameters:
_url - the URL to encode (String)
Returns:
the encoded URL (String)
Throws:
org.xml.sax.SAXException
See Also:
LSPServletContext.encodeURL(String)

_isUserInRole

public java.lang.Object _isUserInRole(java.lang.Object _role)
                               throws org.xml.sax.SAXException
Extension function isUserInRole(role).

Parameters:
_role - the role to check (String)
Returns:
true if user is in the given role
Throws:
org.xml.sax.SAXException
See Also:
LSPServletContext.isUserInRole(String)

_formatDate

public java.lang.Object _formatDate(java.lang.Object _date)
                             throws LSPException
Extension function formatDate(date).

Parameters:
_date - the date to format (java.util.Date)
Returns:
the date formatted as String
Throws:
LSPException

_formatTime

public java.lang.Object _formatTime(java.lang.Object _date)
                             throws LSPException
Extension function formatTime(date).

Parameters:
_date - the time to format (java.util.Date)
Returns:
the time formatted as String
Throws:
LSPException

_formatDateTime

public java.lang.Object _formatDateTime(java.lang.Object _date)
                                 throws LSPException
Extension function formatDateTime(date).

Parameters:
_date - the date/time to format (java.util.Date)
Returns:
the date/time formatted as String
Throws:
LSPException

_formatCustomDateTime

public java.lang.Object _formatCustomDateTime(java.lang.Object _pattern,
                                              java.lang.Object _date)
                                       throws LSPException
Extension function formatCustomDateTime(date).

Parameters:
_pattern - the formatting pattern
_date - the date/time to format (java.util.Date)
Returns:
the date/time formatted as String
Throws:
LSPException

_formatXMLDateTime

public java.lang.Object _formatXMLDateTime(java.lang.Object _date)
                                    throws LSPException
Extension function formatXMLDateTime(date).

Parameters:
_date - the date/time to format (java.util.Date)
Returns:
the date/time formatted as String
Throws:
LSPException