Package org.apache.myfaces.view.facelets

Examples of org.apache.myfaces.view.facelets.ViewPoolProcessor


        UIViewRoot root = new UIViewRoot();
        root.setLocale(locale);
        root.setRenderKitId("HTML_BASIC");
        root.setViewId("/staticPageBinding4.xhtml");
       
        ViewPoolProcessor processor = ViewPoolProcessor.getInstance(facesContext);
        ViewPool viewPool = processor.getViewPool(facesContext, root);
        // Check the view was used
        ViewEntry entry2 = viewPool.popStaticOrPartialStructureView(facesContext, root);
        Assert.assertNull(entry2);
        ViewEntry entry3 = viewPool.popDynamicStructureView(facesContext, root, faceletState);
        Assert.assertNull(entry3);
View Full Code Here


        UIViewRoot root = new UIViewRoot();
        root.setLocale(locale);
        root.setRenderKitId("HTML_BASIC");
        root.setViewId("/staticPageBindingValidator1.xhtml");
       
        ViewPoolProcessor processor = ViewPoolProcessor.getInstance(facesContext);
        ViewPool viewPool = processor.getViewPool(facesContext, root);
        ViewEntry entry = viewPool.popStaticOrPartialStructureView(facesContext, root);
        Assert.assertNotNull(entry);
        Assert.assertEquals(RestoreViewFromPoolResult.COMPLETE, entry.getResult());
        tearDownRequest();
    }
View Full Code Here

        UIViewRoot root = new UIViewRoot();
        root.setLocale(locale);
        root.setRenderKitId("HTML_BASIC");
        root.setViewId("/staticPageBindingValidator1.xhtml");
       
        ViewPoolProcessor processor = ViewPoolProcessor.getInstance(facesContext);
        ViewPool viewPool = processor.getViewPool(facesContext, root);
        // Check the view was used
        ViewEntry entry2 = viewPool.popStaticOrPartialStructureView(facesContext, root);
        Assert.assertNull(entry2);
        ViewEntry entry3 = viewPool.popDynamicStructureView(facesContext, root, faceletState);
        Assert.assertNull(entry3);
View Full Code Here

        UIViewRoot root = new UIViewRoot();
        root.setLocale(locale);
        root.setRenderKitId("HTML_BASIC");
        root.setViewId("/staticPageStateHolderConverter1.xhtml");
       
        ViewPoolProcessor processor = ViewPoolProcessor.getInstance(facesContext);
        ViewPool viewPool = processor.getViewPool(facesContext, root);
        ViewEntry entry = viewPool.popStaticOrPartialStructureView(facesContext, root);
        Assert.assertNotNull(entry);
        Assert.assertEquals(RestoreViewFromPoolResult.REFRESH_REQUIRED, entry.getResult());
        tearDownRequest();
    }
View Full Code Here

        UIViewRoot root = new UIViewRoot();
        root.setLocale(locale);
        root.setRenderKitId("HTML_BASIC");
        root.setViewId("/staticPageStateHolderConverter1.xhtml");
       
        ViewPoolProcessor processor = ViewPoolProcessor.getInstance(facesContext);
        ViewPool viewPool = processor.getViewPool(facesContext, root);
        // Check the view was used
        ViewEntry entry2 = viewPool.popStaticOrPartialStructureView(facesContext, root);
        Assert.assertNull(entry2);
        ViewEntry entry3 = viewPool.popDynamicStructureView(facesContext, root, faceletState);
        Assert.assertNull(entry3);
View Full Code Here

        UIViewRoot root = new UIViewRoot();
        root.setLocale(locale);
        root.setRenderKitId("HTML_BASIC");
        root.setViewId("/staticPageStateHolderConverter2.xhtml");
       
        ViewPoolProcessor processor = ViewPoolProcessor.getInstance(facesContext);
        ViewPool viewPool = processor.getViewPool(facesContext, root);
        ViewEntry entry = viewPool.popStaticOrPartialStructureView(facesContext, root);
        Assert.assertNotNull(entry);
        Assert.assertEquals(RestoreViewFromPoolResult.REFRESH_REQUIRED, entry.getResult());
        tearDownRequest();
    }
