Class CmsWidgetDialog
- All Implemented Interfaces:
org.opencms.widgets.I_CmsWidgetDialog
- Direct Known Subclasses:
A_CmsEditGroupDialog
,A_CmsEditIndexSourceDialog
,A_CmsEditSearchIndexDialog
,A_CmsEditUserDialog
,A_CmsFieldConfigurationDialog
,A_CmsFieldDialog
,A_CmsMappingDialog
,A_CmsMessageDialog
,A_CmsOrgUnitDialog
,A_CmsRfsFileWidgetDialog
,A_CmsUserDataImexportDialog
,CmsCloneModule
,CmsContentCheckDialog
,CmsConvertXmlDialog
,CmsDatabaseExportDialog
,CmsDatabaseImportFromServer
,CmsDependenciesEdit
,CmsDependenciesOverview
,CmsEditLoginMessageDialog
,CmsEditProjectDialog
,CmsEditScheduledJobInfoDialog
,CmsEditUserAddInfoDialog
,CmsElementChangeLocaleDialog
,CmsExportpointsEdit
,CmsExportpointsOverview
,CmsFlexCacheClearDialog
,CmsFlexCacheOverviewDialog
,CmsGroupOverviewDialog
,CmsHistoryClearDialog
,CmsHistorySettingsDialog
,CmsHtmlImportDialog
,CmsImageCacheClearDialog
,CmsImageCacheOverviewDialog
,CmsInternalLinkValidationDialog
,CmsLanguageCopyFolderAndLanguageSelectDialog
,CmsModuleAddResourceTypes
,CmsModulesEditBase
,CmsModulesOverview
,CmsModulesUploadFromServer
,CmsPropertyviewDialog
,CmsRemovePubLocksDialog
,CmsResourceInfoDialog
,CmsRfsFileDisposalDialog
,CmsRfsFileDownloadDialog
,CmsRoleOverviewDialog
,CmsSearchDialog
,CmsSelectReceiverDialog
,CmsSendEmailGroupsDialog
,CmsSendPopupGroupsDialog
,CmsSiteDetailDialog
,CmsSitesSettingsDialog
,CmsSitesWebserverDialog
,CmsSourceSearchDialog
,CmsSynchronizeSettingsDialog
,CmsTagReplaceDialog
,CmsUpdateXmlDialog
,CmsUserOverviewDialog
,CmsUserRoleDialog
,CmsXmlContentRepairDialog
- Since:
- 6.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Action for optional element creation.static final int
Action for optional element removal.static final int
Value for the action: error in the form validation.static final int
Value for the action: save the dialog.static final String
Request parameter value for the action: save the dialog.static final String
Indicates an optional element should be created.static final String
Indicates an optional element should be removed.static final String
Prefix for "hidden" parameters, required since these must be unescaped later.The errors thrown by commit actions.protected Object
The object edited with this widget dialog.The allowed pages for this dialog in a List.protected String
Controls which page is currently displayed in the dialog.The validation errors for the input form.protected Map<String,
List<CmsWidgetDialogParameter>> Contains all parameter value of this dialog.protected List<CmsWidgetDialogParameter>
The list of widgets used on the dialog.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
ConstructorDescriptionCmsWidgetDialog
(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Public constructor with JSP variables.CmsWidgetDialog
(org.opencms.jsp.CmsJspActionElement jsp) Public constructor with JSP action element. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes the edited dialog object from the session.abstract void
Commits the edited object after pressing the "OK" button.void
Adds or removes an optional element.protected void
addCommitError
(Exception error) Adds the given error to the list of errors that are thrown by save actions or form generation.protected void
Adds a new widget parameter definition to the list of all widgets of this dialog.buildAddElement
(String elementName, int insertAfter, boolean enabled) Returns the html for a button to add an optional element.Builds the HTML for the dialog form.buildRemoveElement
(String elementName, int index, boolean enabled) Returns the html for a button to remove an optional element.void
Clears the "dialog object" for this widget dialog by removing it from the current users session.protected boolean
Returnstrue
if the dialog should be closed after the values have been committed.Commits all values on the dialog.commitWidgetValues
(String dialogPage) Commits all values on the given dialog page.protected String
Creates the dialog HTML for all defined widgets of this dialog.protected String
createDialogHtml
(String dialog) Creates the dialog HTML for all defined widgets of the named dialog (page).protected String
Creates the dialog HTML for all occurrences of one widget parameter.protected String
createDialogRowsHtml
(int startIndex, int endIndex) Creates the dialog widget rows HTML for the specified widget indices.protected String
Creates the complete widget dialog end block HTML that finishes a widget block.protected String
createWidgetBlockStart
(String headline) Create the complete widget dialog start block HTML that begins a widget block with optional headline.protected String
Creates the HTML for the error message if validation errors were found.protected String
Creates the HTML for the table around the dialog widgets.protected String
Creates the HTML to close the table around the dialog widgets.protected String
Generates the dialog starting html code.protected String
Returns the html code for the default action content.protected String
Generates the dialog ending html code.protected String
Generates the dialog starting html code.protected abstract void
Defines the list of parameters for this dialog.Builds the end HTML for a block with 3D border in the dialog content area.dialogBlockStart
(String headline) Builds the start HTML for a block with 3D border and optional subheadline in the dialog content area.Creates the HTML for the buttons on the dialog.void
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.protected void
fillWidgetValues
(javax.servlet.http.HttpServletRequest request) Fills all widgets of this widget dialog with the values from the request parameters.int
Returns the errors that are thrown by save actions or form generation.Returns the dialog object for this widget dialog, ornull
if no dialog object has been set.protected String
Returns the title for this Dialog.protected abstract String[]
Returns the allowed pages for this dialog.getPages()
Returns the allowed pages for this dialog.Returns the index of the element to add or remove.Returns the name of the element to add or remove.protected CmsWidgetDialogParameter
getParameterDefinition
(String name) Returns the parameter widget definition for the given parameter name.protected Map<String,
List<CmsWidgetDialogParameter>> Returns the map with the widget parameter values.Returns the page parameter.getParamValue
(String name) Returns the value of the widget parameter with the given name, ornull
if no such widget parameter is available.getParamValue
(String name, int index) Returns the value of the widget parameter with the given name and index, ornull
if no such widget parameter is available.Returns the validation errors for the dialog.protected String
Returns the widget HTML code for the given parameter.Generates the HTML for the end of the widget dialog.Generates the HTML include tags for external JavaScripts files of the used widgets.Generates the JavaScript init calls for the used widgets.Generates the JavaScript initialization methods for the used widgets.protected List<CmsWidgetDialogParameter>
Returns the list of all widgets used on this widget dialog, the List must contain Objects of type
.CmsWidgetDialogParameter
protected boolean
Returnstrue
if the current dialog (page) has commit errors.protected boolean
Returnstrue
if the current dialog (page) has validation errors.protected void
initWorkplaceRequestValues
(org.opencms.workplace.CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request) protected void
setCommitErrors
(List<Throwable> errors) Sets the errors that are thrown by save actions or form generation.void
setDialogObject
(Object dialogObject) Stores the given object as "dialog object" for this widget dialog in the current users session.protected void
setKeyPrefix
(String prefix) Sets an optional localized key prefix identificator for all widgets.protected void
Sets the allowed pages for this dialog.void
setParamElementIndex
(String elementIndex) Sets the index of the element to add or remove.void
setParamElementName
(String elementName) Sets the name of the element to add or remove.void
setParamPage
(String paramPage) Sets the page parameter.protected void
setValidationErrorList
(List<Throwable> errors) Sets the validation errors for the dialog.protected void
Should be overridden for parameter validation.Returns the values of all widget parameters of this dialog as HTML hidden fields.widgetParamsAsHidden
(String excludeDialogPage) Returns the values of all widget parameters of this dialog as HTML hidden fields, excluding the widget values that are on the given dialog page.void
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, 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, paramsAsParameterMap, paramsAsRequest, paramValues, resolveMacros, sendCmsRedirect, sendForward, setForwarded, shortKey, substituteSiteTitle, substituteSiteTitleStatic, switchToCurrentProject, switchToTempProject, updateUserPreferences
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opencms.widgets.I_CmsWidgetDialog
button, buttonBar, buttonBarHorizontalLine, buttonBarSeparator, buttonBarSpacer, buttonBarStartTab, dialogHorizontalSpacer, getLocale, getMessages, useNewStyle
-
Field Details
-
ACTION_ELEMENT_ADD
Action for optional element creation.- See Also:
-
ACTION_ELEMENT_REMOVE
Action for optional element removal.- See Also:
-
ACTION_ERROR
Value for the action: error in the form validation.- See Also:
-
ACTION_SAVE
Value for the action: save the dialog.- See Also:
-
DIALOG_SAVE
Request parameter value for the action: save the dialog.- See Also:
-
EDITOR_ACTION_ELEMENT_ADD
Indicates an optional element should be created.- See Also:
-
EDITOR_ACTION_ELEMENT_REMOVE
Indicates an optional element should be removed.- See Also:
-
HIDDEN_PARAM_PREFIX
Prefix for "hidden" parameters, required since these must be unescaped later.- See Also:
-
m_commitErrors
The errors thrown by commit actions. -
m_dialogObject
The object edited with this widget dialog. -
m_pages
The allowed pages for this dialog in a List. -
m_paramPage
Controls which page is currently displayed in the dialog. -
m_validationErrorList
The validation errors for the input form. -
m_widgetParamValues
Contains all parameter value of this dialog. -
m_widgets
The list of widgets used on the dialog.
-
-
Constructor Details
-
CmsWidgetDialog
Public constructor with JSP action element.- Parameters:
jsp
- an initialized JSP action element
-
CmsWidgetDialog
public CmsWidgetDialog(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Public constructor with JSP variables.- Parameters:
context
- the JSP page contextreq
- the JSP requestres
- the JSP response
-
-
Method Details
-
actionCancel
Deletes the edited dialog object from the session. -
actionCommit
Commits the edited object after pressing the "OK" button.- Throws:
IOException
- in case of errors forwarding to the required result pagejavax.servlet.ServletException
- in case of errors forwarding to the required result page
-
actionToggleElement
Adds or removes an optional element.Depends on the value stored in the
method.CmsDialog.getAction()
-
buildAddElement
Returns the html for a button to add an optional element.- Parameters:
elementName
- name of the elementinsertAfter
- the index of the element after which the new element should be createdenabled
- if true, the button to add an element is shown, otherwise a spacer is returned- Returns:
- the html for a button to add an optional element
-
buildDialogForm
Builds the HTML for the dialog form.- Returns:
- the HTML for the dialog form
-
buildRemoveElement
Returns the html for a button to remove an optional element.- Parameters:
elementName
- name of the elementindex
- the element index of the element to removeenabled
- if true, the button to remove an element is shown, otherwise a spacer is returned- Returns:
- the html for a button to remove an optional element
-
clearDialogObject
Clears the "dialog object" for this widget dialog by removing it from the current users session. -
dialogBlockEnd
Builds the end HTML for a block with 3D border in the dialog content area.- Overrides:
dialogBlockEnd
in classorg.opencms.workplace.CmsDialog
- Returns:
- 3D block start / end segment
-
dialogBlockStart
Builds the start HTML for a block with 3D border and optional subheadline in the dialog content area.- Overrides:
dialogBlockStart
in classorg.opencms.workplace.CmsDialog
- Parameters:
headline
- the headline String for the block- Returns:
- 3D block start / end segment
-
dialogButtonsCustom
Creates the HTML for the buttons on the dialog.- Returns:
- the HTML for the buttons on the dialog.
-
displayDialog
public void displayDialog() throws javax.servlet.jsp.JspException, IOException, javax.servlet.ServletExceptionPerforms the dialog actions depending on the initialized action and displays the dialog form.- Throws:
javax.servlet.jsp.JspException
- if dialog actions failIOException
- 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, 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 failIOException
- 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
-
getButtonStyle
- Specified by:
getButtonStyle
in interfaceorg.opencms.widgets.I_CmsWidgetDialog
- See Also:
-
I_CmsWidgetDialog.getButtonStyle()
-
getCommitErrors
Returns the errors that are thrown by save actions or form generation.- Returns:
- the errors that are thrown by save actions or form generation
-
getDialogObject
Returns the dialog object for this widget dialog, ornull
if no dialog object has been set.- Returns:
- the dialog object for this widget dialog, or
null
-
getHelpMessageIds
- Specified by:
getHelpMessageIds
in interfaceorg.opencms.widgets.I_CmsWidgetDialog
- See Also:
-
I_CmsWidgetDialog.getHelpMessageIds()
-
getParamElementIndex
Returns the index of the element to add or remove.- Returns:
- the index of the element to add or remove
-
getParamElementName
Returns the name of the element to add or remove.- Returns:
- the name of the element to add or remove
-
getParamPage
Returns the page parameter.- Returns:
- the page parameter
-
getParamValue
Returns the value of the widget parameter with the given name, ornull
if no such widget parameter is available.- Parameters:
name
- the widget parameter name to get the value for- Returns:
- the value of the widget parameter with the given name
-
getParamValue
Returns the value of the widget parameter with the given name and index, ornull
if no such widget parameter is available.- Parameters:
name
- the widget parameter name to get the value forindex
- the widget parameter index- Returns:
- the value of the widget parameter with the given name and index
-
getUserAgent
- Specified by:
getUserAgent
in interfaceorg.opencms.widgets.I_CmsWidgetDialog
- See Also:
-
I_CmsWidgetDialog.getUserAgent()
-
getWidgetHtmlEnd
Generates the HTML for the end of the widget dialog.This HTML includes additional components, for example the <div> tags containing the help texts.
- Returns:
- the HTML for the end of the widget dialog
-
getWidgetIncludes
Generates the HTML include tags for external JavaScripts files of the used widgets.- Returns:
- the HTML include tags for external JavaScripts files of the used widgets
- Throws:
javax.servlet.jsp.JspException
- if an error occurs during JavaScript generation
-
getWidgetInitCalls
Generates the JavaScript init calls for the used widgets.- Returns:
- the JavaScript init calls for the used widgets
- Throws:
javax.servlet.jsp.JspException
- the JavaScript init calls for the used widgets
-
getWidgetInitMethods
Generates the JavaScript initialization methods for the used widgets.- Returns:
- the JavaScript initialization methods for the used widgets
- Throws:
javax.servlet.jsp.JspException
- if an error occurs during JavaScript generation
-
paramsAsHidden
- Overrides:
paramsAsHidden
in classorg.opencms.workplace.CmsWorkplace
- See Also:
-
CmsWorkplace.paramsAsHidden()
-
setDialogObject
Stores the given object as "dialog object" for this widget dialog in the current users session.- Parameters:
dialogObject
- the object to store
-
setParamElementIndex
Sets the index of the element to add or remove.- Parameters:
elementIndex
- the index of the element to add or remove
-
setParamElementName
Sets the name of the element to add or remove.- Parameters:
elementName
- the name of the element to add or remove
-
setParamPage
Sets the page parameter.- Parameters:
paramPage
- the page parameter to set
-
widgetParamsAsHidden
Returns the values of all widget parameters of this dialog as HTML hidden fields.- Returns:
- the values of all widget parameters of this dialog as HTML hidden fields
- See Also:
-
CmsWorkplace.paramsAsHidden()
-
widgetParamsAsHidden
Returns the values of all widget parameters of this dialog as HTML hidden fields, excluding the widget values that are on the given dialog page.This can be used to create multi-page dialogs where the values are passed from one page to another before everything is submitted. If a widget A is used on page X, there should be no "hidden" HTML field for A since otherwise A would have 2 values when submitting the dialog page: The one from the widget itself and the one from the hidden field. This may lead to undefined results when processing the submitted values.
- Parameters:
excludeDialogPage
- the dialog page to exclude the values for- Returns:
- the values of all widget parameters of this dialog as HTML hidden fields, excluding the widget values that are on the given dialog page
- See Also:
-
CmsWorkplace.paramsAsHidden()
-
writeDialog
Writes the dialog html code, only if the
is set.CmsDialog.ACTION_DEFAULT
- Throws:
javax.servlet.jsp.JspException
- if dialog actions failIOException
- if writing to the JSP out fails, or in case of errors forwarding to the required result page
-
addCommitError
Adds the given error to the list of errors that are thrown by save actions or form generation.If the error list has not been initialized yet, this is done automatically.
- Parameters:
error
- the errors to add
-
addWidget
Adds a new widget parameter definition to the list of all widgets of this dialog.- Parameters:
param
- the widget parameter definition to add
-
closeDialogOnCommit
Returnstrue
if the dialog should be closed after the values have been committed.The default implementation returns
true
in case there are no commit errors.- Returns:
true
if the dialog should be closed after the values have been committed
-
commitWidgetValues
Commits all values on the dialog.- Returns:
- a List of all Exceptions that occurred when comitting the dialog.
-
commitWidgetValues
Commits all values on the given dialog page.- Parameters:
dialogPage
- the dialog (page) to commit- Returns:
- a List of all Exceptions that occurred when committing the dialog page.
-
createDialogHtml
Creates the dialog HTML for all defined widgets of this dialog.- Returns:
- the dialog HTML for all defined widgets of this dialog
-
createDialogHtml
Creates the dialog HTML for all defined widgets of the named dialog (page).To get a more complex layout variation, you have to overwrite this method in your dialog class.
- Parameters:
dialog
- the dialog (page) to get the HTML for- Returns:
- the dialog HTML for all defined widgets of the named dialog (page)
-
createDialogRowHtml
Creates the dialog HTML for all occurrences of one widget parameter.- Parameters:
base
- the widget parameter base- Returns:
- the dialog HTML for one widget parameter
-
createDialogRowsHtml
Creates the dialog widget rows HTML for the specified widget indices.- Parameters:
startIndex
- the widget index to start withendIndex
- the widget index to stop at- Returns:
- the dialog widget rows HTML for the specified widget indices
-
createWidgetBlockEnd
Creates the complete widget dialog end block HTML that finishes a widget block.- Returns:
- the complete widget dialog end block HTML that finishes a widget block
-
createWidgetBlockStart
Create the complete widget dialog start block HTML that begins a widget block with optional headline.- Parameters:
headline
- the headline String for the block- Returns:
- the complete widget dialog start block HTML that begins a widget block with optional headline
-
createWidgetErrorHeader
Creates the HTML for the error message if validation errors were found.- Returns:
- the HTML for the error message if validation errors were found
-
createWidgetTableEnd
Creates the HTML for the table around the dialog widgets.- Returns:
- the HTML for the table around the dialog widgets
-
createWidgetTableStart
Creates the HTML to close the table around the dialog widgets.- Returns:
- the HTML to close the table around the dialog widgets
-
defaultActionHtml
Generates the dialog starting html code.- Returns:
- html code
- Throws:
javax.servlet.jsp.JspException
- if something goes wrong
-
defaultActionHtmlContent
Returns the html code for the default action content.- Returns:
- html code
-
defaultActionHtmlEnd
Generates the dialog ending html code.- Returns:
- html code
-
defaultActionHtmlStart
Generates the dialog starting html code.- Returns:
- html code
- Throws:
javax.servlet.jsp.JspException
- if something goes wrong
-
defineWidgets
Defines the list of parameters for this dialog. -
fillWidgetValues
Fills all widgets of this widget dialog with the values from the request parameters.- Parameters:
request
- the current HTTP servlet request
-
getDialogTitle
Returns the title for this Dialog.In the default implementation this method returns
null
. Override this if needed.- Returns:
- the title for this Dialog, or
null
if this dialog has no title
-
getPageArray
Returns the allowed pages for this dialog.- Returns:
- the allowed pages for this dialog
-
getPages
Returns the allowed pages for this dialog.- Returns:
- the allowed pages for this dialog
-
getParameterDefinition
Returns the parameter widget definition for the given parameter name.- Parameters:
name
- the parameter name to get the definition for- Returns:
- the parameter widget definition for the given parameter name
-
getParameters
Returns the map with the widget parameter values.- Returns:
- the map with the widget parameter values
-
getValidationErrorList
Returns the validation errors for the dialog.The method (@link CmsWidgetDialog#commitWidgetValues(String)) has to set this list.
- Returns:
- the validation errors for the dialog
-
getWidget
Returns the widget HTML code for the given parameter.- Parameters:
param
- the name (id) of the parameter to get the widget HTML for- Returns:
- the widget HTML code for the given parameter
-
getWidgets
Returns the list of all widgets used on this widget dialog, the List must contain Objects of type
.CmsWidgetDialogParameter
- Returns:
- the list of all widgets used on this widget dialog
-
hasCommitErrors
Returnstrue
if the current dialog (page) has commit errors.- Returns:
true
if the current dialog (page) has commit errors
-
hasValidationErrors
Returnstrue
if the current dialog (page) has validation errors.- Returns:
true
if the current dialog (page) has validation errors
-
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)
-
setCommitErrors
Sets the errors that are thrown by save actions or form generation.- Parameters:
errors
- the errors that are thrown by save actions or form generation
-
setKeyPrefix
Sets an optional localized key prefix identificator for all widgets.- Parameters:
prefix
- the optional localized key prefix identificator for all widgets- See Also:
-
I_CmsWidgetParameter.setKeyPrefix(java.lang.String)
-
setPages
Sets the allowed pages for this dialog.- Parameters:
pages
- the allowed pages for this dialog
-
setValidationErrorList
Sets the validation errors for the dialog.Use this in the method (@link CmsWidgetDialog#commitWidgetValues(String)) to set the list.
- Parameters:
errors
- the validation errors
-
validateParamaters
Should be overridden for parameter validation.The exception is never seen by the user, so it can be just a
new
.Exception
()- Throws:
Exception
- if the parameters are not valid
-