Source Code Cross Referenced for ManifestDocument.java in  » GIS » deegree » org » deegree » owscommon_1_1_0 » 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 » deegree » org.deegree.owscommon_1_1_0 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //$HeadURL: $
002:        /*----------------    FILE HEADER  ------------------------------------------
003:         This file is part of deegree.
004:         Copyright (C) 2001-2008 by:
005:         Department of Geography, University of Bonn
006:         http://www.giub.uni-bonn.de/deegree/
007:         lat/lon GmbH
008:         http://www.lat-lon.de
009:
010:         This library is free software; you can redistribute it and/or
011:         modify it under the terms of the GNU Lesser General Public
012:         License as published by the Free Software Foundation; either
013:         version 2.1 of the License, or (at your option) any later version.
014:         This library is distributed in the hope that it will be useful,
015:         but WITHOUT ANY WARRANTY; without even the implied warranty of
016:         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017:         Lesser General Public License for more details.
018:         You should have received a copy of the GNU Lesser General Public
019:         License along with this library; if not, write to the Free Software
020:         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
021:         Contact:
022:
023:         Andreas Poth
024:         lat/lon GmbH
025:         Aennchenstr. 19
026:         53177 Bonn
027:         Germany
028:         E-Mail: poth@lat-lon.de
029:
030:         Prof. Dr. Klaus Greve
031:         Department of Geography
032:         University of Bonn
033:         Meckenheimer Allee 166
034:         53115 Bonn
035:         Germany
036:         E-Mail: greve@giub.uni-bonn.de
037:         ---------------------------------------------------------------------------*/
038:
039:        package org.deegree.owscommon_1_1_0;
040:
041:        import static org.deegree.framework.xml.XMLTools.getElements;
042:        import static org.deegree.framework.xml.XMLTools.getNodeAsString;
043:        import static org.deegree.framework.xml.XMLTools.getNodesAsStringList;
044:        import static org.deegree.framework.xml.XMLTools.getRequiredElements;
045:        import static org.deegree.ogcbase.CommonNamespaces.XLINK_PREFIX;
046:
047:        import java.util.ArrayList;
048:        import java.util.List;
049:
050:        import org.deegree.framework.log.ILogger;
051:        import org.deegree.framework.log.LoggerFactory;
052:        import org.deegree.framework.util.Pair;
053:        import org.deegree.framework.xml.XMLParsingException;
054:        import org.deegree.i18n.Messages;
055:        import org.w3c.dom.Element;
056:
057:        /**
058:         * <code>ManifestDocument</code> supplies methods for the parsing of a manifest type in ows 1.1.0.
059:         * 
060:         * @author <a href="mailto:bezema@lat-lon.de">Rutger Bezema</a>
061:         * 
062:         * @author last edited by: $Author:$
063:         * 
064:         * @version $Revision:$, $Date:$
065:         * 
066:         */
067:        public class ManifestDocument extends CommonsDocument {
068:            /**
069:             * 
070:             */
071:            private static final long serialVersionUID = -7314461220886459179L;
072:
073:            private static ILogger LOG = LoggerFactory
074:                    .getLogger(ManifestDocument.class);
075:
076:            /**
077:             * @param manifestElement
078:             *            to parse the data from
079:             * @return the manifest bean or <code>null</code> if the given element is <code>null</code>.
080:             * @throws XMLParsingException
081:             *             if a parsing error occurred.
082:             */
083:            public Manifest parseManifestType(Element manifestElement)
084:                    throws XMLParsingException {
085:                if (manifestElement == null) {
086:                    return null;
087:                }
088:                BasicIdentification basicManifestIdentification = parseBasicIdentificationType(manifestElement);
089:                List<Element> referenceGroupElements = getRequiredElements(
090:                        manifestElement, PRE_OWS + "ReferenceGroup", nsContext);
091:                List<ReferenceGroup> referenceGroup = new ArrayList<ReferenceGroup>();
092:                for (Element elem : referenceGroupElements) {
093:                    ReferenceGroup tmp = parseReferenceGroup(elem);
094:                    if (tmp != null) {
095:                        referenceGroup.add(tmp);
096:                    }
097:                }
098:                return new Manifest(basicManifestIdentification, referenceGroup);
099:            }
100:
101:            /**
102:             * @param referenceGroup to be parsed
103:             * @return the bean representation or <code>null</code> if the given element is <code>null</code>.
104:             * @throws XMLParsingException if the element could not be parsed.
105:             */
106:            protected ReferenceGroup parseReferenceGroup(Element referenceGroup)
107:                    throws XMLParsingException {
108:                if (referenceGroup == null) {
109:                    return null;
110:                }
111:                BasicIdentification basicRGId = parseBasicIdentificationType(referenceGroup);
112:                List<Element> referenceElements = getElements(referenceGroup,
113:                        PRE_OWS + "Reference", nsContext);
114:                List<Reference> references = new ArrayList<Reference>();
115:                if (referenceElements == null || referenceElements.size() == 0) {
116:                    LOG
117:                            .logWarning(Messages
118:                                    .getMessage("WCTS_REFERENCE_SUBSTITION_NOT_SUPPORTED"));
119:                } else {
120:                    for (Element refElement : referenceElements) {
121:                        Reference tmp = parseReferenceType(refElement);
122:                        if (tmp != null) {
123:                            references.add(tmp);
124:                        }
125:                    }
126:                }
127:                return new ReferenceGroup(basicRGId, references);
128:
129:            }
130:
131:            /**
132:             * @param referenceElement to be parsed.
133:             * @return the bean representation or <code>null</code> if the given element is <code>null</code>.
134:             * @throws XMLParsingException if the element could not be parsed.
135:             */
136:            protected Reference parseReferenceType(Element referenceElement)
137:                    throws XMLParsingException {
138:                if (referenceElement == null) {
139:                    return null;
140:                }
141:                String hrefAttribute = referenceElement.getAttributeNS(XLNNS
142:                        .toASCIIString(), "href");
143:                if (hrefAttribute == null || "".equals(hrefAttribute.trim())) {
144:                    throw new XMLParsingException(Messages.getMessage(
145:                            "OWS_MISSING_REQUIRED_ATTRIBUTE", XLINK_PREFIX
146:                                    + ":href", PRE_OWS + "Reference"));
147:                }
148:                String roleAttribute = referenceElement.getAttributeNS(XLNNS
149:                        .toASCIIString(), "role");
150:                String typeAttribute = referenceElement.getAttribute("type");
151:                Pair<String, String> identifier = parseIdentifier(referenceElement);
152:                List<String> abstracts = getNodesAsStringList(referenceElement,
153:                        PRE_OWS + "Abstract", nsContext);
154:                String format = getNodeAsString(referenceElement, PRE_OWS
155:                        + "Format", nsContext, null);
156:                List<Pair<String, String>> metadatas = parseMetadatas(getElements(
157:                        referenceElement, PRE_OWS + "Metadata", nsContext));
158:                return new Reference(hrefAttribute, roleAttribute,
159:                        typeAttribute, identifier, abstracts, format, metadatas);
160:            }
161:
162:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.