org.apache.cocoon.webapps.session.context
Class RequestSessionContext

java.lang.Object
  extended by org.apache.cocoon.webapps.session.context.RequestSessionContext
All Implemented Interfaces:
Serializable, SessionContext

Deprecated. This block is deprecated and will be removed in future versions.

public final class RequestSessionContext
extends Object
implements SessionContext

A SessionContext which encapsulates the current Request object. It is not allowed to change this context. The following paths are valid: /parameter - lists all parameters, parameter names build the elements with the value of the first parameter with this name as text node childs /parameter/ - one text node containing the value of the first parameter with this name /querystring - the querystring with a leading '?' or null (the querystring is only for GET) /parametervalues - same as /parameter but values are listed as described below and each value of a parameter is listed. parameter name parameter value ... parameter name parameter value If a parameter has more than one value for each value a block is generated. This output has the namespace of the CIncludeTransformer to use it as input for a command. /attributes - lists all attributes, attribute names build the elements with the values as childs /headers - lists all headers, header names build the elements with the values as text node childs /cookies ----- /characterEncoding /contentLength /contentType /protocol /remoteAddress /remoteHost /scheme /serverName /serverPort /method /contextPath /pathInfo /pathTranslated /remoteUser /requestedSessionId /requestURI /servletPath /isRequestedSessionIdFromCookie /isRequestedSessionIdFromCookie /isRequestedSessionIdValid The following attributes of the servlet api 2.2 are missing: - getUserPrincipal() - getLocale() - getLocales() - getAuthType()

Version:
CVS $Id: RequestSessionContext.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler
See Also:
Serialized Form

Field Summary
protected  Logger logger
          Deprecated. The logger.
 
Constructor Summary
RequestSessionContext(Logger logger)
          Deprecated.  
 
Method Summary
 void appendXML(String path, DocumentFragment fragment)
          Deprecated. Append a document fragment is not possible for the request context.
 Object getAttribute(String key)
          Deprecated. Get a context attribute.
 Object getAttribute(String key, Object defaultObject)
          Deprecated. Get a context attribute.
 String getName()
          Deprecated. Get the name of the context
 NodeList getNodeList(String path)
          Deprecated. Get a copy all the nodes specified by the path.
 String getParameter(String parameterName)
          Deprecated. Get the request parameter as a String
 DocumentFragment getParameterAsXML(String parameterName)
          Deprecated. Get the request parameter as xml
 Request getRequest()
          Deprecated. Get the request object
 Node getSingleNode(String path)
          Deprecated. Get a copy the first node specified by the path.
 String getValueOfNode(String path)
          Deprecated. Get the value of this node.
 DocumentFragment getXML(String path)
          Deprecated. Get the XML from the request object
 void loadXML(String path, SourceParameters parameters)
          Deprecated. Try to load XML into the context.
 void removeXML(String path)
          Deprecated. Removing is not possible for the request context.
 void saveXML(String path, SourceParameters parameters)
          Deprecated. Try to save XML from the context.
 void setAttribute(String key, Object value)
          Deprecated. Set a context attribute.
 void setNode(String path, Node node)
          Deprecated. Set the value of a node.
 void setup(Map objectModel, ServiceManager manager, XPathProcessor processor)
          Deprecated. Set the Request
 void setup(String value, String loadResource, String saveResource)
          Deprecated. Setup this context
 void setValueOfNode(String path, String value)
          Deprecated. Setting of xml is not possible for the request context
 void setXML(String path, DocumentFragment fragment)
          Deprecated. Setting of xml is not possible for the request context
 boolean streamXML(String path, ContentHandler contentHandler, LexicalHandler lexicalHandler)
          Deprecated. Stream the XML directly to the handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected Logger logger
Deprecated. 
The logger.

Constructor Detail

RequestSessionContext

public RequestSessionContext(Logger logger)
Deprecated. 
Method Detail

setup

public void setup(String value,
                  String loadResource,
                  String saveResource)
Deprecated. 
Setup this context

Specified by:
setup in interface SessionContext

setup

public void setup(Map objectModel,
                  ServiceManager manager,
                  XPathProcessor processor)
           throws ProcessingException
Deprecated. 
Set the Request

Throws:
ProcessingException

getName

public String getName()
Deprecated. 
Get the name of the context

