deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.portal.standard.context.control
Class AbstractContextListener

java.lang.Object
  extended by org.deegree.enterprise.control.AbstractListener
      extended by org.deegree.portal.standard.context.control.AbstractContextListener
All Implemented Interfaces:
java.util.EventListener, WebListener
Direct Known Subclasses:
ContextDeleteListener, ContextLoadListener, ContextSaveListener, ContextSwitchListener, FullScreenListener, InitDownloadListener, NormalScreenListener, ResetContextListener

public abstract class AbstractContextListener
extends AbstractListener

This exception shall be thrown when a session(ID) will be used that has been expired.

Version:
$Revision: 24549 $, $Date: 2010-05-25 14:29:38 +0200 (Di, 25 Mai 2010) $
Author:
Andreas Poth , last edited by: $Author: jmays $

Field Summary
protected static java.lang.String userDir
          WEB-INF/conf/igeoportal/users/
 
Constructor Summary
AbstractContextListener()
           
 
Method Summary
static void changeBBox(ViewContext vc, Envelope bbox)
          changes the bounding box of a given view context
protected  void changeLayerList(ViewContext vc, RPCMember[] rpcLayerList)
          changes the layer list of the ViewContext vc according to the information contained in the rpcLayerList
protected  Envelope extractBBox(RPCStruct bboxStruct)
          Deprecated. use extractBBox( RPCStruct, CoordinateSystem ) instead.
protected  Envelope extractBBox(RPCStruct bboxStruct, CoordinateSystem crs)
          Convenience method to extract the boundig box from an rpc fragment.
protected  RPCParameter[] extractRPCParameters(RPCWebEvent rpcEvent)
          Extracts the parameters from the method call element within the passed rpcEvent.
protected  RPCStruct extractRPCStruct(RPCWebEvent rpcEvent, int index)
          Extracts the RPCStruct from the indicated parameter in the params element of the passed RPCWebEvent.
protected  java.util.List<java.lang.String> getContextList(java.lang.String userName)
          returns a list of all available context documents assigned to the passed user
protected  java.lang.String getUserName(java.lang.String sessionId)
          gets the user name assigned to the passed session ID from an authentication service.
protected  java.lang.String getUserPassword(java.lang.String sessionId)
          gets the user password assigned to the passed session ID from a authentification service.
protected  java.lang.String getUsersStartContext(java.lang.String userName)
          returns the name of the users start context.
protected  java.lang.String readSessionID(RPCStruct struct)
          reads the users session ID.
protected  java.lang.String transformToHtmlMapContext(XMLFragment xml, java.lang.String xsl)
          This function takes in a XmlFragment and transforms it to a html map context
 
Methods inherited from class org.deegree.enterprise.control.AbstractListener
actionPerformed, getAlternativeNextPage, getHomePath, getInitParameter, getInitParameterList, getNextPage, getRequest, getReturnValue, gotoErrorPage, handle, setAlternativeNextPage, setDefaultAlternativeNextPage, setDefaultNextPage, setNextPage, setReturnValue, toModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

userDir

protected static final java.lang.String userDir
WEB-INF/conf/igeoportal/users/

See Also:
Constant Field Values
Constructor Detail

AbstractContextListener

public AbstractContextListener()
Method Detail

getUserName

protected java.lang.String getUserName(java.lang.String sessionId)
                                throws XMLParsingException,
                                       java.io.IOException,
                                       org.xml.sax.SAXException
gets the user name assigned to the passed session ID from an authentication service. If no user is assigned to the session ID null will be returned. If the session is closed or expired an exception will be thrown

Parameters:
sessionId -
Returns:
name of the user assigned to the passed session ID
Throws:
XMLParsingException
org.xml.sax.SAXException
java.io.IOException

getUserPassword

protected java.lang.String getUserPassword(java.lang.String sessionId)
                                    throws XMLParsingException,
                                           java.io.IOException,
                                           org.xml.sax.SAXException,
                                           PortalException
gets the user password assigned to the passed session ID from a authentification service. If no user is assigned to the session ID null will be returned. If the session is closed or expired an exception will be thrown

