Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| deegree 2.4 (2010/11/11 10:47 build-27-official)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

    java.lang.Object
      org.deegree.enterprise.control.AbstractListener
          org.deegree.portal.standard.context.control.AbstractContextListener
              org.deegree.portal.standard.context.control.ContextSwitchListener

All Implemented Interfaces:
  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 URL` | `ctxt2html` A `String` defining the name of the xsl file that defines the transformation from a context to html.
`static String` | `NEW_CONTEXT_HTML` A `String` used as a key value for the new html (of the client).
`protected static 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 String` | `doTransformContext(XMLFragment xml)` Transforms the context pointed to by `xml` into html using `xsl`
`protected XMLFragment` | `getContext(String context, Envelope bbox, String sessionID)` returns the context to be used as a String
`protected void` | `writeContextToSession(String context, 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 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 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 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(String context,
                                         String sessionID)
                                  throws Exception

  writes the context the user choosed to the users session. It can be accessed using `Constants.CURRENTMAPCONTEXT` key value

  Parameters:
    `context` -
    `sessionID` -
  Throws:
    `Exception`

### getContext

    protected XMLFragment getContext(String context,
                                     Envelope bbox,
                                     String sessionID)
                              throws Exception

  returns the context to be used as a String

  Parameters:
    `context` -
    `bbox` -
    `sessionID` -
  Returns:
    the context as String
  Throws:
    `Exception`

### doTransformContext

    protected String doTransformContext(XMLFragment xml)

  Transforms the context pointed to by `xml` into html using `xsl`

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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| deegree 2.4 (2010/11/11 10:47 build-27-official)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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