Java Doc for XMLConfigReader.java in  » GIS » GeoServer » org » vfny » geoserver » global » xml » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoServer » org.vfny.geoserver.global.xml 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.vfny.geoserver.global.xml.XMLConfigReader

XMLConfigReader
public class XMLConfigReader (Code)
XMLConfigReader purpose.

Description of XMLConfigReader Static class to load a configuration org.vfny.geoserver.global.dto

Example Use:


 ModelConfig m = XMLConfigReader.load(new File("/conf/"));
 


author:
   dzwiers, Refractions Research, Inc.
version:
   $Id: XMLConfigReader.java 8443 2008-02-25 13:18:59Z groldan $


Field Summary
 ServletContextcontext
    

Constructor Summary
protected  XMLConfigReader(ServletContext context)
     XMLConfigReader constructor.
public  XMLConfigReader(File root, ServletContext context)
    

This method loads the config files from the specified directory into a ModelConfig.


Method Summary
public  DataDTOgetData()
     getData purpose.
public  GeoServerDTOgetGeoServer()
     getGeoServer purpose.
protected  ListgetKeyWords(Element keywordsElem)
     getKeyWords purpose.

Converts a DOM tree into a List of Strings representing keywords.


Parameters:
  keywordsElem - a DOM tree to convert into a List of Strings representingkeywords.
protected  LevelgetLoggingLevel(Element globalConfigElem)
     getLoggingLevel purpose.
public static  MetaDataLinkgetMetaDataLink(Element metadataElem)
     getMetaDataLink purpose.

Used to help with XML manipulations.

public  WCSDTOgetWcs()
     getWcs purpose.
public  WFSDTOgetWfs()
     getWfs purpose.
public  WMSDTOgetWms()
     getWms purpose.
protected static  booleanisInfoFile(File testFile)
     isInfoFile purpose.

Used to perform safety checks on info.xml file handles.


Parameters:
  testFile - The file to test.
public  booleanisInitialized()
    
protected  voidload()
     load purpose.
protected  EnvelopeloadBBox(Element bboxElem)
     loadLatLongBBox purpose.

Converts a DOM tree into a Envelope object.


Parameters:
  bboxElem - a DOM tree to convert into a Envelope object.
protected  voidloadCatalog(File catalogFile, File featureTypeDir, File styleDir, File coverageDir)
     loadCatalog purpose.
protected  MaploadConnectionParams(Element connElem)
     loadConnectionParams purpose.

Converts a DOM tree into a Map of Strings which represent connection parameters.


Parameters:
  connElem - a DOM tree to convert into a Map of Strings which representconnection parameters.
protected  ContactDTOloadContact(Element contactInfoElement)
     loadContact purpose.

Converts a DOM tree into a ContactConfig


Parameters:
  contactInfoElement - a DOM tree to convert into a ContactConfig.
protected  CoverageInfoDTOloadCoverage(File infoFile)
     This method loads the coverage information DTO from an info.xml file on the disk.
protected  CoverageInfoDTOloadCoverageDTOFromXML(Element coverageRoot)
     Creation of a DTo cfron an info.xml file for a coverage.
protected  MaploadCoverages(File coverageRoot)
     This method loads all the coverages present under the geoserver data directory in a Map by using their respective DTOs.
protected  DataStoreInfoDTOloadDataStore(Element dsElem)
     loadDataStore purpose.

Converts a DOM tree into a DataStoreInfo object.


Parameters:
  dsElem - a DOM tree to convert into a DataStoreInfo object.
protected  MaploadDataStores(Element dsRoot)
     loadDataStores purpose.

Converts a DOM tree into a Map of DataStores.


Parameters:
  dsRoot - a DOM tree to convert into a Map of DataStores.
protected  FilterloadDefinitionQuery(Element typeRoot)
     loadDefinitionQuery purpose.

Converts a DOM tree into a Filter object.


Parameters:
  typeRoot - a DOM tree to convert into a Filter object.
protected  InternationalString[]loadDimensionNames(Element gridElem)
    
protected  CoverageDimension[]loadDimensions(NodeList dimElems)
    
protected  GeneralEnvelopeloadEnvelope(Element envelopeElem, CoordinateReferenceSystem crs)
     Loading the envelope for this coverage from the info.xml file.
