You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Ivan <xh...@gmail.com> on 2010/11/05 02:28:09 UTC

Re: svn commit: r1031343 - /geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java

Thanks for fixing the typo issues, I was thinking I have done in my last
commit :-)
The default faces-config.xml file is handled by MyFaces now, you might check
the FacesConfigurator.configure() method. I have posted a thread in the
myfaces community, and wish them could provide a spi for us to pass the
combined faces configurations, so that we could avoid parsing those
configuration files while starting the application.
thanks.

2010/11/5 <dj...@apache.org>

> Author: djencks
> Date: Thu Nov  4 23:21:49 2010
> New Revision: 1031343
>
> URL: http://svn.apache.org/viewvc?rev=1031343&view=rev
> Log:
> GERONIMO-5561 fix some typos and minor logic errors.  Also I'm hoping Ivan
> can confirm how default WEB-INF/faces-config.xml is handled
>
> Modified:
>
>  geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
>
> Modified:
> geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
> URL:
> http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java?rev=1031343&r1=1031342&r2=1031343&view=diff
>
> ==============================================================================
> ---
> geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
> (original)
> +++
> geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
> Thu Nov  4 23:21:49 2010
> @@ -410,7 +410,7 @@ public class MyFacesModuleBuilderExtensi
>         if (webInfClassesDirectory.exists() &&
> webInfClassesDirectory.isDirectory()) {
>             for (File file : webInfClassesDirectory.listFiles()) {
>                 String fileName = file.getName();
> -                if (fileName.equals("META-INF/faces-cofig.xml") ||
> (fileName.startsWith("META-INF/") &&
> fileName.endsWith(".faces-config.xml"))) {
> +                if (fileName.equals("faces-config.xml") ||
> fileName.endsWith(".faces-config.xml")) {
>                     //TODO Double check the relative jar file path once EAR
> is really supported
>                     String filePath = "WEB-INF/classes/META-INF/" +
> fileName;
>                     metaInfConfigurationResources.add(new
> ConfigurationResource(null, filePath, filePath));
> @@ -422,13 +422,26 @@ public class MyFacesModuleBuilderExtensi
>         if (baseDirectory.exists() && baseDirectory.isDirectory()) {
>             for (File file : baseDirectory.listFiles()) {
>                 String fileName = file.getName();
> -                if (fileName.equals("META-INF/faces-cofig.xml") ||
> (fileName.startsWith("META-INF/") &&
> fileName.endsWith(".faces-config.xml"))) {
> +                if (fileName.equals("faces-config.xml") ||
> fileName.endsWith(".faces-config.xml")) {
>                     //TODO Double check the relative jar file path once EAR
> is really supported
>                     String filePath = "META-INF/" + fileName;
>                     metaInfConfigurationResources.add(new
> ConfigurationResource(null, filePath, filePath));
>                 }
>             }
>         }
> +        //default WEB-INF/faces-config.xml is handled by myfaces no matter
> what we do???
> +//        //4. WEB-INF folder
> +//        baseDirectory = new File(earContext.getBaseDir() +
> File.separator + "WEB-INF");
> +//        if (baseDirectory.exists() && baseDirectory.isDirectory()) {
> +//            for (File file : baseDirectory.listFiles()) {
> +//                String fileName = file.getName();
> +//                if (fileName.equals("faces-config.xml") ||
> fileName.endsWith(".faces-config.xml")) {
> +//                    //TODO Double check the relative jar file path once
> EAR is really supported
> +//                    String filePath = "WEB-INF/" + fileName;
> +//                    metaInfConfigurationResources.add(new
> ConfigurationResource(null, filePath, filePath));
> +//                }
> +//            }
> +//        }
>         return metaInfConfigurationResources;
>     }
>
>
>
>


-- 
Ivan

Re: svn commit: r1031343 - /geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java

Posted by David Jencks <da...@yahoo.com>.
H i Ivan,

thanks for the review.  I'm thinking we can leave the commented out "look for WEB-INF/faces-config.xml" until we find out what myfaces does.

I think having these SPIs in myfaces is a great idea!

Related to this, I added a bundle tracker to find the META-INF/faces-config.xml files in bundles like openwebbeans-jsf.jar and a little bit of code to add these into the urls we give myfaces.  This seems to have fixed the owb problem that showed up a few days ago.... still need to check with jetty.

thanks
david jencks

On Nov 4, 2010, at 6:28 PM, Ivan wrote:

> Thanks for fixing the typo issues, I was thinking I have done in my last commit :-)
> The default faces-config.xml file is handled by MyFaces now, you might check the FacesConfigurator.configure() method. I have posted a thread in the myfaces community, and wish them could provide a spi for us to pass the combined faces configurations, so that we could avoid parsing those configuration files while starting the application.
> thanks.
> 
> 2010/11/5 <dj...@apache.org>
> Author: djencks
> Date: Thu Nov  4 23:21:49 2010
> New Revision: 1031343
> 
> URL: http://svn.apache.org/viewvc?rev=1031343&view=rev
> Log:
> GERONIMO-5561 fix some typos and minor logic errors.  Also I'm hoping Ivan can confirm how default WEB-INF/faces-config.xml is handled
> 
> Modified:
>    geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
> 
> Modified: geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
> URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java?rev=1031343&r1=1031342&r2=1031343&view=diff
> ==============================================================================
> --- geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java (original)
> +++ geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java Thu Nov  4 23:21:49 2010
> @@ -410,7 +410,7 @@ public class MyFacesModuleBuilderExtensi
>         if (webInfClassesDirectory.exists() && webInfClassesDirectory.isDirectory()) {
>             for (File file : webInfClassesDirectory.listFiles()) {
>                 String fileName = file.getName();
> -                if (fileName.equals("META-INF/faces-cofig.xml") || (fileName.startsWith("META-INF/") && fileName.endsWith(".faces-config.xml"))) {
> +                if (fileName.equals("faces-config.xml") || fileName.endsWith(".faces-config.xml")) {
>                     //TODO Double check the relative jar file path once EAR is really supported
>                     String filePath = "WEB-INF/classes/META-INF/" + fileName;
>                     metaInfConfigurationResources.add(new ConfigurationResource(null, filePath, filePath));
> @@ -422,13 +422,26 @@ public class MyFacesModuleBuilderExtensi
>         if (baseDirectory.exists() && baseDirectory.isDirectory()) {
>             for (File file : baseDirectory.listFiles()) {
>                 String fileName = file.getName();
> -                if (fileName.equals("META-INF/faces-cofig.xml") || (fileName.startsWith("META-INF/") && fileName.endsWith(".faces-config.xml"))) {
> +                if (fileName.equals("faces-config.xml") || fileName.endsWith(".faces-config.xml")) {
>                     //TODO Double check the relative jar file path once EAR is really supported
>                     String filePath = "META-INF/" + fileName;
>                     metaInfConfigurationResources.add(new ConfigurationResource(null, filePath, filePath));
>                 }
>             }
>         }
> +        //default WEB-INF/faces-config.xml is handled by myfaces no matter what we do???
> +//        //4. WEB-INF folder
> +//        baseDirectory = new File(earContext.getBaseDir() + File.separator + "WEB-INF");
> +//        if (baseDirectory.exists() && baseDirectory.isDirectory()) {
> +//            for (File file : baseDirectory.listFiles()) {
> +//                String fileName = file.getName();
> +//                if (fileName.equals("faces-config.xml") || fileName.endsWith(".faces-config.xml")) {
> +//                    //TODO Double check the relative jar file path once EAR is really supported
> +//                    String filePath = "WEB-INF/" + fileName;
> +//                    metaInfConfigurationResources.add(new ConfigurationResource(null, filePath, filePath));
> +//                }
> +//            }
> +//        }
>         return metaInfConfigurationResources;
>     }
> 
> 
> 
> 
> 
> 
> -- 
> Ivan