atg.nucleus
Class ServiceAdminServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by atg.nucleus.ServiceAdminServlet
All Implemented Interfaces:
atg.beans.NotSerializable, PropertyValueFormatter, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
URLPatternMatchingRuleFilter.URLPatternMatchingRuleFilterAdminServlet, WebAppRegistryAdminServlet

public class ServiceAdminServlet
extends javax.servlet.http.HttpServlet
implements PropertyValueFormatter, atg.beans.NotSerializable

See Also:
Serialized Form

Nested Class Summary
 class ServiceAdminServlet.EncodingOutputStream
          an implementation of a the ServletOutputStream class that wraps a print writer with a given encoding type
 
Field Summary
protected static java.lang.String ATTR_AMIN_SERVLET_POST_REQUEST_PROCESSORS
          The request attribute name that hosts the list of PostRequestProcessors to be invoked at the end of the HTML admin servlet rendering.
static java.lang.String CLASS_VERSION
          Class version string
protected  java.lang.String mCharEncoding
           
protected  Nucleus mNucleus
          The Nucleus controlling the system
protected  java.lang.Object mResolvedService
          The service as returned from Nucleus' resolveName method
protected  java.lang.Object mService
          The Service for whom this interface is operating
protected  boolean mUseServletOutputStream
           
 
Constructor Summary
ServiceAdminServlet(java.lang.Object pService, Nucleus pNucleus)
          Constructs a new ServiceAdminServlet
 
Method Summary
 void addAdminServletPostRequestProcessor(javax.servlet.http.HttpServletRequest pRequest, atg.servlet.PostRequestProcessor pProcessor, java.lang.String pOwnerName)
           
protected  boolean allowPropertyValueLink(boolean pAllowLinks, java.lang.Object pObject, java.lang.String pPropertyName, java.lang.String pPropertyPrefix)
          determine whether the given property value should have an html link
protected  void executeAdminServletPostRequestProcessors(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse)
           
protected  java.lang.String formatLongObject(java.lang.Object pObject, javax.servlet.http.HttpServletRequest pRequest)
          Formats the specified object, turning it into the "long form" String representation of its value.
 java.lang.String formatLongPropertyValue(java.lang.Object pValue, javax.servlet.http.HttpServletRequest pRequest, PropertyValueFormatter pFormatter)
          Formats the specified value into a String, using the "long form" of the value.
protected  java.lang.String formatObject(java.lang.Object pObject, javax.servlet.http.HttpServletRequest pRequest)
          Formats the specified object, turning it into a String representation of its value.
 java.lang.String formatPropertyValue(java.lang.Object pValue, javax.servlet.http.HttpServletRequest pRequest, PropertyValueFormatter pFormatter)
          Formats the specified value into a String, using the "short form" of the value.
protected  java.lang.String formatServiceLink(java.lang.String pServiceName, javax.servlet.http.HttpServletRequest pRequest)
          Returns the opening "href" tag that will lead back to the specified absolute service name
protected  java.lang.String formatServiceName(java.lang.String pServiceName, javax.servlet.http.HttpServletRequest pRequest)
          Returns the specified service name in a manner that is usable as a link, by adding the servlet path and appending a "/" if necessary.
protected  java.lang.String formatServiceName(java.lang.String pServiceName, java.lang.String pSuffix, javax.servlet.http.HttpServletRequest pRequest)
          Returns the specified service name in a manner that is usable as a link, by adding the servlet path and appending a "/" if necessary.
protected  java.lang.String getAbsoluteNameOf(java.lang.Object pComponent)
          Return the absolute name of pComponent.
protected  java.lang.Object getDynamicPropertyValue(java.lang.Object pObject, java.lang.String pPropertyName, java.lang.String pPropertyPrefix)
          get a dynamic property value.
protected  java.lang.String getPropertyConfigurationErrorString(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, java.lang.String pPropertyName, java.lang.String pNewValue, atg.nucleus.logging.CollectingLoggingSupport pLoggerCollecting)
           
 java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Class pClass, java.lang.String pPropertyName)
           
protected  java.util.ResourceBundle getResourceBundle()
          The ResourceBundle to use with this AdminServlet.
