org.deegree_impl.clients.context
Class WebMapContextFactory

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

public class WebMapContextFactory
extends java.lang.Object

Factory class for creating an instance of a web map Context (ViewContext). The factory is able to parse deegree specific extensions (General and Layer) as well as standard web map context documents.

Version:
$Revision: 1.13 $
Author:
Andreas Poth

Constructor Summary
WebMapContextFactory()
           
 
Method Summary
private static BaseURL createBaseURL(org.w3c.dom.Element element)
          creates an instance of BaseURL that is used for
private static GM_Point[] createBoundingBox(org.w3c.dom.Element element)
          creates a GM_Envelope from the passed Element
private static java.lang.String[] createCommonJS(org.w3c.dom.Element element)
          creates a list of javascript pages (names) that contains javascript objects and methods that are used by more than one module
private static ContactAddress createContactAddress(org.w3c.dom.Element element)
          Creates a ContactAddress-instance according to the contents of the DOM-subtree starting at the given 'ContactAddress'-Element.
private static ContactInformation createContactInformation(org.w3c.dom.Element element)
          Creates a ContactInformation-instance according to the contents of the DOM-subtree starting at the given 'ContactInformation'-Element.
private static ContactPersonPrimary createContactPersonPrimary(org.w3c.dom.Element element)
          Creates a ContactPersonPrimary-instance according to the contents of the DOM-subtree starting at the given 'ContactPersonPrimary'-Element.
private static DirectoryAccess createDirectoryAccess(org.w3c.dom.Element element, DirectoryAccess tempDir)
           
private static FormatList createFormatList(org.w3c.dom.Element element)
          creates an instance of a class encapsulating a list of image formats a layer offers
private static Frontend createFrontend(org.w3c.dom.Element element)
          creates an instance of a class encapsulating the frontend (GUI) description of a deegree map client
private static General createGeneral(org.w3c.dom.Element element)
          creates an instance of a class encapsulating the general context informations
private static GeneralExtension createGeneralExtension(org.w3c.dom.Element element)
          creates an instance of a class encapsulating the deegree specific extensions of the general section of a web map context document
private static GUIArea createGUIArea(org.w3c.dom.Element element)
          creates an instance of a class encapsulating the GUI description of one region of the GUI
private static ImageURL createImageURL(org.w3c.dom.Element element)
          creates an instance of an ImageURL that is used for and LegendURL
private static IOSettings createIOSettings(org.w3c.dom.Element element)
          creates an instance of a class encapsulating the IO setting informations
private static java.lang.String[] createKeywords(org.w3c.dom.Element element)
          creates an array of keywords (String) from the passed Keyword list
private static Layer createLayer(org.w3c.dom.Element element)
          creates an instance of a class encapsulating a web map context layer's attributes
private static LayerExtension createLayerExtension(org.w3c.dom.Element element)
          creates an instance of a class encapsulating the deegree specific extensions of a Layer
private static LayerList createLayerList(org.w3c.dom.Element element)
          creates an instance of a class encapsulating the layer list informations
private static MapParameter createMapParameter(org.w3c.dom.Element element)
          creates an instance of a class encapsulating informations about controlling options for a map presented to the user
private static Module createModule(org.w3c.dom.Element element)
          creates an instance of a class encapsulating module informations
private static ModuleConfiguration createModuleConfiguration(org.w3c.dom.Element element)
          creates an instance of a class encapsulating the access the configuration of Module
private static Format[] createOfferedInfoFormats(org.w3c.dom.Element element)
          Creates a list of the feature info formats offered by the client.
private static MapOperationFactor[] createOfferedMapOperationFactors(org.w3c.dom.Element element)
          returns a list of offered numerical map operation factors that can be used to determine zoom or pan levels
private static java.net.URL createOnlineResource(org.w3c.dom.Element element)
          creates an instance of an URL described by a element
private static Parameter createParameter(org.w3c.dom.Element element)
          creates an instance of a class encapsulating a parameter that shall be passed to a module
private static ParameterList createParameterList(org.w3c.dom.Element element)
          creates an instance of a class encapsulating the layer list informations
private static Server createServer(org.w3c.dom.Element element)
          creates an instance of a class encapsulating informations about the server (service) a layer based on
private static SLD createSLD(org.w3c.dom.Element element)
          creates an instance of a class encapsulating a description of a Style based on a SLD
private static Style createStyle(org.w3c.dom.Element element)
          creates an instance of a class encapsulating a description of a Style
private static StyleList createStyleList(org.w3c.dom.Element element)
          creates an instance of a class encapsulating a list of styles available for a layer