protected  FeatureTypeInfoDTOloadFeature(File infoFile)
     Load FeatureTypeInfoDTO from a directory.

Expected directory structure:

  • info.xml - required
  • schema.xml - optional

If a schema.xml file is not used, the information may be generated from a FeatureType using DataTransferObjectFactory.


Parameters:
  infoFile - a File to convert into a FeatureTypeInfo object.
protected  FeatureTypeInfoDTOloadFeaturePt2(Element fTypeRoot)
     loadFeaturePt2 purpose.

Converts a DOM tree into a FeatureTypeInfo object.


Parameters:
  fTypeRoot - a DOM tree to convert into a FeatureTypeInfo object.
protected  MaploadFeatureTypes(File featureTypeRoot)
     Load map of FeatureTypeDTO instances from a directory.
protected  CoverageStoreInfoDTOloadFormat(Element fmElem)
     loadFormat purpose.

Converts a DOM tree into a CoverageStoreInfo object.


Parameters:
  fmElem - a DOM tree to convert into a CoverageStoreInfo object.
protected  MaploadFormats(Element fmRoot)
     loadFormats purpose.

Converts a DOM tree into a Map of Formats.


Parameters:
  fmRoot - a DOM tree to convert into a Map of Formats.
protected  voidloadGlobal(Element globalElem)
     loadGlobal purpose.
protected  GridGeometryloadGrid(Element gridElem, GeneralEnvelope envelope, CoordinateReferenceSystem crs)
     This method is in charge for loading the grid geometry for this coverage's info.xml file.
protected  MetaDataLinkloadMetaDataLink(Element metalinkRoot)
    
protected  MaploadNameSpaces(Element nsRoot)
     loadNameSpaces purpose.

Converts a DOM tree into a Map of NameSpaces.


Parameters:
  nsRoot - a DOM tree to convert into a Map of NameSpaces.
protected  voidloadSchema(File schemaFile, FeatureTypeInfoDTO dto)
     Process schema File for a list of AttributeTypeInfoDTO.
protected  ServiceDTOloadService(Element serviceRoot)
     loadService purpose.

Converts a DOM tree into a ServiceDTO object.


Parameters:
  serviceRoot - a DOM tree to convert into a ServiceDTO object.
protected  voidloadServices(File configFile)
     loadServices purpose.
protected  MaploadStyles(Element stylesElem, File baseDir)
     loadStyles purpose.
protected  voidloadWCS(Element wcsElement)
     loadWCS purpose.
protected  voidloadWFS(Element wfsElement)
     loadWFS purpose.
protected  voidloadWMS(Element wmsElement)
     loadWMS purpose.
public static  voidprocessSchema(Element elem, FeatureTypeInfoDTO featureTypeInfoDTO)
     Process schema DOM for a list of AttributeTypeInfoDTO.
protected  voidsetDefaultNS()
     setDefaultNS purpose.

Finds and sets the default namespace.


Field Detail
context
ServletContext context(Code)
the servlet context *




Constructor Detail
XMLConfigReader
protected XMLConfigReader(ServletContext context)(Code)
XMLConfigReader constructor.

Should never be called.




XMLConfigReader
public XMLConfigReader(File root, ServletContext context) throws ConfigurationException(Code)

This method loads the config files from the specified directory into a ModelConfig. If the path is incorrect, or the directory is formed correctly, a ConfigException will be thrown and/or null returned.

The config directory is as follows:

  • ./WEB-INF/catalog.xml
  • ./WEB-INF/services.xml
  • ./data/featuretypes/ /info.xml
  • ./data/featuretypes/ /schema.xml


Parameters:
  root - A directory which contains the config files.
throws:
  ConfigurationException - When an error occurs.




Method Detail
getData
public DataDTO getData()(Code)
getData purpose.

Description ...




getGeoServer
public GeoServerDTO getGeoServer()(Code)
getGeoServer purpose.

Description ...




getKeyWords
protected List getKeyWords(Element keywordsElem)(Code)
getKeyWords purpose.

Converts a DOM tree into a List of Strings representing keywords.


