You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2011/11/05 21:07:26 UTC

svn commit: r1198042 - in /myfaces/core/branches/2.0.x/impl/src: main/java/org/apache/myfaces/view/facelets/compiler/ main/java/org/apache/myfaces/view/facelets/tag/composite/ test/java/org/apache/myfaces/mc/test/core/ test/java/org/apache/myfaces/view...

Author: lu4242
Date: Sat Nov  5 20:07:25 2011
New Revision: 1198042

URL: http://svn.apache.org/viewvc?rev=1198042&view=rev
Log:
MYFACES-3308 Allow localized composite components

Added:
    myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/localized/   (with props)
    myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/localized/LocalizedCompositeComponentTestCase.java   (with props)
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/faces-config.xml   (with props)
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_de.properties   (with props)
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_en.properties   (with props)
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_es.properties   (with props)
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/de/
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/de/fragments/
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/de/fragments/fragment01.xhtml   (with props)
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/es_CO/
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/es_CO/fragments/
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/es_CO/fragments/fragment01.xhtml   (with props)
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/fragments/
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/fragments/fragment01.xhtml   (with props)
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testGermanLocalizedComposite.xhtml   (with props)
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testNoLocalizedComposite.xhtml   (with props)
    myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testSpanishLocalizedComposite.xhtml   (with props)
Modified:
    myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfig.java
    myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java
    myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeResourceLibrary.java
    myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesRequestTestCase.java
    myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesTestCase.java

Modified: myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfig.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfig.java?rev=1198042&r1=1198041&r2=1198042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfig.java (original)
+++ myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfig.java Sat Nov  5 20:07:25 2011
@@ -118,6 +118,14 @@ public final class TagLibraryConfig
                     FacesContext.getCurrentInstance().getApplication().getResourceHandler();
 
                 String resourceName = localName + ".xhtml";
+                // MYFACES-3308 If a composite component exists, it requires to 
+                // be always resolved. In other words, it should always exists a default.
+                // The call here for resourceHandler.createResource, just try to get
+                // the Resource and if it does not exists, it just returns null.
+                // The intention of this code is just create an instance and pass to
+                // CompositeComponentResourceTagHandler. Then, its values 
+                // (resourceName, libraryName) will be used to derive the real instance
+                // to use in a view, based on the locale used.
                 Resource compositeComponentResource = new CompositeResouceWrapper(
                     resourceHandler.createResource(resourceName, _compositeLibraryName));
                 

Modified: myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java?rev=1198042&r1=1198041&r2=1198042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java (original)
+++ myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentResourceTagHandler.java Sat Nov  5 20:07:25 2011
@@ -97,9 +97,12 @@ public class CompositeComponentResourceT
     {
         super(config);
         _resource = resource;
-        _facetHandlers = TagHandlerUtils.findNextByType(nextHandler, javax.faces.view.facelets.FacetHandler.class, InsertFacetHandler.class);
-        _componentHandlers = TagHandlerUtils.findNextByType(nextHandler, javax.faces.view.facelets.ComponentHandler.class, 
-                InsertChildrenHandler.class, InsertHandler.class, DecorateHandler.class, IncludeHandler.class, TextHandler.class);
+        _facetHandlers = TagHandlerUtils.findNextByType(nextHandler, javax.faces.view.facelets.FacetHandler.class,
+                                                        InsertFacetHandler.class);
+        _componentHandlers = TagHandlerUtils.findNextByType(nextHandler,
+                javax.faces.view.facelets.ComponentHandler.class,
+                InsertChildrenHandler.class, InsertHandler.class,
+                DecorateHandler.class, IncludeHandler.class, TextHandler.class);
     }
 
     public UIComponent createComponent(FaceletContext ctx)
@@ -136,7 +139,8 @@ public class CompositeComponentResourceT
                         
                         if (attrValue == null)
                         {
-                            throw new TagException(this.tag, "Attribute '" + propertyDescriptor.getName() + "' is required");
+                            throw new TagException(this.tag, "Attribute '" + propertyDescriptor.getName()
+                                                             + "' is required");
                         }
                     }
                 }
