atg.droplet.xml
Class XMLToDOM

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.nucleus.servlet.ServletService
                  extended by atg.nucleus.servlet.HttpServletService
                      extended by atg.servlet.DynamoServlet
                          extended by atg.droplet.xml.XMLToDOM
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, ParameterServlet, java.util.EventListener, javax.servlet.Servlet

public class XMLToDOM
extends DynamoServlet

This droplet parses an XML document which is specified by the input parameter. The result of the parse will be bound to the document parameter, which can then be manipulated inside the output oparam.

These are the parameters for the XMLToDOM droplet:

Input Paramaters
 
input (required)
Specifies the XML document to be parsed. This can be either an absolute or relative URL for an XML document.

validate (optional)
Determine how the XML document specified by the input parameter should be validated against a DTD specified in its DOCTYPE declaration. Validation will be slower, but may help prevent problems later when accessing parts of the XML document. The legal values are:


This parameter is optional, the default value is false. If there is no DOCTYPE declaration, this parameter has no effect.

Output Paramaters
 
document (optional)
This parameter will be bound to a DOM document if the XML document was successfully retrieved and parsed. This parameter name is optional. If a name is not provided, the output will be bound to the document parameter.

errors (optional)
This parameter will be bound to an Enumeration of Exceptions if there were failures when parsing or retrieving the XML document.

Open Paramaters
 
unset
This oparam will be used when there is no input document URL parameter.

failure
This oparam will be used to format output when there was a failure to retrieve, parse, or serialize the XML document. It will also be invoked if the documentCache property is null.

output
This oparam can be used to process or render the XML document when it has been successfully retrieved and parsed. If there is no output parameter, the DOM is serialized directly to the response.

Static files should almost always be served directly. When no output oparam is present, the process is not just a transparent conversion of the XML, since it can be validated or indented, and it will loose any internal DTD subset. This cycle of parsing, validation, and serialization will be much slower than simply passing the file to the response, but it can be useful for debugging during development. When the DOM is serialized ot the page, it uses the encoding and MIME type from the Dynamo servlet pipeline. These are typically determined by the EncodingTyper and MimeTyper components, and the default values will be ISO-8859-1 and text/html.


Field Summary
static java.lang.String CLASS_VERSION
           
protected static java.lang.String DOCUMENT_PARAM
          The name of the document output parameter
protected static java.lang.String ERRORS_PARAM
          The name of the errors outpu parameter
protected static java.lang.String FAILURE_PARAM
          The name of the failure open parameter
protected static java.lang.String INPUT_PARAM
          The name of the input input parameter
protected static java.lang.String OUTPUT_PARAM
          The name of the output open parameter
protected static java.lang.String UNSET_PARAM
          The name of the unset open parameter
protected static java.lang.String VALIDATE_PARAM
          The name of the validate input parameter
 
Fields inherited from class atg.servlet.DynamoServlet
mAllowCleanupRequest, mParameters
 
Fields inherited from class atg.nucleus.servlet.ServletService
SERVLET_INFO_KEY
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
XMLToDOM()
           
 
Method Summary
 DocumentCache getDocumentCache()
          The DocumentCache used by this component.
 void service(DynamoHttpServletRequest pReq, DynamoHttpServletResponse pRes)
          Parse an XML document
 void setDocumentCache(DocumentCache pDocumentCache)
          The DocumentCache used by this component
 
Methods inherited from class atg.servlet.DynamoServlet
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, service, service, setParameter
 
Methods inherited from class atg.nucleus.servlet.ServletService
destroy, getServletConfig, getServletInfo, init, setServletInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

INPUT_PARAM

protected static java.lang.String INPUT_PARAM
The name of the input input parameter


VALIDATE_PARAM

protected static java.lang.String VALIDATE_PARAM
The name of the validate input parameter


DOCUMENT_PARAM

protected static java.lang.String DOCUMENT_PARAM
The name of the document output parameter


ERRORS_PARAM

protected static java.lang.String ERRORS_PARAM
The name of the errors outpu parameter


UNSET_PARAM

protected static java.lang.String UNSET_PARAM
The name of the unset open parameter


FAILURE_PARAM

protected static java.lang.String FAILURE_PARAM
The name of the failure open parameter


OUTPUT_PARAM

protected static java.lang.String OUTPUT_PARAM
The name of the output open parameter

Constructor Detail

XMLToDOM

public XMLToDOM()
Method Detail

setDocumentCache

public void setDocumentCache(DocumentCache pDocumentCache)
The DocumentCache used by this component


getDocumentCache

public DocumentCache getDocumentCache()
The DocumentCache used by this component.


service

public void service(DynamoHttpServletRequest pReq,
                    DynamoHttpServletResponse pRes)
             throws javax.servlet.ServletException,
                    java.io.IOException
Parse an XML document

Overrides:
service in class DynamoServlet
Parameters:
pReq - the request to be processed
pRes - the response object for this request
Throws:
javax.servlet.ServletException - an application specific error occurred processing this request
java.io.IOException - an error occurred reading data from the request or writing data to the response.