atg.svc.ui.formhandlers
Class ListChooserFormHandler

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.web.formhandlers.ApplicationFormHandler
                          extended by atg.svc.ui.formhandlers.test.TreeTableDelegatingFormHandler
                              extended by atg.svc.ui.formhandlers.ListChooserFormHandler
All Implemented Interfaces:
atg.droplet.DropletFormHandler, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, 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, TreeTableFormHandler, Listable, Selectable, java.util.EventListener
Direct Known Subclasses:
OrgChooserFormHandler, UserChooserListFormHandler

public class ListChooserFormHandler
extends atg.svc.ui.formhandlers.test.TreeTableDelegatingFormHandler
implements Listable, Selectable

Data source for TreeTable displaying list to be used in List Constraint Editor. Works with different data sources depending from editorField value:

Allows filtering by starting letters. By default, gets values from "SolutionStatus" repository view of ServiceSharedRepository. Allows changing repository, view (items), filtering RQLWhere condition by Nucleus properties file. Returns viewItems as List of DynamicBeanMap items around repository items retrieved.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String CONSTRAINT_LANGUAGE
           
static java.lang.String CONSTRAINT_SELFSERVICE_AUDIENCE
           
protected  java.lang.String editorField
          Name of the constraint attribute or field.
protected  java.lang.String mAdminField
          fieldName, used in admin global field defn
protected  java.lang.String mBaseValue
          Semicolon-separated list of item repository Ids that are initially selected
protected  java.lang.String mFilterKeyword
          Will participate in filtering list to values whose name starts with this value.
protected  java.lang.String mItemKey
           
protected  atg.repository.Repository mRepository
          Repository containing views "SolutionStatus" and "FieldDefinition" or specified specific view.
protected  java.lang.String mRepositoryView
          If this property is specified, use this view to get list of items to display.
protected  SegmentService mSegmentService
          Provides internal Groups for "selfServiceAudience" value of editorField.
protected  java.util.Map mSelectedKeys
          Currently selected keys are mapped to Boolean.TRUE values for easy determining in JSP if given key is selected.
protected  SolutionService mSolutionService
           
protected  java.util.List mViewItems
          visible list items
static java.lang.String PROPERTY_DISPLAY_NAME
           
static java.lang.String PROPERTY_REPOSITORY_ID
           
protected static java.lang.String STATUS_FILTER_RQL
          Text of RQL query to filter solution status values (by displayName property).
static java.lang.String STATUS_VIEW
          Name of repository view to get statuses list from.
 
Fields inherited from class atg.svc.ui.formhandlers.test.TreeTableDelegatingFormHandler
mOperation, mParameters, mState, mTreeTableId, mView
 
Fields inherited from class atg.web.formhandlers.ApplicationFormHandler
EQUALS, PARAM_DELIMITER, QUERY_DELIMITER, 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.svc.ui.treetable.Selectable
SELECT_MULTIPLE, SELECT_NONE, SELECT_SINGLE
 
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
ListChooserFormHandler()
           
 
Method Summary
 void doStartService()
           
static void fillSelectedFromState(java.util.Map pSelectedKeys, StateContainer pState)
          Fill the map provided with Boolean.TRUE values for each itemKey in "pState.selected"
protected  java.util.Collection filterListValues(java.util.Collection src)
          Filters list values by mFilterKeyword
protected  StateContainer findStateContainer()
           
 java.lang.String getAdminField()
          Name of the admin field
 java.lang.String getAllRQLWhere()
          Text of RQL query to get all values in proper order.
 java.lang.String getBaseValue()
          Semicolon-separated list of item repository Ids that are initially selected
 java.lang.String getEditorConstraintType()
           
 java.lang.String getEditorField()
          Name of the constraint attribute or field.
 java.lang.String getFilterKeyword()
           
 java.lang.String getFilterRQLWhere()
          Text of RQL query to filter values: STATUS_FILTER_RQL if editorField is "status",
 java.lang.String getItemKey()
           
 java.lang.String getItemName()
           
 java.lang.String getLanguageProperty()
           
protected  java.util.List getLanguages()
           
 atg.repository.Repository getRepository()
          Repository containing views "SolutionStatus" and "FieldDefinition" or specified specific view.
 java.lang.String getRepositoryView()
          Name of this repository view will be used to extract full or filtered list of items.
