Package org.apache.myfaces.config.element

Examples of org.apache.myfaces.config.element.FacesConfig


            else
            {
                // Zero lenght, if that so the flow definition must be implicitly derived.
                // See JSF 2.2 section 11.4.3.3
                //
                FacesConfig facesConfig = new org.apache.myfaces.config.impl.digester.elements.FacesConfig();
                FacesFlowDefinitionImpl flow = new FacesFlowDefinitionImpl();
                String flowName = systemId.substring(systemId.lastIndexOf('/')+1, systemId.lastIndexOf("-flow.xml"));
                flow.setId(flowName);
                // In this case the defining document id is implicit associated
                flow.setDefiningDocumentId(systemId);
               
                String startNodePath = systemId.substring(0, systemId.lastIndexOf('/')+1)+flowName+".xhtml";
                URL startNodeUrl = ectx.getResource(startNodePath);
                if (startNodeUrl != null)
                {
                    flow.setStartNode(startNodePath);
                }
               
                // There is a default return node with name [flow-name]-return and
                // that by default points to an outer /[flow-name]-return outcome
                FacesFlowReturnImpl returnNode = new FacesFlowReturnImpl();
                returnNode.setId(flowName+"-return");
                NavigationCase returnNavCase = new NavigationCase();
                returnNavCase.setFromOutcome("/"+flowName+"-return");
                returnNode.setNavigationCase(returnNavCase);
                flow.addReturn(returnNode);
               
                facesConfig.getFacesFlowDefinitions().add(flow);
                return facesConfig;
            }

            if (log.isLoggable(Level.INFO))
            {
View Full Code Here


        @Override
        public FacesConfig getStandardFacesConfig(ExternalContext ectx)
        {
            if (standardFacesConfig == null)
            {
                FacesConfig sfc = super.getStandardFacesConfig(ectx);
                Factory factory = (Factory) sfc.getFactories().get(0);
                // Override the default vdl factory with a mock one that only load
                // facelet views
                factory.getViewDeclarationLanguageFactory().set(0, MockMyFacesViewDeclarationLanguageFactory.class.getName());
                standardFacesConfig = sfc;
            }
View Full Code Here

        @Override
        public FacesConfig getAnnotationsFacesConfig(ExternalContext ectx,
                boolean metadataComplete)
        {
            FacesConfig facesConfig = null;
            if (isScanAnnotations())
            {
                facesConfig = super.getAnnotationsFacesConfig(ectx, metadataComplete);
            }
           
View Full Code Here

     *
     * @throws Exception
     */
    public void testSimpleOrdering() throws Exception
    {
        FacesConfig cfg = _impl.getFacesConfig(getClass().getResourceAsStream(
        "empty-config.xml"), "empty-config.xml");
        FacesConfig cfgA = _impl.getFacesConfig(getClass().getResourceAsStream(
            "a-config.xml"), "a-config.xml");
        FacesConfig cfgB = _impl.getFacesConfig(getClass().getResourceAsStream(
            "b-config.xml"), "b-config.xml");
        FacesConfig cfgC = _impl.getFacesConfig(getClass().getResourceAsStream(
            "c-config.xml"), "c-config.xml");
       
       
        List<FacesConfig> appConfigResources = new ArrayList<FacesConfig>();
        appConfigResources.add(cfgA);
View Full Code Here

     *
     * @throws Exception
     */
    public void testMiddleOrdering() throws Exception
    {
        FacesConfig cfg = _impl.getFacesConfig(getClass().getResourceAsStream(
        "empty-config.xml"), "empty-config.xml");       
        org.apache.myfaces.config.impl.digester.elements.FacesConfigImpl cfgA = new org.apache.myfaces.config.impl.digester.elements.FacesConfigImpl();
        org.apache.myfaces.config.impl.digester.elements.FacesConfigImpl cfgB = new org.apache.myfaces.config.impl.digester.elements.FacesConfigImpl();
        org.apache.myfaces.config.impl.digester.elements.FacesConfigImpl cfgC = new org.apache.myfaces.config.impl.digester.elements.FacesConfigImpl();
        org.apache.myfaces.config.impl.digester.elements.FacesConfigImpl cfgD = new org.apache.myfaces.config.impl.digester.elements.FacesConfigImpl();
View Full Code Here

        }
    }
   
    public void testEx4() throws Exception
    {
        FacesConfig cfgA = _impl.getFacesConfig(getClass().getResourceAsStream(
            "transitive-a-config.xml"), "transitive-a-config.xml");
        FacesConfig cfgB = _impl.getFacesConfig(getClass().getResourceAsStream(
            "transitive-b-config.xml"), "transitive-b-config.xml");
        FacesConfig cfgC = _impl.getFacesConfig(getClass().getResourceAsStream(
            "transitive-c-config.xml"), "transitive-c-config.xml");
       
        List<FacesConfig> appConfigResources = new ArrayList<FacesConfig>();
        appConfigResources.add(cfgA);
        appConfigResources.add(cfgB);
View Full Code Here

        _impl = new DigesterFacesConfigUnmarshallerImpl(null);
    }

    public void testEmptyConfig() throws Exception
    {
        FacesConfig cfg = _impl.getFacesConfig(getClass().getResourceAsStream(
                "empty-config.xml"), "empty-config.xml");
        assertNotNull(cfg);
        assertTrue(cfg.getApplications().isEmpty());
        assertTrue(cfg.getComponents().isEmpty());
        assertTrue(cfg.getConverters().isEmpty());
        assertTrue(cfg.getFactories().isEmpty());
        assertTrue(cfg.getLifecyclePhaseListener().isEmpty());
        assertTrue(cfg.getManagedBeans().isEmpty());
        assertTrue(cfg.getNavigationRules().isEmpty());
        assertTrue(cfg.getRenderKits().isEmpty());
        assertTrue(cfg.getValidators().isEmpty());
    }
View Full Code Here

        assertTrue(cfg.getValidators().isEmpty());
    }

    public void testApplicationConfig() throws Exception
    {
        FacesConfig cfg = _impl.getFacesConfig(getClass().getResourceAsStream(
                "application-config.xml"), "application-config.xml");
        assertNotNull(cfg);
        assertEquals(1, cfg.getApplications().size());
        Application app = cfg.getApplications().get(0);
        assertEquals(2, app.getActionListener().size());
        assertEquals("action-listener1", app.getActionListener().get(0));
        assertEquals("action-listener2", app.getActionListener().get(1));
        assertEquals(1, app.getDefaultRenderkitId().size());
        assertEquals("default-render-kit-id", app.getDefaultRenderkitId()
View Full Code Here

        assertEquals("bb", cfg.getSupportedLocales().get(1));
    }
   
    public void testAbsoluteOrderingConfig() throws Exception
    {
        FacesConfig cfg = _impl.getFacesConfig(getClass().getResourceAsStream(
                "absolute-ordering-config.xml"), "absolute-ordering-config.xml");
        assertNotNull(cfg);
        assertEquals("true", cfg.getMetadataComplete());
        assertEquals("a",cfg.getName());

        List<OrderSlot> orderList = cfg.getAbsoluteOrdering().getOrderList();
       
        assertEquals("b", ((FacesConfigNameSlot) orderList.get(0)).getName());
        assertEquals("c", ((FacesConfigNameSlot) orderList.get(1)).getName());
        assertEquals(org.apache.myfaces.config.impl.digester.elements.ConfigOthersSlot.class, orderList.get(2).getClass());
        assertEquals("d", ((FacesConfigNameSlot) orderList.get(3)).getName());
       
        assertTrue(cfg.getApplications().isEmpty());
        assertTrue(cfg.getComponents().isEmpty());
        assertTrue(cfg.getConverters().isEmpty());
        assertTrue(cfg.getFactories().isEmpty());
        assertTrue(cfg.getLifecyclePhaseListener().isEmpty());
        assertTrue(cfg.getManagedBeans().isEmpty());
        assertTrue(cfg.getNavigationRules().isEmpty());
        assertTrue(cfg.getRenderKits().isEmpty());
        assertTrue(cfg.getValidators().isEmpty());
    }
View Full Code Here

        assertTrue(cfg.getValidators().isEmpty());
    }
   
    public void testOrderingConfig() throws Exception
    {
        FacesConfig cfg = _impl.getFacesConfig(getClass().getResourceAsStream(
                "ordering-config.xml"), "ordering-config.xml");
        assertNotNull(cfg);
        assertEquals("a",cfg.getName());

        List<OrderSlot> orderList = cfg.getOrdering().getBeforeList();       
        assertEquals("b", ((FacesConfigNameSlot) orderList.get(0)).getName());
        assertEquals("c", ((FacesConfigNameSlot) orderList.get(1)).getName());
        assertEquals(org.apache.myfaces.config.impl.digester.elements.ConfigOthersSlot.class, orderList.get(2).getClass());
       
        orderList = cfg.getOrdering().getAfterList();       
        assertEquals("d", ((FacesConfigNameSlot) orderList.get(0)).getName());
       
        assertTrue(cfg.getApplications().isEmpty());
        assertTrue(cfg.getComponents().isEmpty());
        assertTrue(cfg.getConverters().isEmpty());
        assertTrue(cfg.getFactories().isEmpty());
        assertTrue(cfg.getLifecyclePhaseListener().isEmpty());
        assertTrue(cfg.getManagedBeans().isEmpty());
        assertTrue(cfg.getNavigationRules().isEmpty());
        assertTrue(cfg.getRenderKits().isEmpty());
        assertTrue(cfg.getValidators().isEmpty());
    }   
View Full Code Here

TOP

Related Classes of org.apache.myfaces.config.element.FacesConfig

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.