Class A_CmsListDialog
- java.lang.Object
-
- org.opencms.workplace.CmsWorkplace
-
- org.opencms.workplace.tools.CmsToolDialog
-
- org.opencms.workplace.CmsDialog
-
- org.opencms.workplace.list.A_CmsListDialog
-
- Direct Known Subclasses:
A_CmsEmbeddedListDialog
,A_CmsGroupsList
,A_CmsGroupUsersList
,A_CmsListExplorerDialog
,A_CmsListResourceTypeDialog
,A_CmsOrgUnitsList
,A_CmsOrgUnitUsersList
,A_CmsResourceCategoriesList
,A_CmsRolesList
,A_CmsRoleUsersList
,A_CmsUserGroupsList
,A_CmsUsersList
,CmsAllPrincipalDependenciesList
,CmsDeletedResourcesList
,CmsElementComparisonList
,CmsExportpointsList
,CmsFlexCacheList
,CmsGroupPrincipalDependenciesList
,CmsGroupSelectionList
,CmsGroupTransferList
,CmsHistoryList
,CmsImageCacheList
,CmsLanguageCopySelectionList
,CmsLog4JAdminDialog
,CmsModulesDependenciesList
,CmsModulesList
,CmsOrgUnitSelectionList
,CmsPrincipalSelectionList
,CmsProjectHistoryList
,CmsProjectsList
,CmsPropertyComparisonList
,CmsPropertyviewList
,CmsSchedulerList
,CmsSearchFieldConfigurationList
,CmsSearchIndexList
,CmsSearchIndexSourceControlList
,CmsSessionsList
,CmsSitesOverviewList
,CmsUserPrincipalDependenciesList
,CmsUserSelectionList
,CmsUserTransferList
public abstract class A_CmsListDialog extends org.opencms.workplace.CmsDialog
Provides a dialog with a list widget.- Since:
- 6.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static int
ACTION_LIST_INDEPENDENT_ACTION
Value for the action: execute a list item independent action of the list.static int
ACTION_LIST_MULTI_ACTION
Value for the action: execute an multi action of the list.static int
ACTION_LIST_SEARCH
Value for the action: search the list.static int
ACTION_LIST_SELECT_PAGE
Value for the action: go to a page.static int
ACTION_LIST_SINGLE_ACTION
Value for the action: execute a single action of the list.static int
ACTION_LIST_SORT
Value for the action: sort the list.static java.lang.String
ICON_ACTIVE
Standard list button location.static java.lang.String
ICON_ADD
Standard list button location.static java.lang.String
ICON_DELETE
Standard list button location.static java.lang.String
ICON_DETAILS_HIDE
Standard list button location.static java.lang.String
ICON_DETAILS_SHOW
Standard list button location.static java.lang.String
ICON_DISABLED
Standard list button location.static java.lang.String
ICON_INACTIVE
Standard list button location.static java.lang.String
ICON_MINUS
Standard list button location.static java.lang.String
ICON_MULTI_ACTIVATE
Standard list button location.static java.lang.String
ICON_MULTI_ADD
Standard list button location.static java.lang.String
ICON_MULTI_DEACTIVATE
Standard list button location.static java.lang.String
ICON_MULTI_DELETE
Standard list button location.static java.lang.String
ICON_MULTI_MINUS
Standard list button location.static java.lang.String
KEY_META_DATA_CACHE
static java.lang.String
LIST_INDEPENDENT_ACTION
Request parameter value for the list action: a list item independent action has been triggered.static java.lang.String
LIST_MULTI_ACTION
Request parameter value for the list action: a multi action has been triggered.static java.lang.String
LIST_SEARCH
Request parameter value for the list action: search/filter.static java.lang.String
LIST_SELECT_PAGE
Request parameter value for the list action: select a page.static java.lang.String
LIST_SINGLE_ACTION
Request parameter value for the list action: a single action has been triggered.static java.lang.String
LIST_SORT
Request parameter value for the list action: sort.protected boolean
m_lazy
A flag which indicates whether the list should use database paging (only supported for some lists) .static java.lang.String
PARAM_FORMNAME
Request parameter key for the requested page.static java.lang.String
PARAM_LIST_ACTION
Request parameter key for the list action.static java.lang.String
PARAM_PAGE
Request parameter key for the requested page.static java.lang.String
PARAM_SEARCH_FILTER
Request parameter key for search the filter.static java.lang.String
PARAM_SEL_ITEMS
Request parameter key for the selected item(s).static java.lang.String
PARAM_SORT_COL
Request parameter key for the column to sort the list.-
Fields inherited from class org.opencms.workplace.CmsDialog
ACTION_CANCEL, ACTION_CLOSEPOPUP, ACTION_CLOSEPOPUP_SAVE, ACTION_CONFIRMED, ACTION_CONTINUE, ACTION_DEFAULT, ACTION_LOCKS_CONFIRMED, ACTION_OK, ACTION_REPORT_BEGIN, ACTION_REPORT_END, ACTION_REPORT_UPDATE, ACTION_SET, ACTION_WAIT, ATTRIBUTE_THROWABLE, BUTTON_ADVANCED, BUTTON_BACK, BUTTON_CANCEL, BUTTON_CLOSE, BUTTON_CONTINUE, BUTTON_DETAILS, BUTTON_DISCARD, BUTTON_EDIT, BUTTON_OK, BUTTON_OK_NO_SUBMIT, BUTTON_SET, DIALOG_BACK, DIALOG_CANCEL, DIALOG_CONFIRMED, DIALOG_CONTINUE, DIALOG_INITIAL, DIALOG_LOCKS_CONFIRMED, DIALOG_OK, DIALOG_SET, DIALOG_WAIT, PARAM_ACTION, PARAM_ACTION_VALUE_FOR_CHANGED_INDEX, PARAM_CLOSELINK, PARAM_DIALOGTYPE, PARAM_ERRORSTACK, PARAM_FILE, PARAM_FRAMENAME, PARAM_ISPOPUP, PARAM_LOCK, PARAM_MESSAGE, PARAM_ORIGINALPARAMS, PARAM_PREACTIONDONE, PARAM_REDIRECT, PARAM_RESOURCE, PARAM_TARGET, PARAM_THREAD, PARAM_THREAD_HASNEXT, PARAM_TITLE, REPORT_BEGIN, REPORT_END, REPORT_UPDATE
-
Fields inherited from class org.opencms.workplace.tools.CmsToolDialog
PARAM_ADMIN_PROJECT, PARAM_BASE, PARAM_FORCE, PARAM_PATH, PARAM_ROOT, PARAM_STYLE, STYLE_NEW
-
Fields inherited from class org.opencms.workplace.CmsWorkplace
DEBUG, DEFAULT_DATE_STRING, DEFAULT_LANGUAGE, DEFAULT_LOCALE, DIALOG_PATH_COMMON, FILE_DIALOG_CLOSE, FILE_DIALOG_SCREEN_CONFIRM, FILE_DIALOG_SCREEN_ERROR, FILE_DIALOG_SCREEN_ERRORPAGE, FILE_DIALOG_SCREEN_WAIT, FILE_EXPLORER_FILELIST, FILE_REPORT_OUTPUT, HTML_END, HTML_START, INPUT_DEFAULT, INPUT_NONE, JSP_WORKPLACE_URI, PARAM_DIRECTPUBLISH, PARAM_MODELFILE, PARAM_NEWRESOURCETYPE, PARAM_PUBLISHSIBLINGS, PARAM_RELATEDRESOURCES, PARAM_RESOURCELIST, PARAM_SUBRESOURCES, PARAM_WP_EXPLORER_RESOURCE, PARAM_WP_PROJECT, PARAM_WP_SITE, PARAM_WP_START, PARAM_WP_VIEW, PATH_DIALOGS, PATH_WORKPLACE, REQUEST_ATTRIBUTE_MULTIPART, REQUEST_ATTRIBUTE_RELOADTREE, RES_PATH_FILETYPES, RFS_PATH_RESOURCES, SESSION_WORKPLACE_CLASS, VFS_DIR_DEFAULTBODIES, VFS_DIR_TEMPLATES, VFS_PATH_COMMONS, VFS_PATH_EDITORS, VFS_PATH_GALLERIES, VFS_PATH_LOCALES, VFS_PATH_MODELDIALOG, VFS_PATH_MODULES, VFS_PATH_NEWRESOURCEDIALOG, VFS_PATH_RESOURCES, VFS_PATH_SITES, VFS_PATH_SYSTEM, VFS_PATH_VIEWS, VFS_PATH_WORKPLACE, VIEW_ADMIN, VIEW_DIRECT_EDIT, VIEW_EXPLORER, VIEW_GALLERY, VIEW_LIST, VIEW_WORKPLACE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
A_CmsListDialog(org.opencms.jsp.CmsJspActionElement jsp, java.lang.String listId, org.opencms.i18n.CmsMessageContainer listName, java.lang.String sortedColId, CmsListOrderEnum sortOrder, java.lang.String searchableColId)
Public constructor.protected
A_CmsListDialog(org.opencms.jsp.CmsJspActionElement jsp, java.lang.String listId, org.opencms.i18n.CmsMessageContainer listName, java.lang.String sortedColId, CmsListOrderEnum sortOrder, java.lang.String searchableColId, boolean lazy)
Public constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
actionDialog()
Performs the dialog actions depending on the initialized action.protected java.lang.String
customHtmlEnd()
Can be overwritten to add some code after the list.protected java.lang.String
customHtmlStart()
Can be overwritten to add some code before the list.java.lang.String
defaultActionHtml()
Generates the dialog starting html code.protected java.lang.String
defaultActionHtmlContent()
Returns the html code for the default action content.protected java.lang.String
defaultActionHtmlEnd()
Generates the dialog ending html code.protected java.lang.String
defaultActionHtmlStart()
Generates the dialog starting html code.void
displayDialog()
Performs the dialog actions depending on the initialized action and displays the dialog form.void
displayDialog(boolean writeLater)
Performs the dialog actions depending on the initialized action and displays the dialog form if needed.void
executeDefaultActions()
This method execute the default actions for searching, sorting and paging.void
executeListIndepActions()
This method should handle the default list independent actions, by comparing
with the id of the action to execute.getParamListAction()
abstract void
executeListMultiActions()
This method should handle every defined list multi action, by comparing
with the id of the action to execute.getParamListAction()
abstract void
executeListSingleActions()
This method should handle every defined list single action, by comparing
with the id of the action to execute.getParamListAction()
protected void
executeSearch()
Filter a list, given the action is set toLIST_SEARCH
and the filter text is set in thePARAM_SEARCH_FILTER
parameter.protected void
executeSelectPage()
Select a page, given the action is set toLIST_SELECT_PAGE
and the page to go to is set in thePARAM_PAGE
parameter.protected void
executeSort()
Sort the list, given the action is set toLIST_SORT
and the sort column is set in thePARAM_SORT_COL
parameter.protected abstract void
fillDetails(java.lang.String detailId)
Lazy initialization for detail data.protected void
fillList()
Calls the
method and catches any exception.getListItems()
CmsHtmlList
getList()
Returns the list.java.lang.String
getListId()
Returns the Id of the list.protected abstract java.util.List<CmsListItem>
getListItems()
Should generate a list with the list items to be displayed.static CmsHtmlList
getListObject(java.lang.Class<?> listDialog, org.opencms.workplace.CmsWorkplaceSettings settings)
Returns the list object for the given list dialog, ornull
if no list object has been set.protected CmsListState
getListState()
Returns the current list state.CmsListMetadata
getMetadata(java.lang.String listDialogName)
Returns the list metadata object for the given dialog.CmsListMetadata
getMetadata(java.lang.String listDialogName, java.lang.String listId)
Should generate the metadata definition for the list, and return the corresponding
object.CmsListMetadata
protected java.util.Map<java.lang.String,CmsListMetadata>
getMetadataCache()
Gets the list metadata cache.java.lang.String
getParamFormName()
Returns the form name.java.lang.String
getParamListAction()
Returns the List Action.java.lang.String
getParamPage()
Returns the current Page.java.lang.String
getParamSearchFilter()
Returns the Search Filter.java.lang.String
getParamSelItems()
Returns the selected Items.java.lang.String
getParamSortCol()
Returns the sorted Column.CmsListItem
getSelectedItem()
Returns the current selected item.java.util.List<CmsListItem>
getSelectedItems()
Returns a list of current selected items.protected void
initializeDetail(java.lang.String detailId)
Lazy details initialization.protected void
initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request)
boolean
isActive()
Returns the activation flag.protected void
listRecovery(java.lang.String listId)
Recover the last list instance that is read from the request attributes.protected void
listSave()
Save the state of the list in the session.void
refreshList()
This method re-read the rows of the list, the user should call this method after executing an action that add or remove rows to the list.void
removeList()
Removes the list from the workplace settings.protected abstract void
setColumns(CmsListMetadata metadata)
Should create the columns and add them to the given list metadata object.protected abstract void
setIndependentActions(CmsListMetadata metadata)
Should add the independent actions to the given list metadata object.void
setList(CmsHtmlList list)
Sets the list.void
setListObject(java.lang.Class<?> listDialog, CmsHtmlList listObject)
Stores the given object as "list object" for the given list dialog in the current users session.protected abstract void
setMultiActions(CmsListMetadata metadata)
Should add the multi actions to the given list metadata object.void
setParamFormName(java.lang.String formName)
Sets the form name.void
setParamListAction(java.lang.String listAction)
Sets the List Action.void
setParamPage(java.lang.String page)
Sets the current Page.void
setParamSearchFilter(java.lang.String searchFilter)
Sets the Search Filter.void
setParamSelItems(java.lang.String paramSelItems)
Sets the selected Items.void
setParamSortCol(java.lang.String sortCol)
Sets the sorted Column.protected void
setSearchAction(CmsListMetadata metadata, java.lang.String columnId)
Creates the default search action.protected void
throwListUnsupportedActionException()
A convenient method to throw a list unsupported action runtime exception.protected void
validateParamaters()
Should be overridden for parameter validation.void
writeDialog()
Writes the dialog html code, only if the
is set.CmsDialog.ACTION_DEFAULT
-
Methods inherited from class org.opencms.workplace.CmsDialog
actionCloseDialog, appendDelimiter, buildAjaxResultContainer, buildAjaxWaitMessage, buildLockAdditionalOptions, buildLockConfirmationMessageJS, buildLockHeaderBox, checkResourcePermissions, checkResourcePermissions, computeCurrentFolder, dialog, dialogBlock, dialogBlockEnd, dialogBlockStart, dialogButtonRow, dialogButtonRowEnd, dialogButtonRowStart, dialogButtons, dialogButtonsClose, dialogButtonsClose, dialogButtonsCloseDetails, dialogButtonsHtml, dialogButtonsOk, dialogButtonsOk, dialogButtonsOkCancel, dialogButtonsOkCancel, dialogButtonsOkCancelAdvanced, dialogButtonsSetOkCancel, dialogContent, dialogContentEnd, dialogContentStart, dialogEnd, dialogHead, dialogHorizontalSpacer, dialogLockButtons, dialogRow, dialogRowEnd, dialogRowStart, dialogScriptSubmit, dialogSeparator, dialogSpacer, dialogStart, dialogStart, dialogSubheadline, dialogToggleStart, dialogWhiteBox, dialogWhiteBoxEnd, dialogWhiteBoxStart, getAction, getAdministrationBackLink, getCancelAction, getDialogRealUri, getDialogUri, getOnlineHelpUriCustom, getParamAction, getParamCloseLink, getParamDialogtype, getParamFramename, getParamIsPopup, getParamMessage, getParamOriginalParams, getParamPreActionDone, getParamRedirect, getParamResource, getParamTitle, getState, hasCorrectLockstate, hasSiblings, htmlStart, htmlStart, htmlStart, htmlStartStyle, includeErrorpage, initCmsDialog, isPopup, isPreEditor, openLaunchpad, openWorkplaceLink, pageHtml, pageHtml, setAction, setOnlineHelpUriCustom, setParamAction, setParamCloseLink, setParamDialogtype, setParamFramename, setParamIsPopup, setParamMessage, setParamOriginalParams, setParamPreActionDone, setParamRedirect, setParamResource, setParamTitle
-
Methods inherited from class org.opencms.workplace.tools.CmsToolDialog
computeUpLevelLink, dialogTitle, getAdminTool, getCurrentToolPath, getParamBase, getParamForce, getParamPath, getParamRoot, getParamStyle, getParentPath, getToolManager, iconsBlockArea, iconsBlockAreaEnd, iconsBlockAreaStart, initAdminTool, pageBody, pageHtmlStyle, setParamBase, setParamForce, setParamPath, setParamRoot, setParamStyle, useNewStyle
-
Methods inherited from class org.opencms.workplace.CmsWorkplace
addMessages, addMessages, allParamsAsHidden, allParamsAsRequest, allParamValues, bodyEnd, bodyStart, bodyStart, buildSelect, buildSelect, button, button, buttonBar, buttonBar, buttonBarHorizontalLine, buttonBarLabel, buttonBarLabel, buttonBarLine, buttonBarLineSpacer, buttonBarSeparator, buttonBarSpacer, buttonBarStartTab, canEditPermissionsForRoles, checkLock, checkLock, checkRole, decodeParamValue, fillParamValues, fillParamValues, generateCssStyle, generatePageEndExtended, generatePageEndSimple, generatePageStartExtended, generatePageStartSimple, getBroadcastMessageString, getCms, getEncoding, getExplorerFileListFullUri, getFrameSource, getJsp, getLocale, getMacroResolver, getMessages, getMultiPartFileItems, getParameterMap, getResourceUri, getResourceUri, getSession, getSettings, getSkinUri, getStartSiteRoot, getStartSiteRoot, getStaticResourceUri, getStaticResourceUri, getStyleUri, getStyleUri, getStyleUri, getTemporaryFileName, getWorkplaceExplorerLink, getWorkplaceExplorerLink, getWorkplaceSettings, htmlEnd, initMessages, initSettings, initTimeWarp, initUserSettings, initWorkplaceMembers, initWorkplaceMembers, initWorkplaceSettings, isForwarded, isHelpEnabled, isSubElement, isTemporaryFile, key, key, keyDefault, nullToEmpty, paramsAsHidden, paramsAsHidden, paramsAsParameterMap, paramsAsRequest, paramValues, resolveMacros, sendCmsRedirect, sendForward, setForwarded, shortKey, substituteSiteTitle, substituteSiteTitleStatic, switchToCurrentProject, switchToTempProject, updateUserPreferences
-
-
-
-
Field Detail
-
ACTION_LIST_INDEPENDENT_ACTION
public static final int ACTION_LIST_INDEPENDENT_ACTION
Value for the action: execute a list item independent action of the list.- See Also:
- Constant Field Values
-
ACTION_LIST_MULTI_ACTION
public static final int ACTION_LIST_MULTI_ACTION
Value for the action: execute an multi action of the list.- See Also:
- Constant Field Values
-
ACTION_LIST_SEARCH
public static final int ACTION_LIST_SEARCH
Value for the action: search the list.- See Also:
- Constant Field Values
-
ACTION_LIST_SELECT_PAGE
public static final int ACTION_LIST_SELECT_PAGE
Value for the action: go to a page.- See Also:
- Constant Field Values
-
ACTION_LIST_SINGLE_ACTION
public static final int ACTION_LIST_SINGLE_ACTION
Value for the action: execute a single action of the list.- See Also:
- Constant Field Values
-
ACTION_LIST_SORT
public static final int ACTION_LIST_SORT
Value for the action: sort the list.- See Also:
- Constant Field Values
-
ICON_ACTIVE
public static final java.lang.String ICON_ACTIVE
Standard list button location.- See Also:
- Constant Field Values
-
ICON_ADD
public static final java.lang.String ICON_ADD
Standard list button location.- See Also:
- Constant Field Values
-
ICON_DELETE
public static final java.lang.String ICON_DELETE
Standard list button location.- See Also:
- Constant Field Values
-
ICON_DETAILS_HIDE
public static final java.lang.String ICON_DETAILS_HIDE
Standard list button location.- See Also:
- Constant Field Values
-
ICON_DETAILS_SHOW
public static final java.lang.String ICON_DETAILS_SHOW
Standard list button location.- See Also:
- Constant Field Values
-
ICON_DISABLED
public static final java.lang.String ICON_DISABLED
Standard list button location.- See Also:
- Constant Field Values
-
ICON_INACTIVE
public static final java.lang.String ICON_INACTIVE
Standard list button location.- See Also:
- Constant Field Values
-
ICON_MINUS
public static final java.lang.String ICON_MINUS
Standard list button location.- See Also:
- Constant Field Values
-
ICON_MULTI_ACTIVATE
public static final java.lang.String ICON_MULTI_ACTIVATE
Standard list button location.- See Also:
- Constant Field Values
-
ICON_MULTI_ADD
public static final java.lang.String ICON_MULTI_ADD
Standard list button location.- See Also:
- Constant Field Values
-
ICON_MULTI_DEACTIVATE
public static final java.lang.String ICON_MULTI_DEACTIVATE
Standard list button location.- See Also:
- Constant Field Values
-
ICON_MULTI_DELETE
public static final java.lang.String ICON_MULTI_DELETE
Standard list button location.- See Also:
- Constant Field Values
-
ICON_MULTI_MINUS
public static final java.lang.String ICON_MULTI_MINUS
Standard list button location.- See Also:
- Constant Field Values
-
LIST_INDEPENDENT_ACTION
public static final java.lang.String LIST_INDEPENDENT_ACTION
Request parameter value for the list action: a list item independent action has been triggered.- See Also:
- Constant Field Values
-
LIST_MULTI_ACTION
public static final java.lang.String LIST_MULTI_ACTION
Request parameter value for the list action: a multi action has been triggered.- See Also:
- Constant Field Values
-
LIST_SEARCH
public static final java.lang.String LIST_SEARCH
Request parameter value for the list action: search/filter.- See Also:
- Constant Field Values
-
LIST_SELECT_PAGE
public static final java.lang.String LIST_SELECT_PAGE
Request parameter value for the list action: select a page.- See Also:
- Constant Field Values
-
LIST_SINGLE_ACTION
public static final java.lang.String LIST_SINGLE_ACTION
Request parameter value for the list action: a single action has been triggered.- See Also:
- Constant Field Values
-
LIST_SORT
public static final java.lang.String LIST_SORT
Request parameter value for the list action: sort.- See Also:
- Constant Field Values
-
PARAM_FORMNAME
public static final java.lang.String PARAM_FORMNAME
Request parameter key for the requested page.- See Also:
- Constant Field Values
-
PARAM_LIST_ACTION
public static final java.lang.String PARAM_LIST_ACTION
Request parameter key for the list action.- See Also:
- Constant Field Values
-
PARAM_PAGE
public static final java.lang.String PARAM_PAGE
Request parameter key for the requested page.- See Also:
- Constant Field Values
-
PARAM_SEARCH_FILTER
public static final java.lang.String PARAM_SEARCH_FILTER
Request parameter key for search the filter.- See Also:
- Constant Field Values
-
PARAM_SEL_ITEMS
public static final java.lang.String PARAM_SEL_ITEMS
Request parameter key for the selected item(s).- See Also:
- Constant Field Values
-
PARAM_SORT_COL
public static final java.lang.String PARAM_SORT_COL
Request parameter key for the column to sort the list.- See Also:
- Constant Field Values
-
KEY_META_DATA_CACHE
public static java.lang.String KEY_META_DATA_CACHE
-
m_lazy
protected boolean m_lazy
A flag which indicates whether the list should use database paging (only supported for some lists) .
-
-
Constructor Detail
-
A_CmsListDialog
protected A_CmsListDialog(org.opencms.jsp.CmsJspActionElement jsp, java.lang.String listId, org.opencms.i18n.CmsMessageContainer listName, java.lang.String sortedColId, CmsListOrderEnum sortOrder, java.lang.String searchableColId)
Public constructor.- Parameters:
jsp
- an initialized JSP action elementlistId
- the id of the displayed listlistName
- the name of the listsortedColId
- the a priory sorted columnsortOrder
- the order of the sorted columnsearchableColId
- the column to search into
-
A_CmsListDialog
protected A_CmsListDialog(org.opencms.jsp.CmsJspActionElement jsp, java.lang.String listId, org.opencms.i18n.CmsMessageContainer listName, java.lang.String sortedColId, CmsListOrderEnum sortOrder, java.lang.String searchableColId, boolean lazy)
Public constructor.- Parameters:
jsp
- an initialized JSP action elementlistId
- the id of the displayed listlistName
- the name of the listsortedColId
- the a priory sorted columnsortOrder
- the order of the sorted columnsearchableColId
- the column to search intolazy
- if this parameter is true, the list should load only load the list items of the current page, if possible
-
-
Method Detail
-
getListObject
public static CmsHtmlList getListObject(java.lang.Class<?> listDialog, org.opencms.workplace.CmsWorkplaceSettings settings)
Returns the list object for the given list dialog, ornull
if no list object has been set.- Parameters:
listDialog
- the list dialog classsettings
- the wp settings for accessing the session- Returns:
- the list object for this list dialog, or
null
-
actionDialog
public void actionDialog() throws javax.servlet.jsp.JspException, javax.servlet.ServletException, java.io.IOException
Performs the dialog actions depending on the initialized action.- Throws:
javax.servlet.jsp.JspException
- if dialog actions failjava.io.IOException
- in case of errors forwarding to the required result pagejavax.servlet.ServletException
- in case of errors forwarding to the required result page
-
defaultActionHtml
public java.lang.String defaultActionHtml()
Generates the dialog starting html code.- Returns:
- html code
-
displayDialog
public void displayDialog() throws javax.servlet.jsp.JspException, java.io.IOException, javax.servlet.ServletException
Performs the dialog actions depending on the initialized action and displays the dialog form.- Throws:
javax.servlet.jsp.JspException
- if dialog actions failjava.io.IOException
- if writing to the JSP out fails, or in case of errors forwarding to the required result pagejavax.servlet.ServletException
- in case of errors forwarding to the required result page
-
displayDialog
public void displayDialog(boolean writeLater) throws javax.servlet.jsp.JspException, java.io.IOException, javax.servlet.ServletException
Performs the dialog actions depending on the initialized action and displays the dialog form if needed.- Parameters:
writeLater
- iftrue
no output is written, you have to call manually the
method.defaultActionHtml()
- Throws:
javax.servlet.jsp.JspException
- if dialog actions failjava.io.IOException
- if writing to the JSP out fails, or in case of errors forwarding to the required result pagejavax.servlet.ServletException
- in case of errors forwarding to the required result page
-
executeDefaultActions
public void executeDefaultActions()
This method execute the default actions for searching, sorting and paging.
-
executeListIndepActions
public void executeListIndepActions()
This method should handle the default list independent actions, by comparing
with the id of the action to execute.getParamListAction()
if you want to handle additional independent actions, override this method, handling your actions and FINALLY calling
super.executeListIndepActions();
.
-
executeListMultiActions
public abstract void executeListMultiActions() throws java.io.IOException, javax.servlet.ServletException, org.opencms.main.CmsRuntimeException
This method should handle every defined list multi action, by comparing
with the id of the action to execute.getParamListAction()
- Throws:
java.io.IOException
- in case of errors when including a required sub-elementjavax.servlet.ServletException
- in case of errors when including a required sub-elementorg.opencms.main.CmsRuntimeException
- to signal that an action is not supported
-
executeListSingleActions
public abstract void executeListSingleActions() throws java.io.IOException, javax.servlet.ServletException, org.opencms.main.CmsRuntimeException
This method should handle every defined list single action, by comparing
with the id of the action to execute.getParamListAction()
- Throws:
java.io.IOException
- in case of errors when including a required sub-elementjavax.servlet.ServletException
- in case of errors when including a required sub-elementorg.opencms.main.CmsRuntimeException
- to signal that an action is not supported
-
getList
public CmsHtmlList getList()
Returns the list.- Returns:
- the list
-
getListId
public final java.lang.String getListId()
Returns the Id of the list.- Returns:
- the list Id
-
getMetadata
public CmsListMetadata getMetadata(java.lang.String listDialogName)
Returns the list metadata object for the given dialog.- Parameters:
listDialogName
- the dialog class name- Returns:
- the list metadata object
-
getMetadata
public CmsListMetadata getMetadata(java.lang.String listDialogName, java.lang.String listId)
Should generate the metadata definition for the list, and return the corresponding
object.CmsListMetadata
- Parameters:
listDialogName
- the name of the class generating the listlistId
- the id of the list- Returns:
- The metadata for the given list
-
getParamFormName
public java.lang.String getParamFormName()
Returns the form name.- Returns:
- the form name
-
getParamListAction
public java.lang.String getParamListAction()
Returns the List Action.- Returns:
- the List Action
-
getParamPage
public java.lang.String getParamPage()
Returns the current Page.- Returns:
- the current Page
-
getParamSearchFilter
public java.lang.String getParamSearchFilter()
Returns the Search Filter.- Returns:
- the Search Filter
-
getParamSelItems
public java.lang.String getParamSelItems()
Returns the selected Items.- Returns:
- the selected Items
-
getParamSortCol
public java.lang.String getParamSortCol()
Returns the sorted Column.- Returns:
- the sorted Column
-
getSelectedItem
public CmsListItem getSelectedItem()
Returns the current selected item.- Returns:
- the current selected item
-
getSelectedItems
public java.util.List<CmsListItem> getSelectedItems()
Returns a list of current selected items.- Returns:
- a list of current selected items
-
isActive
public boolean isActive()
Returns the activation flag.Useful for dialogs with several lists.
Is
if the original
formname
parameter is equals to${listId}-form
.- Returns:
- the activation flag
-
refreshList
public void refreshList()
This method re-read the rows of the list, the user should call this method after executing an action that add or remove rows to the list.
-
removeList
public void removeList()
Removes the list from the workplace settings.Next time the list is displayed the list will be reloaded.
-
setList
public void setList(CmsHtmlList list)
Sets the list.- Parameters:
list
- the list to set
-
setListObject
public void setListObject(java.lang.Class<?> listDialog, CmsHtmlList listObject)
Stores the given object as "list object" for the given list dialog in the current users session.- Parameters:
listDialog
- the list dialog classlistObject
- the list to store
-
setParamFormName
public void setParamFormName(java.lang.String formName)
Sets the form name.- Parameters:
formName
- the form name to set
-
setParamListAction
public void setParamListAction(java.lang.String listAction)
Sets the List Action.- Parameters:
listAction
- the list Action to set
-
setParamPage
public void setParamPage(java.lang.String page)
Sets the current Page.- Parameters:
page
- the current Page to set
-
setParamSearchFilter
public void setParamSearchFilter(java.lang.String searchFilter)
Sets the Search Filter.- Parameters:
searchFilter
- the Search Filter to set
-
setParamSelItems
public void setParamSelItems(java.lang.String paramSelItems)
Sets the selected Items.- Parameters:
paramSelItems
- the selected Items to set
-
setParamSortCol
public void setParamSortCol(java.lang.String sortCol)
Sets the sorted Column.- Parameters:
sortCol
- the sorted Column to set
-
writeDialog
public void writeDialog() throws java.io.IOException
Writes the dialog html code, only if the
is set.CmsDialog.ACTION_DEFAULT
- Throws:
java.io.IOException
- if writing to the JSP out fails, or in case of errros forwarding to the required result page
-
customHtmlEnd
protected java.lang.String customHtmlEnd()
Can be overwritten to add some code after the list.- Returns:
- custom html code
-
customHtmlStart
protected java.lang.String customHtmlStart()
Can be overwritten to add some code before the list.- Returns:
- custom html code
-
defaultActionHtmlContent
protected java.lang.String defaultActionHtmlContent()
Returns the html code for the default action content.- Returns:
- html code
-
defaultActionHtmlEnd
protected java.lang.String defaultActionHtmlEnd()
Generates the dialog ending html code.- Returns:
- html code
-
defaultActionHtmlStart
protected java.lang.String defaultActionHtmlStart()
Generates the dialog starting html code.- Returns:
- html code
-
executeSearch
protected void executeSearch()
Filter a list, given the action is set toLIST_SEARCH
and the filter text is set in thePARAM_SEARCH_FILTER
parameter.
-
executeSelectPage
protected void executeSelectPage()
Select a page, given the action is set toLIST_SELECT_PAGE
and the page to go to is set in thePARAM_PAGE
parameter.
-
executeSort
protected void executeSort()
Sort the list, given the action is set toLIST_SORT
and the sort column is set in thePARAM_SORT_COL
parameter.
-
fillDetails
protected abstract void fillDetails(java.lang.String detailId)
Lazy initialization for detail data.Should fill the given detail column for every list item in
Should not throw any kind of exception.CmsHtmlList.getContent()
- Parameters:
detailId
- the id of the detail to initialize
-
fillList
protected void fillList()
Calls the
method and catches any exception.getListItems()
-
getListItems
protected abstract java.util.List<CmsListItem> getListItems() throws org.opencms.main.CmsException
Should generate a list with the list items to be displayed.- Returns:
- a list of
sCmsListItem
- Throws:
org.opencms.main.CmsException
- if something goes wrong
-
getListState
protected CmsListState getListState()
Returns the current list state.- Returns:
- the current list state
-
getMetadataCache
protected java.util.Map<java.lang.String,CmsListMetadata> getMetadataCache()
Gets the list metadata cache.- Returns:
- the list metadata cache
-
initializeDetail
protected void initializeDetail(java.lang.String detailId)
Lazy details initialization.- Parameters:
detailId
- the id of the detail column
-
initWorkplaceRequestValues
protected void initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request)
- Overrides:
initWorkplaceRequestValues
in classorg.opencms.workplace.CmsDialog
- See Also:
CmsWorkplace.initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)
-
listRecovery
protected void listRecovery(java.lang.String listId)
Recover the last list instance that is read from the request attributes.This is required for keep the whole list in memory while you browse a page.
- Parameters:
listId
- the id of the expected list
-
listSave
protected void listSave()
Save the state of the list in the session.
-
setColumns
protected abstract void setColumns(CmsListMetadata metadata)
Should create the columns and add them to the given list metadata object.This method will be just executed once, the first time the constructor is called.
- Parameters:
metadata
- the list metadata
-
setIndependentActions
protected abstract void setIndependentActions(CmsListMetadata metadata)
Should add the independent actions to the given list metadata object.This method will be just executed once, the first time the constructor is called.
- Parameters:
metadata
- the list metadata
-
setMultiActions
protected abstract void setMultiActions(CmsListMetadata metadata)
Should add the multi actions to the given list metadata object.This method will be just executed once, the first time the constructor is called.
- Parameters:
metadata
- the list metadata
-
setSearchAction
protected void setSearchAction(CmsListMetadata metadata, java.lang.String columnId)
Creates the default search action.Can be overridden for more sophisticated search.
- Parameters:
metadata
- the metadata of the list to do searchablecolumnId
- the if of the column to search into
-
throwListUnsupportedActionException
protected void throwListUnsupportedActionException() throws org.opencms.main.CmsRuntimeException
A convenient method to throw a list unsupported action runtime exception.Should be triggered if your list implementation does not support the
action.getParamListAction()
- Throws:
org.opencms.main.CmsRuntimeException
- always to signal that this operation is not supported
-
validateParamaters
protected void validateParamaters() throws java.lang.Exception
Should be overridden for parameter validation.- Throws:
java.lang.Exception
- if the parameters are not valid
-
-