@@ -203,18 +207,21 @@ public class CompositeComponentResourceT
         
         if (nextHandler instanceof javax.faces.view.facelets.CompositeFaceletHandler)
         {
-            for (FaceletHandler handler : ((javax.faces.view.facelets.CompositeFaceletHandler)nextHandler).getHandlers())
+            for (FaceletHandler handler :
+                    ((javax.faces.view.facelets.CompositeFaceletHandler)nextHandler).getHandlers())
             {
                 if (handler instanceof javax.faces.view.facelets.FacetHandler)
                 {
-                    if (insertFacetList == null || !insertFacetList.contains( ((javax.faces.view.facelets.FacetHandler)handler).getFacetName(ctx)))
+                    if (insertFacetList == null ||
+                        !insertFacetList.contains(((javax.faces.view.facelets.FacetHandler)handler).getFacetName(ctx)))
                     {
                         handler.apply(ctx, c);
                     }
                 }
                 else if (handler instanceof InsertFacetHandler)
                 {
-                    if (insertFacetList == null || !insertFacetList.contains( ((InsertFacetHandler)handler).getFacetName(ctx)))
+                    if (insertFacetList == null ||
+                        !insertFacetList.contains( ((InsertFacetHandler)handler).getFacetName(ctx)))
                     {
                         handler.apply(ctx, c);
                     }
@@ -241,14 +248,16 @@ public class CompositeComponentResourceT
         {
             if (nextHandler instanceof javax.faces.view.facelets.FacetHandler)
             {
-                if (insertFacetList == null || !insertFacetList.contains( ((javax.faces.view.facelets.FacetHandler)nextHandler).getFacetName(ctx)) )
+                if (insertFacetList == null ||
+                    !insertFacetList.contains(((javax.faces.view.facelets.FacetHandler)nextHandler).getFacetName(ctx)))
                 {
                     nextHandler.apply(ctx, c);
                 }
             }
             else if (nextHandler instanceof InsertFacetHandler)
             {
-                if (insertFacetList == null || !insertFacetList.contains( ((InsertFacetHandler)nextHandler).getFacetName(ctx)) )
+                if (insertFacetList == null ||
+                    !insertFacetList.contains( ((InsertFacetHandler)nextHandler).getFacetName(ctx)) )
                 {
                     nextHandler.apply(ctx, c);
                 }
@@ -301,7 +310,8 @@ public class CompositeComponentResourceT
             }
             if (facetsRequiredNotFound != null && !facetsRequiredNotFound.isEmpty())
             {
-                throw new TagException(getTag(), "The following facets are required by the component: "+facetsRequiredNotFound);
+                throw new TagException(getTag(), "The following facets are required by the component: "
+                                                 + facetsRequiredNotFound);
             }
         }
     }
@@ -311,7 +321,8 @@ public class CompositeComponentResourceT
     {
         FaceletCompositionContext mctx = FaceletCompositionContext.getCurrentInstance(faceletContext);
         AbstractFaceletContext actx = (AbstractFaceletContext) faceletContext;
-        UIPanel compositeFacetPanel = (UIPanel) compositeComponentBase.getFacets().get(UIComponent.COMPOSITE_FACET_NAME);
+        UIPanel compositeFacetPanel
+                = (UIPanel) compositeComponentBase.getFacets().get(UIComponent.COMPOSITE_FACET_NAME);
         if (compositeFacetPanel == null)
         {
             compositeFacetPanel = (UIPanel)
@@ -354,7 +365,21 @@ public class CompositeComponentResourceT
         {
             faceletContext.setVariableMapper(new VariableMapperWrapper(orig));
             actx.pushCompositeComponentClient(this);
-            actx.applyCompositeComponent(compositeFacetPanel, _resource);
+            Resource resourceForCurrentView = faceletContext.getFacesContext().getApplication().
+                getResourceHandler().createResource(_resource.getResourceName(), _resource.getLibraryName());
+            if (resourceForCurrentView != null)
+            {
+                //Wrap it for serialization.
+                resourceForCurrentView = new CompositeResouceWrapper(resourceForCurrentView);
+            }
+            else
+            {
+                //If a resource cannot be resolved it means a default for the current 
+                //composite component does not exists.
+                throw new TagException(getTag(), "Composite Component " + getTag().getQName() 
+                        + " requires a default instance that can be found by the installed ResourceHandler.");
+            }
+            actx.applyCompositeComponent(compositeFacetPanel, resourceForCurrentView);
         }
         finally
         {
@@ -374,7 +399,7 @@ public class CompositeComponentResourceT
             if (_mapper == null || !_lastType.equals(type))
             {
                 _lastType = type;
-                BeanInfo beanInfo = (BeanInfo)((UIComponent) component).getAttributes().get(UIComponent.BEANINFO_KEY);    
+                BeanInfo beanInfo = (BeanInfo)component.getAttributes().get(UIComponent.BEANINFO_KEY);
                 _mapper = createMetaRuleset(type , beanInfo).finish();
             }
             
@@ -526,9 +551,11 @@ public class CompositeComponentResourceT
 
         if (insertFacetPropertyDescriptorMap != null && insertFacetPropertyDescriptorMap.containsKey(name))
         {
-            ValueExpression requiredExpr = (ValueExpression) insertFacetPropertyDescriptorMap.get(name).getValue("required");
+            ValueExpression requiredExpr
+                    = (ValueExpression) insertFacetPropertyDescriptorMap.get(name).getValue("required");
             
-            if (requiredExpr != null && Boolean.TRUE.equals(requiredExpr.getValue(ctx.getFacesContext().getELContext())))
+            if (requiredExpr != null &&
+                Boolean.TRUE.equals(requiredExpr.getValue(ctx.getFacesContext().getELContext())))
             {
                 //Insert facet associated is required, but it was not applied.
                 throw new TagException(this.tag, "Cannot find facet with name '"+name+"' in composite component");

Modified: myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeResourceLibrary.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeResourceLibrary.java?rev=1198042&r1=1198041&r2=1198042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeResourceLibrary.java (original)
+++ myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeResourceLibrary.java Sat Nov  5 20:07:25 2011
@@ -108,6 +108,14 @@ public class CompositeResourceLibrary im
             {
                 String libraryName = ns.substring(NAMESPACE_PREFIX.length());
                 String resourceName = localName + ".xhtml";
+                // MYFACES-3308 If a composite component exists, it requires to 
+                // be always resolved. In other words, it should always exists a default.
+                // The call here for resourceHandler.createResource, just try to get
+                // the Resource and if it does not exists, it just returns null.
+                // The intention of this code is just create an instance and pass to
+                // CompositeComponentResourceTagHandler. Then, its values 
+                // (resourceName, libraryName) will be used to derive the real instance
+                // to use in a view, based on the locale used.
                 Resource compositeComponentResource = new CompositeResouceWrapper(
                     resourceHandler.createResource(resourceName, libraryName));
                 if (compositeComponentResource != null)
@@ -121,8 +129,9 @@ public class CompositeResourceLibrary im
         }
         return null;
     }
-    
-    private static class ComponentConfigWrapper implements ComponentConfig {
+
+    private static class ComponentConfigWrapper implements ComponentConfig
+    {
 
         protected final TagConfig parent;
 
@@ -131,29 +140,35 @@ public class CompositeResourceLibrary im
         protected final String rendererType;
 
         public ComponentConfigWrapper(TagConfig parent, String componentType,
-                String rendererType) {
+                                      String rendererType)
+        {
             this.parent = parent;
             this.componentType = componentType;
             this.rendererType = rendererType;
         }
 
-        public String getComponentType() {
+        public String getComponentType()
+        {
             return this.componentType;
         }
 
-        public String getRendererType() {
+        public String getRendererType()
+        {
             return this.rendererType;
         }
 
-        public FaceletHandler getNextHandler() {
+        public FaceletHandler getNextHandler()
+        {
             return this.parent.getNextHandler();
         }
 
-        public Tag getTag() {
+        public Tag getTag()
+        {
             return this.parent.getTag();
         }
 
-        public String getTagId() {
+        public String getTagId()
+        {
             return this.parent.getTagId();
         }
     }

Modified: myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesRequestTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesRequestTestCase.java?rev=1198042&r1=1198041&r2=1198042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesRequestTestCase.java (original)
+++ myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesRequestTestCase.java Sat Nov  5 20:07:25 2011
@@ -18,6 +18,8 @@
  */
 package org.apache.myfaces.mc.test.core;
 
+import java.io.IOException;
+
 import javax.faces.application.Application;
 import javax.faces.component.UICommand;
 import javax.faces.component.UIComponent;
@@ -185,6 +187,11 @@ public abstract class AbstractMyFacesReq
         processRemainingPhases(facesContext);
     }
     
+    protected String getRenderedContent() throws IOException
+    {
+        return getRenderedContent(facesContext);
+    }
+    
     protected void inputText(UIComponent input, String text)
     {
         client.inputText((UIInput)input, text);

Modified: myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesTestCase.java?rev=1198042&r1=1198041&r2=1198042&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesTestCase.java (original)
+++ myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/mc/test/core/AbstractMyFacesTestCase.java Sat Nov  5 20:07:25 2011
@@ -19,6 +19,7 @@
 package org.apache.myfaces.mc.test.core;
 
 import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
@@ -38,6 +39,7 @@ import javax.faces.lifecycle.LifecycleFa
 import javax.faces.webapp.FacesServlet;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
+import javax.servlet.http.HttpServletResponse;
 
 import org.apache.myfaces.config.DefaultFacesConfigurationProvider;
 import org.apache.myfaces.config.RuntimeConfig;
@@ -47,6 +49,7 @@ import org.apache.myfaces.lifecycle.Life
 import org.apache.myfaces.spi.FacesConfigurationProvider;
 import org.apache.myfaces.spi.impl.DefaultFacesConfigurationProviderFactory;
 import org.apache.myfaces.test.el.MockExpressionFactory;
+import org.apache.myfaces.test.mock.MockPrintWriter;
 import org.apache.myfaces.test.mock.MockServletConfig;
 import org.apache.myfaces.test.mock.MockServletContext;
 import org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage;
@@ -594,6 +597,12 @@ public abstract class AbstractMyFacesTes
             throw new UnsupportedOperationException("Cannot execute phase on custom lifecycle instances");
         }
     }
+    
+    protected String getRenderedContent(FacesContext facesContext) throws IOException
+    {
+        MockPrintWriter writer1 = (MockPrintWriter) (((HttpServletResponse) facesContext.getExternalContext().getResponse()).getWriter());
+        return String.valueOf(writer1.content());
+    }
 
     // ------------------------------------------------------ Instance Variables
 

Propchange: myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/localized/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/localized/LocalizedCompositeComponentTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/localized/LocalizedCompositeComponentTestCase.java?rev=1198042&view=auto
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/localized/LocalizedCompositeComponentTestCase.java (added)
+++ myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/localized/LocalizedCompositeComponentTestCase.java Sat Nov  5 20:07:25 2011
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.view.facelets.tag.composite.localized;
+
+import javax.faces.webapp.FacesServlet;
+
+import org.apache.myfaces.mc.test.core.AbstractMyFacesRequestTestCase;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Check if a composite component can be localized following the rules
+ * of JSF 2.0 Resource Handler API that are used for css, javascript
+ * and other resources.
+ * 
+ * @author Leonardo Uribe
+ *
+ */
+public class LocalizedCompositeComponentTestCase extends AbstractMyFacesRequestTestCase
+{
+    // This is a nice example that shows how AbstractMyFacesRequestTestCase 
+    // could be be useful.
+    // This test requires the default ResourceHandler algorithm and involves
+    // create multiple views. So, for this test use FaceletTestCase just does
+    // not fit well and it is more easy to use a test case than setup and
+    // teardown all MyFaces container. 
+    
+    @Override
+    protected void setUpWebConfigParams() throws Exception
+    {
+        super.setUpWebConfigParams();
+        servletContext.addInitParameter(FacesServlet.CONFIG_FILES_ATTR, "/faces-config.xml");
+    }
+
+    @Test
+    public void testNoLocaleCompositeComponent() throws Exception
+    {
+        setupRequest("/testNoLocalizedComposite.xhtml");
+        processLifecycleExecuteAndRender();
+        Assert.assertTrue(getRenderedContent().contains(
+                "English page fragment"));
+        tearDownRequest();
+    }
+    
+    @Test
+    public void testSpanishLocaleCompositeComponent() throws Exception
+    {
+        setupRequest("/testSpanishLocalizedComposite.xhtml");
+        processLifecycleExecuteAndRender();
+        Assert.assertTrue(getRenderedContent().contains(
+                "Fragmento de pagina Espanol"));
+        tearDownRequest();
+    }
+    
+    @Test
+    public void testGermanLocaleCompositeComponent() throws Exception
+    {
+        setupRequest("/testGermanLocalizedComposite.xhtml");
+        processLifecycleExecuteAndRender();
+        Assert.assertTrue(getRenderedContent().contains(
+                "Deutsches Seitenfragment"));
+        tearDownRequest();
+    }
+}

Propchange: myfaces/core/branches/2.0.x/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/localized/LocalizedCompositeComponentTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/faces-config.xml?rev=1198042&view=auto
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/faces-config.xml (added)
+++ myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/faces-config.xml Sat Nov  5 20:07:25 2011
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee" 
+              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" 
+              version="2.0">
+
+<application>
+    <locale-config>
+        <default-locale>en</default-locale>
+        <supported-locale>en</supported-locale>
+        <supported-locale>de</supported-locale>
+        <supported-locale>es</supported-locale>
+    </locale-config>
+    <message-bundle>org.apache.myfaces.view.facelets.tag.composite.localized.messages</message-bundle>
+</application>
+
+</faces-config>

Propchange: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/faces-config.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_de.properties
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_de.properties?rev=1198042&view=auto
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_de.properties (added)
+++ myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_de.properties Sat Nov  5 20:07:25 2011
@@ -0,0 +1,17 @@
+ # Licensed to the Apache Software Foundation (ASF) under one
+ # or more contributor license agreements.  See the NOTICE file
+ # distributed with this work for additional information
+ # regarding copyright ownership.  The ASF licenses this file
+ # to you under the Apache License, Version 2.0 (the
+ # "License"); you may not use this file except in compliance
+ # with the License.  You may obtain a copy of the License at
+ #
+ #   http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing,
+ # software distributed under the License is distributed on an
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ # KIND, either express or implied.  See the License for the
+ # specific language governing permissions and limitations
+ # under the License.
+javax.faces.resource.localePrefix=de
\ No newline at end of file

Propchange: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_de.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_en.properties
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_en.properties?rev=1198042&view=auto
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_en.properties (added)
+++ myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_en.properties Sat Nov  5 20:07:25 2011
@@ -0,0 +1,17 @@
+ # Licensed to the Apache Software Foundation (ASF) under one
+ # or more contributor license agreements.  See the NOTICE file
+ # distributed with this work for additional information
+ # regarding copyright ownership.  The ASF licenses this file
+ # to you under the Apache License, Version 2.0 (the
+ # "License"); you may not use this file except in compliance
+ # with the License.  You may obtain a copy of the License at
+ #
+ #   http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing,
+ # software distributed under the License is distributed on an
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ # KIND, either express or implied.  See the License for the
+ # specific language governing permissions and limitations
+ # under the License.
+javax.faces.resource.localePrefix=en
\ No newline at end of file

Propchange: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_en.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_es.properties
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_es.properties?rev=1198042&view=auto
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_es.properties (added)
+++ myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_es.properties Sat Nov  5 20:07:25 2011
@@ -0,0 +1,17 @@
+ # Licensed to the Apache Software Foundation (ASF) under one
+ # or more contributor license agreements.  See the NOTICE file
+ # distributed with this work for additional information
+ # regarding copyright ownership.  The ASF licenses this file
+ # to you under the Apache License, Version 2.0 (the
+ # "License"); you may not use this file except in compliance
+ # with the License.  You may obtain a copy of the License at
+ #
+ #   http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing,
+ # software distributed under the License is distributed on an
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ # KIND, either express or implied.  See the License for the
+ # specific language governing permissions and limitations
+ # under the License.
+javax.faces.resource.localePrefix=es_CO
\ No newline at end of file

Propchange: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/messages_es.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/de/fragments/fragment01.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/de/fragments/fragment01.xhtml?rev=1198042&view=auto
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/de/fragments/fragment01.xhtml (added)
+++ myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/de/fragments/fragment01.xhtml Sat Nov  5 20:07:25 2011
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+        xmlns:h="http://java.sun.com/jsf/html"
+        xmlns:cc="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<cc:interface>
+</cc:interface>
+
+<cc:implementation>
+    Deutsches Seitenfragment
+</cc:implementation>
+
+</ui:composition>
\ No newline at end of file

Propchange: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/de/fragments/fragment01.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/es_CO/fragments/fragment01.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/es_CO/fragments/fragment01.xhtml?rev=1198042&view=auto
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/es_CO/fragments/fragment01.xhtml (added)
+++ myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/es_CO/fragments/fragment01.xhtml Sat Nov  5 20:07:25 2011
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+        xmlns:h="http://java.sun.com/jsf/html"
+        xmlns:cc="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<cc:interface>
+</cc:interface>
+
+<cc:implementation>
+    Fragmento de pagina Espanol
+</cc:implementation>
+
+</ui:composition>
\ No newline at end of file

Propchange: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/es_CO/fragments/fragment01.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/fragments/fragment01.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/fragments/fragment01.xhtml?rev=1198042&view=auto
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/fragments/fragment01.xhtml (added)
+++ myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/fragments/fragment01.xhtml Sat Nov  5 20:07:25 2011
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+        xmlns:h="http://java.sun.com/jsf/html"
+        xmlns:cc="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<cc:interface>
+</cc:interface>
+
+<cc:implementation>
+    English page fragment
+</cc:implementation>
+
+</ui:composition>
\ No newline at end of file

Propchange: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/resources/fragments/fragment01.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testGermanLocalizedComposite.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testGermanLocalizedComposite.xhtml?rev=1198042&view=auto
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testGermanLocalizedComposite.xhtml (added)
+++ myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testGermanLocalizedComposite.xhtml Sat Nov  5 20:07:25 2011
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+        xmlns:f="http://java.sun.com/jsf/core"
+        xmlns:h="http://java.sun.com/jsf/html"
+        xmlns:jl="http://java.sun.com/jsf/composite/jsflive"
+        xmlns:jlf="http://java.sun.com/jsf/composite/fragments">
+<f:view locale="de">
+<h:head>
+</h:head>
+<h:body>
+    <jlf:fragment01/>
+</h:body>
+</f:view>
+</html>

Propchange: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testGermanLocalizedComposite.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testNoLocalizedComposite.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testNoLocalizedComposite.xhtml?rev=1198042&view=auto
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testNoLocalizedComposite.xhtml (added)
+++ myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testNoLocalizedComposite.xhtml Sat Nov  5 20:07:25 2011
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+        xmlns:f="http://java.sun.com/jsf/core"
+        xmlns:h="http://java.sun.com/jsf/html"
+        xmlns:jl="http://java.sun.com/jsf/composite/jsflive"
+        xmlns:jlf="http://java.sun.com/jsf/composite/fragments">
+<f:view locale="en">
+<h:head>
+</h:head>
+<h:body>
+    <jlf:fragment01/>
+</h:body>
+</f:view>
+</html>

Propchange: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testNoLocalizedComposite.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testSpanishLocalizedComposite.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testSpanishLocalizedComposite.xhtml?rev=1198042&view=auto
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testSpanishLocalizedComposite.xhtml (added)
+++ myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testSpanishLocalizedComposite.xhtml Sat Nov  5 20:07:25 2011
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+        xmlns:f="http://java.sun.com/jsf/core"
+        xmlns:h="http://java.sun.com/jsf/html"
+        xmlns:jl="http://java.sun.com/jsf/composite/jsflive"
+        xmlns:jlf="http://java.sun.com/jsf/composite/fragments">
+<f:view locale="es">
+<h:head>
+</h:head>
+<h:body>
+    <jlf:fragment01/>
+</h:body>
+</f:view>
+</html>

Propchange: myfaces/core/branches/2.0.x/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/localized/testSpanishLocalizedComposite.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native