org.xmlecho.palomar.core
Class ECHORequestServerSide

java.lang.Object
  extended byorg.xmlecho.palomar.dom.NodeBase
      extended byorg.xmlecho.palomar.dom.ParentNode
          extended byorg.xmlecho.palomar.dom.NamespacedNode
              extended byorg.xmlecho.palomar.dom.ElementNode
                  extended byorg.xmlecho.palomar.core.DOMElementImpl
                      extended byorg.xmlecho.palomar.core.ECHORequestImpl
                          extended byorg.xmlecho.palomar.core.ECHORequestServerSide
All Implemented Interfaces:
ECHORequest, org.w3c.dom.Element, org.xmlecho.palomar.dom.ElementEx, org.w3c.dom.Node, org.xmlecho.palomar.dom.NodeEx, org.w3c.dom.NodeList, org.xmlecho.palomar.dom.XmlWritable
Direct Known Subclasses:
ByIDFetchImpl, ChooseImpl, ContinueImpl, CopyBytes, CountRowsImpl, CrawlerImpl, CreateDirectoryImpl, DateImpl, DeleteXStoreItemImpl, ECHOChoose, EvalImpl, FileGetBytes, FileGetImpl, FilePutImpl, GroupImpl, GZipImpl, InlineDocImpl, IntersectImpl, ItemEval, ItemGetBytesImpl, ItemInsertImpl, ItemXSLT, JSEncodeImpl, ListDirectoryImpl, LoginImpl, MapImpl, MergeJoinImpl, NoEvalImpl, NullTransformImpl, OtherwiseImpl, PaginationImpl, ParamRefImpl, ParseStringImpl, RequestRootImpl, SendMailImpl, SortImpl, StandardXMLIn, TimeImpl, ToStringImpl, TransformXSLTImpl, UnionImpl, URIFetchImpl, URIGet, URIPost, UseCacheImpl, WhenImpl, WrapImpl, WriteBytesImpl, XPATHExpr, XpathValue, ZipImpl

public class ECHORequestServerSide
extends ECHORequestImpl

Base class for server-side implementation of ECHO request objects.


Field Summary
protected static org.apache.log4j.Logger _logger
           
protected static SecurityService _sec
           
static boolean DEBUG
           
 
Fields inherited from class org.xmlecho.palomar.dom.ElementNode
_namespaceURI, name
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
ECHORequestServerSide()
           
 
Method Summary
protected static void addAttribute(org.xml.sax.helpers.AttributesImpl atts, java.lang.String attname, java.lang.String attvalue)
          writes a cdata attribute with no namespace
protected  void endElement(java.lang.String tagname, org.xml.sax.ContentHandler dest)
           
