org.deegree_impl.services.wms.capabilities
Class DeegreeWMSCapabilitiesFactory

java.lang.Object
  extended byorg.deegree_impl.services.wms.capabilities.OGCWMSCapabilitiesFactory
      extended byorg.deegree_impl.services.wms.capabilities.DeegreeWMSCapabilitiesFactory

public class DeegreeWMSCapabilitiesFactory
extends OGCWMSCapabilitiesFactory

Factory class for creating WMS capability classes from WMS capabilities XML documents that comply to the deegree WMS 1.1.1 specification.

Version:
$Revision: 1.45 $ $Date: 2004/05/10 08:41:07 $
Author:
Markus Schneider

Field Summary
private  java.lang.String deegreeRoot
           
private  java.net.URL defaultOnlineResource
           
private  java.util.HashMap owsMap
           
 
Fields inherited from class org.deegree_impl.services.wms.capabilities.OGCWMSCapabilitiesFactory
capabilities, collectedLayers, ogcNS, version, wfsNS, wmsNS, xlnNS
 
Constructor Summary
DeegreeWMSCapabilitiesFactory()
           
 
Method Summary
protected  LayerBoundingBox createBoundingBox(GM_Envelope llBBox, java.lang.String crs)
          creates a LayerBoundingBox with a CRS othe than EPSG:4326 instance from the passed LatLonBoundingBox and the desired CRS
protected  WMSCapabilities createCapabilities(org.w3c.dom.Element element)
          Creates a WMSCapabilities-instance according to the contents of the DOM-subtree starting at the given 'WMT_MS_Capabilities'-Element.
protected  Capability createCapability(org.w3c.dom.Element element)
          Creates a Capability-instance according to the contents of the DOM-subtree starting at the given 'Capability'-Element.
protected  DataSource createDataSource(org.w3c.dom.Element element, java.lang.String dfName, ScaleHint dfScaleHint)
          Creates a DataSource-instance according to the contents of the DOM-subtree starting at the given 'DataSource'-Element.
protected  DeegreeParam createDeegreeParam(org.w3c.dom.Element element)
          Creates a DeegreeParam-instance according to the contents of the DOM-subtree starting at the given 'DeegreeParam'-Element.
private  Style createDefaultStyle(java.lang.String layerName, LegendURL[] lURL)
          creates a default style for the submitted layer name.
private  GazetteerParam createGazetteerParameter(org.w3c.dom.Element element)
          creates an object that describes the access to a gazetteer if one have been defined at the section of the capabilities/configuration
private  Operation createGetCapabilities()
          Creates the default 'GetCapabilities'-Operation to be used if it not defined in the capabilities-document.
private  Operation createGetFeatureInfo()
          Creates the default 'GetFeatureInfo'-Operation to be used if it not defined in the capabilities-document.
private  Operation createGetMap()
          Creates the default 'GetMap'-Operation to be used if it not defined.
protected  GM_Envelope createLatLonBoundingBox(LayerBoundingBox box)
          creates a GM_Envelope with lat/lon coordinates from the passed LayerBoundingBox by transforming the corner coordinates to EPSG:4326.
protected  Layer createLayer(org.w3c.dom.Element element, GM_Envelope bbox)
          Creates a Layer-instance according to the contents of the DOM-subtree starting at the given 'Layer'-Element.
protected  LegendURL createLegendURL(org.w3c.dom.Element element, java.lang.String styleName)
          Creates a LegendURL-instance according to the contents of the DOM-subtree starting at the given 'LegendURL'-Element.
protected  java.net.URL createOnlineResource(org.w3c.dom.Element element)
          Creates an URL-instance according to the contents of the DOM-subtree starting at the given 'OnlineResource'-Element.
protected  Operation createOperation(org.w3c.dom.Element element)
          Creates an Operation-instance according to the contents of the DOM-subtree starting at the given Element.
private  Proxy createProxy(org.w3c.dom.Element proxyElement)
          creates a Proxy instance from the passed Element encapsulating the proxy address to be used with the WMS