Parameters:
sessionId -
Returns:
password of the user assigned to the passed session ID
Throws:
XMLParsingException
java.io.IOException
org.xml.sax.SAXException
PortalException

readSessionID

protected java.lang.String readSessionID(RPCStruct struct)
                                  throws XMLParsingException,
                                         org.xml.sax.SAXException,
                                         java.io.IOException
reads the users session ID.
first the PRC will be parsed for a 'sessionID' element. If not present the sessionID will be read from the users session. If even the user's HTTP session does not contain a sessionID, it will be tried to get it from the WAS registered to the current context. If no WAS available null will be returned.

Parameters:
struct -
Returns:
the users session id
Throws:
java.io.IOException
org.xml.sax.SAXException
XMLParsingException

extractBBox

protected Envelope extractBBox(RPCStruct bboxStruct,
                               CoordinateSystem crs)
Convenience method to extract the boundig box from an rpc fragment.

Parameters:
bboxStruct - the RPCStruct containing the bounding box. For example, <member><name>boundingBox</name>etc....
crs - a coordinate system value, may be null.
Returns:
an envelope with the boundaries defined in the rpc structure

extractBBox

@Deprecated
protected Envelope extractBBox(RPCStruct bboxStruct)
Deprecated. use extractBBox( RPCStruct, CoordinateSystem ) instead.

This method is kept for downward compatibility of the API. Do not use it any more!

Parameters:
bboxStruct - the RPCStruct containing the bounding box. For example, <member><name>boundingBox</name>etc....
Returns:
an envelope with the boundaries defined in the rpc structure

changeBBox

public static final void changeBBox(ViewContext vc,
                                    Envelope bbox)
                             throws PortalException
changes the bounding box of a given view context

Parameters:
vc - the view context to be changed
bbox - the new bounding box
Throws:
PortalException

changeLayerList

protected void changeLayerList(ViewContext vc,
                               RPCMember[] rpcLayerList)
                        throws PortalException
changes the layer list of the ViewContext vc according to the information contained in the rpcLayerList

Parameters:
vc - The original ViewContext where the changes will be applied to
rpcLayerList - the current layerlist
Throws:
PortalException

transformToHtmlMapContext

protected java.lang.String transformToHtmlMapContext(XMLFragment xml,
                                                     java.lang.String xsl)
                                              throws javax.xml.transform.TransformerException,
                                                     java.net.MalformedURLException,
                                                     java.io.IOException,
                                                     org.xml.sax.SAXException
This function takes in a XmlFragment and transforms it to a html map context

Parameters:
xml - xmlFragment to transform
xsl - xsl file used to transform
Returns:
html representing the mapContext
Throws:
javax.xml.transform.TransformerException
org.xml.sax.SAXException
java.io.IOException
java.net.MalformedURLException

extractRPCParameters

protected RPCParameter[] extractRPCParameters(RPCWebEvent rpcEvent)
                                       throws PortalException
Extracts the parameters from the method call element within the passed rpcEvent.

Parameters:
rpcEvent -
Returns:
Returns the parameters as array of RPCParameter.
Throws:
PortalException

extractRPCStruct

protected RPCStruct extractRPCStruct(RPCWebEvent rpcEvent,
                                     int index)
                              throws PortalException
Extracts the RPCStruct from the indicated parameter in the params element of the passed RPCWebEvent.

Parameters:
rpcEvent - The RPCWebEvent, that contains the RPCStruct to extract.
index - The index of the parameter from which to extract the RPCStruct (starting with 0).
Returns:
Returns the RPCStruct from the indicated params element.
Throws:
PortalException

getContextList

protected java.util.List<java.lang.String> getContextList(java.lang.String userName)
returns a list of all available context documents assigned to the passed user

Parameters:
userName -
Returns:
the list of available context documents

getUsersStartContext

protected java.lang.String getUsersStartContext(java.lang.String userName)
                                         throws java.io.IOException
returns the name of the users start context. If the user does not own an individual start context the name of the default start context for all users will be returned. (copied and adapted from org.deegree.portal.standard.security.control.GetSessionIDListener)

Parameters:
userName -
Returns:
String
Throws:
java.io.IOException

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org