protected  void errorResponse(java.lang.Throwable ex, org.xml.sax.ContentHandler responseTarget, ECHOContext context)
           
 void eval(org.xml.sax.ContentHandler responseTarget, ECHOContext context)
          Evaluate the request under the given context, sending the results to the responseTarget ContentHandler.
 void evalBody(org.xml.sax.ContentHandler responseTarget, ECHOContext context, java.lang.String nsURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          Copy the element, and the results of its contents to the output.
protected  void evalCopy(org.xml.sax.ContentHandler responseTarget, ECHOContext context)
          copy the element, and contents to the result
 ECHOContext extendContext(ECHOContext parentContext)
          adds a new context frame, attaching any locally bound parameters
protected  RepositoryItem getItem(ECHOContext context)
          get the repository item from parameters in the context
protected  java.lang.String getNamespacePrefix()
           
protected static SecurityService getSecurityService()
          convenience method obtains SecurityService singleton
 ECHORequest getSubRequest(int position)
          returns a child request which is not a "context, paramSet, documentation or meta" element
protected  User getUser(ECHOContext context)
           
protected static void log(java.lang.Exception ex)
           
protected  void startElement(java.lang.String tagname, org.xml.sax.Attributes atts, org.xml.sax.ContentHandler dest)
           
protected  void startElement(java.lang.String tagname, org.xml.sax.ContentHandler dest)
           
protected  void writeException(java.lang.Throwable ex, org.xml.sax.ContentHandler target)
           
protected  void writeException(java.lang.Throwable ex, org.xml.sax.ContentHandler target, ECHOContext context)
           
 
Methods inherited from class org.xmlecho.palomar.core.ECHORequestImpl
eval, getURI
 
Methods inherited from class org.xmlecho.palomar.dom.ElementNode
appendChild, cloneNode, getAppSelectVal, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getChildNodes, getElementsByTagName, getElementsByTagNameNS, getFirstChild, getIdAttributeName, getIndexOf, getInheritedAttribute, getLanguage, getLastChild, getLength, getLocalName, getLocation, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTagName, getUserObject, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isReadonly, isSupported, item, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeWhiteSpaces, replaceChild, setAppSelectVal, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttributeName, setLocation, setNamespaceURI, setNodeValue, setPrefix, setReadonly, setTag, setUserObject, supports, toString, trimToSize, write, writeChildrenXml, writeXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 
Methods inherited from interface org.xmlecho.palomar.dom.NodeEx
getAppSelectVal, getIndexOf, getInheritedAttribute, getLanguage, isReadonly, setAppSelectVal
 
Methods inherited from interface org.xmlecho.palomar.dom.XmlWritable
writeChildrenXml
 

Field Detail

_sec

protected static SecurityService _sec

_logger

protected static org.apache.log4j.Logger _logger

DEBUG

public static boolean DEBUG
Constructor Detail

ECHORequestServerSide

public ECHORequestServerSide()
Method Detail

eval

public void eval(org.xml.sax.ContentHandler responseTarget,
                 ECHOContext context)
          throws java.lang.Exception
Evaluate the request under the given context, sending the results to the responseTarget ContentHandler. This base class exhibits a default behavior, whis is to copy this element with its attributes to the output, and including the results of evaluating its children elements.

Specified by:
eval in interface ECHORequest
Overrides:
eval in class ECHORequestImpl
Parameters:
responseTarget - a SAX2 ContentHandler which will receive the response
Throws:
java.lang.Exception

evalCopy

protected void evalCopy(org.xml.sax.ContentHandler responseTarget,
                        ECHOContext context)
                 throws java.lang.Exception
copy the element, and contents to the result

Throws:
java.lang.Exception

evalBody

public void evalBody(org.xml.sax.ContentHandler responseTarget,
                     ECHOContext context,
                     java.lang.String nsURI,
                     java.lang.String localName,
                     java.lang.String qName,
                     org.xml.sax.Attributes atts)
              throws java.lang.Exception
Copy the element, and the results of its contents to the output.

Parameters:
responseTarget - recieves the SAX events representing the results.
context - the name/value bindings in effect.
nsURI - the namespace name for this element's namespace/localName pair.
localName - the localName for this element's namespace/localName pair.
qName - the prefix/colon(:)/localName representation of the element's tagname.
atts - attributes to send with the start element event
Throws:
java.lang.Exception

extendContext

public ECHOContext extendContext(ECHOContext parentContext)
                          throws java.lang.Exception
adds a new context frame, attaching any locally bound parameters

Throws:
java.lang.Exception

getSubRequest

public ECHORequest getSubRequest(int position)
                          throws java.lang.Exception
returns a child request which is not a "context, paramSet, documentation or meta" element

Throws:
java.lang.Exception

writeException

protected void writeException(java.lang.Throwable ex,
                              org.xml.sax.ContentHandler target)

writeException

protected void writeException(java.lang.Throwable ex,
                              org.xml.sax.ContentHandler target,
                              ECHOContext context)

getNamespacePrefix

protected java.lang.String getNamespacePrefix()

errorResponse

protected void errorResponse(java.lang.Throwable ex,
                             org.xml.sax.ContentHandler responseTarget,
                             ECHOContext context)
                      throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

addAttribute

protected static final void addAttribute(org.xml.sax.helpers.AttributesImpl atts,
                                         java.lang.String attname,
                                         java.lang.String attvalue)
writes a cdata attribute with no namespace


startElement

protected void startElement(java.lang.String tagname,
                            org.xml.sax.Attributes atts,
                            org.xml.sax.ContentHandler dest)
                     throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

startElement

protected void startElement(java.lang.String tagname,
                            org.xml.sax.ContentHandler dest)
                     throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

endElement

protected void endElement(java.lang.String tagname,
                          org.xml.sax.ContentHandler dest)
                   throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

log

protected static final void log(java.lang.Exception ex)

getSecurityService

protected static final SecurityService getSecurityService()
convenience method obtains SecurityService singleton


getUser

protected User getUser(ECHOContext context)
                throws ECHOException
Throws:
ECHOException

getItem

protected RepositoryItem getItem(ECHOContext context)
                          throws java.lang.Exception
get the repository item from parameters in the context

Throws:
java.lang.Exception