Examples of FacesConfig


Examples of com.liferay.faces.util.config.FacesConfig

      try {
        applicationConfig = applicationConfigInitializer.initialize();
        applicationMap.put(appConfigAttrName, applicationConfig);

        // Register the configured factories with the factory extension finder.
        FacesConfig facesConfig = applicationConfig.getFacesConfig();
        List<ConfiguredElement> configuredFactoryExtensions = facesConfig.getConfiguredFactoryExtensions();

        if (configuredFactoryExtensions != null) {

          FactoryExtensionFinder factoryExtensionFinder = FactoryExtensionFinder.getInstance();
View Full Code Here

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

        buildingContext.put(NamingBuilder.INJECTION_KEY, holder);

        XmlObject jettyWebApp = webModule.getVendorDD();

        //Parse default web application faces configuration file WEB-INF/faces-config.xml
        FacesConfig webAppFacesConfig = getWebAppFacesConfig(webModule);

        //Parse all faces-config.xml files found in META-INF folder
        Set<ConfigurationResource> metaInfConfigurationResources = JSF_META_INF_CONFIGURATION_RESOURCES.get(module.getEarContext().getGeneralData());
        List<FacesConfig> metaInfFacesConfigs = new ArrayList<FacesConfig>(metaInfConfigurationResources.size());
        for (ConfigurationResource configurationResource : metaInfConfigurationResources) {
            FacesConfig facesConfig = configurationResource.getFacesConfig();
            if (facesConfig == null) {
                URL url;
                try {
                    url = configurationResource.getConfigurationResourceURL(bundle);
                } catch (MalformedURLException e) {
                    throw new DeploymentException("Fail to read the faces Configuration file " + configurationResource.getConfigurationResourcePath()
                            + (configurationResource.getJarFilePath() == null ? "" : " from jar file " + configurationResource.getJarFilePath()), e);
                }
                if (url == null) {
                    throw new DeploymentException("Fail to read the faces Configuration file " + configurationResource.getConfigurationResourcePath()
                            + (configurationResource.getJarFilePath() == null ? "" : " from jar file " + configurationResource.getJarFilePath()));
                }
                facesConfig = parseConfigFile(url, url.toExternalForm());
            }
            metaInfFacesConfigs.add(facesConfig);
        }

        //Parse all faces-config.xml files found in classloader hierarchy
        List<FacesConfig> classloaderFacesConfigs = new ArrayList<FacesConfig>();
        classloaderFacesConfigs.addAll(metaInfFacesConfigs);
        ServiceReference ref = null;
        try {
            ref = bundle.getBundleContext().getServiceReference(ConfigRegistry.class.getName());
            ConfigRegistry configRegistry = (ConfigRegistry) bundle.getBundleContext().getService(ref);
            classloaderFacesConfigs.addAll(configRegistry.getDependentFacesConfigs(bundle.getBundleId()));
        } finally {
            if (ref != null) {
                bundle.getBundleContext().ungetService(ref);
            }
        }

        //Parse all context faces-config.xml files configured in web.xml file
        List<FacesConfig> contextSpecifiedFacesConfigs = getContextFacesConfigs(webApp, webModule);

        //Scan annotations if required
        FacesConfig annotationsFacesConfig = null;
        if (webAppFacesConfig == null || !Boolean.parseBoolean(webAppFacesConfig.getMetadataComplete())) {
            annotationsFacesConfig = getJSFAnnotationFacesConfig(earContext, webModule, bundle, metaInfConfigurationResources);
        }

        AbstractName myFacesWebAppContextName = moduleContext.getNaming().createChildName(moduleName, "myFacesWebAppContext", "MyFacesWebAppContext");
View Full Code Here

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

                @Override
                public boolean foundInJar(Bundle bundle, String zipFileName, ZipEntry zipEntry, InputStream in) throws Exception {
                    String zipEntryName = zipEntry.getName();
                    if ((zipEntryName.endsWith(".faces-config.xml") && zipEntryName.indexOf('/', "META-INF/".length()) == -1) || zipEntryName.equals("META-INF/faces-config.xml")) {
                        ConfigurationResource configurationResource = new ConfigurationResource(zipFileName, zipEntryName);
                        FacesConfig facesConfig = defaultFacesConfigUnmarshaller.getFacesConfig(in, configurationResource.getConfigurationResourceURL(bundle).toExternalForm());
                        configurationResource.setFacesConfig(facesConfig);
                        metaInfConfigurationResources.add(configurationResource);
                    }
                    return true;
                }
View Full Code Here

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

            if (stream == null)
                throw new FacesException("Standard faces config " + STANDARD_FACES_CONFIG_RESOURCE + " not found");
            if (log.isLoggable(Level.INFO))
                log.info("Reading standard config " + STANDARD_FACES_CONFIG_RESOURCE);
           
            FacesConfig facesConfig = getUnmarshaller(ectx).getFacesConfig(stream, STANDARD_FACES_CONFIG_RESOURCE);
            stream.close();
            return facesConfig;
        }
        catch (IOException e)
        {
View Full Code Here

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

    @Override
    public FacesConfig getWebAppFacesConfig(ExternalContext ectx)
    {
        try
        {
            FacesConfig webAppConfig = null;
            // web application config
            if (MyfacesConfig.getCurrentInstance(ectx).isValidateXML())
            {
                URL url = ectx.getResource(DEFAULT_FACES_CONFIG);
                if (url != null)
View Full Code Here

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

        @Override
        public FacesConfig getStandardFacesConfig(ExternalContext ectx)
        {
            if (standardFacesConfig == null)
            {
                FacesConfig sfc = super.getStandardFacesConfig(ectx);
                FactoryImpl factory = (FactoryImpl) 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

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

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

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

        }

        @Override
        public FacesConfig getMetaInfServicesFacesConfig(ExternalContext ectx)
        {
            FacesConfig facesConfig = jsfConfiguration.getMetaInfServicesFacesConfig();
            if (facesConfig == null)
            {
                facesConfig = super.getMetaInfServicesFacesConfig(ectx);
            }
            return facesConfig;
View Full Code Here

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

        @Override
        public FacesConfig getStandardFacesConfig(ExternalContext ectx)
        {
            if (standardFacesConfig == null)
            {
                FacesConfig sfc = super.getStandardFacesConfig(ectx);
                FactoryImpl factory = (FactoryImpl) 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

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

        @Override
        public FacesConfig getAnnotationsFacesConfig(ExternalContext ectx,
                boolean metadataComplete)
        {
            FacesConfig facesConfig = jsfConfiguration.getAnnotationsFacesConfig();
            if (facesConfig == null)
            {
                if (isScanAnnotations())
                {
                    facesConfig = super.getAnnotationsFacesConfig(ectx, metadataComplete);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.