Class CmsPreferences

java.lang.Object
org.opencms.workplace.CmsWorkplace
org.opencms.workplace.tools.CmsToolDialog
org.opencms.workplace.CmsDialog
org.opencms.workplace.CmsTabDialog
org.opencms.workplace.commons.CmsPreferences

public class CmsPreferences extends CmsTabDialog
Provides methods for the user preferences dialog.

The following files use this class:

  • /commons/preferences.jsp

Since:
6.0.0
  • Field Details

  • Constructor Details

    • CmsPreferences

      public CmsPreferences(org.opencms.jsp.CmsJspActionElement jsp)
      Public constructor with JSP action element.

      Parameters:
      jsp - an initialized JSP action element
    • CmsPreferences

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

    • getOptionsForLanguageStatic

      public static org.opencms.configuration.preferences.CmsBuiltinPreference.SelectOptions getOptionsForLanguageStatic(Locale setLocale, Locale prevLocale)
      Gets the options for the language selector.

      Parameters:
      setLocale - the locale for the select options
      prevLocale - the locale currently set
      Returns:
      the options for the language selector
    • getProjectSelectOptionsStatic

      public static org.opencms.configuration.preferences.CmsBuiltinPreference.SelectOptions getProjectSelectOptionsStatic(org.opencms.file.CmsObject cms, String startProject, Locale locale)
      Gets the options for the project selector.

      Parameters:
      cms - the CMS context
      startProject - the start project
      locale - the locale
      Returns:
      the options for the project selector
    • getSiteSelectOptionsStatic

      public static org.opencms.configuration.preferences.CmsBuiltinPreference.SelectOptions getSiteSelectOptionsStatic(org.opencms.file.CmsObject cms, String wpSite, Locale locale)
      Gets the options for the site selector.

      Parameters:
      cms - the CMS context
      wpSite - the selected site
      locale - the locale for the select options
      Returns:
      the options for the site selector
    • actionChangePassword

      public void actionChangePassword() throws javax.servlet.jsp.JspException
      Performs the change password action.

      Throws:
      javax.servlet.jsp.JspException - if inclusion of error element fails
    • actionSave

      public void actionSave()
      Performs the save operation of the modified user settings.

    • buildSelectCopyFileMode

      public String buildSelectCopyFileMode(String htmlAttributes)
      Builds the html for the default copy file mode select box.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the default copy file mode select box
    • buildSelectCopyFolderMode

      public String buildSelectCopyFolderMode(String htmlAttributes)
      Builds the html for the default copy folder mode select box.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the default copy folder mode select box
    • buildSelectDeleteFileMode

      public String buildSelectDeleteFileMode(String htmlAttributes)
      Builds the html for the default delete file mode select box.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the default delete file mode select box
    • buildSelectDirectEditButtonStyle

      Builds the html for the direct edit button style select box.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the direct edit button style select box
    • buildSelectEditorButtonStyle

      public String buildSelectEditorButtonStyle(String htmlAttributes)
      Builds the html for the editor button style select box.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the editor button style select box
    • buildSelectExplorerButtonStyle

      public String buildSelectExplorerButtonStyle(String htmlAttributes)
      Builds the html for the explorer button style select box.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the explorer button style select box
    • buildSelectExplorerFileEntries

      public String buildSelectExplorerFileEntries(String htmlAttributes)
      Builds the html for the explorer number of entries per page select box.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the explorer number of entries per page select box
    • buildSelectLanguage

      public String buildSelectLanguage(String htmlAttributes)
      Builds the html for the language select box of the start settings.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the language select box
    • buildSelectPreferredEditors

      public String buildSelectPreferredEditors(String htmlAttributes)
      Builds the html for the preferred editors select boxes of the editor settings.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the preferred editors select boxes
    • buildSelectProject

      public String buildSelectProject(String htmlAttributes)
      Builds the html for the project select box of the start settings.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the project select box
    • buildSelectPublishSiblings

      public String buildSelectPublishSiblings(String htmlAttributes)
      Builds the html for the default publish siblings mode select box.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the default publish siblings mode select box
    • buildSelectReportType

      public String buildSelectReportType(String htmlAttributes)
      Builds the html for the workplace report type select box.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the workplace report type select box
    • buildSelectSite

      public String buildSelectSite(String htmlAttributes)
      Builds the html for the workplace start site select box.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the workplace start site select box
    • buildSelectStartGalleries

      public String buildSelectStartGalleries(String htmlAttributes)
      Builds the HTML for the start galleries settings as select boxes.

      Parameters:
      htmlAttributes - optional HTML attributes for the &lgt;select> tag
      Returns:
      the HTML for start galleries select boxes
    • buildSelectUpload

      public String buildSelectUpload(String htmlAttributes)
      Builds the html for the workplace start site select box.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the workplace start site select box
    • buildSelectView

      public String buildSelectView(String htmlAttributes)
      Returns a html select box filled with the views accessible by the current user.

      Parameters:
      htmlAttributes - attributes that will be inserted into the generated html
      Returns:
      a html select box filled with the views accessible by the current user
    • buildSelectWorkplaceButtonStyle

      Builds the html for the workplace button style select box.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the workplace button style select box
    • buildSelectWorkplaceSearchResult

      Builds the html for the workplace search result list type select box.

      Parameters:
      htmlAttributes - optional html attributes for the &lgt;select> tag
      Returns:
      the html for the workplace search result list type select box
    • buildUserInformation

      Builds the html code for the static user information table (tab 4).

      Returns:
      the html code for the static user information table
    • calendarIncludes

      Deprecated.
      use CmsCalendarWidget.calendarIncludes(java.util.Locale), this is just here so that old JSP still work
      Creates the HTML JavaScript and stylesheet includes required by the calendar for the head of the page.

      Returns:
      the necessary HTML code for the js and stylesheet includes
    • calendarInit

      @Deprecated public String calendarInit(String inputFieldId, String triggerButtonId, String align, boolean singleClick, boolean weekNumbers, boolean mondayFirst, String dateStatusFunc, boolean showTime)
      Deprecated.
      use CmsCalendarWidget.calendarInit(org.opencms.i18n.CmsMessages, String, String, String, boolean, boolean, boolean, String, boolean), this is just here so that old JSP still work
      Generates the HTML to initialize the JavaScript calendar element on the end of a page.

      Parameters:
      inputFieldId - the ID of the input field where the date is pasted to
      triggerButtonId - the ID of the button which triggers the calendar
      align - initial position of the calendar popup element
      singleClick - if true, a single click selects a date and closes the calendar, otherwise calendar is closed by doubleclick
      weekNumbers - show the week numbers in the calendar or not
      mondayFirst - show monday as first day of week
      dateStatusFunc - name of the function which determines if/how a date should be disabled
      showTime - true if the time selector should be shown, otherwise false
      Returns:
      the HTML code to initialize a calendar poup element
    • getOptionsForLanguage

      public org.opencms.configuration.preferences.CmsBuiltinPreference.SelectOptions getOptionsForLanguage()
      Gets the select options for the language selector.

      Returns:
      the select options
    • getParamNewPassword

      Returns the new password value.

      Returns:
      the new password value
    • getParamOldPassword

      Returns the old password value.

      Returns:
      the old password value
    • getParamTabDiCopyFileMode

      Returns the "copy file default" setting.

      Returns:
      the "copy file default" setting
    • getParamTabDiCopyFolderMode

      Returns the "copy folder default" setting.

      Returns:
      the "copy folder default" setting
    • getParamTabDiDeleteFileMode

      Returns the "delete file default" setting.

      Returns:
      the "delete file default" setting
    • getParamTabDiPermissionsExpandInherited

      Returns the "expand inherited permissions" default setting.

      Returns:
      the "expand inherited permissions" default setting
    • getParamTabDiPermissionsExpandUser

      Returns the "expand current users permissions" default setting.

      Returns:
      the "expand current users permissions" default setting
    • getParamTabDiPermissionsInheritOnFolder

      Returns the "inherit permissions on folders" default setting.

      Returns:
      the "inherit permissions on folders" default setting
    • getParamTabDiPublishFileMode

      Returns the "publish file siblings default" setting.

      Returns:
      the "publish file siblings default" setting
    • getParamTabDiShowLock

      Returns the "display lock dialog" setting.

      Returns:
      "true" if the "display lock dialog" input field is checked, otherwise ""
    • getParamTabEdButtonStyle

      Returns the "editor button style" setting.

      Returns:
      the "editor button style" setting
    • getParamTabEdDirectEditButtonStyle

      Returns the "direct edit button style" setting.

      Returns:
      the "direct edit button style" setting
    • getParamTabExButtonStyle

      Returns the "explorer button style" setting.

      Returns:
      the "explorer button style" setting
    • getParamTabExFileDateCreated

      Returns the "display file creation date" setting.

      Returns:
      "true" if the file creation date input field is checked, otherwise ""
    • getParamTabExFileDateExpired

      Returns the "display file date expired" setting.

      Returns:
      "true" if the file date expired input field is checked, otherwise ""
    • getParamTabExFileDateLastModified

      Returns the "display file last modification date" setting.

      Returns:
      "true" if the file last modification date input field is checked, otherwise ""
    • getParamTabExFileDateReleased

      Returns the "display file date released" setting.

      Returns:
      "true" if the file date released input field is checked, otherwise ""
    • getParamTabExFileEntries

      Returns the "explorer number of entries per page" setting.

      Returns:
      the "explorer number of entries per page" setting
    • getParamTabExFileLockedBy

      Returns the "display file locked by" setting.

      Returns:
      "true" if the file locked by input field is checked, otherwise ""
    • getParamTabExFileNavText

      Returns the "display navtext" setting.

      Returns:
      "true" if the file navtext input field is checked, otherwise ""
    • getParamTabExFilePermissions

      Returns the "display file permissions" setting.

      Returns:
      "true" if the file permissions input field is checked, otherwise ""
    • getParamTabExFileSize

      Returns the "display file size" setting.

      Returns:
      "true" if the file size input field is checked, otherwise ""
    • getParamTabExFileState

      Returns the "display file state" setting.

      Returns:
      "true" if the file state input field is checked, otherwise ""
    • getParamTabExFileTitle

      Returns the "display file title" setting.

      Returns:
      "true" if the file title input field is checked, otherwise ""
    • getParamTabExFileType

      Returns the "display file type" setting.

      Returns:
      "true" if the file type input field is checked, otherwise ""
    • getParamTabExFileUserCreated

      Returns the "display file created by" setting.

      Returns:
      "true" if the file created by input field is checked, otherwise ""
    • getParamTabExFileUserLastModified

      Returns the "display file last modified by" setting.

      Returns:
      "true" if the file last modified by input field is checked, otherwise ""
    • getParamTabExWorkplaceSearchResult

      Returns the "workplace search result style" setting.

      Returns:
      the "workplace search result style" setting
    • getParamTabWpButtonStyle

      Returns the "workplace button style" setting.

      Returns:
      the "workplace button style" setting
    • getParamTabWpFolder

      Returns the "start folder" setting.

      Returns:
      the "start folder" setting
    • getParamTabWpLanguage

      Returns the start language setting.

      Returns:
      the start language setting
    • getParamTabWpListAllProjects

      Returns the "list all projects" setting.

      Returns:
      "true" if the "list all projects" input is checked, otherwise ""
    • getParamTabWpProject

      Returns the start project setting.

      Returns:
      the start project setting
    • getParamTabWpReportType

      Returns the "workplace report type" setting.

      Returns:
      the "workplace report type" setting
    • getParamTabWpRestrictExplorerView

      Returns the "workplace restrict explorer view" setting.

      Returns:
      the "workplace restrict explorer view" setting
    • getParamTabWpShowPublishNotification

      Returns the "show publish notification" setting.

      Returns:
      "true" if the "show publish notification" input is checked, otherwise ""
    • getParamTabWpSite

      Returns the "start site" setting.

      Returns:
      the "start site" setting
    • getParamTabWpTimeWarp

      Get the "user timewparp" setting in form of a formatted date string.

      If no timewarp has been chosen, a value "-" will be returned.

      Returns:
      the "user timewarp" setting in form of a formatted date string
    • getParamTabWpUploadVariant

      public org.opencms.db.CmsUserSettings.UploadVariant getParamTabWpUploadVariant()
      Returns the upload variant setting.

      Returns:
      "applet", "gwt" or "basic"
    • getParamTabWpView

      Returns the start view setting.

      Returns:
      the start view setting
    • getProjectSelectOptions

      public org.opencms.configuration.preferences.CmsBuiltinPreference.SelectOptions getProjectSelectOptions()
      Gets the project select options.

      Returns:
      the project select options
    • getSiteSelectOptions

      public org.opencms.configuration.preferences.CmsBuiltinPreference.SelectOptions getSiteSelectOptions()
      Gets the site select options.

      Returns:
      the site select options
    • getTabParameterOrder

      Description copied from class: CmsTabDialog
      Returns the order of the parameter prefixes for each tab.

      For example, all parameters stored in tab 1 have the prefix "Tab1", i.e. the getter and setter methods must be getParamTab1MyParameterName().

      To change the tab order, simply change the order in the String array and in the generated tab list.

      Specified by:
      getTabParameterOrder in class CmsTabDialog
      Returns:
      the ordered parameter prefix List
      See Also:
    • getTabs

      public List<String> getTabs()
      Description copied from class: CmsTabDialog
      Returns a list with localized Strings representing the names of the tabs.

      Specified by:
      getTabs in class CmsTabDialog
      Returns:
      list with localized String for the tabs
      See Also:
    • getTimeWarpInt

      Gets the timewarp parameter as a simple numeric string.

      Returns:
      the timewarp parameter as a simple numeric string
    • getUserSettings

      public org.opencms.db.CmsUserSettings getUserSettings()
      Gets the internal user settings object.

      Returns:
      the user settings object
    • isChecked

      public String isChecked(String paramValue)
      Helper method to add the "checked" attribute to an input field.

      Parameters:
      paramValue - the parameter value, if "true", the "checked" attribute will be returned
      Returns:
      the "checked" attribute or an empty String
    • setParamNewPassword

      public void setParamNewPassword(String newPwd)
      Sets the new password value.

      Parameters:
      newPwd - the new password value
    • setParamOldPassword

      public void setParamOldPassword(String oldPwd)
      Sets the old password value.

      Parameters:
      oldPwd - the old password value
    • setParamTabDiCopyFileMode

      public void setParamTabDiCopyFileMode(String value)
      Sets the "copy file default" setting.

      Parameters:
      value - the "copy file default" setting
    • setParamTabDiCopyFolderMode

      public void setParamTabDiCopyFolderMode(String value)
      Sets the "copy folder default" setting.

      Parameters:
      value - the "copy folder default" setting
    • setParamTabDiDeleteFileMode

      public void setParamTabDiDeleteFileMode(String value)
      Sets the "delete file siblings default" setting.

      Parameters:
      value - the "delete file siblings default" setting
    • setParamTabDiPermissionsExpandInherited

      Sets the "expand inherited permissions" default setting.

      Parameters:
      value - the "expand inherited permissions" default setting
    • setParamTabDiPermissionsExpandUser

      Sets the "expand current users permissions" default setting.

      Parameters:
      value - the "expand current users permissions" default setting
    • setParamTabDiPermissionsInheritOnFolder

      Sets the "inherit permissions on folders" default setting.

      Parameters:
      value - the "inherit permissions on folders" default setting
    • setParamTabDiPublishFileMode

      public void setParamTabDiPublishFileMode(String value)
      Sets the "publish file siblings default" setting.

      Parameters:
      value - the "publish file siblings default" setting
    • setParamTabDiShowLock

      public void setParamTabDiShowLock(String value)
      Sets the "display lock dialog" setting.

      Parameters:
      value - "true" to enable the "display lock dialog" setting, all others to disable
    • setParamTabEdButtonStyle

      public void setParamTabEdButtonStyle(String value)
      Sets the "editor button style" setting.

      Parameters:
      value - a String representation of an int value to set the "editor button style" setting
    • setParamTabEdDirectEditButtonStyle

      Sets the "direct edit button style" setting.

      Parameters:
      value - a String representation of an int value to set the "direct edit button style" setting
    • setParamTabExButtonStyle

      public void setParamTabExButtonStyle(String value)
      Sets the "explorer button style" setting.

      Parameters:
      value - a String representation of an int value to set the "explorer button style" setting
    • setParamTabExFileDateCreated

      public void setParamTabExFileDateCreated(String value)
      Sets the "display file creation date" setting.

      Parameters:
      value - "true" to enable the "display file creation date" setting, all others to disable
    • setParamTabExFileDateExpired

      public void setParamTabExFileDateExpired(String value)
      Sets the "display file expired date" setting.

      Parameters:
      value - "true" to enable the "display file expired date" setting, all others to disable
    • setParamTabExFileDateLastModified

      Sets the "display file last modification date" setting.

      Parameters:
      value - "true" to enable the "display file last modification date" setting, all others to disable
    • setParamTabExFileDateReleased

      Sets the "display file released date" setting.

      Parameters:
      value - "true" to enable the "display file released date" setting, all others to disable
    • setParamTabExFileEntries

      public void setParamTabExFileEntries(String value)
      Sets the "explorer number of entries per page" setting.

      Parameters:
      value - a String representation of an int value to set the "number of entries per page" setting
    • setParamTabExFileLockedBy

      public void setParamTabExFileLockedBy(String value)
      Sets the "display file locked by" setting.

      Parameters:
      value - "true" to enable the "display file locked by" setting, all others to disable
    • setParamTabExFileNavText

      public void setParamTabExFileNavText(String value)
      Sets the "display file navtext" setting.

      Parameters:
      value - "true" to enable the "display file navtext" setting, all others to disable
    • setParamTabExFilePermissions

      public void setParamTabExFilePermissions(String value)
      Sets the "display file permissions" setting.

      Parameters:
      value - "true" to enable the "display file permissions" setting, all others to disable
    • setParamTabExFileSize

      public void setParamTabExFileSize(String value)
      Sets the "display file size" setting.

      Parameters:
      value - "true" to enable the "display file size" setting, all others to disable
    • setParamTabExFileState

      public void setParamTabExFileState(String value)
      Sets the "display file state" setting.

      Parameters:
      value - "true" to enable the "display file state" setting, all others to disable
    • setParamTabExFileTitle

      public void setParamTabExFileTitle(String value)
      Sets the "display file title" setting.

      Parameters:
      value - "true" to enable the "display file title" setting, all others to disable
    • setParamTabExFileType

      public void setParamTabExFileType(String value)
      Sets the "display file type" setting.

      Parameters:
      value - "true" to enable the "display file type" setting, all others to disable
    • setParamTabExFileUserCreated

      public void setParamTabExFileUserCreated(String value)
      Sets the "display file created by" setting.

      Parameters:
      value - "true" to enable the "display file created by" setting, all others to disable
    • setParamTabExFileUserLastModified

      Sets the "display file last modified by" setting.

      Parameters:
      value - "true" to enable the "display file last modified by" setting, all others to disable
    • setParamTabExWorkplaceSearchResult

      Sets the "workplace search result style".

      Parameters:
      style - the "workplace search result style" to set
    • setParamTabWpButtonStyle

      public void setParamTabWpButtonStyle(String value)
      Sets the "workplace button style" setting.

      Parameters:
      value - a String representation of an int value to set the "workplace button style" setting
    • setParamTabWpFolder

      public void setParamTabWpFolder(String value)
      Sets the "start folder" setting.

      Parameters:
      value - the start folder to show in the explorer view
    • setParamTabWpLanguage

      public void setParamTabWpLanguage(String value)
      Sets the start language setting.

      Parameters:
      value - the start language setting
    • setParamTabWpListAllProjects

      public void setParamTabWpListAllProjects(String value)
      Sets the "list all projects" flag.

      Parameters:
      value - "true" to enable the "list all project" feature, all others to disable
    • setParamTabWpProject

      public void setParamTabWpProject(String value)
      Sets the start project setting.

      Parameters:
      value - the start project setting
    • setParamTabWpReportType

      public void setParamTabWpReportType(String value)
      Sets the "workplace report type" setting.

      Parameters:
      value - the "workplace report type" setting
    • setParamTabWpRestrictExplorerView

      Sets the "workplace restrict explorer view" setting.

      Parameters:
      value - the "workplace restrict explorer view" setting
    • setParamTabWpShowPublishNotification

      Sets the "show publish notification" setting.

      Parameters:
      value - "true" to enable the "show publish notification" setting, all others to disable
    • setParamTabWpSite

      public void setParamTabWpSite(String value)
      Sets the "start site" setting.

      Parameters:
      value - the start site to show in the explorer view
    • setParamTabWpTimeWarp

      public void setParamTabWpTimeWarp(String value)
      Sets the "user timewparp" setting.

      To delete a timewarp setting for the current user, provide "-" as value.

      Parameters:
      value - a String representation of an date in the formate as required by CmsCalendarWidget.getCalendarDate(org.opencms.i18n.CmsMessages, String, boolean)
    • setParamTabWpUploadVariant

      public void setParamTabWpUploadVariant(String value)
      Sets the upload variant setting.

      Parameters:
      value - "applet", "basic", "gwt", "true" or "false"
    • setParamTabWpView

      public void setParamTabWpView(String value)
      Sets the start view setting.

      Parameters:
      value - the start view setting
    • setTimewarpInt

      public void setTimewarpInt(String timewarp)
      Sets the timewarp setting from a numeric string
      Parameters:
      timewarp - a numeric string containing the number of milliseconds since the epoch
    • setUserSettings

      public void setUserSettings(org.opencms.configuration.CmsDefaultUserSettings userSettings)
      Sets the user settings.

      Parameters:
      userSettings - the user settings
    • updatePreferences

      public void updatePreferences(org.opencms.file.CmsObject cms, javax.servlet.http.HttpServletRequest req)
      Updates the user preferences after changes have been made.

      Parameters:
      cms - the current cms context
      req - the current http request
    • checkRole

      protected void checkRole()
      Overrides:
      checkRole in class org.opencms.workplace.CmsWorkplace
      See Also:
      • CmsWorkplace.checkRole()
    • 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)
    • paramValues

      protected Map<String,Object> paramValues()
      Returns the values of all parameter methods of this workplace class instance.

      This overwrites the super method because of the possible dynamic editor selection entries.

      Overrides:
      paramValues in class org.opencms.workplace.CmsWorkplace
      Returns:
      the values of all parameter methods of this workplace class instance
      See Also:
      • CmsWorkplace.paramValues()