static ViewContext createViewContext(java.io.Reader reader)
          creates an instance of a ViewContext from the web map context document read from the passed Reader
static ViewContext createViewContext(java.lang.String fileName)
          creates an instance of a ViewContext from the web map context document read from the file idenfied by the passed name
private static java.awt.Rectangle createWindow(org.w3c.dom.Element element)
          creates a Rectangle (Window) instance from the passed Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebMapContextFactory

public WebMapContextFactory()
Method Detail

createViewContext

public static ViewContext createViewContext(java.lang.String fileName)
                                     throws java.io.IOException,
                                            XMLParsingException,
                                            ContextException
creates an instance of a ViewContext from the web map context document read from the file idenfied by the passed name

Parameters:
fileName - name of a file containing a web map context document
Returns:
Throws:
java.io.IOException
ContextException
XMLParsingException

createViewContext

public static ViewContext createViewContext(java.io.Reader reader)
                                     throws java.io.IOException,
                                            XMLParsingException,
                                            ContextException
creates an instance of a ViewContext from the web map context document read from the passed Reader

Parameters:
reader - reader enabling access to a web map context document
Returns:
Throws:
java.io.IOException
ContextException
XMLParsingException

createGeneral

private static General createGeneral(org.w3c.dom.Element element)
                              throws XMLParsingException
creates an instance of a class encapsulating the general context informations

Parameters:
element -
Returns:
instance of General
Throws:
XMLParsingException

createWindow

private static java.awt.Rectangle createWindow(org.w3c.dom.Element element)
                                        throws XMLParsingException
creates a Rectangle (Window) instance from the passed Element.

Parameters:
element -
Returns:
instance of Rectangle
Throws:
XMLParsingException

createBoundingBox

private static GM_Point[] createBoundingBox(org.w3c.dom.Element element)
                                     throws XMLParsingException
creates a GM_Envelope from the passed Element

Parameters:
element -
Returns:
instance of GM_Envelope
Throws:
XMLParsingException

createKeywords

private static java.lang.String[] createKeywords(org.w3c.dom.Element element)
                                          throws XMLParsingException
creates an array of keywords (String) from the passed Keyword list

Parameters:
element -
Returns:
array of Strings
Throws:
XMLParsingException

createImageURL

private static ImageURL createImageURL(org.w3c.dom.Element element)
                                throws XMLParsingException
creates an instance of an ImageURL that is used for and LegendURL

Parameters:
element - or
Returns:
instance of ImageURL
Throws:
XMLParsingException

createOnlineResource

private static java.net.URL createOnlineResource(org.w3c.dom.Element element)
                                          throws XMLParsingException
creates an instance of an URL described by a element

Parameters:
element -
Returns:
instance of URL
Throws:
XMLParsingException

createBaseURL

private static BaseURL createBaseURL(org.w3c.dom.Element element)
                              throws XMLParsingException
creates an instance of BaseURL that is used for

Parameters:
element -
Returns:
instance of BaseURL
Throws:
XMLParsingException

createContactInformation

private static ContactInformation createContactInformation(org.w3c.dom.Element element)
                                                    throws XMLParsingException
Creates a ContactInformation-instance according to the contents of the DOM-subtree starting at the given 'ContactInformation'-Element.

Parameters:
element - the 'ContactInformation'-Element
Returns:
the constructed ContactInformation-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createContactPersonPrimary

private static ContactPersonPrimary createContactPersonPrimary(org.w3c.dom.Element element)
                                                        throws XMLParsingException
Creates a ContactPersonPrimary-instance according to the contents of the DOM-subtree starting at the given 'ContactPersonPrimary'-Element.

Parameters:
element - the 'ContactPersonPrimary'-Element
Returns:
the constructed ContactPersonPrimary-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createContactAddress

private static ContactAddress createContactAddress(org.w3c.dom.Element element)
                                            throws XMLParsingException
Creates a ContactAddress-instance according to the contents of the DOM-subtree starting at the given 'ContactAddress'-Element.

Parameters:
element - the 'ContactAddress'-Element
Returns:
the constructed ContactAddress-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createGeneralExtension

private static GeneralExtension createGeneralExtension(org.w3c.dom.Element element)
                                                throws XMLParsingException
creates an instance of a class encapsulating the deegree specific extensions of the general section of a web map context document

Parameters:
element -
Returns:
instance of GeneralExtension
Throws:
XMLParsingException

createFrontend

private static Frontend createFrontend(org.w3c.dom.Element element)
                                throws XMLParsingException
creates an instance of a class encapsulating the frontend (GUI) description of a deegree map client

