org.deegree_impl.clients.wmsclient.configuration
Class WMSClientConfigurationFactory

java.lang.Object
  extended byorg.deegree_impl.clients.wmsclient.configuration.WMSClientConfigurationFactory

public class WMSClientConfigurationFactory
extends java.lang.Object

Factory class for creating instances of WMSClientConfiguration

Version:
$Revision: 1.8 $
Author:
Andreas Poth

Field Summary
private  java.lang.String CNS
           
 
Constructor Summary
WMSClientConfigurationFactory()
           
WMSClientConfigurationFactory(java.lang.String namespace)
           
 
Method Summary
private  WMSGetMapRequest createInitialGetMapRequest(org.w3c.dom.Element initMapReq)
           
private  java.util.HashMap createKnownWMS(org.w3c.dom.Element knownWMSE)
          creates a HashMap with the id of the WMS known by the client as a key and the URL to its capabilities as value
private  Format[] createOfferedMapFormats(org.w3c.dom.Element mapFormats)
          Creates a list of the map/images formats offered by the client.
private  MapOperationFactor[] createOfferedMapOperationFactors(org.w3c.dom.Element factors)
          returns a list of offered numerical map operation factors that can be used to determine zoom or pan levels
private  MapOperation[] createOfferedMapOperations(org.w3c.dom.Element mapOperations)
          returns a list of the map operations (zoomin, zoomout, pan etc.) offered by the client
private  MapSize[] createOfferedMapSizes(org.w3c.dom.Element mapSizes)
          creates a list of available map sizes for the client.
private  Project createProject(org.w3c.dom.Element projectElement)
          creates a predefined project that can be invoked by the client
 WMSClientConfiguration createWMSClientConfiguration(org.w3c.dom.Element root, WMSClientConfiguration defaultConfig)
          creates an instance of the WMSClientConfiguration from the parameters contained in the configuration file referenced by the passed Element
 WMSClientConfiguration createWMSClientConfiguration(java.net.URL url, WMSClientConfiguration defaultConfig)
          creates an instance of the WMSClientConfiguration from the parameters contained in the configuration file referenced by the submitted URL
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CNS

private java.lang.String CNS
Constructor Detail

WMSClientConfigurationFactory

public WMSClientConfigurationFactory()

WMSClientConfigurationFactory

public WMSClientConfigurationFactory(java.lang.String namespace)
Method Detail

createWMSClientConfiguration

public WMSClientConfiguration createWMSClientConfiguration(java.net.URL url,
                                                           WMSClientConfiguration defaultConfig)
                                                    throws XMLParsingException
creates an instance of the WMSClientConfiguration from the parameters contained in the configuration file referenced by the submitted URL

Parameters:
url - refernce to a wms client configuration document
defaultConfig - default map client configuration
Returns:
instance of WMSClientConfiguration
Throws:
XMLParsingException

createWMSClientConfiguration

public WMSClientConfiguration createWMSClientConfiguration(org.w3c.dom.Element root,
                                                           WMSClientConfiguration defaultConfig)
                                                    throws XMLParsingException
creates an instance of the WMSClientConfiguration from the parameters contained in the configuration file referenced by the passed Element

Parameters:
root - XML element containing the web map client configuration
defaultConfig - default map client configuration
Returns:
instance of WMSClientConfiguration
Throws:
XMLParsingException

createKnownWMS

private java.util.HashMap createKnownWMS(org.w3c.dom.Element knownWMSE)
                                  throws XMLParsingException
creates a HashMap with the id of the WMS known by the client as a key and the URL to its capabilities as value

Parameters:
knownWMSE - element of the client configuration
Returns:
HashMap of known WMS
Throws:
XMLParsingException

createOfferedMapSizes

private MapSize[] createOfferedMapSizes(org.w3c.dom.Element mapSizes)
                                 throws XMLParsingException
creates a list of available map sizes for the client. If no offered map size is defined in the client configuration document the default map size of 600x400 will be created.

Parameters:
mapSizes - element of the configuration
Returns:
list of offered map sizes
Throws:
XMLParsingException

createOfferedMapFormats

private Format[] createOfferedMapFormats(org.w3c.dom.Element mapFormats)
                                  throws XMLParsingException
Creates a list of the map/images formats offered by the client. If no format is given in the configuration document 'image/jpeg' will be used as default

Parameters:
mapFormats - element of the configuration
Returns:
list of offered map/image formats
Throws:
XMLParsingException

createOfferedMapOperations

private MapOperation[] createOfferedMapOperations(org.w3c.dom.Element mapOperations)
                                           throws XMLParsingException
returns a list of the map operations (zoomin, zoomout, pan etc.) offered by the client

Parameters:
mapOperations - element of the configuration
Returns:
list of MapOperations
Throws:
XMLParsingException

createOfferedMapOperationFactors

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

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

createInitialGetMapRequest

private WMSGetMapRequest createInitialGetMapRequest(org.w3c.dom.Element initMapReq)
                                             throws XMLParsingException
Parameters:
initMapReq -
Returns:
Throws:
XMLParsingException

createProject

private Project createProject(org.w3c.dom.Element projectElement)
                       throws XMLParsingException
creates a predefined project that can be invoked by the client

Throws:
XMLParsingException

main

public static void main(java.lang.String[] args)