atg.portal.admin
Class PageLayoutFormHandler

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.droplet.TransactionalFormHandler
                      extended by atg.portal.admin.PortalGenericFormHandler
                          extended by atg.portal.admin.PageFormHandler
                              extended by atg.portal.admin.PageLayoutFormHandler
All Implemented Interfaces:
DropletFormHandler, NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class PageLayoutFormHandler
extends PageFormHandler

This form handler provides convenient methods for updating a community page's layout

Everytime the previewLayout property is changed the handlePreviewLayout method will be called to rearrange the gears in the region definition(s) of the layout associated with the Page property of this form handler. The new arrangement of gears is available in a Map previewGearArrangement keyed by gear definition ids, which can be used by the page which is using this form handler to display the arrangement to the end user. finalLayout and finalGearArrangement properties are used to store the layout and gear arrangement for the page when handleUpdateLayout is called.

All handle methods in this form handler mirror a similiar pattern. Each handleXXX process, some have an associated preXXX and postXXX method. For example, the handleUpdateLayout has an associated preUpdateLayout and postUpdateLayout. These pre/post methods provide an easy way for customer's to extend the functionality of this form handler.

See Also:
TransactionalFormHandler, PortalGenericFormHandler, PageFormHandler

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
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.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
PageLayoutFormHandler()
           
 
Method Summary
 java.lang.String[] getFinalGearArrangement()
           
 java.lang.String[] getFinalRegionOrder()
           
 java.lang.String getGearArrangementListSeperator()
           
 java.util.Map getPreviewGearArrangement()
           
 java.lang.String getPreviewLayout()
           
 int getPreviewRegDefSize()
           
 boolean handlePreviewLayout(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Updates the arrangement of gears after a layout change in the previewGearArrangement property
 boolean handleUpdateLayoutAdminMode(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called to update the layout of to a page in admin mode
 boolean handleUpdateLayoutUserMode(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Called to update the layout of to a personalized page.
 void postUpdateLayoutAdminMode(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just after component update is finished
 void postUpdateLayoutUserMode(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just after component update is finished
 void preUpdateLayoutAdminMode(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before component update is started
 void preUpdateLayoutUserMode(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Operation called just before component update is started
protected  java.util.Map rearrangeGears(Page pPage, Layout pNewLayout)
          Create a map of gears list keyed on gear definition ids for the given page using the layout associated with the given pNewLayout.
protected  void resetBean()
          Reset this bean set properties to null
 void setFinalGearArrangement(int index, java.lang.String pFinalGearArrangementList)
           
 void setFinalRegionOrder(int index, java.lang.String pFinalRegionOrderList)
           
 void setGearArrangementListSeperator(java.lang.String pGearArrangementListSeperator)
           
 void setPreviewGearArrangement(java.util.Map pPreviewGearArrangement)
           
 void setPreviewLayout(java.lang.String pPreviewLayout)
           
 void setPreviewRegDefSize(int pPreviewLayoutSize)
           
protected  boolean updateLayoutAdminMode(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          updateLayout is called by the handlers to update the layout of the page.
protected  boolean updateLayoutUserMode(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          updateLayout is called by the handlers to update the layout of the page.
 
Methods inherited from class atg.portal.admin.PageFormHandler
createPageAdminMode, createPageUserMode, deletePageAdminMode, deletePageUserMode, getAccessLevel, getAllowLayoutChanges, getColorPalette, getCommunity, getCommunityId, getDescription, getFixed, getGears, getLayoutTemplate, getMakeDefault, getName, getPage, getPageId, getParentCommunity, getParentFolder, getPortal, getPosition, getProfile, getRegions, getUrl, getWirelessEnabled, handleCreatePageAdminMode, handleCreatePageUserMode, handleDeletePageAdminMode, handleDeletePageUserMode, handleReset, handleUpdatePageAdminMode, handleUpdatePageUserMode, postCreatePageAdminMode, postCreatePageUserMode, postDeletePageAdminMode, postDeletePageUserMode, postUpdatePageAdminMode, postUpdatePageUserMode, preCreatePageAdminMode, preCreatePageUserMode, preDeletePageAdminMode, preDeletePageUserMode, preUpdatePageAdminMode, preUpdatePageUserMode, setAccessLevel, setAllowLayoutChanges, setColorPalette, setCommunity, setCommunityId, setDescription, setFixed, setGears, setLayoutTemplate, setMakeDefault, setName, setPage, setPageId, setParentCommunity, setParentFolder, setPortal, setPosition, setProfile, setRegions, setUrl, setWirelessEnabled, updatePageAdminMode, updatePageUserMode
 
Methods inherited from class atg.portal.admin.PortalGenericFormHandler
addFormException, formatUserMessage, formatUserMessage, formatUserMessage, formatUserMessage, getDefaultLocale, getFailureMessageProcessor, getFailureURL, getFormError, getFormInfo, getFormMessages, getLocale, getPublisher, getSuccessMessageProcessor, getSuccessURL, getUserLocale, handleResetFormExceptions, handleResetFormMessages, handleSetLocale, isUseRequestLocale, processException, processException, processException, processException, processSuccess, processSuccess, processSuccess, resetFormMessages, sendAlertMessage, setDefaultLocale, setFailureMessageProcessor, setFailureURL, setPublisher, setSuccessMessageProcessor, setSuccessURL, setUseRequestLocale
 
Methods inherited from class atg.droplet.TransactionalFormHandler
afterSet, beforeSet, checkFormRedirect, commitTransaction, getTransactionDemarcation, getTransactionStatus, isEnsureTransaction, isRollbackTransaction, isRollbackTransactionOnUnhandledException, isTransactionMarkedAsRollback, setEnsureTransaction, setRollbackTransaction, setRollbackTransactionOnUnhandledException, setTransactionDemarcation
 
Methods inherited from class atg.droplet.GenericFormHandler
addUncheckedFormException, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, 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, getLoggingForVlogging, getLogListenerCount, getLogListeners, 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, reResolveThis, 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

Constructor Detail

PageLayoutFormHandler

public PageLayoutFormHandler()
Method Detail

getPreviewLayout

public java.lang.String getPreviewLayout()

setPreviewLayout

public void setPreviewLayout(java.lang.String pPreviewLayout)

getPreviewRegDefSize

public int getPreviewRegDefSize()

setPreviewRegDefSize

public void setPreviewRegDefSize(int pPreviewLayoutSize)

getFinalGearArrangement

public java.lang.String[] getFinalGearArrangement()

setFinalGearArrangement

public void setFinalGearArrangement(int index,
                                    java.lang.String pFinalGearArrangementList)

getPreviewGearArrangement

public java.util.Map getPreviewGearArrangement()

setPreviewGearArrangement

public void setPreviewGearArrangement(java.util.Map pPreviewGearArrangement)

getFinalRegionOrder

public java.lang.String[] getFinalRegionOrder()

setFinalRegionOrder

public void setFinalRegionOrder(int index,
                                java.lang.String pFinalRegionOrderList)

getGearArrangementListSeperator

public java.lang.String getGearArrangementListSeperator()

setGearArrangementListSeperator

public void setGearArrangementListSeperator(java.lang.String pGearArrangementListSeperator)

handleUpdateLayoutAdminMode

public boolean handleUpdateLayoutAdminMode(DynamoHttpServletRequest pRequest,
                                           DynamoHttpServletResponse pResponse)
                                    throws javax.servlet.ServletException,
                                           java.io.IOException
Called to update the layout of to a page in admin mode

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if successful, false otherwise.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

updateLayoutAdminMode

protected boolean updateLayoutAdminMode(DynamoHttpServletRequest pRequest,
                                        DynamoHttpServletResponse pResponse)
                                 throws java.io.IOException,
                                        javax.servlet.ServletException,
                                        SecurityException
updateLayout is called by the handlers to update the layout of the page.

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong
SecurityException

preUpdateLayoutAdminMode

public void preUpdateLayoutAdminMode(DynamoHttpServletRequest pRequest,
                                     DynamoHttpServletResponse pResponse)
                              throws javax.servlet.ServletException,
                                     java.io.IOException
Operation called just before component update is started

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

postUpdateLayoutAdminMode

public void postUpdateLayoutAdminMode(DynamoHttpServletRequest pRequest,
                                      DynamoHttpServletResponse pResponse)
                               throws javax.servlet.ServletException,
                                      java.io.IOException
Operation called just after component update is finished

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

handleUpdateLayoutUserMode

public boolean handleUpdateLayoutUserMode(DynamoHttpServletRequest pRequest,
                                          DynamoHttpServletResponse pResponse)
                                   throws javax.servlet.ServletException,
                                          java.io.IOException
Called to update the layout of to a personalized page. A new personalized page will be created for the current profile if one does not exist.

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if successful, false otherwise.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

updateLayoutUserMode

protected boolean updateLayoutUserMode(DynamoHttpServletRequest pRequest,
                                       DynamoHttpServletResponse pResponse)
                                throws java.io.IOException,
                                       javax.servlet.ServletException,
                                       SecurityException
updateLayout is called by the handlers to update the layout of the page.

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong
SecurityException

preUpdateLayoutUserMode

public void preUpdateLayoutUserMode(DynamoHttpServletRequest pRequest,
                                    DynamoHttpServletResponse pResponse)
                             throws javax.servlet.ServletException,
                                    java.io.IOException
Operation called just before component update is started

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

postUpdateLayoutUserMode

public void postUpdateLayoutUserMode(DynamoHttpServletRequest pRequest,
                                     DynamoHttpServletResponse pResponse)
                              throws javax.servlet.ServletException,
                                     java.io.IOException
Operation called just after component update is finished

Parameters:
pRequest - the dynamo request object
pResponse - the dynamo response object
Throws:
javax.servlet.ServletException - if something went wrong
java.io.IOException - if something went wrong

handlePreviewLayout

public boolean handlePreviewLayout(DynamoHttpServletRequest pRequest,
                                   DynamoHttpServletResponse pResponse)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
Updates the arrangement of gears after a layout change in the previewGearArrangement property

Parameters:
pRequest - the servlet's request
pResponse - the servlet's response
Returns:
true if successful, false otherwise.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

rearrangeGears

protected java.util.Map rearrangeGears(Page pPage,
                                       Layout pNewLayout)
                                throws PortalException
Create a map of gears list keyed on gear definition ids for the given page using the layout associated with the given pNewLayout. Gears are assigned to regions based on their width preferences. A gear having a matching width preference with the region definition will be assigned to that region definition. All gears that do not match any preference or if they do not have any preferences are assigned evenly across the region definition

Throws:
PortalException

resetBean

protected void resetBean()
Reset this bean set properties to null

Overrides:
resetBean in class PageFormHandler