protected  java.util.List getSegmentItems()
          Retrieve items from segment
 SegmentService getSegmentService()
           
 java.util.List<java.lang.String> getSelectedItemsList()
          Display names of all selected items.
 java.util.Map getSelectedKeys()
          Currently selected keys are mapped to Boolean.TRUE values for easy determining in JSP if given key is selected.
 java.util.List<java.lang.String> getSelectedKeysList()
          Made to preserve sorting of mViewItems
 SiteService getSiteService()
           
 SolutionService getSolutionService()
           
 int getTotalItemCount()
          Same as getTotalItemCount().
 int getViewItemCount()
           
 java.util.List getViewItems()
          Create collection of visible list items.
 boolean handleList(atg.servlet.DynamoHttpServletRequest request, atg.servlet.DynamoHttpServletResponse response)
          Prepare for rendering of TreeTable
 boolean isStatusField()
           
protected  java.util.List prepareSelectedList(java.util.Collection pViewItems, java.lang.String propertyName)
           
protected  void resetListValue(atg.servlet.DynamoHttpServletRequest pRequest)
          Called on reset and refresh operations Cleans up the selection and initializes selected keys from the base value
protected  void saveStateContainer(StateContainer pStateContainer)
           
 void select(java.lang.Object pItemKey, java.lang.String pMode)
          Implementation of Selectable interface.
 void setAdminField(java.lang.String adminField)
          Name of the admin field
 void setBaseValue(java.lang.String pBaseValue)
          initially selected items (saved in DB)
 void setEditorConstraintType(java.lang.String pEditorConstraintType)
           
 void setEditorField(java.lang.String editorField)
          Name of the constraint attribute or field.
 void setFilterKeyword(java.lang.String filterKeyword)
          Value of the filter criteria.
 void setItemKey(java.lang.String itemKey)
           
 void setLanguageProperty(java.lang.String pLanguageProperty)
          Sets LanguageProperty
 void setRepository(atg.repository.Repository repository)
          Repository containing views "SolutionStatus" and "FieldDefinition" or specified specific view.
 void setRepositoryView(java.lang.String pRepositoryView)
           
 void setSegmentService(SegmentService pSegmentService)
          Set source of internal Groups.
 void setSiteService(SiteService pSiteService)
           
 void setSolutionService(SolutionService pSolutionService)
           
 void setState(java.lang.String pState)
          Remember treetable state, remember keys of already selected items in the List.
 void setViewItems(java.util.List viewItems)
          Use this method in JSP to set items to be shown
protected  java.util.List uploadRepositoryItems()
          Retrieve items from specified repository and view.
protected  java.util.List uploadViewItems()
          Retrieve items from canned list, or from SegmentService specified, or from repository.
