Search in sources :

Example 1 with MCRServletJob

use of org.mycore.frontend.servlets.MCRServletJob in project mycore by MyCoRe-Org.

the class MCRParameterCollector method getInstanceFromUserSession.

public static MCRParameterCollector getInstanceFromUserSession() {
    MCRSession mcrSession = MCRSessionMgr.getCurrentSession();
    MCRServletJob job = (MCRServletJob) mcrSession.get("MCRServletJob");
    return job == null ? new MCRParameterCollector() : new MCRParameterCollector(job.getRequest());
}
Also used : MCRSession(org.mycore.common.MCRSession) MCRServletJob(org.mycore.frontend.servlets.MCRServletJob)

Example 2 with MCRServletJob

use of org.mycore.frontend.servlets.MCRServletJob in project mycore by MyCoRe-Org.

the class MCRFrontendUtil method configureSession.

public static void configureSession(MCRSession session, HttpServletRequest request, HttpServletResponse response) {
    session.setServletJob(new MCRServletJob(request, response));
    // language
    getProperty(request, "lang").ifPresent(session::setCurrentLanguage);
    // Set the IP of the current session
    if (session.getCurrentIP().length() == 0) {
        session.setCurrentIP(getRemoteAddr(request));
    }
    // set BASE_URL_ATTRIBUTE to MCRSession
    if (request.getAttribute(BASE_URL_ATTRIBUTE) != null) {
        session.put(BASE_URL_ATTRIBUTE, request.getAttribute(BASE_URL_ATTRIBUTE));
    }
    // Store XSL.*.SESSION parameters to MCRSession
    putParamsToSession(request);
}
Also used : MCRServletJob(org.mycore.frontend.servlets.MCRServletJob)

Aggregations

MCRServletJob (org.mycore.frontend.servlets.MCRServletJob)2 MCRSession (org.mycore.common.MCRSession)1