Package org.itsnat.core.http

Examples of org.itsnat.core.http.ItsNatHttpSession


    public void startExamplePanel()
    {
        ItsNatDocument itsNatDoc = getItsNatDocument();
        Document doc = itsNatDoc.getDocument();

       ItsNatHttpSession session = (ItsNatHttpSession)itsNatDoc.getClientDocumentOwner().getItsNatSession();
        if (itsNatDoc.isLoading() &&
           itsNatDoc.getItsNatDocumentTemplate().isFastLoadMode() &&
           session.getUserAgent().indexOf("MSIE") != -1)
        {
            // Removing <!DOCTYPE> sets Internet Explorer in Quirks Mode.
            // Quirks mode is mandatory with SVG inline and ASV
            DocumentType docType = doc.getDoctype();
            doc.removeChild(docType);
View Full Code Here


        this.container = (HTMLElement)doc.getElementById("containerId");

        // Initially container is an <object>
        this.url = container.getAttribute("data");

        ItsNatHttpSession session = (ItsNatHttpSession)itsNatDoc.getClientDocumentOwner().getItsNatSession();
        if (session.getUserAgent().indexOf("MSIE") != -1)
        {
            // URL must be absolute when used with Savarese Ssrc
            this.url = getRequestURLOfDocument() + this.url + "#p=n,c=n"; // For communication parent/child (p=parent, c=child, n=no, y=yes pending update)

            // In Internet Explorer the <object> element is weird.
View Full Code Here

{
    public static boolean isMobileBrowser(ItsNatServletRequest request)
    {
        if (isIEMobile6on6(request))
            return true;
        ItsNatHttpSession session = (ItsNatHttpSession)request.getItsNatSession();
        String userAgent = session.getUserAgent();
        return (userAgent.indexOf("Android") != -1) ||  // Opera Mobile
               (userAgent.indexOf("S60") != -1) || // Opera Mobile
               (userAgent.indexOf("Symbian") != -1) ||  // Opera Mobile 9.5 & S60WebKit
               (userAgent.indexOf("Nokia6600s") != -1) || // S40WebKit
               (userAgent.indexOf("iPod") != -1) ||
View Full Code Here

               (userAgent.indexOf("BlackBerry") != -1);
    }

    public static boolean isJoystickModePreferred(ItsNatServletRequest request)
    {
        ItsNatHttpSession session = (ItsNatHttpSession)request.getItsNatSession();
        String userAgent = session.getUserAgent();
        if (userAgent.indexOf("Android") != -1)
            return true;
        return false;
    }
View Full Code Here

    {
        ItsNatDocument itsNatDoc = getItsNatDocument();
        Document doc = itsNatDoc.getDocument();
        ItsNatVariableResolver resolver = itsNatDoc.createItsNatVariableResolver();
        ClientDocument owner = itsNatDoc.getClientDocumentOwner();
        ItsNatHttpSession itsNatSession = (ItsNatHttpSession)owner.getItsNatSession();
        HttpSession session = itsNatSession.getHttpSession();
        session.setAttribute("sessionId",itsNatSession.getId());
        itsNatDoc.setAttribute("docId",itsNatDoc.getId());
        resolver.setLocalVariable("refreshInterval",new Integer(3000));
        resolver.setLocalVariable("commMode",new Integer(CommMode.XHR_ASYNC));

        Element links = doc.getElementById("remoteCtrlLinksId");
View Full Code Here

        resolver.setLocalVariable("refreshInterval",new Integer(3000));
        resolver.setLocalVariable("commMode",new Integer(CommMode.XHR_ASYNC));

        for(int i = 0; i < sessionList.size(); i++)
        {
            ItsNatHttpSession otherSession = (ItsNatHttpSession)sessionList.get(i);

            ItsNatDocument[] remDocs = otherSession.getItsNatDocuments();

            for(int j = 0; j < remDocs.length; j++)
            {
                ItsNatDocument currRemDoc = remDocs[j];
                if (itsNatDoc == currRemDoc) continue;

                // currRemDoc should be synchronized, but a dead lock could occur by other process doing the same (docs locked mutually, the parent doc is already locked)
                // there is no problem, the ItsNatDocument.getItsNatDocumentTemplate() is thread safe
                ItsNatDocumentTemplate docTemplate = currRemDoc.getItsNatDocumentTemplate();
                if (docTemplate != thisDocTemplate)
                    continue;

                String docId = currRemDoc.getId(); // No sync is needed
                Element sessionElem = (Element)sessionNodeList.addElement();

                long lastRequest = currRemDoc.getClientDocumentOwner().getLastRequestTime();

                ItsNatVariableResolver resolver2 = resolver.createItsNatVariableResolver();
                resolver2.setLocalVariable("sessionId",otherSession.getId());
                resolver2.setLocalVariable("docId",docId);
                resolver2.setLocalVariable("agentInfo",otherSession.getUserAgent());
                resolver2.setLocalVariable("lastRequest",new Date(lastRequest).toString());

                resolver2.resolve(sessionElem);
            }
        }
View Full Code Here

    }

    public void saveDocumentToSession()
    {
        ItsNatDocument itsNatDoc = itsNatRequest.getItsNatDocument();
        ItsNatHttpSession itsNatSession = (ItsNatHttpSession)itsNatRequest.getItsNatSession();
        HttpSession session = itsNatSession.getHttpSession();
        session.setAttribute("previous_doc",itsNatDoc);
    }
View Full Code Here

        session.setAttribute("previous_doc",itsNatDoc);
    }

    public ItsNatDocument loadDocumentFromSession()
    {
        ItsNatHttpSession itsNatSession = (ItsNatHttpSession)itsNatRequest.getItsNatSession();
        HttpSession session = itsNatSession.getHttpSession();
        ItsNatDocument itsNatDocPrev = (ItsNatDocument)session.getAttribute("previous_doc");
        session.removeAttribute("previous_doc"); // No longer available
        return itsNatDocPrev;
    }
View Full Code Here

    }

    public void saveDocumentToSession()
    {
        ItsNatDocument itsNatDoc = itsNatRequest.getItsNatDocument();
        ItsNatHttpSession itsNatSession = (ItsNatHttpSession)itsNatRequest.getItsNatSession();
        HttpSession session = itsNatSession.getHttpSession();
        session.setAttribute("previous_doc",itsNatDoc);
    }
View Full Code Here

        session.setAttribute("previous_doc",itsNatDoc);
    }

    public ItsNatDocument loadDocumentFromSession()
    {
        ItsNatHttpSession itsNatSession = (ItsNatHttpSession)itsNatRequest.getItsNatSession();
        HttpSession session = itsNatSession.getHttpSession();
        ItsNatDocument itsNatDocPrev = (ItsNatDocument)session.getAttribute("previous_doc");
        session.removeAttribute("previous_doc"); // No longer available
        return itsNatDocPrev;
    }
View Full Code Here

TOP

Related Classes of org.itsnat.core.http.ItsNatHttpSession

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.