Parameters:
  keywordsElem - a DOM tree to convert into a List of Strings representingkeywords. A complete List of Strings representing keywords loaded from theDOM tree provided.



getLoggingLevel
protected Level getLoggingLevel(Element globalConfigElem) throws ConfigurationException(Code)
getLoggingLevel purpose.

Parses the LoggingLevel from a DOM tree and converts the level into a Level Object.


Parameters:
  globalConfigElem - The logging Level
throws:
  ConfigurationException - When an error occurs.



getMetaDataLink
public static MetaDataLink getMetaDataLink(Element metadataElem) throws Exception(Code)
getMetaDataLink purpose.

Used to help with XML manipulations. Returns a metedataLink Attribute


Parameters:
  metadataElem - The root element to look for children in. The MetaDataLink that was found.
throws:
  Exception -



getWcs
public WCSDTO getWcs()(Code)
getWcs purpose.

Description ...




getWfs
public WFSDTO getWfs()(Code)
getWfs purpose.

Description ...




getWms
public WMSDTO getWms()(Code)
getWms purpose.

Description ...




isInfoFile
protected static boolean isInfoFile(File testFile)(Code)
isInfoFile purpose.

Used to perform safety checks on info.xml file handles.


Parameters:
  testFile - The file to test. true if the file is an info.xml file.



isInitialized
public boolean isInitialized()(Code)



load
protected void load() throws ConfigurationException(Code)
load purpose.

Main load routine, sets up file handles for various other portions of the load procedure.


throws:
  ConfigurationException -



loadBBox
protected Envelope loadBBox(Element bboxElem) throws ConfigurationException(Code)
loadLatLongBBox purpose.

Converts a DOM tree into a Envelope object.


Parameters:
  bboxElem - a DOM tree to convert into a Envelope object. A complete Envelope object loaded from the DOM tree provided.
throws:
  ConfigurationException - When an error occurs.



loadCatalog
protected void loadCatalog(File catalogFile, File featureTypeDir, File styleDir, File coverageDir) throws ConfigurationException(Code)
loadCatalog purpose.

loads catalog.xml into memory with the assistance of other class methods.


Parameters:
  catalogFile - catalog.xml
Parameters:
  featureTypeDir - the directory containing the info.xml files for thefeaturetypes.
throws:
  ConfigurationException - When an error occurs.



loadConnectionParams
protected Map loadConnectionParams(Element connElem) throws ConfigurationException(Code)
loadConnectionParams purpose.

Converts a DOM tree into a Map of Strings which represent connection parameters.


Parameters:
  connElem - a DOM tree to convert into a Map of Strings which representconnection parameters. A complete Map of Strings which represent connection parametersloaded from the DOM tree provided.
throws:
  ConfigurationException - When an error occurs.



loadContact
protected ContactDTO loadContact(Element contactInfoElement) throws ConfigurationException(Code)
loadContact purpose.

Converts a DOM tree into a ContactConfig


Parameters:
  contactInfoElement - a DOM tree to convert into a ContactConfig. The resulting ContactConfig object from the DOM tree.
throws:
  ConfigurationException - When an error occurs.



loadCoverage
protected CoverageInfoDTO loadCoverage(File infoFile) throws ConfigurationException(Code)
This method loads the coverage information DTO from an info.xml file on the disk.
Parameters:
  infoFile -
throws:
  ConfigurationException -



loadCoverageDTOFromXML
protected CoverageInfoDTO loadCoverageDTOFromXML(Element coverageRoot) throws ConfigurationException(Code)
Creation of a DTo cfron an info.xml file for a coverage.
Parameters:
  coverageRoot -
throws:
  ConfigurationException -



loadCoverages
protected Map loadCoverages(File coverageRoot) throws ConfigurationException(Code)
This method loads all the coverages present under the geoserver data directory in a Map by using their respective DTOs.
See Also:   XMLConfigReader.loadCoverage(File)
Parameters:
  coverageRoot -
throws:
  ConfigurationException -



loadDataStore
protected DataStoreInfoDTO loadDataStore(Element dsElem) throws ConfigurationException(Code)
loadDataStore purpose.

Converts a DOM tree into a DataStoreInfo object.


Parameters:
  dsElem - a DOM tree to convert into a DataStoreInfo object. A complete DataStoreInfo object loaded from the DOM treeprovided.
