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

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

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

public final class SimpleSessionContext
extends Object
implements SessionContext

This is a simple implementation of the session context.

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

Constructor Summary
SimpleSessionContext(XPathProcessor xPathProcessor, SourceResolver resolver)
          Deprecated. Constructor
 
Method Summary
 void appendXML(String path, DocumentFragment fragment)
          Deprecated. Append a document fragment at the given path.
 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.
 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 a document fragment.
 void loadXML(String path, SourceParameters parameters)
          Deprecated. Try to load XML into the context.
 void removeXML(String path)
          Deprecated. Remove nodes
 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(String value, String loadResource, String saveResource)
          Deprecated. Set the name of the context.
 void setValueOfNode(String path, String value)
          Deprecated. Set the value of a node.
 void setXML(String path, DocumentFragment fragment)
          Deprecated. Set a document fragment at the given path.
 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
 

Constructor Detail

SimpleSessionContext

public SimpleSessionContext(XPathProcessor xPathProcessor,
                            SourceResolver resolver)
                     throws ProcessingException
Deprecated. 
Constructor

Throws:
ProcessingException
Method Detail

getName

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

Specified by:
getName in interface SessionContext

setup

public void setup(String value,
                  String loadResource,
                  String saveResource)
Deprecated. 
Description copied from interface: SessionContext
Set the name of the context. This method must be invoked in the init phase. In addition a load and a save resource can be provided.

Specified by:
setup in interface SessionContext

getXML

public DocumentFragment getXML(String path)
                        throws ProcessingException
Deprecated. 
Description copied from interface: SessionContext
Get a document fragment. If the node specified by the path exist, its content is returned as a DocumentFragment. If the node does not exists, null is returned.

Specified by:
getXML in interface SessionContext
Throws:
ProcessingException

setXML

public void setXML(String path,
                   DocumentFragment fragment)
            throws ProcessingException
Deprecated. 
Description copied from interface: SessionContext
Set a document fragment at the given path. The implementation of this method is context specific. Usually all children of the node specified by the path are removed and the children of the fragment are inserted as new children. If the path is not existent it is created.

Specified by:
setXML in interface SessionContext
Throws:
ProcessingException

appendXML

public void appendXML(String path,
                      DocumentFragment fragment)
               throws ProcessingException
Deprecated. 
Append a document fragment at the given path. The implementation of this method is context specific. Usually the children of the fragment are appended as new children of the node specified by the path. If the path is not existent it is created.

Specified by:
appendXML in interface SessionContext
Throws:
ProcessingException

removeXML

public void removeXML(String path)
               throws ProcessingException
Deprecated. 
Remove nodes

Specified by:
removeXML 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

setAttribute

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

Specified by:
setAttribute in interface SessionContext

getAttribute

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

Specified by:
getAttribute in interface SessionContext

getAttribute

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

Specified by:
getAttribute in interface SessionContext

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

setValueOfNode

public void setValueOfNode(String path,
                           String value)
                    throws ProcessingException
Deprecated. 
Set the value of a node.

Specified by:
setValueOfNode 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

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.