/** * Constructor with options.<p> * * @param cms the current cms context * @param options the options to use */ public CmsPublish(CmsObject cms, CmsPublishOptions options) { m_cms = cms; m_workplaceLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(m_cms); m_options = options; }
/** * Returns the current workplace encoding.<p> * * @return the current workplace encoding */ public String getEncoding() { return OpenCms.getWorkplaceManager().getEncoding(); }
/** * Gets the workplace locale.<p> * * @return the workplace locale */ private Locale getLocale() { return OpenCms.getWorkplaceManager().getWorkplaceLocale(m_cms); }
/** * Gets the locale to use for a given CMS context.<p> * * @param userCms the CMS context * * @return the locale to use */ protected Locale getLocale(CmsObject userCms) { return OpenCms.getWorkplaceManager().getWorkplaceLocale(userCms); }
/** * The gallery search scope.<p> * * @return the gallery search scope */ public CmsGallerySearchScope getScope() { if (m_scope == null) { return OpenCms.getWorkplaceManager().getGalleryDefaultScope(); } return m_scope; }
/** * Returns the instantiated editor display option class from the workplace manager.<p> * * This is a convenience method to be used on editor JSPs.<p> * * @return the instantiated editor display option class */ public CmsEditorDisplayOptions getEditorDisplayOptions() { return OpenCms.getWorkplaceManager().getEditorDisplayOptions(); }
/** * Returns the workplace locale for the current user.<p> * * @return the workplace locale */ public Locale getWorkplaceLocale() { return OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject()); }
/** * Returns the label for the given locale.<p> * * @param locale the user locale * * @return the label */ protected String getLabel(Locale locale) { return OpenCms.getWorkplaceManager().getMessages(locale).key(m_labelKey); }
/** * Initializes the login message object for this dialog.<p> * * The {@link CmsRfsFileViewer} instance is obtained from the * <code>{@link org.opencms.workplace.CmsWorkplaceManager}</code>. */ protected void initLogfileViewBean() { // clone to get a modifiable (not frozen) instance. m_logView = (CmsRfsFileViewer)OpenCms.getWorkplaceManager().getFileViewSettings().clone(); }
public int compare(I_CmsResourceType type1, I_CmsResourceType type2) { CmsExplorerTypeSettings settings1 = OpenCms.getWorkplaceManager().getExplorerTypeSetting( type1.getTypeName()); CmsExplorerTypeSettings settings2 = OpenCms.getWorkplaceManager().getExplorerTypeSetting( type2.getTypeName()); return ComparisonChain.start().compare( settings1.getViewOrder(true), settings2.getViewOrder(true)).compare( parse(settings1.getNewResourceOrder()), parse(settings2.getNewResourceOrder())).result(); }
/** * Returns the workplace message to the given key using the current users workplace locale.<p> * * @param key the key * * @return the message */ protected String getWorkplaceMessage(String key) { CmsWorkplaceMessages messages = OpenCms.getWorkplaceManager().getMessages(UI.getCurrent().getLocale()); return messages.key(key); }
/** * Returns the context menu.<p> * @return the context menu */ public CmsExplorerContextMenu getContextMenu() { if ((m_reference != null) && (m_contextMenu.isEmpty())) { m_contextMenu = (CmsExplorerContextMenu)OpenCms.getWorkplaceManager().getExplorerTypeSetting( m_reference).getContextMenu().clone(); } return m_contextMenu; }
/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#matches(org.opencms.file.CmsObject, CmsResourceUtil[]) */ public boolean matches(CmsObject cms, CmsResourceUtil[] resourceUtil) { if (resourceUtil[0].isInsideProject()) { if (resourceUtil[0].getLock().isNullLock()) { return !OpenCms.getWorkplaceManager().autoLockResources(); } } // resource is not in current project return false; }
/** * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getHelpText(java.util.Locale) */ public String getHelpText(Locale locale) { return CmsMacroResolver.newInstance().setMessages( OpenCms.getWorkplaceManager().getMessages(locale)).resolveMacros(m_toolHandler.getHelpText()); }
/** * 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)); }
/** * Constructor.<p> * * @param locale the user locale */ public CmsPasswordForm(Locale locale) { CmsVaadinUtils.readAndLocalizeDesign(this, OpenCms.getWorkplaceManager().getMessages(locale), null); m_securityHint.setVisible(false); m_password1Style = new CmsStyleVariable(m_password1Wrapper); m_password2Style = new CmsStyleVariable(m_password2Wrapper); m_oldPasswordStyle = new CmsStyleVariable(m_oldPasswordWrapper); }
/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#matches(org.opencms.file.CmsObject, CmsResourceUtil[]) */ public boolean matches(CmsObject cms, CmsResourceUtil[] resourceUtil) { if (resourceUtil[0].isInsideProject()) { boolean matches = (!resourceUtil[0].getProjectState().isLockedForPublishing()) && (CmsStringUtil.isEmptyOrWhitespaceOnly(resourceUtil[0].getLockedByName())); return matches && !OpenCms.getWorkplaceManager().autoLockResources(); } // resource is not in current project return false; }
/** * @see com.vaadin.server.SessionInitListener#sessionInit(com.vaadin.server.SessionInitEvent) */ public void sessionInit(final SessionInitEvent event) { // set the locale to the users workplace locale Locale wpLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject()); event.getSession().setLocale(wpLocale); event.getSession().addRequestHandler(REQUEST_AUTHORIZATION_HANDLER); event.getSession().addUIProvider(LOGIN_UI_PROVIDER); event.getSession().addBootstrapListener(BOOTSTRAP_LISTENER); }