Package org.itsnat.impl.core.servlet

Examples of org.itsnat.impl.core.servlet.ItsNatServletRequestImpl


    public void dispatchRequestListeners()
    {  
        // Damos una oportunidad de procesar a medida el "page not found"
        // pudiendo mostrar una p�gina de error elegante

        ItsNatServletRequestImpl itsNatRequest = itsNatResponse.getItsNatServletRequestImpl();
        ItsNatServletImpl itsNatServlet = itsNatRequest.getItsNatServletImpl();
        if (!itsNatServlet.dispatchItsNatServletRequestListeners(itsNatRequest))
        {
            // No hay listeners globales provocamos un error
            String docName = getRequestNormalLoadDocNotFound().getDocName();
            throw new ItsNatException("Document/page " + docName + " does not exist",itsNatRequest);
View Full Code Here


                    // Porque este servlet es diferente al que recibe la request, no pasamos
                    // los objetos request y response originales pues los de ItsNat est�n vinculados
                    // al servlet, tenemos que crear un par "falsos"
                    // el �nico caso problem�tico son los templates basados en TemplateSource que son los �nicos que necesitan estos objetos
                    ItsNatServletRequestImpl currItsNatServReq = currItsNatServlet.createItsNatServletRequest(servRequest,servResponse,this); // Pasando la sesi�n como par�metro evitamos que se intente cargar de nuevo
                    ItsNatServletResponseImpl currItsNatServResp = currItsNatServReq.getItsNatServletResponseImpl();

                    for(DeserialPendingTask task : pendingTasksOfServlet)
                    {
                        task.process(currItsNatServlet,currItsNatServReq,currItsNatServResp);
                    }
View Full Code Here

        ClientDocumentAttachedServerImpl clientDocAS = getClientDocumentAttachedServer();

        ItsNatStfulDocumentTemplateAttachedServerImpl template = clientDocAS.getItsNatStfulDocumentTemplateAttachedServer();

        ItsNatServletResponseImpl itsNatResponse = getItsNatServletResponse();
        ItsNatServletRequestImpl itsNatRequest = itsNatResponse.getItsNatServletRequestImpl();

        ServletResponse responseOriginal = itsNatResponse.getServletResponse();
        ServletResponseAttachedServer servResWrapper = itsNatResponse.createServletResponseAttachedServer();
        itsNatResponse.setServletResponse(servResWrapper);

        RequestNormalLoadDocAttachedServerImpl delegRequest = new RequestNormalLoadDocAttachedServerImpl(template,getRequestAttachedServerLoadDoc(),itsNatRequest);
        itsNatRequest.setRequest(delegRequest); // Para que al procesar el request el ItsNatServletRequestImpl est� correctamente conectado a request de carga normal no al attached y el c�digo del usuario obtenga el ClientDocument normal por ejemplo
        delegRequest.process(null);
        ClientDocumentStfulImpl clientDocNormal = delegRequest.getClientDocumentStful();
        Browser browser = clientDocNormal.getBrowser();

        itsNatResponse.setServletResponse(responseOriginal); // restauramos
View Full Code Here

        return (ClientDocumentStfulOwnerImpl)clientDocOwner;
    }

    public ClientDocumentStfulImpl getRequestingClientDocumentStful()
    {
        ItsNatServletRequestImpl request = getCurrentItsNatServletRequest();
        if (request != null) return (ClientDocumentStfulImpl)request.getClientDocumentImpl(); // No puede ser null el ClientDocument devuelto (no tiene sentido en este contexto)
        return getClientDocumentStfulOwner(); // Caso de que no haya un request en proceso
    }
View Full Code Here

        dispatchRequestListeners();
    }

    public void dispatchRequestListeners()
    {
        ItsNatServletRequestImpl itsNatRequest = itsNatResponse.getItsNatServletRequestImpl();
        ItsNatServletImpl itsNatServlet = itsNatRequest.getItsNatServletImpl();
        if (!itsNatServlet.dispatchItsNatServletRequestListeners(itsNatRequest))
        {
            // No hay listeners globales provocamos un error
            String docName = getRequestAttachedServerPrepareNotFound().getDocName();
            throw new ItsNatException("Document/page " + docName + " does not exist",itsNatRequest);
View Full Code Here

        StringBuilder code = new StringBuilder();

        ClientDocumentAttachedServerImpl clientDoc = getClientDocumentAttachedServer();
        ItsNatStfulDocumentTemplateAttachedServerImpl template = clientDoc.getItsNatStfulDocumentTemplateAttachedServer();

        ItsNatServletRequestImpl itsNatRequest = getRequest().getItsNatServletRequest();
        String url = itsNatRequest.getServletPath(true, true); // Devuelve un URL absoluto sin la query

        code.append("itsnat.init = function(markupOrig)\n");
        code.append("{ \n");
        code.append("  this.markupCode = escape(markupOrig); \n"); // http://xkr.us/articles/javascript/encode-compare/
        // http://support.microsoft.com/kb/208427 2,083 max len URL, hay que reservar espacio para la parte fija de la URL de ah� el valor de sliceLen
View Full Code Here

        StringBuilder code = new StringBuilder();

        ClientDocumentAttachedServerImpl clientDoc = getClientDocumentAttachedServer();
        ItsNatStfulDocumentTemplateAttachedServerImpl template = clientDoc.getItsNatStfulDocumentTemplateAttachedServer();

        ItsNatServletRequestImpl itsNatRequest = getRequest().getItsNatServletRequest();
        String url = itsNatRequest.getServletPath(true, true); // Devuelve un URL absoluto sin la query

        boolean useOnLoad = clientDoc.isOnLoadHanderUsed();

        code.append("itsnat.init = function(markupOrig)\n");
        code.append("{ \n");
View Full Code Here

        processClientDocument(clientDoc);
    }

    public String getRequestedSessionId()
    {
        ItsNatServletRequestImpl itsNatReq = getItsNatServletRequest();
        return itsNatReq.getAttrOrParamExist("itsnat_session_id");
    }
View Full Code Here

        return itsNatReq.getAttrOrParamExist("itsnat_session_id");
    }

    public String getRequestedSessionToken()
    {
        ItsNatServletRequestImpl itsNatReq = getItsNatServletRequest();
        return itsNatReq.getAttrOrParamExist("itsnat_session_token");
    }
View Full Code Here

        return getItsNatDocumentTemplate().canVersionBeSharedBetweenDocs();
    }

    public ItsNatDocumentImpl loadItsNatDocument(RequestNormalLoadDocImpl request)
    {
        ItsNatServletRequestImpl itsNatRequest = request.getItsNatServletRequest();
        Browser browser = getBrowser(itsNatRequest);
        Document doc = loadDocument(browser);
        boolean stateless = request.isStateless();
        ItsNatDocumentImpl itsNatDoc = createItsNatDocument(doc,browser,itsNatRequest.getRequestURLInternal().toString(),itsNatRequest.getItsNatSessionImpl(),stateless);
        if (!canVersionBeSharedBetweenDocs()) cleanDOMPattern(); // Ya no necesitamos m�s el Document patr�n pues el template no se utiliza para crear m�s documentos
        return itsNatDoc;
    }
View Full Code Here

TOP

Related Classes of org.itsnat.impl.core.servlet.ItsNatServletRequestImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.