/** * @see org.opencms.workplace.tools.I_CmsToolHandler#isEnabled(org.opencms.file.CmsObject) */ @Override public boolean isEnabled(CmsObject cms) { return !cms.getRequestContext().getCurrentProject().isOnlineProject(); } }
/** * Initializes this bean.<p> * * @param cms the current cms context * @param locale the locale for which properties should be read */ public void init(CmsObject cms, Locale locale) { m_cms = cms; m_locale = locale; m_requestUri = m_cms.getRequestContext().getUri(); m_requestUriFolder = CmsResource.getFolderPath(m_requestUri); }
/** * @see org.opencms.workplace.tools.I_CmsToolHandler#isEnabled(org.opencms.file.CmsObject) */ @Override public boolean isEnabled(CmsObject cms) { 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().getCurrentProject().getUuid()); }
/** * Returns if direct edit is enabled.<p> * * @param cms the current cms context * * @return <code>true</code> if direct edit is enabled */ static boolean isDirectEditEnabled(CmsObject cms) { return !cms.getRequestContext().getCurrentProject().isOnlineProject() && (cms.getRequestContext().getAttribute(CmsGwtConstants.PARAM_DISABLE_DIRECT_EDIT) == null); }
/** * Returns the current users name.<p> * * @return the current users name */ public String userName() { return m_cms.getRequestContext().getCurrentUser().getName(); }
/** * 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.ui.contextmenu.I_CmsHasMenuItemVisibility#getVisibility(org.opencms.file.CmsObject, java.util.List) */ public CmsMenuItemVisibilityMode getVisibility(CmsObject cms, List<CmsResource> resources) { return cms.getRequestContext().getCurrentUser().isManaged() ? CmsMenuItemVisibilityMode.VISIBILITY_INVISIBLE : CmsMenuItemVisibilityMode.VISIBILITY_ACTIVE; } }
/** * Returns the set of permissions of the current user for a given resource.<p> * * @param resourceName the name of the resource * * @return the bit set of the permissions of the current user * * @throws CmsException if something goes wrong */ public CmsPermissionSet getPermissions(String resourceName) throws CmsException { return getPermissions(resourceName, m_context.getCurrentUser().getName()); }
/** * Returns the set of permissions of the current user for a given resource.<p> * * @param resourceName the name of the resource * * @return the bit set of the permissions of the current user * * @throws CmsException if something goes wrong */ public CmsPermissionSet getPermissions(String resourceName) throws CmsException { return getPermissions(resourceName, m_context.currentUser().getName()); }
/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#matches(org.opencms.file.CmsObject, CmsResourceUtil[]) */ public boolean matches(CmsObject cms, CmsResourceUtil[] resourceUtil) { return cms.getRequestContext().getCurrentProject().isOnlineProject(); }
/** * Initiliazes this bean.<p> * * @param cms context provider for the current request */ public void init(CmsObject cms) { m_cms = cms; m_requestUri = m_cms.getRequestContext().getUri(); m_requestUriFolder = CmsResource.getFolderPath(m_requestUri); } }
/** * @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(); }
/** * Returns the DEFAULT filter in the Online project, and IGNORE_EXPIRATION otherwise.<p> * * @param cms the CMS context whose project to check * @return the resource filter based on the given CmsObject */ public static CmsResourceFilter ignoreExpirationOffline(CmsObject cms) { return cms.getRequestContext().getCurrentProject().isOnlineProject() ? DEFAULT : IGNORE_EXPIRATION; }
/** * Returns the current folder set as URI in the request context.<p> * * @return the current folder * @throws Exception if something goes wrong * @see org.opencms.file.CmsRequestContext#getUri() * @see CmsResource#getFolderPath(String) */ public String pwd() throws Exception { return CmsResource.getFolderPath(m_cms.getRequestContext().getUri()); }
/** * Returns if the current project is the online project.<p> * * @return <code>true</code> if the current project is the online project */ public boolean getIsOnlineProject() { return m_cms.getRequestContext().getCurrentProject().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().getCurrentProject().isOnlineProject(); }
/** * Returns true if the project set in the CmsObject is the Online project.<p> * * @param cms the CMS context to check * * @return true if the project set in the CMS context is the Online project */ private boolean isOnline(CmsObject cms) { return cms.getRequestContext().getCurrentProject().isOnlineProject(); }
/** * Returns true if this an online configuration cache.<p> * * @return true if this is an online cache, false if it is an offline cache */ protected boolean isOnline() { return m_cms.getRequestContext().getCurrentProject().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().getCurrentProject().isOnlineProject(); }