Package org.apache.myfaces.config

Examples of org.apache.myfaces.config.RuntimeConfig


       
        FacesConfigurationProviderFactory factory = FacesConfigurationProviderFactory.
            getFacesConfigurationProviderFactory(externalContext);
        List<FacesConfig> list = factory.getFacesConfigurationProvider(externalContext)
            .getFaceletTaglibFacesConfig(externalContext);
        RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);
        for (FacesConfig fc : list)
        {
            for (FaceletTagLibrary lib : fc.getFaceletTagLibraryList())
            {
                runtimeConfig.addFaceletTagLibrary(lib);
            }
        }

        vdl = (MockFaceletViewDeclarationLanguage) application.getViewHandler().
            getViewDeclarationLanguage(facesContext,"/test");
View Full Code Here


        protected void initContainerIntegration(ServletContext servletContext,
                ExternalContext externalContext)
        {
            ExpressionFactory expressionFactory = createExpressionFactory();

            RuntimeConfig runtimeConfig = buildConfiguration(servletContext, externalContext, expressionFactory);
        }
View Full Code Here

                }
            }
           
            ExpressionFactory expressionFactory = createExpressionFactory();

            RuntimeConfig runtimeConfig = buildConfiguration(servletContext, externalContext, expressionFactory);
        }
View Full Code Here

                }
            }
           
            ExpressionFactory expressionFactory = createExpressionFactory();

            RuntimeConfig runtimeConfig = buildConfiguration(servletContext, externalContext, expressionFactory);
        }
View Full Code Here

        }
    }

    public Object saveState(FacesContext context)
    {
        RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(
            context.getExternalContext());
        Object[] values = new Object[4];
        Integer tagId = runtimeConfig.getIdByNamespace().get(taglibURI);
        if (tagId != null)
        {
            values[0] = tagId;
        }
        else if (taglibURI.startsWith(CompositeResourceLibrary.NAMESPACE_PREFIX))
View Full Code Here

        {
            taglibURI = (String) values[0];
        }
        else if (values[0] instanceof Integer)
        {
            RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(
                context.getExternalContext());
            taglibURI = runtimeConfig.getNamespaceById().get((Integer)values[0]);
        }
        else if (values[0] instanceof Object[])
        {
            Object[] def = (Object[])values[0];
            String ns = ( ((Integer)def[0]).intValue() == 0) ?
View Full Code Here

     * @param facesContext
     */
    private void _createEagerBeans(FacesContext facesContext)
    {
        ExternalContext externalContext = facesContext.getExternalContext();
        RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);
        List<ManagedBean> eagerBeans = new ArrayList<ManagedBean>();
       
        // check all registered managed-beans
        for (ManagedBean bean : runtimeConfig.getManagedBeans().values())
        {
            String eager = bean.getEager();
            if (eager != null && "true".equals(eager))
            {
                // eager beans are only allowed for application scope
View Full Code Here

     * @return the current runtime configuration
     */
    protected RuntimeConfig buildConfiguration(ServletContext servletContext,
                                               ExternalContext externalContext, ExpressionFactory expressionFactory)
    {
        RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);
        runtimeConfig.setExpressionFactory(expressionFactory);

        // And configure everything
        new FacesConfigurator(externalContext).configure();

        validateFacesConfig(servletContext, externalContext);
View Full Code Here

        compiler.addTagLibrary(new CompositeResourceLibrary(context,
            CompositeResourceLibrary.ALIAS_NAMESPACE_PREFIX));
        compiler.addTagLibrary(new JsfLibrary());
        compiler.addTagLibrary(new PassThroughLibrary());
       
        RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(eContext);
        if (!runtimeConfig.getComponentTagDeclarations().isEmpty())
        {
            // Set a dummy view root, to avoid Application.createComponent() to fail
            ComponentTagDeclarationLibrary componentTagDeclarationLibrary = new ComponentTagDeclarationLibrary();
           
            LoadComponentTagDeclarationFacesContextWrapper wrappedFacesContext =
                new LoadComponentTagDeclarationFacesContextWrapper(context);
            try
            {
                wrappedFacesContext.setWrapperAsCurrentFacesContext();
                UIViewRoot root = new UIViewRoot();
                root.setRenderKitId("HTML_BASIC");
                wrappedFacesContext.setViewRoot(new UIViewRoot());
               
                for (ComponentTagDeclaration declaration : runtimeConfig.getComponentTagDeclarations())
                {
                    // We have here probably an inconsistency, because the annotation does not
                    // have a default renderer type. Let the renderer type be null will cause problems
                    // later, because application.createComponent() may not scan the renderer class if
                    // a rendererType is not provided. The easy way to overcome this situation is create
                    // a dummy instance and check its rendererType. If is set the renderer if any will be
                    // scanned for annotations, if not it just do things as usual. It is unlikely to create
                    // a component and does not set a default renderer type if is required.
                    UIComponent component = context.getApplication().createComponent(declaration.getComponentType());
                    componentTagDeclarationLibrary.addComponent(declaration.getNamespace(),
                            declaration.getTagName(), declaration.getComponentType(), component.getRendererType());
                }
            }
            finally
            {
                wrappedFacesContext.restoreCurrentFacesContext();
            }
            compiler.addTagLibrary(componentTagDeclarationLibrary);
        }
       
        List<FaceletTagLibrary> faceletTagLibraries = runtimeConfig.getFaceletTagLibraries();
        for (FaceletTagLibrary faceletTagLibrary : faceletTagLibraries)
        {
            //Create TagLibrary here, populate and add it to the compiler.
            TagLibrary tl = TagLibraryConfig.create(context, faceletTagLibrary);
            if (tl != null)
View Full Code Here

        }
    }
   
    private void _initializeContractMappings(ExternalContext context)
    {
        RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(context);
        List<String> prefixWildcardKeys = new ArrayList<String>();
        Map<String, List<String>> contractMappings = new HashMap<String, List<String>>();
       
        for (Map.Entry<String, List<String>> entry : runtimeConfig.getContractMappings().entrySet())
        {
            String urlPattern = entry.getKey().trim();
            if (urlPattern.endsWith(ASTERISK))
            {
                prefixWildcardKeys.add(urlPattern);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.config.RuntimeConfig

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.