atg.commerce.csr.repository
Class CSRRepositoryFormHandler

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.droplet.EmptyFormHandler
              extended by atg.droplet.GenericFormHandler
                  extended by atg.repository.servlet.RepositoryFormHandler
                      extended by atg.commerce.csr.repository.CSRRepositoryFormHandler
All Implemented Interfaces:
atg.droplet.DropletFormHandler, atg.naming.AbsoluteNameable, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameContextParentable, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.Configured, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, atg.repository.servlet.RepositoryFormConstants, atg.repository.servlet.RepositoryFormData, java.util.EventListener

public class CSRRepositoryFormHandler
extends atg.repository.servlet.RepositoryFormHandler

This form handler extends RepositoryFormHandler to provide automatic management of relationships between existing repository items and repository items that are created and removed by this form handler.

There are four properties added by the form handler that are used to automatically manage relationships between items and generate agent audit events.

The properties are updateRepositoryId, updateItemDescriptorName, updatePropertyName and updateKey. The following describes how each of them are used for each of the functions performed by the form handler.

If updateRepositoryId is provided then updateItemDescriptorName and updatePropertyName are also required. updateKey is also required if the property being updated is a map.

Creating new repository items
These four properties are used to update a repository item that has a property reference to the item being created. After the item is created, these four properties are used to perform an update to item to add the reference. The updateKey is used only if the update property is a map, where this value is the key to the new item in the map.
Deleting repository items
These four properties are used to update a repository item that has a property reference to the item being deleted. Before the item is delete, these four properties are used to perform an update to the item to remove the reference. The updateKey is used only if the update property is a map, where this value is the key to the new item in the map.
Updating repository items
These four properties are used to generate the correct information for the ItemUpdateAgentEvent, which is sent after the update is made.

Other properties:

ItemUpdateAgentEvent
An ItemUpdateAgentEvent which is sent in postUpdate. This event is created in preUpdate and put in this property, and subsequently sent in postUpdate. It is created in preUpdate so that old property values can be captured prior to the update.
ItemUpdateJMSType
The jms type used to send the agent events.
ItemUpdateActivityType
The type used when creating new ItemUpdateAgentEvents.

See Also:
RepositoryFormHandler

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  CSRAgentTools mCSRAgentTools
           
static java.lang.String MY_RESOURCE_NAME
           
 
Fields inherited from class atg.repository.servlet.RepositoryFormHandler
STATUS_ERROR_REDIRECT, STATUS_ERROR_STAY, STATUS_SUCCESS
 
Fields inherited from class atg.droplet.GenericFormHandler
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.repository.servlet.RepositoryFormConstants
NULL_SENTINEL, REPOSITORY_ID_PROPERTY_NAME, RESOURCE_BUNDLE_NAME, UPDATE_APPEND, UPDATE_PREPEND, UPDATE_REMOVE, UPDATE_REPLACE
 
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
CSRRepositoryFormHandler()
           
 
Method Summary
protected  void checkForRequiredPropertiesInValueDictionary(atg.servlet.DynamoHttpServletRequest pRequest, java.lang.String[] pRequiredProperties)
          This method can be used to ensure that a specific set of properties are in the value dictionary.