static java.util.List wrapArray(java.lang.Object[] pItems)
          Make array of objects (usually RepositoryItem's) to be a list of DynamicBeanMap (recursively wrapped).
static java.util.List wrapCollection(java.util.Collection children)
          Make list of arbitrary JavaBean objects to be list of DynamicBeanMap (recursively wrapped).
static java.util.List wrapProfileGroups(java.util.List children)
          Make list of ProfileGroups objects to be list of Map having repositoryId and displayName.
static java.util.List wrapSelfServiceAudienceCollection(java.util.Collection children)
          Make list of Organization objects to be list of Map having repositoryId and displayName.
 
Methods inherited from class atg.svc.ui.formhandlers.test.TreeTableDelegatingFormHandler
getOperation, getParameters, getState, getTreeTableId, getView, handleResponse, setOperation, setParameters, setTreeTableId, setView, validate
 
Methods inherited from class atg.web.formhandlers.ApplicationFormHandler
addParameterToURLString, beforeGet, beforeSet, checkFormError, checkFormRedirect, checkFormSuccess, formHandlerBeforeGet, formHandlerBeforeSet, formHandlerInit, getErrorURL, getRedirectDelayMS, getString, getString, getString, getSuccessURL, getUserMessagesResourceBundle, handleCancel, processException, processException, processExceptionAndLog, processExceptionAndLog, redirect, setErrorURL, setRedirectDelayMS, setSuccessURL, setUserMessagesResourceBundle
 
Methods inherited from class atg.droplet.TransactionalFormHandler
afterSet, commitTransaction, getTransactionDemarcation, getTransactionStatus, isEnsureTransaction, isRollbackTransaction, isRollbackTransactionOnUnhandledException, isTransactionMarkedAsRollback, setEnsureTransaction, setRollbackTransaction, setRollbackTransactionOnUnhandledException, setTransactionDemarcation
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, 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
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


STATUS_VIEW

public static final java.lang.String STATUS_VIEW
Name of repository view to get statuses list from. Used when editorField property is "status".

See Also:
Constant Field Values

CONSTRAINT_LANGUAGE

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

CONSTRAINT_SELFSERVICE_AUDIENCE

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

PROPERTY_DISPLAY_NAME

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

PROPERTY_REPOSITORY_ID

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

mFilterKeyword

protected java.lang.String mFilterKeyword
Will participate in filtering list to values whose name starts with this value.


editorField

protected java.lang.String editorField
Name of the constraint attribute or field.


mAdminField

protected java.lang.String mAdminField
fieldName, used in admin global field defn


mBaseValue

protected java.lang.String mBaseValue
Semicolon-separated list of item repository Ids that are initially selected


mRepository

protected atg.repository.Repository mRepository
Repository containing views "SolutionStatus" and "FieldDefinition" or specified specific view.


mRepositoryView

protected java.lang.String mRepositoryView
If this property is specified, use this view to get list of items to display.


STATUS_FILTER_RQL

protected static java.lang.String STATUS_FILTER_RQL
Text of RQL query to filter solution status values (by displayName property).


mSegmentService

protected SegmentService mSegmentService
Provides internal Groups for "selfServiceAudience" value of editorField.


mSolutionService

protected SolutionService mSolutionService

mViewItems

protected java.util.List mViewItems
visible list items


mItemKey

protected java.lang.String mItemKey

mSelectedKeys

protected java.util.Map mSelectedKeys
Currently selected keys are mapped to Boolean.TRUE values for easy determining in JSP if given key is selected.

Constructor Detail

ListChooserFormHandler

public ListChooserFormHandler()
Method Detail

getLanguages

protected java.util.List getLanguages()
Returns:
list of language repository item imitations (maps)

doStartService

public void doStartService()
                    throws atg.nucleus.ServiceException
Overrides:
doStartService in class atg.nucleus.GenericService
Throws:
atg.nucleus.ServiceException

getSiteService

public SiteService getSiteService()

setSiteService

public void setSiteService(SiteService pSiteService)

getFilterKeyword

public java.lang.String getFilterKeyword()
Returns:
value of the filter criteria of the list.

setFilterKeyword

public void setFilterKeyword(java.lang.String filterKeyword)
Value of the filter criteria.


getEditorField

public java.lang.String getEditorField()
Name of the constraint attribute or field.


setEditorField

public void setEditorField(java.lang.String editorField)
Name of the constraint attribute or field.


getEditorConstraintType

public java.lang.String getEditorConstraintType()

setEditorConstraintType

public void setEditorConstraintType(java.lang.String pEditorConstraintType)

getAdminField

public java.lang.String getAdminField()
Name of the admin field


setAdminField

public void setAdminField(java.lang.String adminField)
Name of the admin field


getBaseValue

public java.lang.String getBaseValue()
Semicolon-separated list of item repository Ids that are initially selected


setBaseValue

public void setBaseValue(java.lang.String pBaseValue)
initially selected items (saved in DB)

Parameters:
pBaseValue - Semicolon-separated list of item repository Ids

getRepository

public atg.repository.Repository getRepository()
Repository containing views "SolutionStatus" and "FieldDefinition" or specified specific view.


setRepository

public void setRepository(atg.repository.Repository repository)
Repository containing views "SolutionStatus" and "FieldDefinition" or specified specific view.


getRepositoryView

public java.lang.String getRepositoryView()
Name of this repository view will be used to extract full or filtered list of items.

Returns:
STATUS_VIEW if editorField is "status", "FieldDefinition" if mRepositoryView is not specified and mRepositoryView if specified.

isStatusField

public boolean isStatusField()
Returns:
boolean value, which means whether statuses list should be extracted or not.

setRepositoryView

public void setRepositoryView(java.lang.String pRepositoryView)
Parameters:
pRepositoryView - Name of the repository view that will be used to extract full or filtered list of items.

getFilterRQLWhere

public java.lang.String getFilterRQLWhere()
Text of RQL query to filter values: STATUS_FILTER_RQL if editorField is "status",


getAllRQLWhere

public java.lang.String getAllRQLWhere()
Text of RQL query to get all values in proper order.


getLanguageProperty

public java.lang.String getLanguageProperty()
Returns:
LanguageProperty

setLanguageProperty

public void setLanguageProperty(java.lang.String pLanguageProperty)
Sets LanguageProperty


getSegmentService

public SegmentService getSegmentService()
Returns:
SegmentService configured

setSegmentService

public void setSegmentService(SegmentService pSegmentService)
Set source of internal Groups.


getSolutionService

public SolutionService getSolutionService()
Returns:
solution service for internal groups

setSolutionService

public void setSolutionService(SolutionService pSolutionService)
Parameters:
pSolutionService - solution service for internal groups

getViewItems

public java.util.List getViewItems()
Create collection of visible list items.

Specified by:
getViewItems in interface Listable
Returns:
created collection of list items.

setViewItems

public void setViewItems(java.util.List viewItems)
Use this method in JSP to set items to be shown

Parameters:
viewItems -

getViewItemCount

public int getViewItemCount()
Specified by:
getViewItemCount in interface Listable
Returns:
Number of all items visible to user at this time (taking into account filtering).

getTotalItemCount

public int getTotalItemCount()
Same as getTotalItemCount().

Specified by:
getTotalItemCount in interface Listable
Returns:
Number of all items visible to user at this time (taking into account filtering).

getItemKey

public java.lang.String getItemKey()

setItemKey

public void setItemKey(java.lang.String itemKey)

getItemName

public java.lang.String getItemName()

getSelectedKeys

public java.util.Map getSelectedKeys()
Currently selected keys are mapped to Boolean.TRUE values for easy determining in JSP if given key is selected.


getSelectedKeysList

public java.util.List<java.lang.String> getSelectedKeysList()
Made to preserve sorting of mViewItems

Returns:
keys of all selected items to allow iteration.

getSelectedItemsList

public java.util.List<java.lang.String> getSelectedItemsList()
Display names of all selected items.


prepareSelectedList

protected java.util.List prepareSelectedList(java.util.Collection pViewItems,
                                             java.lang.String propertyName)
Parameters:
propertyName -
Returns:
Display names of specified items.

setState

public void setState(java.lang.String pState)
Remember treetable state, remember keys of already selected items in the List.

Specified by:
setState in interface TreeTableFormHandler
Overrides:
setState in class atg.svc.ui.formhandlers.test.TreeTableDelegatingFormHandler
Parameters:
pState - serialized string for TreeTable component state stored on client

fillSelectedFromState

public static void fillSelectedFromState(java.util.Map pSelectedKeys,
                                         StateContainer pState)
Fill the map provided with Boolean.TRUE values for each itemKey in "pState.selected"

Parameters:
pSelectedKeys - map to update
pState - Tree state that holds all the selected items

select

public void select(java.lang.Object pItemKey,
                   java.lang.String pMode)
Implementation of Selectable interface. Called when user selects some new item. Add this new key to List of already selected.

Specified by:
select in interface Selectable
Parameters:
pItemKey - key of the newly selected item

handleList

public boolean handleList(atg.servlet.DynamoHttpServletRequest request,
                          atg.servlet.DynamoHttpServletResponse response)
                   throws java.lang.Exception
Prepare for rendering of TreeTable

Throws:
java.lang.Exception

resetListValue

protected void resetListValue(atg.servlet.DynamoHttpServletRequest pRequest)
Called on reset and refresh operations Cleans up the selection and initializes selected keys from the base value


uploadViewItems

protected java.util.List uploadViewItems()
Retrieve items from canned list, or from SegmentService specified, or from repository.

Returns:
actual items to show

getSegmentItems

protected java.util.List getSegmentItems()
Retrieve items from segment

Returns:
wrapped segment items

uploadRepositoryItems

protected java.util.List uploadRepositoryItems()
Retrieve items from specified repository and view.

Returns:
wrapped repository items
See Also:
#getRepositoryView()} for details what repository view is used., #wrapArray(java.lang.Object[])} how wrapping works.

filterListValues

protected java.util.Collection filterListValues(java.util.Collection src)
Filters list values by mFilterKeyword

Parameters:
src - source collection
Returns:
collection of list values starting with mFilterKeyword

wrapCollection

public static java.util.List wrapCollection(java.util.Collection children)
Make list of arbitrary JavaBean objects to be list of DynamicBeanMap (recursively wrapped).

Parameters:
children - collection to wrap
Returns:
ArrayList having Map objects

wrapSelfServiceAudienceCollection

public static java.util.List wrapSelfServiceAudienceCollection(java.util.Collection children)
Make list of Organization objects to be list of Map having repositoryId and displayName.

Parameters:
children - collection to wrap
Returns:
List having Map objects
See Also:
#getRepItemImitation(java.lang.String, java.lang.String)} how items are wrapping

wrapProfileGroups

public static java.util.List wrapProfileGroups(java.util.List children)
Make list of ProfileGroups objects to be list of Map having repositoryId and displayName.

Parameters:
children - collection to wrap
Returns:
ArrayList having Map objects
See Also:
#getRepItemImitation(java.lang.String, java.lang.String)} how items are wrapping

wrapArray

public static java.util.List wrapArray(java.lang.Object[] pItems)
Make array of objects (usually RepositoryItem's) to be a list of DynamicBeanMap (recursively wrapped).

Parameters:
pItems - array to wrap
Returns:
list having DynamicBeanMap objects.

findStateContainer

protected StateContainer findStateContainer()

saveStateContainer

protected void saveStateContainer(StateContainer pStateContainer)