Search in sources :

Example 1 with DominoFacesContext

use of com.ibm.xsp.domino.context.DominoFacesContext in project org.openntf.domino by OpenNTF.

the class ODAFacesContextFactory method getFacesContext.

@Override
public FacesContext getFacesContext(final Object context, final Object request, final Object response, final Lifecycle lifecycle) throws FacesException {
    FacesContext ctx = _delegate.getFacesContext(context, request, response, lifecycle);
    Factory.initThread(ODAPlatform.getAppThreadConfig(null));
    Factory.setSessionFactory(new XPageCurrentSessionFactory(), SessionType.CURRENT);
    Factory.setSessionFactory(new XPageSignerSessionFactory(false), SessionType.SIGNER);
    Factory.setSessionFactory(new XPageSignerSessionFactory(true), SessionType.SIGNER_FULL_ACCESS);
    // TODO RPr: This is probably the wrong locale. See ViewHandler.calculateLocale
    Factory.setUserLocale(ctx.getExternalContext().getRequestLocale());
    Factory.setClassLoader(ctx.getContextClassLoader());
    if (ODAPlatform.isAppGodMode(null)) {
        ODAFacesContext localContext = new ODAFacesContext(ctx);
        attachListener(localContext);
        return localContext;
    } else {
        if (ctx instanceof FacesContextEx) {
            attachListener((FacesContextEx) ctx);
            return ctx;
        } else {
            DominoFacesContext localContext = new DominoFacesContext(ctx);
            attachListener(localContext);
            return localContext;
        }
    }
}
Also used : DominoFacesContext(com.ibm.xsp.domino.context.DominoFacesContext) FacesContext(javax.faces.context.FacesContext) XPageCurrentSessionFactory(org.openntf.domino.xsp.session.XPageCurrentSessionFactory) FacesContextEx(com.ibm.xsp.context.FacesContextEx) DominoFacesContext(com.ibm.xsp.domino.context.DominoFacesContext) XPageSignerSessionFactory(org.openntf.domino.xsp.session.XPageSignerSessionFactory)

Aggregations

FacesContextEx (com.ibm.xsp.context.FacesContextEx)1 DominoFacesContext (com.ibm.xsp.domino.context.DominoFacesContext)1 FacesContext (javax.faces.context.FacesContext)1 XPageCurrentSessionFactory (org.openntf.domino.xsp.session.XPageCurrentSessionFactory)1 XPageSignerSessionFactory (org.openntf.domino.xsp.session.XPageSignerSessionFactory)1