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 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.
    protected List<Throwable>
    The errors thrown by commit actions.
    protected Object
    The object edited with this widget dialog.
    protected List<String>
    The allowed pages for this dialog in a List.
    protected String
    Controls which page is currently displayed in the dialog.
    protected List<Throwable>
    The validation errors for the input form.
    Contains all parameter value of this dialog.
    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

    Modifier and Type
    Method
    Description
    void
    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
    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
    Returns true if the dialog should be closed after the values have been committed.
    protected List<Throwable>
    Commits all values on the dialog.
    protected List<Throwable>
    Commits all values on the given dialog page.
    protected String
    Creates the dialog HTML for all defined widgets of this dialog.
    protected String
    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
    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.
    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, or null 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.
    protected List<String>
    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.
    Returns the parameter widget definition for the given parameter name.
    Returns the map with the widget parameter values.
    Returns the page parameter.
    Returns the value of the widget parameter with the given name, or null 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, or null if no such widget parameter is available.
     
    protected List<Throwable>
    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.
    Returns the list of all widgets used on this widget dialog, the List must contain Objects of type CmsWidgetDialogParameter.
    protected boolean
    Returns true if the current dialog (page) has commit errors.
    protected boolean
    Returns true if the current dialog (page) has validation errors.
    protected void
    initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request)
     
     
    protected void
    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
    Sets an optional localized key prefix identificator for all widgets.
    protected void
    Sets the allowed pages for this dialog.
    void
    Sets the index of the element to add or remove.
    void
    Sets the name of the element to add or remove.
    void
    setParamPage(String paramPage)
    Sets the page parameter.
    protected void
    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 CmsDialog.ACTION_DEFAULT is set.

    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

  • Constructor Details

    • 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 context
      req - the JSP request
      res - the JSP response
  • Method Details

    • actionCancel

      public void actionCancel()
      Deletes the edited dialog object from the session.

    • actionCommit

      public abstract void actionCommit() throws IOException, javax.servlet.ServletException
      Commits the edited object after pressing the "OK" button.

      Throws:
      IOException - in case of errors forwarding to the required result page
      javax.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 CmsDialog.getAction() method.

    • buildAddElement

      public String buildAddElement(String elementName, int insertAfter, boolean enabled)
      Returns the html for a button to add an optional element.

      Parameters:
      elementName - name of the element
      insertAfter - the index of the element after which the new element should be created
      enabled - 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

      public String buildRemoveElement(String elementName, int index, boolean enabled)
      Returns the html for a button to remove an optional element.

      Parameters:
      elementName - name of the element
      index - the element index of the element to remove
      enabled - 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

      Builds the end HTML for a block with 3D border in the dialog content area.

      Overrides:
      dialogBlockEnd in class org.opencms.workplace.CmsDialog
      Returns:
      3D block start / end segment
    • dialogBlockStart

      public String dialogBlockStart(String headline)
      Builds the start HTML for a block with 3D border and optional subheadline in the dialog content area.

      Overrides:
      dialogBlockStart in class org.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.ServletException
      Performs the dialog actions depending on the initialized action and displays the dialog form.

      Throws:
      javax.servlet.jsp.JspException - if dialog actions fail
      IOException - if writing to the JSP out fails, or in case of errors forwarding to the required result page
      javax.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 - if true no output is written, you have to call manually the defaultActionHtml() method.
      Throws:
      javax.servlet.jsp.JspException - if dialog actions fail
      IOException - if writing to the JSP out fails, or in case of errors forwarding to the required result page
      javax.servlet.ServletException - in case of errors forwarding to the required result page
    • getButtonStyle

      public int getButtonStyle()
      Specified by:
      getButtonStyle in interface org.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, or null if no dialog object has been set.

      Returns:
      the dialog object for this widget dialog, or null
    • getHelpMessageIds

      Specified by:
      getHelpMessageIds in interface org.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

      public String getParamPage()
      Returns the page parameter.

      Returns:
      the page parameter
    • getParamValue

      public String getParamValue(String name)
      Returns the value of the widget parameter with the given name, or null 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 String getParamValue(String name, int index)
      Returns the value of the widget parameter with the given name and index, or null if no such widget parameter is available.

      Parameters:
      name - the widget parameter name to get the value for
      index - the widget parameter index
      Returns:
      the value of the widget parameter with the given name and index
    • getUserAgent

      public String getUserAgent()
      Specified by:
      getUserAgent in interface org.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

      public 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 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 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

      Overrides:
      paramsAsHidden in class org.opencms.workplace.CmsWorkplace
      See Also:
      • CmsWorkplace.paramsAsHidden()
    • setDialogObject

      public void setDialogObject(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(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(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(String paramPage)
      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

      public String 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.

      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 IOException, javax.servlet.jsp.JspException
      Writes the dialog html code, only if the CmsDialog.ACTION_DEFAULT is set.

      Throws:
      javax.servlet.jsp.JspException - if dialog actions fail
      IOException - if writing to the JSP out fails, or in case of errors forwarding to the required result page
    • addCommitError

      protected void addCommitError(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()
      Returns true 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

      protected List<Throwable> commitWidgetValues(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 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 String createDialogHtml(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

      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 String createDialogRowsHtml(int startIndex, int endIndex)
      Creates the dialog widget rows HTML for the specified widget indices.

      Parameters:
      startIndex - the widget index to start with
      endIndex - 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

      protected String createWidgetBlockStart(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

      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

      protected 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

      Returns the html code for the default action content.

      Returns:
      html code
    • defaultActionHtmlEnd

      Generates the dialog ending html code.

      Returns:
      html code
    • defaultActionHtmlStart

      protected 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 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 String[] getPageArray()
      Returns the allowed pages for this dialog.

      Returns:
      the allowed pages for this dialog
    • getPages

      protected List<String> 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

      protected boolean hasCommitErrors()
      Returns true if the current dialog (page) has commit errors.

      Returns:
      true if the current dialog (page) has commit errors
    • hasValidationErrors

      protected boolean hasValidationErrors()
      Returns true 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 class org.opencms.workplace.CmsDialog
      See Also:
      • CmsWorkplace.initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)
    • setCommitErrors

      protected void setCommitErrors(List<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(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(List<String> pages)
      Sets the allowed pages for this dialog.

      Parameters:
      pages - the allowed pages for this dialog
    • setValidationErrorList

      protected void setValidationErrorList(List<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 Exception
      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