/** * Updates all session info objects, so that invalid projects * are replaced by the Online project.<p> * * @param cms the cms context */ public void updateSessionInfos(CmsObject cms) { // get all sessions List userSessions = getSessionInfos(); Iterator i = userSessions.iterator(); while (i.hasNext()) { CmsSessionInfo sessionInfo = (CmsSessionInfo)i.next(); // check is the project stored in this session is not existing anymore // if so, set it to the online project CmsUUID projectId = sessionInfo.getProject(); try { cms.readProject(projectId); } catch (CmsException e) { // the project does not longer exist, update the project information with the online project sessionInfo.setProject(CmsProject.ONLINE_PROJECT_ID); addSessionInfo(sessionInfo); } } }
/** * 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(); } }
/** * Updates all session info objects, so that invalid projects * are replaced by the Online project.<p> * * @param cms the cms context */ public void updateSessionInfos(CmsObject cms) { // get all sessions List<CmsSessionInfo> userSessions = getSessionInfos(); Iterator<CmsSessionInfo> i = userSessions.iterator(); while (i.hasNext()) { CmsSessionInfo sessionInfo = i.next(); // check is the project stored in this session is not existing anymore // if so, set it to the online project CmsUUID projectId = sessionInfo.getProject(); try { cms.readProject(projectId); } catch (CmsException e) { // the project does not longer exist, update the project information with the online project sessionInfo.setProject(CmsProject.ONLINE_PROJECT_ID); addSessionInfo(sessionInfo); } } }