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

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

java.lang.Object
  extended by org.deegree.enterprise.control.AbstractListener
      extended by org.deegree.portal.standard.context.control.AbstractContextListener
          extended by org.deegree.portal.standard.context.control.ContextSwitchListener
All Implemented Interfaces:
java.util.EventListener, WebListener

public class ContextSwitchListener
extends AbstractContextListener

This class handles switch of map contexts. The basic logic is (1) receiving an rpc request with a context name (xml) and, possibly, a bounding box, (2) transforming this xml using a provided xsl, and (3) forwarding the result back to the browser.
Most of the action takes place in doTransformContext, and is delegated to the ContextTransformer.
In order to perform the transformation from a context xml to a html, a xslt is provided. This is per default called context2HTML.xsl (see the class member DEFAULT_CTXT2HTML) and should be put under ${context-home}/WEB-INF/xml/.

Version:
$Revision: 21693 $, $Date: 2010-01-03 15:07:54 +0100 (So, 03 Jan 2010) $
Author:
Ugo Taddei, Andreas Poth, last edited by: $Author: apoth $

Field Summary
protected  java.net.URL ctxt2html
          A String defining the name of the xsl file that defines the transformation from a context to html.
static java.lang.String NEW_CONTEXT_HTML
          A String used as a key value for the new html (of the client).
protected static java.lang.String WEBMAPCTXT2HTML
          script to transform a standard WMC document into a deegree WMC
 
Fields inherited from class org.deegree.portal.standard.context.control.AbstractContextListener
userDir
 
Constructor Summary
ContextSwitchListener()
           
 
Method Summary
 void actionPerformed(FormEvent event)
           
protected  java.lang.String doTransformContext(XMLFragment xml)
          Transforms the context pointed to by xml into html using xsl
protected  XMLFragment getContext(java.lang.String context, Envelope bbox, java.lang.String sessionID)
          returns the context to be used as a String
protected  void writeContextToSession(java.lang.String context, java.lang.String sessionID)
          writes the context the user choosed to the users session.
 
Methods inherited from class org.deegree.portal.standard.context.control.AbstractContextListener
changeBBox, changeLayerList, extractBBox, extractBBox, extractRPCParameters, extractRPCStruct, getContextList, getUserName, getUserPassword, getUsersStartContext, readSessionID, transformToHtmlMapContext
 
Methods inherited from class org.deegree.enterprise.control.AbstractListener
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

NEW_CONTEXT_HTML

public static final java.lang.String NEW_CONTEXT_HTML
A String used as a key value for the new html (of the client). This key is used in the JSP which output the new(-ly transformed html.

See Also:
Constant Field Values

ctxt2html

protected java.net.URL ctxt2html
A String defining the name of the xsl file that defines the transformation from a context to html. This must be placed, together with the map context xml and helper xsl files, under ${context-home}/WEB-INF/conf/igeoportal/.


WEBMAPCTXT2HTML

protected static final java.lang.String WEBMAPCTXT2HTML
script to transform a standard WMC document into a deegree WMC

See Also:
Constant Field Values
Constructor Detail

ContextSwitchListener

public ContextSwitchListener()
Method Detail

actionPerformed

public void actionPerformed(FormEvent event)
Specified by:
actionPerformed in interface WebListener
Specified by:
actionPerformed in class AbstractListener

writeContextToSession

protected void writeContextToSession(java.lang.String context,
                                     java.lang.String sessionID)
                              throws java.lang.Exception
writes the context the user choosed to the users session. It can be accessed using Constants.CURRENTMAPCONTEXT key value

Parameters:
context -
sessionID -
Throws:
java.lang.Exception

getContext

protected XMLFragment getContext(java.lang.String context,
                                 Envelope bbox,
                                 java.lang.String sessionID)
                          throws java.lang.Exception
returns the context to be used as a String

Parameters:
context -
bbox -
sessionID -
Returns:
the context as String
Throws:
java.lang.Exception

doTransformContext

protected java.lang.String doTransformContext(XMLFragment xml)
Transforms the context pointed to by xml into html using xsl

Parameters:
xml - the context xml
Returns:
the transformed context

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