/** * Returns the pre defined ou fqn.<p> * * @param cms the cms context * @param request the request * @param logout in case of a logout * * @return the ou fqn */ private static String getPreDefOuFqn(CmsObject cms, HttpServletRequest request, boolean logout) { if (logout && (request.getAttribute(PARAM_PREDEF_OUFQN) == null)) { String oufqn = cms.getRequestContext().getOuFqn(); if (!oufqn.startsWith(CmsOrganizationalUnit.SEPARATOR)) { oufqn = CmsOrganizationalUnit.SEPARATOR + oufqn; } request.setAttribute(CmsLoginHelper.PARAM_PREDEF_OUFQN, oufqn); } return (String)request.getAttribute(PARAM_PREDEF_OUFQN); } }
/** * Returns a list of all sites available (visible) for the current user.<p> * * @param cms the current OpenCms user context * @param workplaceMode if true, the root and current site is included for the admin user * and the view permission is required to see the site root * * @return a list of all sites available for the current user */ public List<CmsSite> getAvailableSites(CmsObject cms, boolean workplaceMode) { return getAvailableSites(cms, workplaceMode, cms.getRequestContext().getOuFqn()); }
/** * Returns a list of all sites available for the current user.<p> * * @param cms the current OpenCms user context * @param workplaceMode if true, the root and current site is included for the admin user * and the view permission is required to see the site root * * @return a list of all site available for the current user */ public List getAvailableSites(CmsObject cms, boolean workplaceMode) { return getAvailableSites(cms, workplaceMode, cms.getRequestContext().getOuFqn()); }
/** * Returns the predefined organizational unit fqn.<p> * * This is normally selected by url, and set by the {@link CmsWorkplaceLoginHandler}.<p> * * @return the predefined organizational unit fqn */ protected String getPreDefOuFqn() { if (Boolean.valueOf(m_actionLogout).booleanValue() && (getRequest().getAttribute(PARAM_PREDEF_OUFQN) == null)) { String oufqn = getCmsObject().getRequestContext().getOuFqn(); if (!oufqn.startsWith(CmsOrganizationalUnit.SEPARATOR)) { oufqn = CmsOrganizationalUnit.SEPARATOR + oufqn; } getRequest().setAttribute(CmsLogin.PARAM_PREDEF_OUFQN, oufqn); } return (String)getRequest().getAttribute(PARAM_PREDEF_OUFQN); }
/** * Returns the predefined organizational unit fqn.<p> * * This is normally selected by url, and set by the {@link CmsWorkplaceLoginHandler}.<p> * * @return the predefined organizational unit fqn */ protected String getPreDefOuFqn() { if (Boolean.valueOf(m_actionLogout).booleanValue() && (getRequest().getAttribute(PARAM_PREDEF_OUFQN) == null)) { String oufqn = getCmsObject().getRequestContext().getOuFqn(); if (!oufqn.startsWith(CmsOrganizationalUnit.SEPARATOR)) { oufqn = CmsOrganizationalUnit.SEPARATOR + oufqn; } getRequest().setAttribute(CmsLogin.PARAM_PREDEF_OUFQN, oufqn); } return (String)getRequest().getAttribute(PARAM_PREDEF_OUFQN); }
/** * 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.getCurrentProject().getUuid()); m_ouFqn = context.getOuFqn(); } }
/** * 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 list of all sites available for the current user.<p> * * @param cms the current cms context * @param workplaceMode if true, the root and current site is included for the admin user * and the view permission is required to see the site root * * @return a list of all site available for the current user * * @deprecated Use {@link OpenCms#getSiteManager()} to obtain the configured site manager instance, * then use the method with the same name and signature. */ public static List getAvailableSites(CmsObject cms, boolean workplaceMode) { return OpenCms.getSiteManager().getAvailableSites(cms, workplaceMode, cms.getRequestContext().getOuFqn()); }
/** * Unlocks a user who has exceeded his number of failed login attempts so that he can try to log in again.<p> * This requires the "account manager" role. * * @param cms the current CMS context * @param user the user to unlock * * @throws CmsRoleViolationException if the permission check fails */ public void unlockUser(CmsObject cms, CmsUser user) throws CmsRoleViolationException { OpenCms.getRoleManager().checkRole(cms, CmsRole.ACCOUNT_MANAGER.forOrgUnit(cms.getRequestContext().getOuFqn())); Set<String> keysToRemove = getKeysForUser(user); for (String keyToRemove : keysToRemove) { m_storage.remove(keyToRemove); } }
true, false, cms.getRequestContext().getOuFqn());
false, false, cms.getRequestContext().getOuFqn()); Collections.sort(resStatus.getOtherSiteRelationSources(), new Comparator<CmsResourceStatusRelationBean>() {
true, false, cms.getRequestContext().getOuFqn()); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(wpSite) && !wpSite.endsWith("/")) { wpSite += "/";
/** * Initializes the session object to work with depending on the dialog state and request parameters.<p> */ protected void initSessionObject() { try { if (!CmsStringUtil.isEmpty(getParamAction()) && !CmsDialog.DIALOG_INITIAL.equals(getParamAction())) { m_resources = (List)getDialogObject(); // test m_resources.size(); } } catch (Exception e) { // ignore } if (m_resources == null) { // create a new project object m_resources = new ArrayList(); try { Iterator it = OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit( getCms(), getCms().getRequestContext().getOuFqn()).iterator(); while (it.hasNext()) { CmsResource res = (CmsResource)it.next(); m_resources.add(getCms().getSitePath(res)); } } catch (CmsException e1) { // should never happen } } }
includeRootSite, true, getCms().getRequestContext().getOuFqn());
siteRoot, cms.getRequestContext().getCurrentProject().getUuid(), cms.getRequestContext().getOuFqn());
/** * This method updates the request context information.<p> * * The update information is:<br> * <ul> * <li>Requested Url</li> * <li>Locale</li> * <li>Encoding</li> * <li>Remote Address</li> * <li>Request Time</li> * </ul> * * @param request the current request * @param cms the cms object to update the request context for * * @return a new updated cms context * * @throws CmsException if something goes wrong */ protected CmsObject updateContext(HttpServletRequest request, CmsObject cms) throws CmsException { // get the right site for the request CmsSite site = OpenCms.getSiteManager().matchRequest(request); return initCmsObject( request, cms.getRequestContext().currentUser(), site.getSiteRoot(), cms.getRequestContext().currentProject().getUuid(), cms.getRequestContext().getOuFqn()); }
/** * 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()); }
/** * 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.getCurrentUser().getName()); setProjectName(requestContext.getCurrentProject().getName()); setRequestedUri(requestContext.getUri()); setSiteRoot(requestContext.getSiteRoot()); setRequestMatcher(requestContext.getRequestMatcher()); setLocale(requestContext.getLocale()); setEncoding(requestContext.getEncoding()); setRemoteAddr(requestContext.getRemoteAddress()); setRequestTime(requestContext.getRequestTime()); setIsSecureRequest(requestContext.isSecureRequest()); setOuFqn(requestContext.getOuFqn()); setDetailResource(requestContext.getDetailResource()); }
CmsUUID ouProject = OpenCms.getOrgUnitManager().readOrganizationalUnit( m_context.getCms(), m_context.getCms().getRequestContext().getOuFqn()).getProjectId(); if (projects.containsId(ouProject)) { m_projectComboBox.select(ouProject);