/** * Constructor, creates a new CmsContentCheckThread.<p> * * @param cms the current CmsObject * @param contentCheck the CmsContentCheck objectt */ public CmsContentCheckThread(CmsObject cms, CmsContentCheck contentCheck) { super(cms, "contentcheck"); initHtmlReport(cms.getRequestContext().getLocale()); m_cms = cms; m_cms.getRequestContext().setUpdateSessionEnabled(false); m_contentCheck = contentCheck; }
/** * Constructor, creates a new CmsElementRenameThread.<p> * * @param cms the current CmsObject * @param elementRename the initialized CmsElementRename Object */ public CmsElementRenameThread(CmsObject cms, CmsElementRename elementRename) { super(cms, "Renaming Elements"); cms.getRequestContext().setUpdateSessionEnabled(false); initHtmlReport(cms.getRequestContext().getLocale()); m_elementRename = elementRename; }
/** * Constructor, creates a new CmsMergePagesThread.<p> * * @param cms the current CmsObject * @param mergePages the initialized CmsMergePages Object */ public CmsMergePagesThread(CmsObject cms, CmsMergePages mergePages) { super(cms, Messages.get().getBundle().key(Messages.GUI_MERGE_PAGES_THREAD_NAME_0)); cms.getRequestContext().setUpdateSessionEnabled(false); initHtmlReport(cms.getRequestContext().getLocale()); m_mergePages = mergePages; }
/** * Logs out the current user redirecting to the login form afterwards.<p> * * @param cms the cms context * @param request the servlet request * @param response the servlet response * * @throws IOException if writing to the response fails */ public static void logout(CmsObject cms, HttpServletRequest request, HttpServletResponse response) throws IOException { String loggedInUser = cms.getRequestContext().getCurrentUser().getName(); HttpSession session = request.getSession(false); if (session != null) { session.invalidate(); /* we need this because a new session might be created after this method, but before the session info is updated in OpenCmsCore.showResource. */ cms.getRequestContext().setUpdateSessionEnabled(false); } // logout was successful if (LOG.isInfoEnabled()) { LOG.info( org.opencms.jsp.Messages.get().getBundle().key( org.opencms.jsp.Messages.LOG_LOGOUT_SUCCESFUL_3, loggedInUser, cms.getRequestContext().addSiteRoot(cms.getRequestContext().getUri()), cms.getRequestContext().getRemoteAddress())); } response.sendRedirect(getFormLink(cms)); }
/** * Constructs a new report Thread with the given name.<p> * * @param cms the current OpenCms context object * @param name the name of the Thread */ protected A_CmsReportThread(CmsObject cms, String name) { super(OpenCms.getThreadStore().getThreadGroup(), name); // report Threads are never daemon Threads setDaemon(false); // the session in the cms context must not be updated when it is used in a report m_cms = cms; m_cms.getRequestContext().setUpdateSessionEnabled(false); // generate the report Thread id m_id = new CmsUUID(); setName(name + " [" + m_id + "]"); // new Threads are not doomed m_doomed = false; // set start time m_starttime = System.currentTimeMillis(); // add this Thread to the main Thread store OpenCms.getThreadStore().addThread(this); }
/** * Constructs a new report Thread with the given name.<p> * * @param cms the current OpenCms context object * @param name the name of the Thread */ protected A_CmsReportThread(CmsObject cms, String name) { super(OpenCms.getThreadStore().getThreadGroup(), name); // report Threads are never daemon Threads setDaemon(false); // the session in the cms context must not be updated when it is used in a report m_cms = cms; m_cms.getRequestContext().setUpdateSessionEnabled(false); // generate the report Thread id m_id = new CmsUUID(); setName(name + " [" + m_id + "]"); // new Threads are not doomed m_doomed = false; // set start time m_starttime = System.currentTimeMillis(); // add this Thread to the main Thread store OpenCms.getThreadStore().addThread(this); }
/** * Logs a user out, i.e. destroys the current users session, * after that the current page will be redirected to itself one time to ensure that * the users session is truly destroyed.<p> * * @throws IOException if redirect after logout fails */ public void logout() throws IOException { String loggedInUserName = getRequestContext().getCurrentUser().getName(); HttpSession session = getRequest().getSession(false); if (session != null) { session.invalidate(); /* we need this because a new session might be created after this method, but before the session info is updated in OpenCmsCore.showResource. */ getCmsObject().getRequestContext().setUpdateSessionEnabled(false); } // logout was successful if (LOG.isInfoEnabled()) { LOG.info( Messages.get().getBundle().key( Messages.LOG_LOGOUT_SUCCESFUL_3, loggedInUserName, getRequestContext().addSiteRoot(getRequestContext().getUri()), getRequestContext().getRemoteAddress())); } getResponse().sendRedirect(getFormLink()); } }
/** * Constructor, creates a new CmsExternLinkValidationThread.<p> * * @param cms the current CmsObject */ public CmsExternalLinksValidatorThread(CmsObject cms) { super(cms, Messages.get().getBundle().key(Messages.GUI_POINTER_VALIDATION_THREAD_NAME_0)); initHtmlReport(cms.getRequestContext().getLocale()); m_cms = cms; m_cms.getRequestContext().setUpdateSessionEnabled(false); m_externLinkValidator = new CmsExternalLinksValidator(); m_externLinkValidator.setReport(getReport()); }
/** * Constructor, creates a new CmsExternLinkValidationThread.<p> * * @param cms the current CmsObject */ public CmsExternalLinksValidatorThread(CmsObject cms) { super(cms, Messages.get().getBundle().key(Messages.GUI_POINTER_VALIDATION_THREAD_NAME_0)); initHtmlReport(cms.getRequestContext().getLocale()); m_cms = cms; m_cms.getRequestContext().setUpdateSessionEnabled(false); m_externLinkValidator = new CmsExternalLinksValidator(); m_externLinkValidator.setReport(getReport()); }