org.apache.cocoon.webapps.session.context
Interface SessionContext

All Superinterfaces:
Serializable
All Known Implementing Classes:
AuthenticationContext, RequestSessionContext, SessionContextImpl, SimpleSessionContext

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

public interface SessionContext
extends Serializable

Interface for a SessionContext. This interface describes a SessionContext. The SessionContext is a data container containing structured XML which can be retrieved/set by the session transformer. This interface does not specify how the session context stores the data. This is left to the implementation itself, but actually this interface is build in the DOM model. As this context is used in a web context, all methods must be synchronized.

Version:
CVS $Id: SessionContext.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler

Method Summary
 void appendXML(String path, DocumentFragment fragment)
          Deprecated. Append a document fragment at the given path.
 Object getAttribute(String key)
          Deprecated. Get the value of a context attribute.
 Object getAttribute(String key, Object defaultObject)
          Deprecated. Get the value of a context attribute.
 String getName()
          Deprecated. Get the name of the context
 NodeList getNodeList(String path)
          Deprecated. Get a copy of all nodes specified by the path.
 Node getSingleNode(String path)
          Deprecated. Get a copy of 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 some content from the 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(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.
 

Method Detail

setup

void setup(String value,
           String loadResource,
           String saveResource)
Deprecated. 
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.


getName

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


getXML

DocumentFragment getXML(String path)
                        throws ProcessingException
Deprecated. 
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.

Throws:
ProcessingException

setXML

void setXML(String path,
            DocumentFragment fragment)
            throws ProcessingException
Deprecated. 
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.

Throws:
ProcessingException

appendXML

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 and this method should work in the same way as setXML.

Throws:
ProcessingException

removeXML

void removeXML(String path)
               throws ProcessingException
Deprecated. 
Remove some content from the context. The implementation of this method is context specific. Usually this method should remove all children of the node specified by the path.

Throws:
ProcessingException

setAttribute

void setAttribute(String key,
                  Object value)
                  throws ProcessingException
Deprecated. 
Set a context attribute. Attributes over a means to store any data (object) in a session context. If value is null the attribute is removed. If already an attribute exists with the same key, the value is overwritten with the new one.

Throws:
ProcessingException

getAttribute

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

Throws:
ProcessingException

getAttribute

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

Throws:
ProcessingException

getSingleNode

Node getSingleNode(String path)
                   throws ProcessingException
Deprecated. 
Get a copy of the first node specified by the path. If the node does not exist, null is returned.

Throws:
ProcessingException

getNodeList

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

Throws:
ProcessingException

setNode

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

Throws:
ProcessingException

getValueOfNode

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.

Throws:
ProcessingException

setValueOfNode

void setValueOfNode(String path,
                    String value)
                    throws ProcessingException
Deprecated. 
Set the value of a node. All children of the node are removed beforehand and one single text node with the given value is appended to the node.

Throws:
ProcessingException

streamXML

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. If no data is available (if the path does not exist) false is returned, otherwise true.

Throws:
SAXException
ProcessingException

loadXML

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.

Throws:
SAXException
ProcessingException
IOException

saveXML

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.

Throws:
SAXException
ProcessingException
IOException


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