Parameters:
element -
Returns:
instance of Frontend
Throws:
XMLParsingException

createCommonJS

private static java.lang.String[] createCommonJS(org.w3c.dom.Element element)
                                          throws XMLParsingException
creates a list of javascript pages (names) that contains javascript objects and methods that are used by more than one module

Parameters:
element -
Returns:
instance of String[]
Throws:
XMLParsingException

createGUIArea

private static GUIArea createGUIArea(org.w3c.dom.Element element)
                              throws XMLParsingException
creates an instance of a class encapsulating the GUI description of one region of the GUI

Parameters:
element - ; ; ; or
Returns:
instance of GUIArea
Throws:
XMLParsingException

createModule

private static Module createModule(org.w3c.dom.Element element)
                            throws XMLParsingException
creates an instance of a class encapsulating module informations

Parameters:
element -
Returns:
instance of Module
Throws:
XMLParsingException

createModuleConfiguration

private static ModuleConfiguration createModuleConfiguration(org.w3c.dom.Element element)
                                                      throws XMLParsingException
creates an instance of a class encapsulating the access the configuration of Module

Parameters:
element -
Returns:
instance of ModuleConfiguration
Throws:
XMLParsingException

createParameterList

private static ParameterList createParameterList(org.w3c.dom.Element element)
                                          throws XMLParsingException
creates an instance of a class encapsulating the layer list informations

Parameters:
element -
Returns:
instance of LayerList
Throws:
XMLParsingException

createParameter

private static Parameter createParameter(org.w3c.dom.Element element)
                                  throws XMLParsingException
creates an instance of a class encapsulating a parameter that shall be passed to a module

Parameters:
element -
Returns:
instance of Parameter
Throws:
XMLParsingException

createMapParameter

private static MapParameter createMapParameter(org.w3c.dom.Element element)
                                        throws XMLParsingException
creates an instance of a class encapsulating informations about controlling options for a map presented to the user

Parameters:
element -
Returns:
instance of MapParameter
Throws:
XMLParsingException

createOfferedInfoFormats

private static Format[] createOfferedInfoFormats(org.w3c.dom.Element element)
                                          throws XMLParsingException
Creates a list of the feature info formats offered by the client.

Parameters:
element - element of the configuration
Returns:
list of offered feature info formats
Throws:
XMLParsingException

createOfferedMapOperationFactors

private static MapOperationFactor[] createOfferedMapOperationFactors(org.w3c.dom.Element element)
                                                              throws XMLParsingException
returns a list of offered numerical map operation factors that can be used to determine zoom or pan levels

Parameters:
element - a Element that contains elements as children
Returns:
list of MapOperationFactors
Throws:
XMLParsingException

createIOSettings

private static IOSettings createIOSettings(org.w3c.dom.Element element)
                                    throws XMLParsingException
creates an instance of a class encapsulating the IO setting informations

Parameters:
element -
Returns:
Throws:
XMLParsingException

createDirectoryAccess

private static DirectoryAccess createDirectoryAccess(org.w3c.dom.Element element,
                                                     DirectoryAccess tempDir)
                                              throws XMLParsingException
Parameters:
element -
tempDir -
Returns:
Throws:
XMLParsingException

createLayerList

private static LayerList createLayerList(org.w3c.dom.Element element)
                                  throws XMLParsingException
creates an instance of a class encapsulating the layer list informations

Parameters:
element -
Returns:
instance of LayerList
Throws:
XMLParsingException

createLayer

private static Layer createLayer(org.w3c.dom.Element element)
                          throws XMLParsingException
creates an instance of a class encapsulating a web map context layer's attributes

Parameters:
element -
Returns:
instance of Layer
Throws:
XMLParsingException

createServer

private static Server createServer(org.w3c.dom.Element element)
                            throws XMLParsingException
creates an instance of a class encapsulating informations about the server (service) a layer based on

Parameters:
element -
Returns:
instance of Server
Throws:
XMLParsingException

createFormatList

private static FormatList createFormatList(org.w3c.dom.Element element)
                                    throws XMLParsingException
creates an instance of a class encapsulating a list of image formats a layer offers

Parameters:
element -
Returns:
instance of FormatList
Throws:
XMLParsingException

createStyleList

private static StyleList createStyleList(org.w3c.dom.Element element)
                                  throws XMLParsingException
creates an instance of a class encapsulating a list of styles available for a layer

Parameters:
element -
Returns:
instance of StyleList
Throws:
XMLParsingException

createStyle

private static Style createStyle(org.w3c.dom.Element element)
                          throws XMLParsingException
creates an instance of a class encapsulating a description of a Style

Parameters:
element -