protected  java.lang.String getResourceString(java.lang.String pPattern)
          Loads the resource bundle, if not already loaded, and returns the requested resource string.
protected  java.lang.String getResourceString(java.lang.String pPattern, java.lang.Object[] pPatternArgs)
          Loads the resource bundle, if not already loaded, and returns the requested resource string with any args inserted.
 java.lang.String getResourceString(java.lang.String pPattern, java.lang.String... pArgs)
          Public form of getResourceString that supports variable number of arguments.
protected  javax.servlet.ServletOutputStream getResponseStream(javax.servlet.http.HttpServletResponse pResponse)
          get the servlet output stream from the response
 java.lang.String getScopeRelativePath(java.lang.String pPath)
          Return the scope relative path for a given component.
protected  void handleInvocationException(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, java.lang.String pMethodName, java.lang.Throwable pException)
          Handle an invocation exception.
protected  void insertStyle(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut)
          Insert any style/css tags...
protected  void printAdmin(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut)
          Prints the administrative information specific to this service.
protected  void printBodyTag(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut)
          Prints the opening body tag.
protected  boolean printCollectionValues(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut, java.lang.Object pObject, java.lang.String pPrefix)
           
protected  void printDirectory(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut)
           
protected  void printDynamicPropertyValues(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut, java.lang.Object pObject, java.lang.String pPrefix, boolean pIncludeCollection)
          Prints a listing of all the service's properties and values.
protected  void printDynamicPropertyValues(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut, java.lang.String pPropertyPrefix, java.lang.Object pObject, DynamicPropertyDescriptor[] pPropDescs, boolean pSortProperties, boolean pAllowLinks)
          Prints a listing of all the service's properties and values.
 void printEventSet(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, java.lang.String pEventSetName)
          Prints an event set
protected  void printEventSets(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut)
           
protected  void printHeaderTitle(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut)
          Prints the title of the page's header.
 void printMethodInvocation(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, java.lang.String pMethodName)
          Prints the formatted information of a method invocation on a service
protected  void printMethodInvocationResult(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, java.lang.String pMethodName, java.lang.Object pResult)
          Print out the invocation method result.
 void printMethodInvocationVerification(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, java.lang.String pMethodName)
          Prints the formatted information for a verification screen before invoking a method
protected  void printMethods(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut)
           
 void printProperty(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, java.lang.String pPropertyName)
          Prints the formatted information for a service, including the name, directory listing, and properties.
protected  void printPropertyValues(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut)
           
protected  void printPropertyValues(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut, java.lang.String pPropertyPrefix, java.lang.Object pObject, java.beans.PropertyDescriptor[] pPropDescs)
          Prints a listing of all the service's properties and values.
 void printService(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse)
          Prints the formatted information for a service, including the name, directory listing, and properties.
protected  void printServiceInfo(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut)
          Prints the serviceInfo property of the service.
protected  void printStringValue(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut)
          Prints the string value (toString) of the service.
protected  void printTitle(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, javax.servlet.ServletOutputStream pOut)
          Prints the title of the page.
 void reloadComponent(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse)
          Reload a class generated from a InstanceFactory instance.
 void service(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse)
          Handles requests
 void setResolvedService(java.lang.Object pService)
          Sets the service component as resolved by Nucleus.
protected  java.beans.EventSetDescriptor[] sortEventSetDescriptors(java.beans.EventSetDescriptor[] pDescriptors)
          Sorts the list of eventSet descriptors by eventSet name and returns a new list of the sorted descriptors.
protected  java.beans.MethodDescriptor[] sortMethodDescriptors(java.beans.MethodDescriptor[] pDescriptors)
          Sorts the list of method descriptors by method name and returns a new list of the sorted descriptors.
protected  java.beans.PropertyDescriptor[] sortPropertyDescriptors(java.beans.PropertyDescriptor[] pDescriptors)
          Sorts the list of property descriptors by property name and returns a new list of the sorted descriptors.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
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
Class version string


mService

protected transient java.lang.Object mService
The Service for whom this interface is operating


mNucleus

protected transient Nucleus mNucleus
The Nucleus controlling the system