Specified by:
getName in interface SessionContext

getRequest

public Request getRequest()
Deprecated. 
Get the request object


getXML

public DocumentFragment getXML(String path)
                        throws ProcessingException
Deprecated. 
Get the XML from the request object

Specified by:
getXML in interface SessionContext
Throws:
ProcessingException

setXML

public void setXML(String path,
                   DocumentFragment fragment)
            throws ProcessingException
Deprecated. 
Setting of xml is not possible for the request context

Specified by:
setXML in interface SessionContext
Throws:
ProcessingException

setValueOfNode

public void setValueOfNode(String path,
                           String value)
                    throws ProcessingException
Deprecated. 
Setting of xml is not possible for the request context

Specified by:
setValueOfNode in interface SessionContext
Throws:
ProcessingException

appendXML

public void appendXML(String path,
                      DocumentFragment fragment)
               throws ProcessingException
Deprecated. 
Append a document fragment is not possible for the request context.

Specified by:
appendXML in interface SessionContext
Throws:
ProcessingException

removeXML

public void removeXML(String path)
               throws ProcessingException
Deprecated. 
Removing is not possible for the request context.

Specified by:
removeXML in interface SessionContext
Throws:
ProcessingException

setAttribute

public void setAttribute(String key,
                         Object value)
                  throws ProcessingException
Deprecated. 
Set a context attribute. If value is null the attribute is removed.

Specified by:
setAttribute in interface SessionContext
Throws:
ProcessingException

getAttribute

public Object getAttribute(String key)
                    throws ProcessingException
Deprecated. 
Get a context attribute. If the attribute is not available return null

Specified by:
getAttribute in interface SessionContext
Throws:
ProcessingException

getAttribute

public Object getAttribute(String key,
                           Object defaultObject)
                    throws ProcessingException
Deprecated. 
Get a context attribute. If the attribute is not available the defaultObject is returned

Specified by:
getAttribute in interface SessionContext
Throws:
ProcessingException

getSingleNode

public Node getSingleNode(String path)
                   throws ProcessingException
Deprecated. 
Get a copy the first node specified by the path.

Specified by:
getSingleNode in interface SessionContext
Throws:
ProcessingException

getNodeList

public NodeList getNodeList(String path)
                     throws ProcessingException
Deprecated. 
Get a copy all the nodes specified by the path.

Specified by:
getNodeList in interface SessionContext
Throws:
ProcessingException

setNode

public void setNode(String path,
                    Node node)
             throws ProcessingException
Deprecated. 
Set the value of a node. The node is copied before insertion.

Specified by:
setNode in interface SessionContext
Throws:
ProcessingException

getValueOfNode

public String getValueOfNode(String path)
                      throws ProcessingException
Deprecated. 
Get the value of this node. This is similiar to the xsl:value-of function. If the node does not exist, null is returned.

Specified by:
getValueOfNode in interface SessionContext
Throws:
ProcessingException

streamXML

public boolean streamXML(String path,
                         ContentHandler contentHandler,
                         LexicalHandler lexicalHandler)
                  throws SAXException,
                         ProcessingException
Deprecated. 
Stream the XML directly to the handler. This streams the contents of getXML() to the given handler without creating a DocumentFragment containing a copy of the data

Specified by:
streamXML in interface SessionContext
Throws:
SAXException
ProcessingException

getParameterAsXML

public DocumentFragment getParameterAsXML(String parameterName)
                                   throws ProcessingException
Deprecated. 
Get the request parameter as xml

Throws:
ProcessingException

getParameter

public String getParameter(String parameterName)
Deprecated. 
Get the request parameter as a String


loadXML

public void loadXML(String path,
                    SourceParameters parameters)
             throws SAXException,
                    ProcessingException,
                    IOException
Deprecated. 
Try to load XML into the context. If the context does not provide the ability of loading, an exception is thrown.

Specified by:
loadXML in interface SessionContext
Throws:
SAXException
ProcessingException
IOException

saveXML

public void saveXML(String path,
                    SourceParameters parameters)
             throws SAXException,
                    ProcessingException,
                    IOException
Deprecated. 
Try to save XML from the context. If the context does not provide the ability of saving, an exception is thrown.

Specified by:
saveXML in interface SessionContext
Throws:
SAXException
ProcessingException
IOException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.