/** * Returns the setting for the upload button for initializing the explorer view.<p> * * @return the setting for the upload button */ public String getShowFileUploadButtons() { return OpenCms.getWorkplaceManager().getDefaultUserSettings().getShowFileUploadButtonString(); }
/** * Returns the setting for the upload button for initializing the explorer view.<p> * * @return the setting for the upload button */ public String getShowFileUploadButtons() { return OpenCms.getWorkplaceManager().getDefaultUserSettings().getShowFileUploadButtonString(); }
/** * Saves an individual user preference value.<p> * * @param key the key of the user preference * @param value the value of the user preference * * @throws Exception if something goes wrong */ private void saveSetting(String key, String value) throws Exception { Map<String, I_CmsPreference> prefs = OpenCms.getWorkplaceManager().getDefaultUserSettings().getPreferences(); if (prefs.containsKey(key)) { prefs.get(key).setValue(m_currentPreferences, value); } else { LOG.error("Can't save user setting '" + key + "'"); } }
/** * Gets the value for a user defined preference.<p> * * @param name the name of the preference * @param useDefault true if the default value should be returned in case the preference is not set * * @return the preference value */ public String getAdditionalPreference(String name, boolean useDefault) { String value = m_additionalPreferences.get(name); if ((value == null) && useDefault) { I_CmsPreference pref = OpenCms.getWorkplaceManager().getDefaultUserSettings().getPreferences().get(name); if (pref != null) { value = pref.getDefaultValue(); } } return value; }
/** * Builds the html for the explorer number of entries per page select box.<p> * * @param htmlAttributes optional html attributes for the &lgt;select> tag * @return the html for the explorer number of entries per page select box */ public String buildSelectExplorerFileEntries(String htmlAttributes) { String emptyOption = OpenCms.getWorkplaceManager().getDefaultUserSettings().getExplorerFileEntryOptions(); if (CmsStringUtil.isEmptyOrWhitespaceOnly(emptyOption)) { emptyOption = "50,100,200,300,400,500"; } // remove all non digits without ',' emptyOption = emptyOption.replaceAll("[^0-9|^,]", ""); // remove all empty entries emptyOption = emptyOption.replaceAll(",,", ","); List<String> opts = CmsStringUtil.splitAsList(emptyOption, ",", true); opts.add(key(Messages.GUI_LABEL_UNLIMITED_0)); opts.remove("0"); List<String> vals = CmsStringUtil.splitAsList(emptyOption, ",", true); vals.add("" + Integer.MAX_VALUE); vals.remove("0"); int selectedIndex = 2; for (int i = 0; i < vals.size(); i++) { if (vals.get(i).equals(getParamTabExFileEntries())) { selectedIndex = i; break; } } return buildSelect(htmlAttributes, opts, vals, selectedIndex); }
/** * Builds the html for the explorer number of entries per page select box.<p> * * @param htmlAttributes optional html attributes for the &lgt;select> tag * @return the html for the explorer number of entries per page select box */ public String buildSelectExplorerFileEntries(String htmlAttributes) { String emptyOption = OpenCms.getWorkplaceManager().getDefaultUserSettings().getExporerFileEntryOptions(); if (CmsStringUtil.isEmptyOrWhitespaceOnly(emptyOption)) { emptyOption = "10,25,50,100"; } // remove all non digits without ',' emptyOption = emptyOption.replaceAll("[^0-9|^,]", ""); // remove all empty entries emptyOption = emptyOption.replaceAll(",,", ","); List opts = CmsStringUtil.splitAsList(emptyOption, ",", true); opts.add(key(Messages.GUI_LABEL_UNLIMITED_0)); opts.remove("0"); List vals = CmsStringUtil.splitAsList(emptyOption, ",", true); vals.add("" + Integer.MAX_VALUE); vals.remove("0"); int selectedIndex = 2; for (int i = 0; i < vals.size(); i++) { if (vals.get(i).equals(getParamTabExFileEntries())) { selectedIndex = i; break; } } return buildSelect(htmlAttributes, opts, vals, selectedIndex); }
/** * Returns <code>true</code> if the current user is allowed * to publish the selected resources.<p> * * @return <code>true</code> if the current user is allowed * to publish the selected resources */ public boolean isCanPublish() { return OpenCms.getWorkplaceManager().getDefaultUserSettings().isAllowBrokenRelations() || OpenCms.getRoleManager().hasRole(getCms(), CmsRole.VFS_MANAGER); }
/** * Returns <code>true</code> if the current user is allowed * to delete the selected resources.<p> * * @return <code>true</code> if the current user is allowed * to delete the selected resources */ public boolean isCanDelete() { return OpenCms.getWorkplaceManager().getDefaultUserSettings().isAllowBrokenRelations() || OpenCms.getRoleManager().hasRole(getCms(), CmsRole.VFS_MANAGER); }
/** * Sets the "workplace search result style".<p> * * @param style the "workplace search result style" to set */ public void setParamTabExWorkplaceSearchResult(String style) { if (style == null) { style = OpenCms.getWorkplaceManager().getDefaultUserSettings().getWorkplaceSearchViewStyle().getMode(); } m_userSettings.setWorkplaceSearchViewStyle(CmsSearchResultStyle.valueOf(style)); }
/** * Sets the "workplace search result style".<p> * * @param style the "workplace search result style" to set */ public void setParamTabExWorkplaceSearchResult(String style) { if (style == null) { style = OpenCms.getWorkplaceManager().getDefaultUserSettings().getWorkplaceSearchViewStyle().getMode(); } m_userSettings.setWorkplaceSearchViewStyle(CmsSearchResultStyle.valueOf(style)); }
/** * Returns <code>true</code> if the current user is allowed * to publish the selected resources.<p> * * @return <code>true</code> if the current user is allowed * to publish the selected resources */ public boolean isCanPublish() { return OpenCms.getWorkplaceManager().getDefaultUserSettings().isAllowBrokenRelations() || OpenCms.getRoleManager().hasRole(getCms(), CmsRole.VFS_MANAGER); }
/** * Returns <code>true</code> if the current user is allowed * to delete the selected resources.<p> * * @return <code>true</code> if the current user is allowed * to delete the selected resources */ public boolean isCanDelete() { return OpenCms.getWorkplaceManager().getDefaultUserSettings().isAllowBrokenRelations() || OpenCms.getRoleManager().hasRole(getCms(), CmsRole.VFS_MANAGER); }
/** * Sets the upload variant.<p> * * @param uploadVariant the upload variant as String */ public void setUploadVariant(String uploadVariant) { UploadVariant upload = null; try { upload = UploadVariant.valueOf(uploadVariant); } catch (Exception e) { // may happen, set default if (upload == null) { upload = OpenCms.getWorkplaceManager().getDefaultUserSettings().getUploadVariant(); } if (upload == null) { upload = UploadVariant.gwt; } } setUploadVariant(upload); }
/** * Loads the current user's preferences into a CmsUserSettingsBean.<p> * * @return the bean representing the current user's preferences */ public CmsUserSettingsBean loadSettings() { CmsUserSettingsBean result = new CmsUserSettingsBean(); CmsDefaultUserSettings currentSettings = new CmsDefaultUserSettings(); currentSettings.init(m_currentPreferences.getUser()); for (I_CmsPreference pref : OpenCms.getWorkplaceManager().getDefaultUserSettings().getPreferences().values()) { String tab = pref.getTab(); if (CmsGwtConstants.TAB_HIDDEN.equals(tab) || pref.isDisabled(m_cms)) { continue; } CmsXmlContentProperty prop2 = pref.getPropertyDefinition(m_cms); String value = pref.getValue(currentSettings); CmsXmlContentProperty resolvedProp = CmsXmlContentPropertyHelper.resolveMacrosInProperty( prop2.withDefaultWidget("string"), m_macroResolver); result.addSetting(value, resolvedProp, CmsGwtConstants.TAB_BASIC.equals(tab)); } return result; }
defProject = getParamOufqn() + OpenCms.getWorkplaceManager().getDefaultUserSettings().getStartProject();
String publishButton = OpenCms.getWorkplaceManager().getDefaultUserSettings().getPublishButtonAppearance(); if (CmsDefaultUserSettings.PUBLISHBUTTON_SHOW_NEVER.equals(publishButton)) { return "";
String publishButton = OpenCms.getWorkplaceManager().getDefaultUserSettings().getPublishButtonAppearance(); if (CmsDefaultUserSettings.PUBLISHBUTTON_SHOW_NEVER.equals(publishButton)) { return "";
/** * @see org.opencms.workplace.list.A_CmsListDialog#initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest) */ @Override protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, HttpServletRequest request) { super.initWorkplaceRequestValues(settings, request); if (DIALOG_CONTINUE.equals(getParamAction())) { setAction(ACTION_CONTINUE); } else if (CmsNewResource.DIALOG_NEWFORM.equals(getParamAction())) { CmsDefaultUserSettings userSettings = OpenCms.getWorkplaceManager().getDefaultUserSettings(); Boolean editPropsChecked = userSettings.getNewFolderEditProperties(); setParamNewResourceEditProps(editPropsChecked.toString()); } // set title String title = null; CmsExplorerTypeSettings set = OpenCms.getWorkplaceManager().getExplorerTypeSetting(CmsResourceTypeFolder.getStaticTypeName()); if ((set != null) && (CmsStringUtil.isNotEmptyOrWhitespaceOnly(set.getTitleKey()))) { title = getMessages().key(set.getTitleKey(), true); } if (CmsStringUtil.isEmptyOrWhitespaceOnly(title)) { title = key(Messages.GUI_NEWRESOURCE_FOLDER_0); } setParamTitle(title); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest) */ @Override protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, HttpServletRequest request) { super.initWorkplaceRequestValues(settings, request); if (DIALOG_CONTINUE.equals(getParamAction())) { setAction(ACTION_CONTINUE); } else if (CmsNewResource.DIALOG_NEWFORM.equals(getParamAction())) { CmsDefaultUserSettings userSettings = OpenCms.getWorkplaceManager().getDefaultUserSettings(); Boolean editPropsChecked = userSettings.getNewFolderEditProperties(); setParamNewResourceEditProps(editPropsChecked.toString()); } // set title String title = null; CmsExplorerTypeSettings set = OpenCms.getWorkplaceManager().getExplorerTypeSetting( CmsResourceTypeFolder.getStaticTypeName()); if ((set != null) && (CmsStringUtil.isNotEmptyOrWhitespaceOnly(set.getTitleKey()))) { title = getMessages().key(set.getTitleKey(), true); } if (CmsStringUtil.isEmptyOrWhitespaceOnly(title)) { title = key(Messages.GUI_NEWRESOURCE_FOLDER_0); } setParamTitle(title); }
CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_DELETE_MULTI_CONFIRMATION_0)); m_okButton.setVisible(true); boolean canIgnoreBrokenLinks = OpenCms.getWorkplaceManager().getDefaultUserSettings().isAllowBrokenRelations() || OpenCms.getRoleManager().hasRole(cms, CmsRole.VFS_MANAGER); try {