mResolvedService

protected transient java.lang.Object mResolvedService
The service as returned from Nucleus' resolveName method


ATTR_AMIN_SERVLET_POST_REQUEST_PROCESSORS

protected static final java.lang.String ATTR_AMIN_SERVLET_POST_REQUEST_PROCESSORS
The request attribute name that hosts the list of PostRequestProcessors to be invoked at the end of the HTML admin servlet rendering.

See Also:
Constant Field Values

mCharEncoding

protected java.lang.String mCharEncoding

mUseServletOutputStream

protected boolean mUseServletOutputStream
Constructor Detail

ServiceAdminServlet

public ServiceAdminServlet(java.lang.Object pService,
                           Nucleus pNucleus)
Constructs a new ServiceAdminServlet

Parameters:
pService - the service object to be manipulated by this servlet
pNucleus - the Nucleus controlling the service hierarchy
Method Detail

service

public void service(javax.servlet.http.HttpServletRequest pRequest,
                    javax.servlet.http.HttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Handles requests

Overrides:
service in class javax.servlet.http.HttpServlet
Parameters:
pRequest - the current request
pReponse - the current response
Throws:
javax.servlet.ServletException - if an error occurred while processing the servlet request
java.io.IOException - if an error occurred while reading or writing the servlet request

reloadComponent

public void reloadComponent(javax.servlet.http.HttpServletRequest pRequest,
                            javax.servlet.http.HttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Reload a class generated from a InstanceFactory instance.

Parameters:
pRequest - the current request
pReponse - the current response
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

printService

public void printService(javax.servlet.http.HttpServletRequest pRequest,
                         javax.servlet.http.HttpServletResponse pResponse)
                  throws javax.servlet.ServletException,
                         java.io.IOException
Prints the formatted information for a service, including the name, directory listing, and properties.

Parameters:
pRequest - the current request
pReponse - the current response
Throws:
javax.servlet.ServletException - if an error occurred while processing the servlet request
java.io.IOException - if an error occurred while reading or writing the servlet request

insertStyle

protected void insertStyle(javax.servlet.http.HttpServletRequest pRequest,
                           javax.servlet.http.HttpServletResponse pResponse,
                           javax.servlet.ServletOutputStream pOut)
                    throws javax.servlet.ServletException,
                           java.io.IOException
Insert any style/css tags... inserted into the header.

Parameters:
pRequest - the current request
pReponse - the current response
pOut - the output stream to write to
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

printHeaderTitle

protected void printHeaderTitle(javax.servlet.http.HttpServletRequest pRequest,
                                javax.servlet.http.HttpServletResponse pResponse,
                                javax.servlet.ServletOutputStream pOut)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Prints the title of the page's header. By default, this will print the name of the service with links to the various parts of the name.

Parameters:
pRequest - the current request
pReponse - the current response
pOut - the output stream to write to
Throws:
javax.servlet.ServletException - if an error occurred
java.io.IOException - if an error occurred

printTitle

protected void printTitle(javax.servlet.http.HttpServletRequest pRequest,
                          javax.servlet.http.HttpServletResponse pResponse,
                          javax.servlet.ServletOutputStream pOut)
                   throws javax.servlet.ServletException,
                          java.io.IOException
Prints the title of the page. By default, this will print the name of the service.

Parameters:
pRequest - the current request
pReponse - the current response
pOut - the output stream to write to
Throws:
javax.servlet.ServletException - if an error occurred
java.io.IOException - if an error occurred

printServiceInfo

protected void printServiceInfo(javax.servlet.http.HttpServletRequest pRequest,
                                javax.servlet.http.HttpServletResponse pResponse,
                                javax.servlet.ServletOutputStream pOut)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Prints the serviceInfo property of the service.

Parameters:
pRequest - the current request
pReponse - the current response
pOut - the output stream to write to
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

printStringValue

protected void printStringValue(javax.servlet.http.HttpServletRequest pRequest,
                                javax.servlet.http.HttpServletResponse pResponse,
                                javax.servlet.ServletOutputStream pOut)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Prints the string value (toString) of the service.

Parameters:
pRequest - the current request
pReponse - the current response
pOut - the output stream to write to
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

printBodyTag

protected void printBodyTag(javax.servlet.http.HttpServletRequest pRequest,
                            javax.servlet.http.HttpServletResponse pResponse,
                            javax.servlet.ServletOutputStream pOut)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Prints the opening body tag. By default, this prints out no background color.

Parameters:
pRequest - the current request
pReponse - the current response
pOut - the output stream to write to
Throws:
javax.servlet.ServletException - if an error occurred
java.io.IOException - if an error occurred

printDirectory

protected void printDirectory(javax.servlet.http.HttpServletRequest pRequest,
                              javax.servlet.http.HttpServletResponse pResponse,
                              javax.servlet.ServletOutputStream pOut)
                       throws javax.servlet.ServletException,
                              java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

sortPropertyDescriptors

protected java.beans.PropertyDescriptor[] sortPropertyDescriptors(java.beans.PropertyDescriptor[] pDescriptors)
Sorts the list of property descriptors by property name and returns a new list of the sorted descriptors.

Parameters:
pDescriptors - the array of property descriptors to sort
Returns:
the shorted property descriptors

sortMethodDescriptors

protected java.beans.MethodDescriptor[] sortMethodDescriptors(java.beans.MethodDescriptor[] pDescriptors)
Sorts the list of method descriptors by method name and returns a new list of the sorted descriptors.

Parameters:
pDescriptors - the method descriptors to sort.
Returns:
the sorted method descriptors.

printMethods

protected void printMethods(javax.servlet.http.HttpServletRequest pRequest,
                            javax.servlet.http.HttpServletResponse pResponse,
                            javax.servlet.ServletOutputStream pOut)
                     throws javax.servlet.ServletException,
                            java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

printPropertyValues

protected void printPropertyValues(javax.servlet.http.HttpServletRequest pRequest,
                                   javax.servlet.http.HttpServletResponse pResponse,
                                   javax.servlet.ServletOutputStream pOut)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

printPropertyValues

protected void printPropertyValues(javax.servlet.http.HttpServletRequest pRequest,
                                   javax.servlet.http.HttpServletResponse pResponse,
                                   javax.servlet.ServletOutputStream pOut,
                                   java.lang.String pPropertyPrefix,
                                   java.lang.Object pObject,
                                   java.beans.PropertyDescriptor[] pPropDescs)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
Prints a listing of all the service's properties and values.

Parameters:
pRequest - the current request
pReponse - the current response
pOut - the output stream to write to
pPropertyPrefix - the property prefix path, typically the path usd to get to pObject with a "." appended.
pObject - the object whose property values to print out.
pPropDescs - the array of property descriptors.
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

printCollectionValues

protected boolean printCollectionValues(javax.servlet.http.HttpServletRequest pRequest,
                                        javax.servlet.http.HttpServletResponse pResponse,
                                        javax.servlet.ServletOutputStream pOut,
                                        java.lang.Object pObject,
                                        java.lang.String pPrefix)
                                 throws javax.servlet.ServletException,
                                        java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

printDynamicPropertyValues

protected void printDynamicPropertyValues(javax.servlet.http.HttpServletRequest pRequest,
                                          javax.servlet.http.HttpServletResponse pResponse,
                                          javax.servlet.ServletOutputStream pOut,
                                          java.lang.Object pObject,
                                          java.lang.String pPrefix,
                                          boolean pIncludeCollection)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
Prints a listing of all the service's properties and values.

Parameters:
pRequest - the current request
pReponse - the current response
pOut - the output stream to write to
pObject - the object whose dynamic properties to print
pPrefix - the property prefix path, typically the path usd to get to pObject with a "." appended.
pIncludeCollection - whether to include collection properties.
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

printDynamicPropertyValues

protected void printDynamicPropertyValues(javax.servlet.http.HttpServletRequest pRequest,
                                          javax.servlet.http.HttpServletResponse pResponse,
                                          javax.servlet.ServletOutputStream pOut,
                                          java.lang.String pPropertyPrefix,
                                          java.lang.Object pObject,
                                          DynamicPropertyDescriptor[] pPropDescs,
                                          boolean pSortProperties,
                                          boolean pAllowLinks)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
Prints a listing of all the service's properties and values.

Parameters:
pRequest - the current request
pReponse - the current response
pOut - the output stream to write to
pPropertyPrefix - the property prefix path, typically the path usd to get to pObject with a "." appended.
pObject - the object whose dynamic property values to print
pPropDescs - the array of dynamic property descriptors
pSortProperties - whethers the properties should be sorted
pAllowLinks - whether to allow links when printing property values
Throws:
javax.servlet.ServletException - if an error occurs
java.io.IOException - if an error occurs

getDynamicPropertyValue

protected java.lang.Object getDynamicPropertyValue(java.lang.Object pObject,
                                                   java.lang.String pPropertyName,
                                                   java.lang.String pPropertyPrefix)
                                            throws PropertyNotFoundException
get a dynamic property value. break this out into its own method to allow subclasses to modify this behavior if the standard algorithm for getting a property value will choke on the property name, which can be the case if the property name contains periods, but shouldn't be interpreted as dot notation

Parameters:
pObject - the object containing the dynamic property values
pPropertyName - the name of the property
pPropertyPrefix - the property prefix
Returns:
the property value
Throws:
PropertyNotFoundException - if there was an error finding the property value

allowPropertyValueLink

protected boolean allowPropertyValueLink(boolean pAllowLinks,
                                         java.lang.Object pObject,
                                         java.lang.String pPropertyName,
                                         java.lang.String pPropertyPrefix)
determine whether the given property value should have an html link

Parameters:
pAllowLinks - the current value for allowing links or not
pObject - the property value object
pPropertyName - the property name
pPropertyPrefix - the property name prefix
Returns:
true if we should allow links for this property value, false if not

getPropertyDescriptor

public java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Class pClass,
                                                           java.lang.String pPropertyName)
                                                    throws java.beans.IntrospectionException
Throws:
java.beans.IntrospectionException

printMethodInvocationVerification

public void printMethodInvocationVerification(javax.servlet.http.HttpServletRequest pRequest,
                                              javax.servlet.http.HttpServletResponse pResponse,
                                              java.lang.String pMethodName)
                                       throws javax.servlet.ServletException,
                                              java.io.IOException
Prints the formatted information for a verification screen before invoking a method

Parameters:
pRequest - the current request
pReponse - the current response
pMethodName - the name of the method whose invocation should be printed.
Throws:
javax.servlet.ServletException - if an error occurred while processing the servlet request
java.io.IOException - if an error occurred while reading or writing the servlet request

printMethodInvocation

public void printMethodInvocation(javax.servlet.http.HttpServletRequest pRequest,
                                  javax.servlet.http.HttpServletResponse pResponse,
                                  java.lang.String pMethodName)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
Prints the formatted information of a method invocation on a service

Parameters:
pRequest - the current request
pReponse - the current response
pMethodName - the name of the method whose invocation link to print.
Throws:
javax.servlet.ServletException - if an error occurred while processing the servlet request
java.io.IOException - if an error occurred while reading or writing the servlet request

printMethodInvocationResult

protected void printMethodInvocationResult(javax.servlet.http.HttpServletRequest pRequest,
                                           javax.servlet.http.HttpServletResponse pResponse,
                                           java.lang.String pMethodName,
                                           java.lang.Object pResult)
                                    throws java.io.IOException
Print out the invocation method result. By default, a table containing the returned value and class.

Parameters:
pRequest - the current request
pReponse - the current response
pMethodName - the name of the method whose result to print
pResult - the result value to print
Throws:
java.io.IOException - if an error occurs

handleInvocationException

protected void handleInvocationException(javax.servlet.http.HttpServletRequest pRequest,
                                         javax.servlet.http.HttpServletResponse pResponse,
                                         java.lang.String pMethodName,
                                         java.lang.Throwable pException)
                                  throws java.io.IOException
Handle an invocation exception. By default, just print out a stack trace.

Parameters:
pRequest - the current request
pReponse - the current response
pMethodName - the name of the method that threw the exception
pException - the exception that was thrown
Throws:
java.io.IOException - if an error occurs

getScopeRelativePath

public java.lang.String getScopeRelativePath(java.lang.String pPath)
Return the scope relative path for a given component. If the component is not the child of a scope manager, returns null.

Parameters:
pPath - the path to calculate relative to the current scope.
Returns:
the scope-reltaive (rather than the absolute) path.

printProperty

public void printProperty(javax.servlet.http.HttpServletRequest pRequest,
                          javax.servlet.http.HttpServletResponse pResponse,
                          java.lang.String pPropertyName)
                   throws javax.servlet.ServletException,
                          java.io.IOException
Prints the formatted information for a service, including the name, directory listing, and properties.

Parameters:
pRequest - the current request
pReponse - the current response
pPropertyName - the name of the property to print
Throws:
javax.servlet.ServletException - if an error occurred while processing the servlet request
java.io.IOException - if an error occurred while reading or writing the servlet request

getPropertyConfigurationErrorString

protected java.lang.String getPropertyConfigurationErrorString(javax.servlet.http.HttpServletRequest pRequest,
                                                               javax.servlet.http.HttpServletResponse pResponse,
                                                               java.lang.String pPropertyName,
                                                               java.lang.String pNewValue,
                                                               atg.nucleus.logging.CollectingLoggingSupport pLoggerCollecting)

sortEventSetDescriptors

protected java.beans.EventSetDescriptor[] sortEventSetDescriptors(java.beans.EventSetDescriptor[] pDescriptors)
Sorts the list of eventSet descriptors by eventSet name and returns a new list of the sorted descriptors.

Parameters:
pDescriptors - the descriptors to sort
Returns:
the sorted descriptors

printEventSets

protected void printEventSets(javax.servlet.http.HttpServletRequest pRequest,
                              javax.servlet.http.HttpServletResponse pResponse,
                              javax.servlet.ServletOutputStream pOut)
                       throws javax.servlet.ServletException,
                              java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

printEventSet

public void printEventSet(javax.servlet.http.HttpServletRequest pRequest,
                          javax.servlet.http.HttpServletResponse pResponse,
                          java.lang.String pEventSetName)
                   throws javax.servlet.ServletException,
                          java.io.IOException
Prints an event set

Parameters:
pRequest - the current request
pReponse - the current response
pEventSetName - the name of the event set to print
Throws:
javax.servlet.ServletException - if an error occurred while processing the servlet request
java.io.IOException - if an error occurred while reading or writing the servlet request

printAdmin

protected void printAdmin(javax.servlet.http.HttpServletRequest pRequest,
                          javax.servlet.http.HttpServletResponse pResponse,
                          javax.servlet.ServletOutputStream pOut)
                   throws javax.servlet.ServletException,
                          java.io.IOException
Prints the administrative information specific to this service. By default, this does nothing. Subclasses should override this to print service-specific information.

Parameters:
pRequest - the current request
pReponse - the current response
pOut - the output stream to write to
Throws:
javax.servlet.ServletException - if an error occurred
java.io.IOException - if an error occurred

formatObject

protected java.lang.String formatObject(java.lang.Object pObject,
                                        javax.servlet.http.HttpServletRequest pRequest)
Formats the specified object, turning it into a String representation of its value. If the object is a NameContextElement, then a link to the service is returned.

Parameters:
pObject - the object to sort
pRequest - the request to use for the formatting
Returns:
the format value

formatLongObject

protected java.lang.String formatLongObject(java.lang.Object pObject,
                                            javax.servlet.http.HttpServletRequest pRequest)
Formats the specified object, turning it into the "long form" String representation of its value. If the object is a NameContextElement, then a link to the service is returned.

Parameters:
pObject - the object whole long form to return
pRequest - the current request
Returns:
the long form representation of the object

formatServiceName

protected java.lang.String formatServiceName(java.lang.String pServiceName,
                                             javax.servlet.http.HttpServletRequest pRequest)
Returns the specified service name in a manner that is usable as a link, by adding the servlet path and appending a "/" if necessary.

Parameters:
pServiceName - the name of the service
pRequest - the current request
Returns:
the formatted service name

formatServiceName

protected java.lang.String formatServiceName(java.lang.String pServiceName,
                                             java.lang.String pSuffix,
                                             javax.servlet.http.HttpServletRequest pRequest)
Returns the specified service name in a manner that is usable as a link, by adding the servlet path and appending a "/" if necessary.

Parameters:
pServiceName - the name of the service to format
pSuffix - the suffix to append to the service string
pRequest - the current request
Returns:
the formatted service name

formatServiceLink

protected java.lang.String formatServiceLink(java.lang.String pServiceName,
                                             javax.servlet.http.HttpServletRequest pRequest)
Returns the opening "href" tag that will lead back to the specified absolute service name

Parameters:
pServiceName - the service to format a link to
pRequest - the current request
Returns:
the formatted beginning of the link tag

formatPropertyValue

public java.lang.String formatPropertyValue(java.lang.Object pValue,
                                            javax.servlet.http.HttpServletRequest pRequest,
                                            PropertyValueFormatter pFormatter)
Formats the specified value into a String, using the "short form" of the value.

Specified by:
formatPropertyValue in interface PropertyValueFormatter
Parameters:
pValue - the property value to format
pRequest - the current request
pFormatter - the formatter to use for formatting
Returns:
the formatted property value

formatLongPropertyValue

public java.lang.String formatLongPropertyValue(java.lang.Object pValue,
                                                javax.servlet.http.HttpServletRequest pRequest,
                                                PropertyValueFormatter pFormatter)
Formats the specified value into a String, using the "long form" of the value.

Specified by:
formatLongPropertyValue in interface PropertyValueFormatter
Parameters:
pValue - the property value to format
pRequest - the current request
pFormatter - the formatter to use for formatting
Returns:
the formatted long property value

getResourceString

protected java.lang.String getResourceString(java.lang.String pPattern)
Loads the resource bundle, if not already loaded, and returns the requested resource string.

Parameters:
pPattern - the resource key of the resource to return
Returns:
the corresponding resource string

getResourceString

protected java.lang.String getResourceString(java.lang.String pPattern,
                                             java.lang.Object[] pPatternArgs)
Loads the resource bundle, if not already loaded, and returns the requested resource string with any args inserted.

Parameters:
pPattern - resource key for the pattern
pPatternArgs - the format arguments
Returns:
the formatted resource string.

getResourceString

public java.lang.String getResourceString(java.lang.String pPattern,
                                          java.lang.String... pArgs)
Public form of getResourceString that supports variable number of arguments.

Parameters:
pPattern - resource key for the pattern
pArgs - the format arguments
Returns:
the formatted resource string.

getResourceBundle

protected java.util.ResourceBundle getResourceBundle()
The ResourceBundle to use with this AdminServlet. Override this method to use a different resource bundle

Returns:
the resource bundle

setResolvedService

public void setResolvedService(java.lang.Object pService)
Sets the service component as resolved by Nucleus. In some cases the object resolved from Nucleus is a proxy to the real one, so the admin servlet may require a reference to the proxy object.

Parameters:
pService - the re-resolved service

getAbsoluteNameOf

protected java.lang.String getAbsoluteNameOf(java.lang.Object pComponent)
Return the absolute name of pComponent. Attempts to get the absolute path of the component via unresolveName

Parameters:
pComponent - the component to get the absolute name of
Returns:
the absolute name of the specified object, or null if the absolute name could not be found (because the component could not be found by unresolveName and it's not a name context element).

addAdminServletPostRequestProcessor

public void addAdminServletPostRequestProcessor(javax.servlet.http.HttpServletRequest pRequest,
                                                atg.servlet.PostRequestProcessor pProcessor,
                                                java.lang.String pOwnerName)

executeAdminServletPostRequestProcessors

protected void executeAdminServletPostRequestProcessors(javax.servlet.http.HttpServletRequest pRequest,
                                                        javax.servlet.http.HttpServletResponse pResponse)
                                                 throws javax.servlet.ServletException,
                                                        java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

getResponseStream

protected javax.servlet.ServletOutputStream getResponseStream(javax.servlet.http.HttpServletResponse pResponse)
                                                       throws java.io.IOException
get the servlet output stream from the response

Parameters:
pResponse - the response object
Returns:
a ServletOutputStream object
Throws:
java.io.IOException