atg.projects.b2bstore.soap
Class DOMWriterService

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.projects.b2bstore.soap.DOMWriterService
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class DOMWriterService
extends GenericService

This is a simple service which will receive an org.w3c.dom.Element object and print out the DOM associated wth it. This is a simple utility class which is intended to be used with a SOAP server. The SOAP server can register this service to receive a single org.w3c.dom.Element object and print it out.


Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String FAILURE
          Code to return if we were unable to serialize the DOM/Element object to the output stream.
static java.lang.String RPC_ROUTER_ID
           
static java.lang.String SUCCESS
          Code to return if we were able to serialize the DOM/Element object to the output stream.
 
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
DOMWriterService()
           
 
Method Summary
 void doStartService()
          This method will allow this service to register itself with a ServiceManager.
 java.lang.String[] getMethods()
          Return the methods property.
 java.lang.String getOutputMethod()
          The output method that gets set on the transformer.
 java.io.OutputStream getOutputStream()
          The outputstream that the Document/Element should be rendered to.
 atg.server.soap.DynamoRPCRouterServlet getRPCRouterServlet()
          Return the RPCRouterServlet property.
 java.lang.String getServiceId()
          Return the ServiceId property.
 boolean IsIndent()
          If this value is set to true, then the OutputKeys.INDENT property on the transformer will be set to true.
 java.lang.String receiveDocument(org.w3c.dom.Element pElement)
          This is the main method that is exposed to the SOAP server.
 void setIndent(boolean pIndent)
          Set the IsIndent property.
 void setMethods(java.lang.String[] pMethods)
          Set the methods property.
 void setOutputMethod(java.lang.String pOutputMethod)
          Set the OutputMethod property.
 void setOutputStream(java.io.OutputStream pOutputStream)
          Set the OutputStream property.
 void setRPCRouterServlet(atg.server.soap.DynamoRPCRouterServlet pRPCRouterServlet)
          Set the RPCRouterServlet property.
 void setServiceId(java.lang.String pServiceId)
          Set the ServiceId property.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, 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

RPC_ROUTER_ID

public static final java.lang.String RPC_ROUTER_ID
See Also:
Constant Field Values

SUCCESS

public static final java.lang.String SUCCESS
Code to return if we were able to serialize the DOM/Element object to the output stream.

See Also:
Constant Field Values

FAILURE

public static final java.lang.String FAILURE
Code to return if we were unable to serialize the DOM/Element object to the output stream.

See Also:
Constant Field Values
Constructor Detail

DOMWriterService

public DOMWriterService()
Method Detail

getServiceId

public java.lang.String getServiceId()
Return the ServiceId property.

Returns:

setServiceId

public void setServiceId(java.lang.String pServiceId)
Set the ServiceId property.

Parameters:
pServiceId -

getMethods

public java.lang.String[] getMethods()
Return the methods property.

Returns:

setMethods

public void setMethods(java.lang.String[] pMethods)
Set the methods property.

Parameters:
pMethods -

IsIndent

public boolean IsIndent()
If this value is set to true, then the OutputKeys.INDENT property on the transformer will be set to true. This will cause the rendered XML file to be indented as appropriate.

This defaults to true.

Returns:
true if the XML document should be serialized.

setIndent

public void setIndent(boolean pIndent)
Set the IsIndent property.

Parameters:
pIndent -

getOutputMethod

public java.lang.String getOutputMethod()
The output method that gets set on the transformer. This defaults to xml.

Returns:
the output method

setOutputMethod

public void setOutputMethod(java.lang.String pOutputMethod)
Set the OutputMethod property.

Parameters:
pOutputMethod -

getOutputStream

public java.io.OutputStream getOutputStream()
The outputstream that the Document/Element should be rendered to. This defaults to System.out

Returns:
the output stream

setOutputStream

public void setOutputStream(java.io.OutputStream pOutputStream)
Set the OutputStream property.

Parameters:
pOutputStream -

getRPCRouterServlet

public atg.server.soap.DynamoRPCRouterServlet getRPCRouterServlet()
Return the RPCRouterServlet property.

Returns:

setRPCRouterServlet

public void setRPCRouterServlet(atg.server.soap.DynamoRPCRouterServlet pRPCRouterServlet)
Set the RPCRouterServlet property.

Parameters:
pRPCRouterServlet -

doStartService

public void doStartService()
                    throws ServiceException
This method will allow this service to register itself with a ServiceManager. The ServiceManager that it registers itself with is the one that is associated with the RPCRouterServlet of this class.

It registers itself by creating a DeploymentDescriptor and populating that DeploymentDescriptor with the appropriate values. It set the Id property to that configured in this classes serviceId property. It will also set the methods property to be that from the getMethods method.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if an error occurs

receiveDocument

public java.lang.String receiveDocument(org.w3c.dom.Element pElement)
This is the main method that is exposed to the SOAP server. It will receive an org.w3c.dom.Element object and print the tree structur of the element object.

This printing is performed by using the javax.xml.transform package to create an identity transformer and render the output.

When rendering the output, the output will be rendered to a created StreamResult object. The StreamResult object will be created with the OutputStream returned by getOutputStream/

Parameters:
pElement - the element whose tree structure will be rendered.
Returns:
success if transformation was successful, else failure