atg.droplet
Class BeanProperty

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.BeanProperty
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 BeanProperty
extends DynamoServlet

This servlet gets or sets a property in a bean. The bean is defined by the bean parameter. The property to get or set is defined by the propertyName parameter. The value may be set or read using the propertyValue parameter. In either case, the droplet renders an oparam named output.

Examples:

To set the property value, specify the new value using the propertyValue parameter, as in this example:


 <droplet bean="/atg/dynamo/droplet/BeanProperty">
   <param name="bean" value="param:myBean">
   <param name="propertyName" value="color">
   <param name="propertyValue" value="red">
 </droplet>
 
When setting property values the oparam need not be used, since there's no need to render output within the droplet's context.

To get the property value, leave the propertyValue parameter unset. The parameter will then take on the current value within the output oparam, as in this example:


 <droplet bean="/atg/dynamo/droplet/BeanProperty">
   <param name="bean" value="param:myBean">
   <param name="propertyName" value="color">
   <oparam name="output">
     The bean's color is <valueof param="propertyValue">unset</valueof>.
   </oparam>
 </droplet>
 
Dotted subproperty expressions of the form "a.b.c" are permitted when getting a property value, though not when setting one. When getting a value using subproperty expressions, if any intermediate property is null then propertyValue will also be null, as is the case when using DynamicBeans.

See Also:
DynamicBeans

Field Summary
static java.lang.String BEAN
           
protected static java.lang.String BEANRESOURCES
           
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String OUTPUT
           
static java.lang.String PROPERTY
           
protected static java.util.ResourceBundle sResourceBundle
           
static java.lang.String VALUE
           
 
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
BeanProperty()
          Constructs an instanceof BeanProperty
 
Method Summary
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Service the servlets request.
protected  void serviceGet(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, java.lang.Object pBean, java.lang.String pProperty, java.lang.Object pValue)
          Handles a request to get a property
protected  void serviceSet(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, java.lang.Object pBean, java.lang.String pProperty, java.lang.Object pValue)
          handles a request to set a property
 
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
Class version string


BEAN

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

PROPERTY

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

VALUE

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

OUTPUT

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

BEANRESOURCES

protected static final java.lang.String BEANRESOURCES
See Also:
Constant Field Values

sResourceBundle

protected static java.util.ResourceBundle sResourceBundle
Constructor Detail

BeanProperty

public BeanProperty()
Constructs an instanceof BeanProperty

Method Detail

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Service the servlets request. If the input indicates a get request the serviceGet method is called if the input indicates a set request then the serviceSet method is called.

Overrides:
service in class DynamoServlet
Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

serviceGet

protected void serviceGet(DynamoHttpServletRequest pRequest,
                          DynamoHttpServletResponse pResponse,
                          java.lang.Object pBean,
                          java.lang.String pProperty,
                          java.lang.Object pValue)
                   throws javax.servlet.ServletException,
                          java.io.IOException
Handles a request to get a property

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
pBean - the bean to operate on
pProperty - the property to get
pValue - the value of this property
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

serviceSet

protected void serviceSet(DynamoHttpServletRequest pRequest,
                          DynamoHttpServletResponse pResponse,
                          java.lang.Object pBean,
                          java.lang.String pProperty,
                          java.lang.Object pValue)
                   throws javax.servlet.ServletException,
                          java.io.IOException
handles a request to set a property

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
pBean - the bean to operate on
pProperty - the property to set
pValue - the value to set this property to
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io