Package org.itsnat.core.tmpl

Examples of org.itsnat.core.tmpl.ItsNatDocFragmentTemplate


        docTemplate.addItsNatServletRequestListener(new StlessFreeListExampleInitialDocLoadListener());
        docTemplate.setEventsEnabled(false);                
       
        // HTML fragments

        ItsNatDocFragmentTemplate docFragTemplate;

        Properties htmlFragments = loadProperties(pathPrefix + "html_fragments.properties");
        for(Enumeration fragmentNames = htmlFragments.propertyNames(); fragmentNames.hasMoreElements(); )
        {
            String name = (String)fragmentNames.nextElement();
View Full Code Here


        docTemplate = itsNatServlet.registerItsNatDocumentTemplate("manual.core.xmlExample","text/xml",  pathPrefix + "xml_example.xml");
        docTemplate = itsNatServlet.registerItsNatDocumentTemplate("manual.comp.example",   "text/html", pathPrefix + "comp_example.xhtml");       
        docTemplate = itsNatServlet.registerItsNatDocumentTemplate("manual.stless.example", "text/xml",  pathPrefix + "stless_example.html");
        docTemplate = itsNatServlet.registerItsNatDocumentTemplate("manual.stless.example.eventReceiver", "text/xml",  pathPrefix + "stless_example_event_receiver.html");       
       
        ItsNatDocFragmentTemplate docFragTemplate;
        docFragTemplate = itsNatServlet.registerItsNatDocFragmentTemplate("manual.core.xmlFragExample","text/xml",pathPrefix + "xml_fragment_example.xml");
        docFragTemplate = itsNatServlet.registerItsNatDocFragmentTemplate("manual.stless.example.fragment","text/xml",pathPrefix + "stless_example_fragment.html");

    }
View Full Code Here

        Element discsElem = doc.getDocumentElement();

        Element cdListElem = ItsNatTreeWalker.getLastChildElement(discsElem);

        ItsNatServlet servlet = request.getItsNatServlet();
        ItsNatDocFragmentTemplate fragTemplate = servlet.getItsNatDocFragmentTemplate("manual.core.xmlFragExample");
        DocumentFragment docFrag = fragTemplate.loadDocumentFragment(itsNatDoc);
        discsElem.insertBefore(docFrag,cdListElem); // docFrag is empty now

        ElementGroupManager factory = itsNatDoc.getElementGroupManager();
        ElementList discList = factory.createElementList(cdListElem,true);
View Full Code Here

        return servlet.getItsNatDocFragmentTemplate(name);
    }

    public DocumentFragment loadDocumentFragment(String name)
    {
        ItsNatDocFragmentTemplate template = getFragmentTemplate(name);
        if (template == null) return null;
        return template.loadDocumentFragment(itsNatDoc);
    }
View Full Code Here

    public void changeState(String stateName)
    {
        String fragmentName = getFragmentName(stateName);

        ItsNatDocFragmentTemplate template = getFragmentTemplate(fragmentName);
        if (template == null)
        {
            changeState("not_found");
            return;
        }

        // Cleaning previous state:
        if (currentState != null)
        {
            currentState.dispose();
            this.currentState = null;
        }

        ItsNatDOMUtil.removeAllChildren(contentParentElem);

        // Setting new state:
        changeActiveMenu(stateName);

        DocumentFragment frag = template.loadDocumentFragment(itsNatDoc);
        contentParentElem.appendChild(frag);

        if (stateName.equals("overview")||stateName.equals("overview.showpopup"))
        {
            boolean popup = stateName.equals("overview.showpopup");
View Full Code Here

       
        docTemplate = itsNatServlet.registerItsNatDocumentTemplate("manual.stless.example.eventReceiver","text/html", pathPrefix + "stless_example_event_receiver.html");
        docTemplate.addItsNatServletRequestListener(new StatelessExampleForProcessingEventDocLoadListener());
        docTemplate.setEventsEnabled(false); // Stateless 
       
        ItsNatDocFragmentTemplate docFragDesc;
        docFragDesc = itsNatServlet.registerItsNatDocFragmentTemplate("manual.stless.example.fragment","text/html", pathPrefix + "stless_example_fragment.html");       
    }
View Full Code Here

        docTemplate.addItsNatServletRequestListener(new CoreExampleLoadListener());

        docTemplate = itsNatServlet.registerItsNatDocumentTemplate("manual.core.xmlExample","text/xml", pathPrefix + "xml_example.xml");
        docTemplate.addItsNatServletRequestListener(new CoreXMLExampleLoadListener());

        ItsNatDocFragmentTemplate docFragTemplate;
        docFragTemplate = itsNatServlet.registerItsNatDocFragmentTemplate("manual.core.xmlFragExample","text/xml",pathPrefix + "xml_fragment_example.xml");
    }
View Full Code Here

    @Override
    public void afterPropertiesSet() throws Exception
    {
        // name, mime and source are mandatory
        ItsNatHttpServlet itsNatHttpServlet = ItsNatBeansRegistryUtil.getItsNatHttpServlet(context);
        ItsNatDocFragmentTemplate fragTemplate;
        fragTemplate = itsNatHttpServlet.registerItsNatDocFragmentTemplate(name,mime,source);
        // More config here...
    }
View Full Code Here

        return servlet.getItsNatDocFragmentTemplate(name);
    }

    public DocumentFragment loadDocumentFragment(String name)
    {
        ItsNatDocFragmentTemplate template = getFragmentTemplate(name);
        if (template == null) return null;
        return template.loadDocumentFragment(itsNatDoc);
    }
View Full Code Here

   
    public void changeState(String stateName,String stateSecondaryName)
    {
        String fragmentName = getFragmentName(stateName);

        ItsNatDocFragmentTemplate template = getFragmentTemplate(fragmentName);
        if (template == null)
        {
            changeState("not_found");
            return;
        }
       
        if (!itsNatDoc.isLoading())
        {
            ClientDocument clientDoc = itsNatDoc.getClientDocumentOwner();
            String contentParentRef = clientDoc.getScriptUtil().getNodeReference(contentParentElem);           
            clientDoc.addCodeToSend("removeChildren(" + contentParentRef + ");")// ".innerHTML = '';"
        }
       
        //ItsNatDOMUtil.removeAllChildren(contentParentElem);

        // Setting new state:
        changeActiveMenu(stateName);

        DocumentFragment frag = template.loadDocumentFragment(itsNatDoc);
        contentParentElem.appendChild(frag);

        if (stateName.equals("overview")||stateName.equals("overview.showpopup"))
        {
            boolean popup = stateName.equals("overview.showpopup");
View Full Code Here

TOP

Related Classes of org.itsnat.core.tmpl.ItsNatDocFragmentTemplate

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.