nl.itc.RIMapper
Class Utils
java.lang.Object
nl.itc.RIMapper.Utils
public class Utils
- extends Object
Set of (static) utility classes for RIMapperWMS.
Currently, mainl for XML file parsing and Error handling
- Version:
- 1.0 [December 2006]
- Author:
- Barend Köbben - kobben@itc.nl
|
Constructor Summary |
Utils()
|
XHTML_DOCTYPE
public static final String XHTML_DOCTYPE
- See Also:
- Constant Field Values
OGC_EXCEPTION_DOCTYPE
public static final String OGC_EXCEPTION_DOCTYPE
- See Also:
- Constant Field Values
XML_HEADER
public static final String XML_HEADER
- See Also:
- Constant Field Values
XHTML_NAMESPACE
public static final String XHTML_NAMESPACE
- See Also:
- Constant Field Values
XLINK_NAMESPACE
public static final String XLINK_NAMESPACE
- See Also:
- Constant Field Values
XMLEVENTS_NAMESPACE
public static final String XMLEVENTS_NAMESPACE
- See Also:
- Constant Field Values
SVG_NAMESPACE
public static final String SVG_NAMESPACE
- See Also:
- Constant Field Values
RIM_NAMESPACE
public static final String RIM_NAMESPACE
- See Also:
- Constant Field Values
XHTML_MIME_TYPE
public static final String XHTML_MIME_TYPE
- See Also:
- Constant Field Values
SVG_MIME_TYPE
public static final String SVG_MIME_TYPE
- See Also:
- Constant Field Values
PNG_MIME_TYPE
public static final String PNG_MIME_TYPE
- See Also:
- Constant Field Values
JPEG_MIME_TYPE
public static final String JPEG_MIME_TYPE
- See Also:
- Constant Field Values
CAPABILITIES_MIME_TYPE
public static final String CAPABILITIES_MIME_TYPE
- See Also:
- Constant Field Values
GML_MIME_TYPE
public static final String GML_MIME_TYPE
- See Also:
- Constant Field Values
OGC_EXCEPTION_XML_MIME_TYPE
public static final String OGC_EXCEPTION_XML_MIME_TYPE
- See Also:
- Constant Field Values
OGC_EXCEPTION_INIMAGE_MIME_TYPE
public static final String OGC_EXCEPTION_INIMAGE_MIME_TYPE
- See Also:
- Constant Field Values
PLAINXML_MIME_TYPE
public static final String PLAINXML_MIME_TYPE
- See Also:
- Constant Field Values
Utils
public Utils()
getXMLtree
public static Document getXMLtree(String XMLfile,
boolean validate)
throws RIMapperException
- Parses XML template file and returns the document tree.
- Parameters:
XMLfile - the URL or file pathvalidate - sets DTD validation on/off returns the document tree
- Throws:
RIMapperException
getTagFromXML
public static String getTagFromXML(Document myXML,
String myTag)
throws RIMapperException
- Gets the value (CDATA or Text node) of a Tag out of an XML document.
- Parameters:
myXML - the XML Document objectmyTag - the Tag whose value we want
- Returns:
- a String with the tag value
- Throws:
RIMapperException
MakeError
public static StringBuffer MakeError(String ErrorLocation,
String ErrorMessage,
String ResponseType,
String ExceptionResponseType)
- Generates ErrorMessage as complete XHTML, SVG, or other file.
For
SVG, fills screens with MonoTyped text in 25 char lines.
For X(HT)ML,
lets browser do the textflow.
- Parameters:
ErrorLocation - the class that the error occured inErrorMessage - the message to be displayedExceptionResponseType - the MIME type of exceptionsResponseType - the MIME type of the WMS response:
Error output will be:
"application/vnd.ogc.se_xml" for output in OGC Error XML
"application/vnd.ogc.se_xml_inimage" for output in the ResponseType:
- if ResponseType = "image/svg+xml" => SVG output
- if ResponseType = "image/png" or if "image/jpeg" => image output
- else (eg. Capabilities XML) => HTML output
- Returns:
- a StringBuffer with the error output.