protected  atg.agent.events.ItemUpdateAgentEvent generateCreateItemUpdateAgentEvent(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Generates and ItemUpdateAgentEvent based on the new item created and the item that contains a reference to the newly created item.
protected  atg.agent.events.ItemUpdateAgentEvent generateDeleteItemUpdateAgentEvent(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Generates an ItemUpdateAgentEvent based on the deleted item and the item that references the the deleted item.
protected  atg.agent.events.ItemUpdateAgentEvent generateUpdateItemUpdateAgentEvent(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Generates an ItemUpdateAgentEvent based on the updates being made in the values dictionary and the values of updatePropertyName, updateRepositoryId and updateKey.
 CSRAgentMessagingTools getAgentMessagingTools()
          Returns property CSRAgentMessagingTools
 CSRAgentTools getCSRAgentTools()
           
protected  atg.repository.RepositoryItem getCurrentItem()
          Get the repository item that this form is operating on.
 atg.userprofiling.Profile getCustomerProfile()
          Returns the value of the property CustomerProfile.
 java.util.Map getEditValue()
           
 java.lang.String getItemUpdateActivityType()
           
 atg.agent.events.ItemUpdateAgentEvent getItemUpdateAgentEvent()
          This property is used to hold the ItemUpdateAgentEvent that is created is preUpdate but not sent until postUpdate.
 java.lang.String getItemUpdateJMSType()
           
protected  java.util.Locale getLocale(atg.servlet.DynamoHttpServletRequest pRequest)
          Get the locale to use for user-visible error messages.
protected  java.lang.String getMsgResource(java.lang.String pMessageKey, atg.servlet.DynamoHttpServletRequest pRequest)
          Return a message from a resource file, taking into account the locale used for user-visible messages.
protected  java.lang.String getMsgResource(java.lang.String pMessageKey, atg.servlet.DynamoHttpServletRequest pRequest, java.lang.Object pArg)
          Return a message from a resource file, taking into account the locale used for user-visible messages and substituting the value of a specified argument for the {0} placeholder in the message text.
 java.lang.String[] getRequiredFields()
          Return the list of required property names.
static java.lang.String getResourceBundleName()
          Return the name of the resource bundle to use for this class.
 java.lang.String getTicketId()
          Returns the Id of the current ticket
protected  atg.repository.RepositoryItem getUpdatableItem()
          Get the repository item whose id updateRepositoryId and whose type is updateItemDescriptorName.
protected  java.lang.Object getUpdatableProperty()
          Get the property of the update repository item that is to be updated when a new repository item is created.
 java.lang.String getUpdateItemDescriptorName()
          Return the item descriptor name for the item specified by updateRepositoryId.
 java.lang.String getUpdateKey()
          Return the key that identifies the map entry to modify, in cases where updatePropertyName specifies a map-valued property.
 java.lang.String getUpdatePropertyName()
          Return the property of the update item to modify when this form handler creates or deletes a repository item.
 java.lang.String getUpdateRepositoryId()
          Return the repository id of a "container" or "parent" item that may be updated automatically whenever a repository item is created or deleted by this form handler.
 java.lang.String getUserLocale()
          Return the preferred Locale for user-vislble error messages.
 boolean handleCancel(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method extension clears the editVlaue dictionary and nulls out the updateKey and repositoryId.
 boolean isSendAgentEvents()
           
protected  boolean isUpdateProperties()
          Determines if the UpdateRepositoryId is valued.
protected  void postCreateItem(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method is called just after a new repository item has been created.
protected  void postDeleteItem(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method calls sendItemUpdateAuditEvents.
protected  void postUpdateItem(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method calls sendPostUpdateAgentEvents.
protected  void preCreateItem(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method is called just before the item creation process is started.
protected  void preDeleteItem(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method is called just before a repository item has been is deleted.
protected  void preUpdateItem(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method calls the generateUpdateItemUpdateAgentEvent method to create the ItemUpdateAgentEvent prior to the updates being applied.
protected  void resetForm()
          Resets the form properties repositoryId, updateKey, editValue dictionary, and value dictionary are reset.
 void sendPostCreateAgentEvents(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Sends the ItemUpdateAgentEvent generated by a call to generateCreateItemUpdateAgentEvent
 void sendPostDeleteAgentEvents(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Sends the ItemUpdateAgentEvent generated by a call to generateDeleteItemUpdateAgentEvents
 void sendPostUpdateAgentEvents(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Sends the ItemUpdateAgentEvent in the itemUpdateAgentEvent property using the jms type defined by itemUpdateJMSType.
 void setAgentMessagingTools(CSRAgentMessagingTools pAgentMessagingTools)
          Sets property CSRAgentMessagingTools
 void setCSRAgentTools(CSRAgentTools pCSRAgentTools)
          Sets the property CSRAgentTools.
 void setCustomerProfile(atg.userprofiling.Profile pCustomerProfile)
          Sets the property CustomerProfile.
 void setItemUpdateActivityType(java.lang.String pItemUpdateActivityType)
          Sets the activity type used for sending the item update agent events.
 void setItemUpdateAgentEvent(atg.agent.events.ItemUpdateAgentEvent pItemUpdateAgentEvent)
           
 void setItemUpdateJMSType(java.lang.String pItemUpdateJMSType)
          Sets the JMS Type used for sending the item update agent events.
 void setRequiredFields(java.lang.String[] pRequiredFields)
          Specify a list of property names that must be set by the form using this form handler.
 void setSendAgentEvents(boolean pSendAgentEvents)
          Property for enabling/disabling agent events.
 void setUpdateItemDescriptorName(java.lang.String pUpdateItemDescriptorName)
          Set the item descriptor name for the item specified by updateRepositoryId.
 void setUpdateKey(java.lang.String pUpdateKey)
          Set the key that identifies the map entry to modify, in cases where updatePropertyName specifies a map-valued property.
 void setUpdatePropertyName(java.lang.String pPropertyName)
          Set the property of the update item to modify when this form handler creates or deletes a repository item.
 void setUpdateRepositoryId(java.lang.String pUpdateRepositoryId)
          Set the repository id of a "container" or "parent" item that may be updated automatically whenever a repository item is created or deleted by this form handler.
 void setUserLocale(java.lang.String pUserLocale)
          Set the preferred Locale for user-vislble error messages.
protected  void validatePropertiesOnCreate(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method is called by preCreateItem so that extensions can verify that all the necessary data is available to create the new item.
protected  void validatePropertiesOnUpdate(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          This method is called by preUpdateItem so that extensions can validate the data used to update the item.
protected  void validateUpdateProperties(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
           
 
Methods inherited from class atg.repository.servlet.RepositoryFormHandler
checkFormError, checkFormSuccess, checkForRequiredProperties, deleteItem, getCheckForReadOnlyProperties, getCheckForRequiredProperties, getContentItemDescriptor, getContentNameProperty, getContentPathProperty, getCreateErrorURL, getCreateSuccessURL, getDeleteErrorURL, getDeleteSuccessURL, getEditMapsAsLists, getErrorHandler, getExtractDefaultValuesFromItem, getFolderIdProperty, getItemDescriptor, getItemDescriptorName, getItemProperty, getLogger, getMapKeyValueSeparator, getRemoveReferencesToDeletedItems, getRepository, getRepositoryId, getRepositoryItem, getRepositoryItemEditor, getRepositoryPathName, getRequireIdOnCreate, getSpecifiedIdPropertyValue, getTransactionDemarcation, getTransactionManager, getTrimProperties, getUpdateErrorURL, getUpdateSuccessURL, getValue, getValueProperty, handleCreate, handleDelete, handleUpdate, isClearValueOnSet, isCreateTransientItems, isRequireMapKeys, isSortRepositoryItemSets, isTrimProperty, isUpdateItemsInCollection, postUpdateItemProperties, setCheckForReadOnlyProperties, setCheckForRequiredProperties, setClearValueOnSet, setContentNameProperty, setContentPathProperty, setCreateErrorURL, setCreateSuccessURL, setCreateTransientItems, setDeleteErrorURL, setDeleteSuccessURL, setEditMapsAsLists, setExtractDefaultValuesFromItem, setFolderIdProperty, setItemDescriptorName, setMapKeyValueSeparator, setRemoveReferencesToDeletedItems, setRepository, setRepositoryId, setRepositoryItemEditor, setRepositoryPathName, setRequireIdOnCreate, setRequireMapKeys, setSortRepositoryItemSets, setTrimProperties, setUpdateErrorURL, setUpdateItemsInCollection, setUpdateSuccessURL, setValueProperty, testPropertyAttribute, updateChildItemProperty, updateContentItemValues, updateItem, updateItemProperties, updateListProperty, updateMapProperty
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, afterSet, beforeSet, checkFormRedirect, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwards
 
Methods inherited from class atg.droplet.EmptyFormHandler
afterGet, beforeGet
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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 final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

MY_RESOURCE_NAME

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

mCSRAgentTools

protected CSRAgentTools mCSRAgentTools
Constructor Detail

CSRRepositoryFormHandler

public CSRRepositoryFormHandler()
Method Detail

setItemUpdateJMSType

public void setItemUpdateJMSType(java.lang.String pItemUpdateJMSType)
Sets the JMS Type used for sending the item update agent events.

Parameters:
pItemUpdateJMSType - the JMS Type used for sending the item update agent events.

getItemUpdateJMSType

public java.lang.String getItemUpdateJMSType()
Returns:
the JMS Type for sending the item update agent events.

setItemUpdateActivityType

public void setItemUpdateActivityType(java.lang.String pItemUpdateActivityType)
Sets the activity type used for sending the item update agent events.

Parameters:
pItemUpdateActivityType - the activity type used when sending the item update agent events.

getItemUpdateActivityType

public java.lang.String getItemUpdateActivityType()
Returns:
the activity type used when sending the item update agent events.

getItemUpdateAgentEvent

public atg.agent.events.ItemUpdateAgentEvent getItemUpdateAgentEvent()
This property is used to hold the ItemUpdateAgentEvent that is created is preUpdate but not sent until postUpdate.

Returns:
Returns an ItemUpdateAgentEvent.

setItemUpdateAgentEvent

public void setItemUpdateAgentEvent(atg.agent.events.ItemUpdateAgentEvent pItemUpdateAgentEvent)

setSendAgentEvents

public void setSendAgentEvents(boolean pSendAgentEvents)
Property for enabling/disabling agent events.

Parameters:
pSendAgentEvents - new value to set

isSendAgentEvents

public boolean isSendAgentEvents()
Returns:
The value of the property SendAgentEvents.

setCustomerProfile

public void setCustomerProfile(atg.userprofiling.Profile pCustomerProfile)
Sets the property CustomerProfile.


getCustomerProfile

public atg.userprofiling.Profile getCustomerProfile()
Returns the value of the property CustomerProfile.


setAgentMessagingTools

public void setAgentMessagingTools(CSRAgentMessagingTools pAgentMessagingTools)
Sets property CSRAgentMessagingTools


getAgentMessagingTools

public CSRAgentMessagingTools getAgentMessagingTools()
Returns property CSRAgentMessagingTools


setCSRAgentTools

public void setCSRAgentTools(CSRAgentTools pCSRAgentTools)
Sets the property CSRAgentTools.


getCSRAgentTools

public CSRAgentTools getCSRAgentTools()
Returns:
The value of the property ProfileTools.

getUpdateRepositoryId

public java.lang.String getUpdateRepositoryId()
Return the repository id of a "container" or "parent" item that may be updated automatically whenever a repository item is created or deleted by this form handler. When a new repository item is created, it can be automatically added to a collection- or map-valued property of the update item. When a repository item is deleted, it can be automatically removed from a collection- or map-valued property of the update item.


setUpdateRepositoryId

public void setUpdateRepositoryId(java.lang.String pUpdateRepositoryId)
Set the repository id of a "container" or "parent" item that may be updated automatically whenever a repository item is created or deleted by this form handler.


getUpdateItemDescriptorName

public java.lang.String getUpdateItemDescriptorName()
Return the item descriptor name for the item specified by updateRepositoryId.


setUpdateItemDescriptorName

public void setUpdateItemDescriptorName(java.lang.String pUpdateItemDescriptorName)
Set the item descriptor name for the item specified by updateRepositoryId.


getUpdatePropertyName

public java.lang.String getUpdatePropertyName()
Return the property of the update item to modify when this form handler creates or deletes a repository item. For example, if updateRepositoryId refers to a repository item of type Organization, and the updatePropertyName is billingAddrs, then creating a new repository item will automatically add it to that organization's billingAddrs property, and removing a repository item will automatically remove it from that organization's billingAddrs.


setUpdatePropertyName

public void setUpdatePropertyName(java.lang.String pPropertyName)
Set the property of the update item to modify when this form handler creates or deletes a repository item.


getUpdateKey

public java.lang.String getUpdateKey()
Return the key that identifies the map entry to modify, in cases where updatePropertyName specifies a map-valued property.


setUpdateKey

public void setUpdateKey(java.lang.String pUpdateKey)
Set the key that identifies the map entry to modify, in cases where updatePropertyName specifies a map-valued property.


getRequiredFields

public java.lang.String[] getRequiredFields()
Return the list of required property names. When any item is created or updated using this form handler, the preCreate or preUpdate method checks to make sure all of the required properties have been set. If any required properties are missing, a form exception is added to the form for each missing property.


setRequiredFields

public void setRequiredFields(java.lang.String[] pRequiredFields)
Specify a list of property names that must be set by the form using this form handler. When any item is created or updated using this form handler, the preCreate or preUpdate method checks to make sure all of the required properties have been set. If any required properties are missing, a form exception is added to the form for each missing property.


getEditValue

public java.util.Map getEditValue()
Returns:
The value of the property EditValue. This is a map that stores the pending values for an editing operations on the profile

getUserLocale

public java.lang.String getUserLocale()
Return the preferred Locale for user-vislble error messages.


setUserLocale

public void setUserLocale(java.lang.String pUserLocale)
Set the preferred Locale for user-vislble error messages. If not set, the Locale of the request will be used, if available. Otherwise, the default server Locale will be used.


getResourceBundleName

public static java.lang.String getResourceBundleName()
Return the name of the resource bundle to use for this class.


getTicketId

public java.lang.String getTicketId()
Returns the Id of the current ticket


validatePropertiesOnCreate

protected void validatePropertiesOnCreate(atg.servlet.DynamoHttpServletRequest pRequest,
                                          atg.servlet.DynamoHttpServletResponse pResponse)
This method is called by preCreateItem so that extensions can verify that all the necessary data is available to create the new item.


validatePropertiesOnUpdate

protected void validatePropertiesOnUpdate(atg.servlet.DynamoHttpServletRequest pRequest,
                                          atg.servlet.DynamoHttpServletResponse pResponse)
This method is called by preUpdateItem so that extensions can validate the data used to update the item.


checkForRequiredPropertiesInValueDictionary

protected void checkForRequiredPropertiesInValueDictionary(atg.servlet.DynamoHttpServletRequest pRequest,
                                                           java.lang.String[] pRequiredProperties)
This method can be used to ensure that a specific set of properties are in the value dictionary.

A form error is added for each missing property

Parameters:
pRequest - the current request
pRequiredProperties - the array of required properties names

getCurrentItem

protected atg.repository.RepositoryItem getCurrentItem()
                                                throws atg.repository.RepositoryException
Get the repository item that this form is operating on. In the case of item creation, this will return the item just created. In the case of item update or removal, this will return the item being modified or deleted.

Throws:
atg.repository.RepositoryException

getUpdatableItem

protected atg.repository.RepositoryItem getUpdatableItem()
                                                  throws atg.repository.RepositoryException
Get the repository item whose id updateRepositoryId and whose type is updateItemDescriptorName.

Throws:
atg.repository.RepositoryException

getUpdatableProperty

protected java.lang.Object getUpdatableProperty()
                                         throws atg.repository.RepositoryException
Get the property of the update repository item that is to be updated when a new repository item is created. Return null if no such property can be found.

Throws:
atg.repository.RepositoryException

getMsgResource

protected java.lang.String getMsgResource(java.lang.String pMessageKey,
                                          atg.servlet.DynamoHttpServletRequest pRequest)
Return a message from a resource file, taking into account the locale used for user-visible messages.


getMsgResource

protected java.lang.String getMsgResource(java.lang.String pMessageKey,
                                          atg.servlet.DynamoHttpServletRequest pRequest,
                                          java.lang.Object pArg)
Return a message from a resource file, taking into account the locale used for user-visible messages and substituting the value of a specified argument for the {0} placeholder in the message text.


getLocale

protected java.util.Locale getLocale(atg.servlet.DynamoHttpServletRequest pRequest)
Get the locale to use for user-visible error messages. Returns the locale specified by the userLocale property if set, otherwise returns the request locale from pRequest if set, otherwise returns the default server locale.


preDeleteItem

protected void preDeleteItem(atg.servlet.DynamoHttpServletRequest pRequest,
                             atg.servlet.DynamoHttpServletResponse pResponse)
                      throws javax.servlet.ServletException,
                             java.io.IOException
This method is called just before a repository item has been is deleted. If an updateRepositoryId is specified it will update that item to remove the deleted item using the updatePropertyName. If the property is a map, the updateKey is used as the key to the map entry.

If RemoveReferencesToDeletedItems is false the item cannot be deleted unless the parent item has the only reference to it.

Overrides:
preDeleteItem in class atg.repository.servlet.RepositoryFormHandler
Parameters:
pRequest - the current request
pResponse - the current response
Throws:
javax.servlet.ServletException
java.io.IOException

preCreateItem

protected void preCreateItem(atg.servlet.DynamoHttpServletRequest pRequest,
                             atg.servlet.DynamoHttpServletResponse pResponse)
                      throws javax.servlet.ServletException,
                             java.io.IOException
This method is called just before the item creation process is started. It first calls the validatePropertiesOnCreate to do property validation.

It also verify that the updateKey doesn't already exist when updating a map property.

Overrides:
preCreateItem in class atg.repository.servlet.RepositoryFormHandler
Throws:
javax.servlet.ServletException
java.io.IOException

preUpdateItem

protected void preUpdateItem(atg.servlet.DynamoHttpServletRequest pRequest,
                             atg.servlet.DynamoHttpServletResponse pResponse)
                      throws javax.servlet.ServletException,
                             java.io.IOException
This method calls the generateUpdateItemUpdateAgentEvent method to create the ItemUpdateAgentEvent prior to the updates being applied. This event is then stored in the itemUpdateAgentEvent property and subsequently send in postUpdate.

Overrides:
preUpdateItem in class atg.repository.servlet.RepositoryFormHandler
Throws:
javax.servlet.ServletException
java.io.IOException

postCreateItem

protected void postCreateItem(atg.servlet.DynamoHttpServletRequest pRequest,
                              atg.servlet.DynamoHttpServletResponse pResponse)
                       throws javax.servlet.ServletException,
                              java.io.IOException
This method is called just after a new repository item has been created. If an updateRepositoryId is specified it will update that item with the new item using the updatePropertyName. If the property is a map, the updateKey is used as the key to the map entry.

Overrides:
postCreateItem in class atg.repository.servlet.RepositoryFormHandler
Parameters:
pRequest - the current request
pResponse - the current response
Throws:
javax.servlet.ServletException
java.io.IOException

postUpdateItem

protected void postUpdateItem(atg.servlet.DynamoHttpServletRequest pRequest,
                              atg.servlet.DynamoHttpServletResponse pResponse)
                       throws javax.servlet.ServletException,
                              java.io.IOException
This method calls sendPostUpdateAgentEvents.

It also clears the editValue dictionary.

Overrides:
postUpdateItem in class atg.repository.servlet.RepositoryFormHandler
Throws:
javax.servlet.ServletException
java.io.IOException

sendPostUpdateAgentEvents

public void sendPostUpdateAgentEvents(atg.servlet.DynamoHttpServletRequest pRequest,
                                      atg.servlet.DynamoHttpServletResponse pResponse)
Sends the ItemUpdateAgentEvent in the itemUpdateAgentEvent property using the jms type defined by itemUpdateJMSType.

Parameters:
pRequest - the current request
pResponse - the current response

sendPostCreateAgentEvents

public void sendPostCreateAgentEvents(atg.servlet.DynamoHttpServletRequest pRequest,
                                      atg.servlet.DynamoHttpServletResponse pResponse)
Sends the ItemUpdateAgentEvent generated by a call to generateCreateItemUpdateAgentEvent

Parameters:
pRequest - the current request
pResponse - the current response

sendPostDeleteAgentEvents

public void sendPostDeleteAgentEvents(atg.servlet.DynamoHttpServletRequest pRequest,
                                      atg.servlet.DynamoHttpServletResponse pResponse)
Sends the ItemUpdateAgentEvent generated by a call to generateDeleteItemUpdateAgentEvents

Parameters:
pRequest - the current request
pResponse - the current response

postDeleteItem

protected void postDeleteItem(atg.servlet.DynamoHttpServletRequest pRequest,
                              atg.servlet.DynamoHttpServletResponse pResponse)
                       throws javax.servlet.ServletException,
                              java.io.IOException
This method calls sendItemUpdateAuditEvents.

It also clears the editValue dictionary.

Overrides:
postDeleteItem in class atg.repository.servlet.RepositoryFormHandler
Throws:
javax.servlet.ServletException
java.io.IOException

handleCancel

public boolean handleCancel(atg.servlet.DynamoHttpServletRequest pRequest,
                            atg.servlet.DynamoHttpServletResponse pResponse)
                     throws javax.servlet.ServletException,
                            java.io.IOException
This method extension clears the editVlaue dictionary and nulls out the updateKey and repositoryId.

Overrides:
handleCancel in class atg.droplet.GenericFormHandler
Throws:
javax.servlet.ServletException
java.io.IOException

generateCreateItemUpdateAgentEvent

protected atg.agent.events.ItemUpdateAgentEvent generateCreateItemUpdateAgentEvent(atg.servlet.DynamoHttpServletRequest pRequest,
                                                                                   atg.servlet.DynamoHttpServletResponse pResponse)
Generates and ItemUpdateAgentEvent based on the new item created and the item that contains a reference to the newly created item.

Parameters:
pRequest - the current request
pResponse - the current response

generateDeleteItemUpdateAgentEvent

protected atg.agent.events.ItemUpdateAgentEvent generateDeleteItemUpdateAgentEvent(atg.servlet.DynamoHttpServletRequest pRequest,
                                                                                   atg.servlet.DynamoHttpServletResponse pResponse)
Generates an ItemUpdateAgentEvent based on the deleted item and the item that references the the deleted item.

Parameters:
pRequest - the current request
pResponse - the current response

generateUpdateItemUpdateAgentEvent

protected atg.agent.events.ItemUpdateAgentEvent generateUpdateItemUpdateAgentEvent(atg.servlet.DynamoHttpServletRequest pRequest,
                                                                                   atg.servlet.DynamoHttpServletResponse pResponse)
Generates an ItemUpdateAgentEvent based on the updates being made in the values dictionary and the values of updatePropertyName, updateRepositoryId and updateKey.

Parameters:
pRequest - the current request
pResponse - the current response

resetForm

protected void resetForm()
Resets the form properties repositoryId, updateKey, editValue dictionary, and value dictionary are reset.


validateUpdateProperties

protected void validateUpdateProperties(atg.servlet.DynamoHttpServletRequest pRequest,
                                        atg.servlet.DynamoHttpServletResponse pResponse)

isUpdateProperties

protected boolean isUpdateProperties()
Determines if the UpdateRepositoryId is valued.

Returns:
boolean