protected  Request createRequest(org.w3c.dom.Element element)
          Creates a Request-instance according to the contents of the DOM-subtree starting at the given 'Request'-Element.
protected  Style createStyle(org.w3c.dom.Element element, java.lang.String layerName)
          Creates a Style-instance according to the contents of the DOM-subtree starting at the given 'Style'-Element.
private  java.util.HashMap toMap(java.lang.String request, java.util.HashMap map)
          puts a http-GET request to a HashMap
 
Methods inherited from class org.deegree_impl.services.wms.capabilities.OGCWMSCapabilitiesFactory
createAttribution, createAuthorityURL, createBoundingBox, createCapabilities, createCapabilities, createContactAddress, createContactInformation, createContactPersonPrimary, createDataURL, createDCPType, createDimension, createException, createExtent, createFeatureListURL, createIdentifier, createLatLonBoundingBox, createLayer, createLegendURL, createLogoURL, createMetadataURL, createScaleHint, createService, createStyle, createStyleSheetURL, createStyleURL, createUserDefinedSymbolization, createVendorSpecificCapabilities
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

deegreeRoot

private java.lang.String deegreeRoot

defaultOnlineResource

private java.net.URL defaultOnlineResource

owsMap

private java.util.HashMap owsMap
Constructor Detail

DeegreeWMSCapabilitiesFactory

public DeegreeWMSCapabilitiesFactory()
Method Detail

createCapabilities

protected WMSCapabilities createCapabilities(org.w3c.dom.Element element)
                                      throws XMLParsingException
Creates a WMSCapabilities-instance according to the contents of the DOM-subtree starting at the given 'WMT_MS_Capabilities'-Element.

Overrides:
createCapabilities in class OGCWMSCapabilitiesFactory
Parameters:
element - the 'WMT_MS_Capabilities'-Element
Returns:
the constructed WMSCapabilities-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createDeegreeParam

protected DeegreeParam createDeegreeParam(org.w3c.dom.Element element)
                                   throws XMLParsingException
Creates a DeegreeParam-instance according to the contents of the DOM-subtree starting at the given 'DeegreeParam'-Element.

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

createGazetteerParameter

private GazetteerParam createGazetteerParameter(org.w3c.dom.Element element)
                                         throws XMLParsingException
creates an object that describes the access to a gazetteer if one have been defined at the section of the capabilities/configuration

Throws:
XMLParsingException

createProxy

private Proxy createProxy(org.w3c.dom.Element proxyElement)
                   throws XMLParsingException
creates a Proxy instance from the passed Element encapsulating the proxy address to be used with the WMS

Throws:
XMLParsingException

createCapability

protected Capability createCapability(org.w3c.dom.Element element)
                               throws XMLParsingException
Creates a Capability-instance according to the contents of the DOM-subtree starting at the given 'Capability'-Element.

Overrides:
createCapability in class OGCWMSCapabilitiesFactory
Parameters:
element - the 'Capability'-Element
Returns:
the constructed Capability-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createRequest

protected Request createRequest(org.w3c.dom.Element element)
                         throws XMLParsingException
Creates a Request-instance according to the contents of the DOM-subtree starting at the given 'Request'-Element.

Overrides:
createRequest in class OGCWMSCapabilitiesFactory
Parameters:
element - the 'Request'-Element
Returns:
the constructed Request-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createOperation

protected Operation createOperation(org.w3c.dom.Element element)
                             throws XMLParsingException
Creates an Operation-instance according to the contents of the DOM-subtree starting at the given Element.

Overrides:
createOperation in class OGCWMSCapabilitiesFactory
Parameters:
element - the Element that describes an Operation
Returns:
the constructed Operation-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createOnlineResource

protected java.net.URL createOnlineResource(org.w3c.dom.Element element)
                                     throws XMLParsingException
Creates an URL-instance according to the contents of the DOM-subtree starting at the given 'OnlineResource'-Element.