View Full Code Here

        UIViewRoot root = new UIViewRoot();
        root.setLocale(locale);
        root.setRenderKitId("HTML_BASIC");
        root.setViewId("/staticPageStateHolderConverter2.xhtml");
       
        ViewPoolProcessor processor = ViewPoolProcessor.getInstance(facesContext);
        ViewPool viewPool = processor.getViewPool(facesContext, root);
        // Check the view was used
        ViewEntry entry2 = viewPool.popStaticOrPartialStructureView(facesContext, root);
        Assert.assertNull(entry2);
        ViewEntry entry3 = viewPool.popDynamicStructureView(facesContext, root, faceletState);
        Assert.assertNull(entry3);
View Full Code Here

        UIViewRoot root = new UIViewRoot();
        root.setLocale(locale);
        root.setRenderKitId("HTML_BASIC");
        root.setViewId("/partialPage1.xhtml");
       
        ViewPoolProcessor processor = ViewPoolProcessor.getInstance(facesContext);
        ViewPool viewPool = processor.getViewPool(facesContext, root);
        ViewEntry entry = viewPool.popStaticOrPartialStructureView(facesContext, root);
        Assert.assertNotNull(entry);
        Assert.assertEquals(RestoreViewFromPoolResult.REFRESH_REQUIRED, entry.getResult());
        tearDownRequest();
    }
View Full Code Here

        UIViewRoot root = new UIViewRoot();
        root.setLocale(locale);
        root.setRenderKitId("HTML_BASIC");
        root.setViewId("/partialPage1.xhtml");
       
        ViewPoolProcessor processor = ViewPoolProcessor.getInstance(facesContext);
        ViewPool viewPool = processor.getViewPool(facesContext, root);
        // Check the view was used
        ViewEntry entry2 = viewPool.popStaticOrPartialStructureView(facesContext, root);
        Assert.assertNull(entry2);
        ViewEntry entry3 = viewPool.popDynamicStructureView(facesContext, root, faceletState);
        Assert.assertNull(entry3);
View Full Code Here

                {
                    partialViewContext.setRenderAll(true);
                }

                // Dispose view if the view has been marked as disposable by default action listener
                ViewPoolProcessor processor = ViewPoolProcessor.getInstance(facesContext);
                if (processor != null &&
                    processor.isViewPoolEnabledForThisView(facesContext, facesContext.getViewRoot()))
                {
                    processor.disposeView(facesContext, facesContext.getViewRoot());
                }
               
                // JSF 2.0 Spec call Flash.setRedirect(true) to notify Flash scope and take proper actions
                externalContext.getFlash().setRedirect(true);
                try
                {
                    externalContext.redirect(redirectPath);
                    facesContext.responseComplete();
                }
                catch (IOException e)
                {
                    throw new FacesException(e.getMessage(), e);
                }
            }
            else
            {
                ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
                //create new view
                String newViewId = navigationCase.getToViewId(facesContext);

                // JSF 2.0 the javadoc of handleNavigation() says something like this
                // "...If the view has changed after an application action, call
                // PartialViewContext.setRenderAll(true)...". The effect is that ajax requests
                // are included on navigation.
                PartialViewContext partialViewContext = facesContext.getPartialViewContext();
                String viewId = facesContext.getViewRoot() != null ? facesContext.getViewRoot().getViewId() : null;
                if ( partialViewContext.isPartialRequest() &&
                     !partialViewContext.isRenderAll() &&
                     newViewId != null &&
                     !newViewId.equals(viewId))
                {
                    partialViewContext.setRenderAll(true);
                }

                if (facesContext.getViewRoot() != null &&
                    facesContext.getViewRoot().getAttributes().containsKey("oam.CALL_PRE_DISPOSE_VIEW"))
                {
                    facesContext.getAttributes().put(SKIP_ITERATION_HINT, Boolean.TRUE);
                    facesContext.getViewRoot().visitTree(VisitContext.createVisitContext(facesContext),
                                                         new PreDisposeViewCallback());
                    facesContext.getAttributes().remove(SKIP_ITERATION_HINT);
                }
               
                applyFlowTransition(facesContext, navigationContext);

                // Dispose view if the view has been marked as disposable by default action listener
                ViewPoolProcessor processor = ViewPoolProcessor.getInstance(facesContext);
                if (processor != null &&
                    processor.isViewPoolEnabledForThisView(facesContext, facesContext.getViewRoot()))
                {
                    processor.disposeView(facesContext, facesContext.getViewRoot());
                }
               
                // create UIViewRoot for new view
                UIViewRoot viewRoot = null;
               
View Full Code Here

TOP

Related Classes of org.apache.myfaces.view.facelets.ViewPoolProcessor

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.