/** * Returns <code>true</code> if the given project is the project of this lock.<p> * * @param project the project to compare to the project of this lock * * @return <code>true</code> if the given project is the project of this lock */ public boolean isInProject(CmsProject project) { return m_project.equals(project); }
/** * Returns <code>true</code> if the given project is the project of this lock.<p> * * @param project the project to compare to the project of this lock * * @return <code>true</code> if the given project is the project of this lock */ public boolean isInProject(CmsProject project) { return m_project.equals(project); }
/** * Compares this lock to the specified object.<p> * * @param obj the object to compare to * @return true if and only if member values of this CmsLock are the same with the compared CmsLock */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof CmsLock) { CmsLock other = (CmsLock)obj; return other.m_resourceName.equals(m_resourceName) && other.m_userId.equals(m_userId) && other.m_project.equals(m_project) && other.m_type.equals(m_type); } return false; }
/** * Compares this lock to the specified object.<p> * * @param obj the object to compare to * @return true if and only if member values of this CmsLock are the same with the compared CmsLock */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof CmsLock) { CmsLock other = (CmsLock)obj; return other.m_resourceName.equals(m_resourceName) && other.m_userId.equals(m_userId) && other.m_project.equals(m_project) && other.m_type.equals(m_type); } return false; }
/** * Returns the project widget configuration.<p> * * @return the project widget configuration */ private List<CmsSelectWidgetOption> getProjectWidgetConfiguration() { List<CmsSelectWidgetOption> result = new ArrayList<CmsSelectWidgetOption>(); try { List<CmsProject> projects = OpenCms.getOrgUnitManager().getAllManageableProjects(getCms(), "", true); projects.add(getCms().readProject(CmsProject.ONLINE_PROJECT_ID)); for (CmsProject project : projects) { CmsSelectWidgetOption option = new CmsSelectWidgetOption(project.getName(), project.equals(project)); result.add(option); } } catch (CmsException e) { // should never happen } return result; }
/** * Changes to the given project. Will update session and workplace settings.<p> * * @param project the project to change to */ public void changeProject(CmsProject project) { CmsObject cms = getCmsObject(); if (!cms.getRequestContext().getCurrentProject().equals(project)) { cms.getRequestContext().setCurrentProject(project); getWorkplaceSettings().setProject(project.getUuid()); OpenCms.getSessionManager().updateSessionInfo(cms, getHttpSession()); if (!project.isOnlineProject()) { setAttribute(LAST_OFFLINE_PROJECT, project); } } }
/** * Submits the dialog action.<p> */ void submit() { try { CmsProject project = m_context.getCms().readProject((CmsUUID)m_projectComboBox.getValue()); if (!m_context.getCms().getRequestContext().getCurrentProject().equals(project)) { A_CmsUI.get().changeProject(project); } else { project = null; } String siteRoot = (String)m_siteComboBox.getValue(); if (!m_context.getCms().getRequestContext().getSiteRoot().equals(siteRoot)) { A_CmsUI.get().changeSite(siteRoot); } else { siteRoot = null; } if ((siteRoot != null) && CmsFileExplorerConfiguration.APP_ID.equals(m_context.getAppId())) { I_CmsWorkplaceAppConfiguration editorConf = OpenCms.getWorkplaceAppManager().getAppConfiguration( CmsPageEditorConfiguration.APP_ID); if (editorConf.getVisibility(m_context.getCms()).isActive()) { ((I_CmsHasAppLaunchCommand)editorConf).getAppLaunchCommand().run(); return; } } m_context.finish(project, siteRoot); } catch (CmsException e) { m_context.error(e); } }