org.deegree_impl.clients.context
Class JSPCreator

java.lang.Object
  extended byorg.deegree_impl.clients.context.JSPCreator

public class JSPCreator
extends java.lang.Object

This class offers methods for creating JSP and JavaSript fragments depending on the Map context document used as configuration for the deegree web map client.

The created fragments partially uses javascript calls as defined in the deegree integrated client. if somebody needs other javascript methods he/she must write its own creator methods or must directly use an instance of a ViewContext in a JSP page.

Version:
$Revision: 1.7 $
Author:
Andreas Poth

Constructor Summary
JSPCreator()
           
 
Method Summary
static java.lang.String createCommonJSImport(ViewContext viewContext)
           
private static java.lang.StringBuffer createInitCalls(GUIArea guiarea)
           
static java.lang.String createJSInitSection(ViewContext viewContext)
          creates a set of constructor calls that are requierd to initialize the GUI.
static java.lang.String getArea(ViewContext viewContext, int area)
          creates JSP import statement for the modules being part of an area of the GUI/page.
static java.lang.String getAvailableLayersAsComboBox(ViewContext viewContext)
           
static java.lang.String getAvailableLayersAsHTMLList(ViewContext viewContext)
           
static java.lang.String getControlBarContent(ViewContext viewContext)
           
static java.lang.String getLayerAsHTMLTable(ViewContext viewContext)
          returns the layers contained in the passed ViewContext as a HTML table with a Checkbox for visibility and a Radiobutton for query (featureInfo).
private static java.lang.StringBuffer getLayerAsHTMLTableJS()
           
static java.lang.Object[][] getLayersGroupedByService(ViewContext viewContext)
          returns a matrix containing an array of layer for each server defined in the map context. the matrix is ordered in that way that in the first row and first field you find the server in the second field you find an array of layers served by the server.
static java.lang.String[][] getServiceRequests(ViewContext viewContext)
          creates a list of servers and GetMap requests assigned to them from a ViewContext.
static java.lang.String getVisibleLayersAsHTMLList(ViewContext viewContext)
           
static void main(java.lang.String[] args)
           
private static boolean usesSLD(Layer[] layers)
          returns true if one of the passed layers uses SLD instead of named styles
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSPCreator

public JSPCreator()
Method Detail

getArea

public static java.lang.String getArea(ViewContext viewContext,
                                       int area)
creates JSP import statement for the modules being part of an area of the GUI/page. Known areas are GUIArea.WEST, GUIArea.EAST, GUIArea.NORTH, GUIArea.SOUTH and GUIArea.CENTER

Parameters:
viewContext -
area - area to create import statements for
Returns:
JSP import fragment

createJSInitSection

public static java.lang.String createJSInitSection(ViewContext viewContext)
creates a set of constructor calls that are requierd to initialize the GUI. Each module that is registered will be represented by a JavaScript object. For each of these objects one instance will be created and registered by the central controller which also is a JavaScript object.

Parameters:
viewContext - web map context
Returns:
javascript fragment

createInitCalls

private static java.lang.StringBuffer createInitCalls(GUIArea guiarea)
Parameters:
guiarea -
Returns:

createCommonJSImport

public static java.lang.String createCommonJSImport(ViewContext viewContext)
Parameters:
viewContext -
Returns:

getLayersGroupedByService

public static java.lang.Object[][] getLayersGroupedByService(ViewContext viewContext)
returns a matrix containing an array of layer for each server defined in the map context. the matrix is ordered in that way that in the first row and first field you find the server in the second field you find an array of layers served by the server. In the next row the same is done for another server. In the third row you find another server or the same server as in the first row because the layer order as defined in the map context requiers asking one server two or more times.

Parameters:
viewContext -
Returns:

getServiceRequests

public static java.lang.String[][] getServiceRequests(ViewContext viewContext)
                                               throws ContextException
creates a list of servers and GetMap requests assigned to them from a ViewContext. The requests/servers are order like they appears in the underlying web map context document. The requests are presented in a bottom to top approach. TODO: the method currently doesn't deal with layers using SLD for style description and services others than WMS

Parameters:
viewContext -
Returns:
Throws:
ContextException

usesSLD

private static boolean usesSLD(Layer[] layers)
returns true if one of the passed layers uses SLD instead of named styles


getLayerAsHTMLTable

public static java.lang.String getLayerAsHTMLTable(ViewContext viewContext)
returns the layers contained in the passed ViewContext as a HTML table with a Checkbox for visibility and a Radiobutton for query (featureInfo). The method assues that the deegree integrated client or Map client will be used so the corresponding JavaScript calls will be created.

Parameters:
viewContext -
Returns:

getLayerAsHTMLTableJS

private static java.lang.StringBuffer getLayerAsHTMLTableJS()
Returns:

getVisibleLayersAsHTMLList

public static java.lang.String getVisibleLayersAsHTMLList(ViewContext viewContext)
Parameters:
viewContext -
Returns:

getAvailableLayersAsHTMLList

public static java.lang.String getAvailableLayersAsHTMLList(ViewContext viewContext)
Parameters:
viewContext -
Returns:

getAvailableLayersAsComboBox

public static java.lang.String getAvailableLayersAsComboBox(ViewContext viewContext)
Parameters:
viewContext -
Returns:

getControlBarContent

public static java.lang.String getControlBarContent(ViewContext viewContext)
Parameters:
viewContext -
Returns:

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Parameters:
args -
Throws:
java.lang.Exception