Overrides:
createOnlineResource in class OGCWMSCapabilitiesFactory
Parameters:
element - the 'OnlineResource'-Element
Returns:
the constructed URL-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createLayer

protected Layer createLayer(org.w3c.dom.Element element,
                            GM_Envelope bbox)
                     throws XMLParsingException
Creates a Layer-instance according to the contents of the DOM-subtree starting at the given 'Layer'-Element.

Parameters:
element - the 'Layer'-Element
bbox - latlon bounding box of the parent layer
Returns:
the constructed Layer/tt>-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createLatLonBoundingBox

protected GM_Envelope createLatLonBoundingBox(LayerBoundingBox box)
                                       throws XMLParsingException
creates a GM_Envelope with lat/lon coordinates from the passed LayerBoundingBox by transforming the corner coordinates to EPSG:4326.

Parameters:
box - LayerBoundingBox
Returns:
GM_Envelope with lat/lon coordinates
Throws:
XMLParsingException

createBoundingBox

protected LayerBoundingBox createBoundingBox(GM_Envelope llBBox,
                                             java.lang.String crs)
                                      throws XMLParsingException
creates a LayerBoundingBox with a CRS othe than EPSG:4326 instance from the passed LatLonBoundingBox and the desired CRS

Parameters:
llBBox - latlon Bounding Box
crs - desired target CRS for the returned LayerBoundingBox
Returns:
LayerBoundingBox in the desired CRS
Throws:
XMLParsingException

createDefaultStyle

private Style createDefaultStyle(java.lang.String layerName,
                                 LegendURL[] lURL)
                          throws XMLParsingException
creates a default style for the submitted layer name. If the submitted LegendURL != null it will be used in the style definition

Parameters:
layerName - name of the layer to create a default style for
lURL - LegendURL to be used for style if not null
Throws:
XMLParsingException

createStyle

protected Style createStyle(org.w3c.dom.Element element,
                            java.lang.String layerName)
                     throws XMLParsingException
Creates a Style-instance according to the contents of the DOM-subtree starting at the given 'Style'-Element.

Parameters:
element - the 'Style'-Element
layerName - name of the layer the style belongs to
Returns:
the constructed Style/tt>-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createDataSource

protected DataSource createDataSource(org.w3c.dom.Element element,
                                      java.lang.String dfName,
                                      ScaleHint dfScaleHint)
                               throws XMLParsingException
Creates a DataSource-instance according to the contents of the DOM-subtree starting at the given 'DataSource'-Element.

This is a deegree-specific parameter!

Parameters:
element - the 'DataSource'-Element
dfName - default name to be used if missing (same as name of layer)
dfScaleHint - default value to be used if missing
Returns:
the constructed DataSource/tt>-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

toMap

private java.util.HashMap toMap(java.lang.String request,
                                java.util.HashMap map)
puts a http-GET request to a HashMap


createLegendURL

protected LegendURL createLegendURL(org.w3c.dom.Element element,
                                    java.lang.String styleName)
                             throws XMLParsingException
Creates a LegendURL-instance according to the contents of the DOM-subtree starting at the given 'LegendURL'-Element.

Parameters:
element - the 'LegendURL'-Element
styleName - name of the currently processed style
Returns:
the constructed LegendURL/tt>-instance
Throws:
XMLParsingException - if a syntactic or semantic error in the DOM-subtree is encountered

createGetMap

private Operation createGetMap()
Creates the default 'GetMap'-Operation to be used if it not defined. defined in the capabilities-document

Returns:
default 'GetMap'-Operation

createGetFeatureInfo

private Operation createGetFeatureInfo()
                                throws XMLParsingException
Creates the default 'GetFeatureInfo'-Operation to be used if it not defined in the capabilities-document.

Returns:
default 'GetFeatureInfo'-Operation
Throws:
XMLParsingException

createGetCapabilities

private Operation createGetCapabilities()
Creates the default 'GetCapabilities'-Operation to be used if it not defined in the capabilities-document.

Returns:
default 'GetCapabilities'-Operation