/** * Returns the current users project.<p> * * @return the current users project */ public CmsProject currentProject() { return m_requestContext.currentProject(); }
/** * Returns the project to use to check project state.<p> * * @return the project to use to check project state */ public CmsProject getReferenceProject() { if (m_referenceProject == null) { if (m_request != null) { m_referenceProject = m_request.currentProject(); } } return m_referenceProject; }
/** * Returns the project to use as reference.<p> * * @return the project to use as reference */ protected CmsProject getProject() { return getCms().getRequestContext().currentProject(); }
/** * @see org.opencms.workplace.tools.I_CmsToolHandler#isEnabled(org.opencms.file.CmsObject) */ @Override public boolean isEnabled(CmsObject cms) { return !cms.getRequestContext().currentProject().isOnlineProject(); } }
/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#matches(org.opencms.file.CmsObject, CmsResourceUtil[]) */ public boolean matches(CmsObject cms, CmsResourceUtil[] resourceUtil) { return cms.getRequestContext().currentProject().isOnlineProject(); }
/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#matches(org.opencms.file.CmsObject, CmsResourceUtil[]) */ public boolean matches(CmsObject cms, CmsResourceUtil[] resourceUtil) { return cms.getRequestContext().currentProject().isOnlineProject(); }
/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#matches(org.opencms.file.CmsObject, CmsResourceUtil[]) */ public boolean matches(CmsObject cms, CmsResourceUtil[] resourceUtil) { return cms.getRequestContext().currentProject().isOnlineProject(); }
/** * Unlocks the current project, required before publishing.<p> * @throws Exception if something goes wrong */ public void unlockCurrentProject() throws Exception { m_cms.unlockProject(m_cms.getRequestContext().currentProject().getUuid()); }
/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#getVisibility(org.opencms.file.CmsObject, CmsResourceUtil[]) */ @Override public CmsMenuItemVisibilityMode getVisibility(CmsObject cms, CmsResourceUtil[] resourceUtil) { if (cms.getRequestContext().currentProject().isOnlineProject()) { return CmsMenuItemVisibilityMode.VISIBILITY_INACTIVE.addMessageKey(Messages.GUI_CONTEXTMENU_TITLE_INACTIVE_ONLINEPROJECT_0); } return CmsMenuItemVisibilityMode.VISIBILITY_ACTIVE; }
/** * Updates the session info object with the information from * the given request context.<p> * * @param context the request context to update the session with */ protected void update(CmsRequestContext context) { m_timeUpdated = System.currentTimeMillis(); m_siteRoot = context.getSiteRoot(); setProject(context.currentProject().getUuid()); m_ouFqn = context.getOuFqn(); } }
/** * Returns a cache key for the given root path based on the status * of the given CmsObject.<p> * * @param cms the cms context * @param rootPath the filename to get the cache key for * * @return the cache key for the system id */ private String getCacheKeyForCurrentProject(CmsObject cms, String rootPath) { // check the project boolean project = (cms != null) ? cms.getRequestContext().currentProject().isOnlineProject() : false; return getCacheKey(rootPath, project); }
/** * Returns a publish list with all new/changed/deleted resources of the current (offline) * project that actually get published.<p> * * @param cms the cms request context * * @return a publish list * * @throws CmsException if something goes wrong */ public CmsPublishList getPublishList(CmsObject cms) throws CmsException { return m_securityManager.fillPublishList(cms.getRequestContext(), new CmsPublishList( cms.getRequestContext().currentProject())); }
/** * Checks if the provided request is running in OpenCms and the current users project is the online project.<p> * * @param req the current request * * @return <code>true</code> if the request is running in OpenCms and the current users project is * the online project, <code>false</code> otherwise */ public static boolean isCmsOnlineRequest(ServletRequest req) { if (req == null) { return false; } return getController(req).getCmsObject().getRequestContext().currentProject().isOnlineProject(); }
/** * 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()); }
/** * @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()) { CmsLock lock = resourceUtil[0].getLock(); return (!resourceUtil[0].getProjectState().isLockedForPublishing() && !lock.isShared() && lock.isOwnedInProjectBy( cms.getRequestContext().currentUser(), cms.getRequestContext().currentProject())); } // resource is not locked by the user in current project, rule does not match return false; }
/** * @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()) { CmsLock lock = resourceUtil[0].getLock(); return !(!resourceUtil[0].getProjectState().isLockedForPublishing() && !lock.isNullLock() && lock.isExclusiveOwnedInProjectBy( cms.getRequestContext().currentUser(), cms.getRequestContext().currentProject())); } // resource is not in current project, rule does not match return false; }
/** * @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()) { CmsLock lock = resourceUtil[0].getLock(); return !(!resourceUtil[0].getProjectState().isLockedForPublishing() && !lock.isNullLock() && lock.isExclusiveOwnedInProjectBy( cms.getRequestContext().currentUser(), cms.getRequestContext().currentProject())); } // resource is not in current project, rule does not match return false; }
/** * @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()) { CmsLock lock = resourceUtil[0].getLock(); return (!resourceUtil[0].getProjectState().isLockedForPublishing() && !lock.isShared() && lock.isOwnedInProjectBy( cms.getRequestContext().currentUser(), cms.getRequestContext().currentProject())); } // resource is not locked by the user in current project, rule does not match return false; }
/** * @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()) { CmsLock lock = resourceUtil[0].getLock(); return resourceUtil[0].getProjectState().isLockedForPublishing() || !(!lock.isNullLock() && lock.isExclusiveOwnedInProjectBy( cms.getRequestContext().currentUser(), cms.getRequestContext().currentProject())); } // resource is not in current project, rule does not match return false; }
/** * 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(); }