throws:
  ConfigurationException - When an error occurs.



loadDataStores
protected Map loadDataStores(Element dsRoot) throws ConfigurationException(Code)
loadDataStores purpose.

Converts a DOM tree into a Map of DataStores.


Parameters:
  dsRoot - a DOM tree to convert into a Map of DataStores. A complete Map of DataStores loaded from the DOM tree provided.
throws:
  ConfigurationException - When an error occurs.



loadDefinitionQuery
protected Filter loadDefinitionQuery(Element typeRoot) throws ConfigurationException(Code)
loadDefinitionQuery purpose.

Converts a DOM tree into a Filter object.


Parameters:
  typeRoot - a DOM tree to convert into a Filter object. A complete Filter object loaded from the DOM tree provided.
throws:
  ConfigurationException - When an error occurs.



loadDimensionNames
protected InternationalString[] loadDimensionNames(Element gridElem) throws ConfigurationException(Code)

Parameters:
  gridElem -
throws:
  ConfigurationException -



loadDimensions
protected CoverageDimension[] loadDimensions(NodeList dimElems) throws ConfigurationException(Code)



loadEnvelope
protected GeneralEnvelope loadEnvelope(Element envelopeElem, CoordinateReferenceSystem crs) throws ConfigurationException(Code)
Loading the envelope for this coverage from the info.xml file.
Parameters:
  envelopeElem -
throws:
  ConfigurationException -



loadFeature
protected FeatureTypeInfoDTO loadFeature(File infoFile) throws ConfigurationException(Code)
Load FeatureTypeInfoDTO from a directory.

Expected directory structure:

  • info.xml - required
  • schema.xml - optional

If a schema.xml file is not used, the information may be generated from a FeatureType using DataTransferObjectFactory.


Parameters:
  infoFile - a File to convert into a FeatureTypeInfo object. (info.xml) A complete FeatureTypeInfo object loaded from the File handleprovided.
throws:
  ConfigurationException - When an error occurs.
throws:
  IllegalArgumentException - DOCUMENT ME!
See Also:    loadFeaturePt2(Element)



loadFeaturePt2
protected FeatureTypeInfoDTO loadFeaturePt2(Element fTypeRoot) throws ConfigurationException(Code)
loadFeaturePt2 purpose.

Converts a DOM tree into a FeatureTypeInfo object.


Parameters:
  fTypeRoot - a DOM tree to convert into a FeatureTypeInfo object. A complete FeatureTypeInfo object loaded from the DOM treeprovided.
throws:
  ConfigurationException - When an error occurs.



loadFeatureTypes
protected Map loadFeatureTypes(File featureTypeRoot) throws ConfigurationException(Code)
Load map of FeatureTypeDTO instances from a directory.

Expected directory structure:

  • rootDir
  • rootDir/featureType1/info.xml - required
  • rootDir/featureType1/schema.xml - optional
  • rootDir/featureType2/info.xml - required
  • rootDir/featureType2/schema.xml - optional

If a schema.xml file is not used, the information may be generated from a FeatureType using DataTransferObjectFactory.


Parameters:
  featureTypeRoot - Root FeatureType directory Map of FeatureTypeInfoDTO by dataStoreId:typeName
throws:
  ConfigurationException - When an error occurs.
throws:
  IllegalArgumentException - DOCUMENT ME!



loadFormat
protected CoverageStoreInfoDTO loadFormat(Element fmElem) throws ConfigurationException(Code)
loadFormat purpose.

Converts a DOM tree into a CoverageStoreInfo object.


Parameters:
  fmElem - a DOM tree to convert into a CoverageStoreInfo object. A complete CoverageStoreInfo object loaded from the DOM treeprovided.
throws:
  ConfigurationException - When an error occurs.



loadFormats
protected Map loadFormats(Element fmRoot) throws ConfigurationException(Code)
loadFormats purpose.

Converts a DOM tree into a Map of Formats.


Parameters:
  fmRoot - a DOM tree to convert into a Map of Formats. A complete Map of Formats loaded from the DOM tree provided.
throws:
  ConfigurationException - When an error occurs.



