Package org.itsnat.impl.core.doc

Examples of org.itsnat.impl.core.doc.ItsNatStfulDocumentImpl


    protected boolean preventiveNodeCachingTwoOrMoreClient(final Node node)
    {
        // Evitamos cachear con un nuevo id si todos los clientes ya usan
        // dicho id, es el caso de un nodo que ya fue "cacheado preventivamente"
        // por las vistas y se quiere una nueva referencia como string.
        ItsNatStfulDocumentImpl itsNatDoc = getItsNatStfulDocument();
        ClientDocumentStfulImpl clientDocOwner = itsNatDoc.getClientDocumentStfulOwner();
        NodeCacheRegistryImpl nodeCache = clientDocOwner.getNodeCacheRegistry(); // No puede ser nula
        final String oldId = nodeCache.getId(node);

        ClientDocStfulTask clientTask = new ClientDocStfulTask()
        {
            public boolean doTask(ClientDocumentStfulImpl clientDoc,Object arg)
            {
                boolean cached = isNodeCachedWithId(node,oldId,clientDoc);
                return cached; // true = continuar
            }
        };
        boolean res = itsNatDoc.executeTaskOnClients(clientTask,null);
        if (res) return false; // Ya est� cacheado por todos los clientes con el mismo id

        // Debe generarse un nuevo id por el documento pues algunos ids pueden compartirse entre cach�s de un mismo documento como es este caso
        String id = NodeCacheRegistryImpl.generateUniqueId(itsNatDoc);

        ClientDocumentStfulImpl[] allClient = itsNatDoc.getAllClientDocumentStfulsCopy();
        for(int i = 0; i < allClient.length; i++)
        {
            ClientDocumentStfulImpl clientDoc = allClient[i];
            preventiveNodeCaching(node,id,clientDoc);
        }
View Full Code Here


            render.addItsNatEventListenerCodeClient(itsNatListener,clientDoc);
        }
        else
        {
            // Para todos los clientes
            ItsNatStfulDocumentImpl itsNatDoc = itsNatListener.getItsNatStfulDocument();
            if (!itsNatDoc.hasClientDocumentAttachedClient())
            {
                clientDoc = itsNatDoc.getClientDocumentStfulOwner();

                JSRenderItsNatEventListenerImpl render = JSRenderItsNatEventListenerImpl.getJSRenderItsNatEventListener(itsNatListener, clientDoc);
                render.addItsNatEventListenerCodeClient(itsNatListener,clientDoc);
            }
            else
            {
                ClientDocumentStfulImpl[] clients = itsNatDoc.getAllClientDocumentStfulsCopy();
                for(int i = 0; i < clients.length; i++)
                {
                    clientDoc = clients[i];

                    JSRenderItsNatEventListenerImpl render = JSRenderItsNatEventListenerImpl.getJSRenderItsNatEventListener(itsNatListener, clientDoc);
View Full Code Here

            render.removeItsNatEventListenerCodeClient(itsNatListener,clientDoc);
        }
        else
        {
            // Para todos
            ItsNatStfulDocumentImpl itsNatDoc = itsNatListener.getItsNatStfulDocument();
            if (!itsNatDoc.hasClientDocumentAttachedClient())
            {
                clientDoc = itsNatDoc.getClientDocumentStfulOwner();

                JSRenderItsNatEventListenerImpl render = JSRenderItsNatEventListenerImpl.getJSRenderItsNatEventListener(itsNatListener, clientDoc);
                render.removeItsNatEventListenerCodeClient(itsNatListener,clientDoc);
            }
            else
            {
                ClientDocumentStfulImpl[] clients = itsNatDoc.getAllClientDocumentStfulsCopy();
                for(int i = 0; i < clients.length; i++)
                {
                    clientDoc = clients[i];

                    JSRenderItsNatEventListenerImpl render = JSRenderItsNatEventListenerImpl.getJSRenderItsNatEventListener(itsNatListener, clientDoc);
View Full Code Here

        return true;
    }

    protected boolean preventiveNodeCachingOneClient(Node node)
    {
        ItsNatStfulDocumentImpl itsNatDoc = getItsNatStfulDocument();
        ClientDocumentStfulImpl clientDoc = itsNatDoc.getClientDocumentStfulOwner();
        return preventiveNodeCachingOneClient(node,clientDoc);
    }
View Full Code Here

    {
        ItsNatEventImpl itsNatEvt = (ItsNatEventImpl)evt;

        ItsNatServletRequestImpl itsNatRequest = itsNatEvt.getItsNatServletRequestImpl();
        ItsNatSessionImpl itsNatSession = itsNatRequest.getItsNatSessionImpl();
        ItsNatStfulDocumentImpl itsNatDoc = itsNatEvt.getItsNatStfulDocument();
        itsNatSession.getReferrer().pushItsNatStfulDocument(itsNatDoc);
    }
View Full Code Here

        ServerItsNatDOMEventImpl evt = (ServerItsNatDOMEventImpl)event; // No valen los eventos que no hayan sido creados con el createServerItsNatDOMStdEvent p�blico
        evt.checkInitializedEvent();

        // timers, asynctask y comet no tienen mucho sentido aqu�

        ItsNatStfulDocumentImpl itsNatDoc = evt.getItsNatStfulDocument();
        ClientDocumentStfulImpl clientDoc = evt.getClientDocumentStful();
        ItsNatDOMEventListenerRegistryImpl[] registries = new ItsNatDOMEventListenerRegistryImpl[2];
        if (evt instanceof ServerItsNatDOMStdEventImpl)
        {
            registries[0] = itsNatDoc.getDOMStdEventListenerRegistry();
            registries[1] = clientDoc.getDOMStdEventListenerRegistry();
        }
        else if (evt instanceof ServerItsNatUserEventImpl)
        {
            registries[0] = itsNatDoc.getUserEventListenerRegistry();
            registries[1] = clientDoc.getUserEventListenerRegistry();
        }
        else if (evt instanceof ServerItsNatContinueEventImpl)
        {
            registries[0] = clientDoc.getContinueEventListenerRegistry();
View Full Code Here

        this.delegByBrowser = ResponseDelegStfulLoadDocByBrowserImpl.createResponseDelegStfulLoadDocByBrowser(this);
    }

    public static ResponseDelegateStfulLoadDocImpl createResponseDelegateStfulLoadDoc(ResponseLoadStfulDocumentValid responseParent)
    {
        ItsNatStfulDocumentImpl itsNatDoc = responseParent.getItsNatStfulDocument();
        if (itsNatDoc instanceof ItsNatHTMLDocumentImpl)
            return ResponseDelegateHTMLLoadDocImpl.createResponseDelegateHTMLLoadDoc(responseParent);
        else if (itsNatDoc instanceof ItsNatOtherNSDocumentImpl)
            return ResponseDelegateOtherNSLoadDocImpl.createResponseDelegateOtherNSLoadDoc(responseParent);
        else
View Full Code Here

        return getResponseLoadStfulDocumentValid().isSerializeBeforeDispatching();
    }
   
    public void processResponse()
    {
        ItsNatStfulDocumentImpl itsNatDoc = getItsNatStfulDocument();
        DocMutationEventListenerImpl mutListener = itsNatDoc.getDocMutationEventListener();

        String docMarkup = null;

        boolean serializeBefore = isSerializeBeforeDispatching();
        if (serializeBefore) // Caso fastLoad=false y remote control
View Full Code Here

            // puede provocar la recarga de la p�gina, as� evitamos un fallo con load que es un evento
            // m�s normal que pueda usar el usuario.
            // Acerca de DOMContentLoad: http://developer.mozilla.org/en/docs/Gecko-Specific_DOM_Events
            // Alternativas: http://dean.edwards.name/weblog/2005/02/order-of-events/

            ItsNatStfulDocumentImpl itsNatDoc = getItsNatStfulDocument();
            Document doc = itsNatDoc.getDocument();

            OnLoadBackForwardListenerImpl listener = new OnLoadBackForwardListenerImpl();
            ParamTransport[] extraParam = OnLoadBackForwardListenerImpl.createExtraParams();
            String eventType;
            EventTarget target;
View Full Code Here

        clientDoc.addCodeToSend(code);
    }

    public String rewriteClientUIControlProperties(boolean revertJSChanges)
    {
        ItsNatStfulDocumentImpl itsNatDoc = getItsNatStfulDocument();
        Document doc = itsNatDoc.getDocument();
        StringBuilder code = new StringBuilder();
        Element elem = doc.getDocumentElement();
        do
        {
            rewriteClientUIControlProperties(elem,revertJSChanges,code);
View Full Code Here

TOP

Related Classes of org.itsnat.impl.core.doc.ItsNatStfulDocumentImpl

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.