/** * Checks if a project is the tempfile project.<p> * @param project the project to test * @return true if the project is the tempfile project */ public boolean isTempfileProject(CmsProject project) { return project.getName().equals("tempFileProject"); }
/** * Checks if a project is the tempfile project.<p> * @param project the project to test * @return true if the project is the tempfile project */ public boolean isTempfileProject(CmsProject project) { return project.getName().equals("tempFileProject"); }
/** * Compares this instance to another given object instance of this class .<p> * * @param o the other given object instance to compare with * @return integer value for sorting the objects */ public int compareTo(CmsProject o) { if (o == this) { return 0; } // compare the names return m_name.compareTo(o.getName()); }
/** * Caches the given project under its id AND the fully qualified name.<p> * * @param project the project to cache */ public void cacheProject(CmsProject project) { if (m_disabled.get(CacheType.PROJECT) != null) { return; } m_cacheProject.put(project.getUuid().toString(), project); m_cacheProject.put(project.getName(), project); }
/** * Caches the given project under its id AND the fully qualified name.<p> * * @param project the project to cache */ public void cacheProject(CmsProject project) { if (m_disabled.get(CacheType.PROJECT) != null) { return; } m_cacheProject.put(project.getUuid().toString(), project); m_cacheProject.put(project.getName(), project); }
/** * Removes the given project from the cache.<p> * * The project is removed by name AND also by uuid.<p> * * @param project the project to remove from cache */ public void uncacheProject(CmsProject project) { m_cacheProject.remove(project.getUuid().toString()); m_cacheProject.remove(project.getName()); }
/** * Removes the given project from the cache.<p> * * The project is removed by name AND also by uuid.<p> * * @param project the project to remove from cache */ public void uncacheProject(CmsProject project) { m_cacheProject.remove(project.getUuid().toString()); m_cacheProject.remove(project.getName()); }
/** * Removes a project if there are no longer any resources which have been last modified in that project.<p> * * @param project the project * @throws CmsException if something goes wrong */ protected void cleanupProjectIfEmpty(CmsProject project) throws CmsException { if ((project.getType().getMode() == CmsProject.PROJECT_TYPE_WORKFLOW.getMode()) && isProjectEmpty(project)) { LOG.info("Removing project " + project.getName() + " because it is an empty workflow project."); m_adminCms.deleteProject(project.getUuid()); } }
/** * @see org.opencms.workplace.CmsWidgetDialog#validateParamaters() */ @Override protected void validateParamaters() throws Exception { if (!isNewProject()) { // test the needed parameters getCms().readProject(new CmsUUID(getParamProjectid())).getName(); } }
/** * Returns the project name.<p> * * @return the project name */ private String getProjectname() { CmsUUID id = new CmsUUID(getParamProjectid()); try { return getCms().readProject(id).getName(); } catch (CmsException e) { LOG.error(Messages.get().getBundle().key(Messages.LOG_SET_PROJECT_NAME_FAILED_0), e); } return "-error-"; }
/** * Returns the project name.<p> * * @return the project name */ private String getProjectname() { CmsUUID id = new CmsUUID(getParamProjectid()); try { return getCms().readProject(id).getName(); } catch (CmsException e) { LOG.error(Messages.get().getBundle().key(Messages.LOG_SET_PROJECT_NAME_FAILED_0), e); } return "-error-"; }
/** * Creates a thread that validates the relations for all files of the current project.<p> * * @param cms the current OpenCms context object */ public CmsRelationsValidatorThread(CmsObject cms) { super(cms, Messages.get().getBundle().key( Messages.GUI_HTML_LINK_VALIDATOR_THREAD_NAME_1, new Object[] {cms.getRequestContext().currentProject().getName()})); m_publishList = null; m_savePublishList = false; m_settings = null; initHtmlReport(cms.getRequestContext().getLocale()); }
/** * Creates the history clear Thread.<p> * * @param cms the current OpenCms context object * @param historyClear the settings to clear the history */ public CmsHistoryClearThread(CmsObject cms, CmsHistoryClear historyClear) { super( cms, Messages.get().getBundle().key( Messages.GUI_HISTORY_CLEAR_THREAD_NAME_1, cms.getRequestContext().getCurrentProject().getName())); m_historyClear = historyClear; initHtmlReport(cms.getRequestContext().getLocale()); }
/** * Creates a thread that validates the relations for all files of the current project.<p> * * @param cms the current OpenCms context object */ public CmsRelationsValidatorThread(CmsObject cms) { super( cms, Messages.get().getBundle().key( Messages.GUI_HTML_LINK_VALIDATOR_THREAD_NAME_1, new Object[] {cms.getRequestContext().getCurrentProject().getName()})); m_publishList = null; m_savePublishList = false; m_settings = null; initHtmlReport(cms.getRequestContext().getLocale()); }
/** * @see org.opencms.ade.publish.I_CmsVirtualProject#getProjectBean(org.opencms.file.CmsObject, java.util.Map) */ public CmsProjectBean getProjectBean(CmsObject cms, Map<String, String> params) { try { CmsProject project = cms.readProject(getProjectId()); CmsProjectBean result = CmsDefaultWorkflowManager.createProjectBeanFromProject(cms, project); Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms); String name = Messages.get().getBundle(locale).key(Messages.GUI_NORMAL_PROJECT_1, project.getName()); result.setDefaultGroupName(name); return result; } catch (CmsException e) { return null; } }
/** * Creates the synchronize Thread.<p> * * @param cms the current OpenCms context object */ public CmsSynchronizeThread(CmsObject cms) { super(cms, Messages.get().getBundle().key( Messages.GUI_SYNCHRONIZE_THREAD_NAME_1, cms.getRequestContext().currentProject().getName())); initHtmlReport(cms.getRequestContext().getLocale()); m_settings = new CmsUserSettings(cms).getSynchronizeSettings(); }
/** * Creates the synchronize Thread.<p> * * @param cms the current OpenCms context object */ public CmsSynchronizeThread(CmsObject cms) { super( cms, Messages.get().getBundle().key( Messages.GUI_SYNCHRONIZE_THREAD_NAME_1, cms.getRequestContext().getCurrentProject().getName())); initHtmlReport(cms.getRequestContext().getLocale()); m_settings = new CmsUserSettings(cms).getSynchronizeSettings(); }
/** * Creates a project bean from a real project.<p> * * @param cms the CMS context * @param project the project * * @return the bean containing the project information */ public static CmsProjectBean createProjectBeanFromProject(CmsObject cms, CmsProject project) { CmsProjectBean manProj = new CmsProjectBean( project.getUuid(), project.getType().getMode(), org.opencms.ade.publish.Messages.get().getBundle(OpenCms.getWorkplaceManager().getWorkplaceLocale(cms)).key( org.opencms.ade.publish.Messages.GUI_NORMAL_PROJECT_1, getOuAwareName(cms, project.getName())), project.getDescription()); return manProj; }
/** * @see org.opencms.workflow.CmsDefaultPublishResourceFormatter.I_PublishResourceValidator#getInfoForResource(org.opencms.file.CmsResource) */ public CmsPublishResourceInfo getInfoForResource(CmsResource resource) throws CmsException { String info; CmsPublishResourceInfo.Type infoType; CmsPublishResourceInfo infoObj; CmsLock lock = m_cms.getLock(resource); info = Messages.get().getBundle(getLocale()).key( Messages.GUI_RESOURCE_LOCKED_BY_2, getOuAwareName(m_cms, m_cms.readUser(lock.getUserId()).getName()), getOuAwareName(m_cms, lock.getProject().getName())); infoType = CmsPublishResourceInfo.Type.LOCKED; infoObj = new CmsPublishResourceInfo(info, infoType); return infoObj; } }
/** * Creates a new instance with all context variables initialized from the given request context.<p> * * @param requestContext the request context to initialize this context info with */ public CmsContextInfo(CmsRequestContext requestContext) { setUserName(requestContext.currentUser().getName()); setProjectName(requestContext.currentProject().getName()); setRequestedUri(requestContext.getUri()); setSiteRoot(requestContext.getSiteRoot()); setLocale(requestContext.getLocale()); setEncoding(requestContext.getEncoding()); setRemoteAddr(requestContext.getRemoteAddress()); setRequestTime(requestContext.getRequestTime()); setOuFqn(requestContext.getOuFqn()); }