Class CmsWidgetDialog
- java.lang.Object
-
- org.opencms.workplace.CmsWorkplace
-
- org.opencms.workplace.tools.CmsToolDialog
-
- org.opencms.workplace.CmsDialog
-
- org.opencms.workplace.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
public abstract class CmsWidgetDialog extends org.opencms.workplace.CmsDialog implements org.opencms.widgets.I_CmsWidgetDialog
Base class for dialogs that use the OpenCms widgets without XML content.- Since:
- 6.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static int
ACTION_ELEMENT_ADD
Action for optional element creation.static int
ACTION_ELEMENT_REMOVE
Action for optional element removal.static int
ACTION_ERROR
Value for the action: error in the form validation.static int
ACTION_SAVE
Value for the action: save the dialog.static java.lang.String
DIALOG_SAVE
Request parameter value for the action: save the dialog.static java.lang.String
EDITOR_ACTION_ELEMENT_ADD
Indicates an optional element should be created.static java.lang.String
EDITOR_ACTION_ELEMENT_REMOVE
Indicates an optional element should be removed.static java.lang.String
HIDDEN_PARAM_PREFIX
Prefix for "hidden" parameters, required since these must be unescaped later.protected java.util.List<java.lang.Throwable>
m_commitErrors
The errors thrown by commit actions.protected java.lang.Object
m_dialogObject
The object edited with this widget dialog.protected java.util.List<java.lang.String>
m_pages
The allowed pages for this dialog in a List.protected java.lang.String
m_paramPage
Controls which page is currently displayed in the dialog.protected java.util.List<java.lang.Throwable>
m_validationErrorList
The validation errors for the input form.protected java.util.Map<java.lang.String,java.util.List<CmsWidgetDialogParameter>>
m_widgetParamValues
Contains all parameter value of this dialog.protected java.util.List<CmsWidgetDialogParameter>
m_widgets
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
Constructors Constructor Description CmsWidgetDialog(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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
actionCancel()
Deletes the edited dialog object from the session.abstract void
actionCommit()
Commits the edited object after pressing the "OK" button.void
actionToggleElement()
Adds or removes an optional element.protected void
addCommitError(java.lang.Exception error)
Adds the given error to the list of errors that are thrown by save actions or form generation.protected void
addWidget(CmsWidgetDialogParameter param)
Adds a new widget parameter definition to the list of all widgets of this dialog.java.lang.String
buildAddElement(java.lang.String elementName, int insertAfter, boolean enabled)
Returns the html for a button to add an optional element.java.lang.String
buildDialogForm()
Builds the HTML for the dialog form.java.lang.String
buildRemoveElement(java.lang.String elementName, int index, boolean enabled)
Returns the html for a button to remove an optional element.void
clearDialogObject()
Clears the "dialog object" for this widget dialog by removing it from the current users session.protected boolean
closeDialogOnCommit()
Returnstrue
if the dialog should be closed after the values have been committed.protected java.util.List<java.lang.Throwable>
commitWidgetValues()
Commits all values on the dialog.protected java.util.List<java.lang.Throwable>
commitWidgetValues(java.lang.String dialogPage)
Commits all values on the given dialog page.protected java.lang.String
createDialogHtml()
Creates the dialog HTML for all defined widgets of this dialog.protected java.lang.String
createDialogHtml(java.lang.String dialog)
Creates the dialog HTML for all defined widgets of the named dialog (page).protected java.lang.String
createDialogRowHtml(CmsWidgetDialogParameter base)
Creates the dialog HTML for all occurrences of one widget parameter.protected java.lang.String
createDialogRowsHtml(int startIndex, int endIndex)
Creates the dialog widget rows HTML for the specified widget indices.protected java.lang.String
createWidgetBlockEnd()
Creates the complete widget dialog end block HTML that finishes a widget block.protected java.lang.String
createWidgetBlockStart(java.lang.String headline)
Create the complete widget dialog start block HTML that begins a widget block with optional headline.protected java.lang.String
createWidgetErrorHeader()
Creates the HTML for the error message if validation errors were found.protected java.lang.String
createWidgetTableEnd()
Creates the HTML for the table around the dialog widgets.protected java.lang.String
createWidgetTableStart()
Creates the HTML to close the table around the dialog widgets.protected 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.protected abstract void
defineWidgets()
Defines the list of parameters for this dialog.java.lang.String
dialogBlockEnd()
Builds the end HTML for a block with 3D border in the dialog content area.java.lang.String
dialogBlockStart(java.lang.String headline)
Builds the start HTML for a block with 3D border and optional subheadline in the dialog content area.java.lang.String
dialogButtonsCustom()
Creates the HTML for the buttons on the dialog.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.protected void
fillWidgetValues(javax.servlet.http.HttpServletRequest request)
Fills all widgets of this widget dialog with the values from the request parameters.int
getButtonStyle()
java.util.List<java.lang.Throwable>
getCommitErrors()
Returns the errors that are thrown by save actions or form generation.java.lang.Object
getDialogObject()
Returns the dialog object for this widget dialog, ornull
if no dialog object has been set.protected java.lang.String
getDialogTitle()
Returns the title for this Dialog.java.util.Set<java.lang.String>
getHelpMessageIds()
protected abstract java.lang.String[]
getPageArray()
Returns the allowed pages for this dialog.protected java.util.List<java.lang.String>
getPages()
Returns the allowed pages for this dialog.java.lang.String
getParamElementIndex()
Returns the index of the element to add or remove.java.lang.String
getParamElementName()
Returns the name of the element to add or remove.protected CmsWidgetDialogParameter
getParameterDefinition(java.lang.String name)
Returns the parameter widget definition for the given parameter name.protected java.util.Map<java.lang.String,java.util.List<CmsWidgetDialogParameter>>
getParameters()
Returns the map with the widget parameter values.java.lang.String
getParamPage()
Returns the page parameter.java.lang.String
getParamValue(java.lang.String name)
Returns the value of the widget parameter with the given name, ornull
if no such widget parameter is available.java.lang.String
getParamValue(java.lang.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.java.lang.String
getUserAgent()
protected java.util.List<java.lang.Throwable>
getValidationErrorList()
Returns the validation errors for the dialog.protected java.lang.String
getWidget(CmsWidgetDialogParameter param)
Returns the widget HTML code for the given parameter.java.lang.String
getWidgetHtmlEnd()
Generates the HTML for the end of the widget dialog.java.lang.String
getWidgetIncludes()
Generates the HTML include tags for external JavaScripts files of the used widgets.java.lang.String
getWidgetInitCalls()
Generates the JavaScript init calls for the used widgets.java.lang.String
getWidgetInitMethods()
Generates the JavaScript initialization methods for the used widgets.protected java.util.List<CmsWidgetDialogParameter>
getWidgets()
Returns the list of all widgets used on this widget dialog, the List must contain Objects of type
.CmsWidgetDialogParameter
protected boolean
hasCommitErrors()
Returnstrue
if the current dialog (page) has commit errors.protected boolean
hasValidationErrors()
Returnstrue
if the current dialog (page) has validation errors.protected void
initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request)
java.lang.String
paramsAsHidden()
protected void
setCommitErrors(java.util.List<java.lang.Throwable> errors)
Sets the errors that are thrown by save actions or form generation.void
setDialogObject(java.lang.Object dialogObject)
Stores the given object as "dialog object" for this widget dialog in the current users session.protected void
setKeyPrefix(java.lang.String prefix)
Sets an optional localized key prefix identificator for all widgets.protected void
setPages(java.util.List<java.lang.String> pages)
Sets the allowed pages for this dialog.void
setParamElementIndex(java.lang.String elementIndex)
Sets the index of the element to add or remove.void
setParamElementName(java.lang.String elementName)
Sets the name of the element to add or remove.void
setParamPage(java.lang.String paramPage)
Sets the page parameter.protected void
setValidationErrorList(java.util.List<java.lang.Throwable> errors)
Sets the validation errors for the dialog.protected void
validateParamaters()
Should be overridden for parameter validation.java.lang.String
widgetParamsAsHidden()
Returns the values of all widget parameters of this dialog as HTML hidden fields.java.lang.String
widgetParamsAsHidden(java.lang.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
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, 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
-
-
-
-
Field Detail
-
ACTION_ELEMENT_ADD
public static final int ACTION_ELEMENT_ADD
Action for optional element creation.- See Also:
- Constant Field Values
-
ACTION_ELEMENT_REMOVE
public static final int ACTION_ELEMENT_REMOVE
Action for optional element removal.- See Also:
- Constant Field Values
-
ACTION_ERROR
public static final int ACTION_ERROR
Value for the action: error in the form validation.- See Also:
- Constant Field Values
-
ACTION_SAVE
public static final int ACTION_SAVE
Value for the action: save the dialog.- See Also:
- Constant Field Values
-
DIALOG_SAVE
public static final java.lang.String DIALOG_SAVE
Request parameter value for the action: save the dialog.- See Also:
- Constant Field Values
-
EDITOR_ACTION_ELEMENT_ADD
public static final java.lang.String EDITOR_ACTION_ELEMENT_ADD
Indicates an optional element should be created.- See Also:
- Constant Field Values
-
EDITOR_ACTION_ELEMENT_REMOVE
public static final java.lang.String EDITOR_ACTION_ELEMENT_REMOVE
Indicates an optional element should be removed.- See Also:
- Constant Field Values
-
HIDDEN_PARAM_PREFIX
public static final java.lang.String HIDDEN_PARAM_PREFIX
Prefix for "hidden" parameters, required since these must be unescaped later.- See Also:
- Constant Field Values
-
m_commitErrors
protected java.util.List<java.lang.Throwable> m_commitErrors
The errors thrown by commit actions.
-
m_dialogObject
protected java.lang.Object m_dialogObject
The object edited with this widget dialog.
-
m_pages
protected java.util.List<java.lang.String> m_pages
The allowed pages for this dialog in a List.
-
m_paramPage
protected java.lang.String m_paramPage
Controls which page is currently displayed in the dialog.
-
m_validationErrorList
protected java.util.List<java.lang.Throwable> m_validationErrorList
The validation errors for the input form.
-
m_widgetParamValues
protected java.util.Map<java.lang.String,java.util.List<CmsWidgetDialogParameter>> m_widgetParamValues
Contains all parameter value of this dialog.
-
m_widgets
protected java.util.List<CmsWidgetDialogParameter> m_widgets
The list of widgets used on the dialog.
-
-
Constructor Detail
-
CmsWidgetDialog
public CmsWidgetDialog(org.opencms.jsp.CmsJspActionElement jsp)
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 Detail
-
actionCancel
public void actionCancel()
Deletes the edited dialog object from the session.
-
actionCommit
public abstract void actionCommit() throws java.io.IOException, javax.servlet.ServletException
Commits the edited object after pressing the "OK" button.- Throws:
java.io.IOException
- in case of errors forwarding to the required result pagejavax.servlet.ServletException
- in case of errors forwarding to the required result page
-
actionToggleElement
public void actionToggleElement()
Adds or removes an optional element.Depends on the value stored in the
method.CmsDialog.getAction()
-
buildAddElement
public java.lang.String buildAddElement(java.lang.String elementName, int insertAfter, boolean enabled)
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
public java.lang.String buildDialogForm()
Builds the HTML for the dialog form.- Returns:
- the HTML for the dialog form
-
buildRemoveElement
public java.lang.String buildRemoveElement(java.lang.String elementName, int index, boolean enabled)
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
public void clearDialogObject()
Clears the "dialog object" for this widget dialog by removing it from the current users session.
-
dialogBlockEnd
public java.lang.String 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
public java.lang.String dialogBlockStart(java.lang.String headline)
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
public java.lang.String 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, 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
-
getButtonStyle
public int getButtonStyle()
- Specified by:
getButtonStyle
in interfaceorg.opencms.widgets.I_CmsWidgetDialog
- See Also:
I_CmsWidgetDialog.getButtonStyle()
-
getCommitErrors
public java.util.List<java.lang.Throwable> 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
public java.lang.Object 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
public java.util.Set<java.lang.String> getHelpMessageIds()
- Specified by:
getHelpMessageIds
in interfaceorg.opencms.widgets.I_CmsWidgetDialog
- See Also:
I_CmsWidgetDialog.getHelpMessageIds()
-
getParamElementIndex
public java.lang.String getParamElementIndex()
Returns the index of the element to add or remove.- Returns:
- the index of the element to add or remove
-
getParamElementName
public java.lang.String getParamElementName()
Returns the name of the element to add or remove.- Returns:
- the name of the element to add or remove
-
getParamPage
public java.lang.String getParamPage()
Returns the page parameter.- Returns:
- the page parameter
-
getParamValue
public java.lang.String getParamValue(java.lang.String name)
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
public java.lang.String getParamValue(java.lang.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.- 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
public java.lang.String getUserAgent()
- Specified by:
getUserAgent
in interfaceorg.opencms.widgets.I_CmsWidgetDialog
- See Also:
I_CmsWidgetDialog.getUserAgent()
-
getWidgetHtmlEnd
public java.lang.String 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
public java.lang.String getWidgetIncludes() throws javax.servlet.jsp.JspException
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
public java.lang.String getWidgetInitCalls() throws javax.servlet.jsp.JspException
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
public java.lang.String getWidgetInitMethods() throws javax.servlet.jsp.JspException
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
public java.lang.String paramsAsHidden()
- Overrides:
paramsAsHidden
in classorg.opencms.workplace.CmsWorkplace
- See Also:
CmsWorkplace.paramsAsHidden()
-
setDialogObject
public void setDialogObject(java.lang.Object dialogObject)
Stores the given object as "dialog object" for this widget dialog in the current users session.- Parameters:
dialogObject
- the object to store
-
setParamElementIndex
public void setParamElementIndex(java.lang.String elementIndex)
Sets the index of the element to add or remove.- Parameters:
elementIndex
- the index of the element to add or remove
-
setParamElementName
public void setParamElementName(java.lang.String elementName)
Sets the name of the element to add or remove.- Parameters:
elementName
- the name of the element to add or remove
-
setParamPage
public void setParamPage(java.lang.String paramPage)
Sets the page parameter.- Parameters:
paramPage
- the page parameter to set
-
widgetParamsAsHidden
public java.lang.String 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
public java.lang.String widgetParamsAsHidden(java.lang.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.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
public void writeDialog() throws java.io.IOException, javax.servlet.jsp.JspException
Writes the dialog html code, only if the
is set.CmsDialog.ACTION_DEFAULT
- 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 page
-
addCommitError
protected void addCommitError(java.lang.Exception error)
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
protected void addWidget(CmsWidgetDialogParameter param)
Adds a new widget parameter definition to the list of all widgets of this dialog.- Parameters:
param
- the widget parameter definition to add
-
closeDialogOnCommit
protected boolean 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
protected java.util.List<java.lang.Throwable> commitWidgetValues()
Commits all values on the dialog.- Returns:
- a List of all Exceptions that occurred when comitting the dialog.
-
commitWidgetValues
protected java.util.List<java.lang.Throwable> commitWidgetValues(java.lang.String dialogPage)
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
protected java.lang.String createDialogHtml()
Creates the dialog HTML for all defined widgets of this dialog.- Returns:
- the dialog HTML for all defined widgets of this dialog
-
createDialogHtml
protected java.lang.String createDialogHtml(java.lang.String dialog)
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
protected java.lang.String createDialogRowHtml(CmsWidgetDialogParameter base)
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
protected java.lang.String createDialogRowsHtml(int startIndex, int endIndex)
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
protected java.lang.String 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
protected java.lang.String createWidgetBlockStart(java.lang.String headline)
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
protected java.lang.String 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
protected java.lang.String createWidgetTableEnd()
Creates the HTML for the table around the dialog widgets.- Returns:
- the HTML for the table around the dialog widgets
-
createWidgetTableStart
protected java.lang.String createWidgetTableStart()
Creates the HTML to close the table around the dialog widgets.- Returns:
- the HTML to close the table around the dialog widgets
-
defaultActionHtml
protected java.lang.String defaultActionHtml() throws javax.servlet.jsp.JspException
Generates the dialog starting html code.- Returns:
- html code
- Throws:
javax.servlet.jsp.JspException
- if something goes wrong
-
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() throws javax.servlet.jsp.JspException
Generates the dialog starting html code.- Returns:
- html code
- Throws:
javax.servlet.jsp.JspException
- if something goes wrong
-
defineWidgets
protected abstract void defineWidgets()
Defines the list of parameters for this dialog.
-
fillWidgetValues
protected void fillWidgetValues(javax.servlet.http.HttpServletRequest request)
Fills all widgets of this widget dialog with the values from the request parameters.- Parameters:
request
- the current HTTP servlet request
-
getDialogTitle
protected java.lang.String 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
protected abstract java.lang.String[] getPageArray()
Returns the allowed pages for this dialog.- Returns:
- the allowed pages for this dialog
-
getPages
protected java.util.List<java.lang.String> getPages()
Returns the allowed pages for this dialog.- Returns:
- the allowed pages for this dialog
-
getParameterDefinition
protected CmsWidgetDialogParameter getParameterDefinition(java.lang.String name)
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
protected java.util.Map<java.lang.String,java.util.List<CmsWidgetDialogParameter>> getParameters()
Returns the map with the widget parameter values.- Returns:
- the map with the widget parameter values
-
getValidationErrorList
protected java.util.List<java.lang.Throwable> 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
protected java.lang.String getWidget(CmsWidgetDialogParameter param)
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
protected java.util.List<CmsWidgetDialogParameter> 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
protected boolean hasCommitErrors()
Returnstrue
if the current dialog (page) has commit errors.- Returns:
true
if the current dialog (page) has commit errors
-
hasValidationErrors
protected boolean 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
protected void setCommitErrors(java.util.List<java.lang.Throwable> errors)
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
protected void setKeyPrefix(java.lang.String prefix)
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
protected void setPages(java.util.List<java.lang.String> pages)
Sets the allowed pages for this dialog.- Parameters:
pages
- the allowed pages for this dialog
-
setValidationErrorList
protected void setValidationErrorList(java.util.List<java.lang.Throwable> errors)
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
protected void validateParamaters() throws java.lang.Exception
Should be overridden for parameter validation.The exception is never seen by the user, so it can be just a
new
.Exception
()- Throws:
java.lang.Exception
- if the parameters are not valid
-
-