loadGlobal
protected void loadGlobal(Element globalElem) throws ConfigurationException(Code)
loadGlobal purpose.

Converts a DOM tree into a GlobalData configuration.


Parameters:
  globalElem - A DOM tree representing a complete global configuration.
throws:
  ConfigurationException - When an error occurs.



loadGrid
protected GridGeometry loadGrid(Element gridElem, GeneralEnvelope envelope, CoordinateReferenceSystem crs) throws ConfigurationException, FactoryException(Code)
This method is in charge for loading the grid geometry for this coverage's info.xml file.
Parameters:
  gridElem -
Parameters:
  envelope -
Parameters:
  crs -
throws:
  ConfigurationException -



loadMetaDataLink
protected MetaDataLink loadMetaDataLink(Element metalinkRoot)(Code)



loadNameSpaces
protected Map loadNameSpaces(Element nsRoot) throws ConfigurationException(Code)
loadNameSpaces purpose.

Converts a DOM tree into a Map of NameSpaces.


Parameters:
  nsRoot - a DOM tree to convert into a Map of NameSpaces. A complete Map of NameSpaces loaded from the DOM tree provided.
throws:
  ConfigurationException - When an error occurs.



loadSchema
protected void loadSchema(File schemaFile, FeatureTypeInfoDTO dto) throws ConfigurationException(Code)
Process schema File for a list of AttributeTypeInfoDTO.

The provided FeatureTypeInfoDTO will be updated with the schemaBase.


Parameters:
  schemaFile - File containing schema definition
Parameters:
  dto - Schema DOM element
throws:
  ConfigurationException -



loadService
protected ServiceDTO loadService(Element serviceRoot) throws ConfigurationException(Code)
loadService purpose.

Converts a DOM tree into a ServiceDTO object.


Parameters:
  serviceRoot - a DOM tree to convert into a ServiceDTO object. A complete ServiceDTO object loaded from the DOM tree provided.
throws:
  ConfigurationException - When an error occurs.



loadServices
protected void loadServices(File configFile) throws ConfigurationException(Code)
loadServices purpose.

loads services.xml into memory with the assistance of other class methods.


Parameters:
  configFile - services.xml
throws:
  ConfigurationException - When an error occurs.



loadStyles
protected Map loadStyles(Element stylesElem, File baseDir) throws ConfigurationException(Code)
loadStyles purpose.

Converts a DOM tree into a Map of Styles.


Parameters:
  stylesElem - a DOM tree to convert into a Map of Styles.
Parameters:
  baseDir - DOCUMENT ME! A complete Map of Styles loaded from the DOM tree provided.
throws:
  ConfigurationException - When an error occurs.



loadWCS
protected void loadWCS(Element wcsElement) throws ConfigurationException(Code)
loadWCS purpose.

Converts a DOM tree into a WCS object.


Parameters:
  wfsElement - a DOM tree to convert into a WCS object.
throws:
  ConfigurationException - When an error occurs.
See Also:   GlobalData.getBaseUrl



loadWFS
protected void loadWFS(Element wfsElement) throws ConfigurationException(Code)
loadWFS purpose.

Converts a DOM tree into a WFS object.


Parameters:
  wfsElement - a DOM tree to convert into a WFS object.
throws:
  ConfigurationException - When an error occurs.
See Also:   GlobalData.getBaseUrl



loadWMS
protected void loadWMS(Element wmsElement) throws ConfigurationException(Code)
loadWMS purpose.

Converts a DOM tree into a WMS object.


Parameters:
  wmsElement - a DOM tree to convert into a WMS object.
throws:
  ConfigurationException - When an error occurs.
See Also:   GlobalData.getBaseUrl



processSchema
public static void processSchema(Element elem, FeatureTypeInfoDTO featureTypeInfoDTO) throws ConfigurationException(Code)
Process schema DOM for a list of AttributeTypeInfoDTO.

The provided FeatureTypeInfoDTO will be updated with the schemaBase.


Parameters:
  elem - Schema DOM element
Parameters:
  featureTypeInfoDTO -
throws:
  ConfigurationException -



setDefaultNS
protected void setDefaultNS()(Code)
setDefaultNS purpose.

Finds and sets the default namespace. The namespaces in catalog must already be loaded.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.