myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r635338 - in /myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main: java/org/apache/myfaces/buildtools/maven2/plugin/faces/ java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/ java/org/apach...
Date Sun, 09 Mar 2008 19:55:09 GMT
Author: lu4242
Date: Sun Mar  9 12:55:02 2008
New Revision: 635338

URL: http://svn.apache.org/viewvc?rev=635338&view=rev
Log:
fixes Component generation tomahawk 1.1

Modified:
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/GenerateJspTaglibsMojo.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/GenerateMasterFacesConfigMojo.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/AbstractComponentGenerator.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/MyFacesComponentGenerator.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/AbstractComponentTagGenerator.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/ComponentBean.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/ConverterBean.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/FacesConfigParser.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/PropertyBean.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/util/Util.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/resources/org/apache/myfaces/buildtools/maven2/plugin/faces/resources/transform.xsl

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/GenerateJspTaglibsMojo.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/GenerateJspTaglibsMojo.java?rev=635338&r1=635337&r2=635338&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/GenerateJspTaglibsMojo.java
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/GenerateJspTaglibsMojo.java
Sun Mar  9 12:55:02 2008
@@ -631,6 +631,13 @@
 
           stream.writeEndElement();
         }
+        else if (property.isRtexprvalue())
+        {
+            stream.writeCharacters("\n      ");
+            stream.writeStartElement("rtexprvalue");
+            stream.writeCharacters("true");
+            stream.writeEndElement();
+        }
         else
         {
           stream.writeCharacters("\n      ");
@@ -773,20 +780,26 @@
         while (components.hasNext())
         {
           ComponentBean component = (ComponentBean)components.next();
-          if (!component.isTagClassExcluded()){
+          if (!component.isTagClassExcluded())
+          {
               componentGen.generateTagHandler(component);
               count++;
           }
         }
         while (converters.hasNext())
         {
-          converterGen.generateTagHandler((ConverterBean)converters.next(), generatedSourceDirectory);
-          count++;
+          ConverterBean converter = (ConverterBean)converters.next();
+          if (!converter.isTagClassExcluded())
+          {
+              converterGen.generateTagHandler(converter, generatedSourceDirectory);
+              count++;
+          }
         }
         while (validators.hasNext())
         {
           ValidatorBean validator = (ValidatorBean)validators.next();
-          if (!validator.isTagClassExcluded()){
+          if (!validator.isTagClassExcluded())
+          {
               validatorGen.generateTagHandler(validator, generatedSourceDirectory);
               count++;    
           }          
@@ -823,11 +836,18 @@
       Set componentList;
       
       String fullSuperclassName = component.findJspTagSuperclass();
+            
       if (fullSuperclassName == null)
       {
         getLog().warn("Missing JSP Tag superclass for component: " + component.getComponentClass()
                       + ", generation of this Tag is skipped");
         return;
+      }else{
+          if (is12() && "javax.faces.webapp.UIComponentTag".equalsIgnoreCase(fullSuperclassName)){
+              fullSuperclassName = "javax.faces.webapp.UIComponentELTag";
+          }else if (!is12() && "javax.faces.webapp.UIComponentELTag".equalsIgnoreCase(fullSuperclassName)){
+              fullSuperclassName = "javax.faces.webapp.UIComponentTag";
+          }
       }
       
       componentList = initComponentList(component, fullSuperclassName);

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/GenerateMasterFacesConfigMojo.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/GenerateMasterFacesConfigMojo.java?rev=635338&r1=635337&r2=635338&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/GenerateMasterFacesConfigMojo.java
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/GenerateMasterFacesConfigMojo.java
Sun Mar  9 12:55:02 2008
@@ -23,6 +23,7 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.util.HashSet;
 
 import javax.xml.stream.XMLOutputFactory;
 import javax.xml.stream.XMLStreamException;
@@ -51,15 +52,54 @@
       addResourceRoot(project, targetDirectory.getCanonicalPath());
 
       // Scan for .xrts sources
-      DirectoryScanner scanner = new DirectoryScanner();
-      scanner.setBasedir(new File(sourceDirectory, sourcePath));
-      scanner.addDefaultExcludes();
-      scanner.setIncludes(new String[] { "**/*.xml" });
-      if (excludes != null)
-        scanner.setExcludes(excludes);
-      scanner.scan();
+      String [] xmlFiles;
+      
+      if (inheritedDirectory != null)
+      {
+          HashSet set = new HashSet();
+         
+          DirectoryScanner scanner = new DirectoryScanner();
+          scanner.setBasedir(new File(sourceDirectory, sourcePath));
+          scanner.addDefaultExcludes();
+          scanner.setIncludes(new String[] { "**/*.xml" });
+          if (excludes != null)
+              scanner.setExcludes(excludes);
+          scanner.scan();
+          
+          String [] sourceFiles = scanner.getIncludedFiles();
+          
+          for (int i = 0; i < sourceFiles.length;i++){
+              set.add(sourceFiles[i]);
+          }
+          
+          scanner.setBasedir(new File(inheritedDirectory,sourcePath));
+          scanner.scan();
+          
+          sourceFiles = scanner.getIncludedFiles();
+          for (int i = 0; i < sourceFiles.length;i++){
+              set.add(sourceFiles[i]);
+          }          
+                    
+          Object [] result = set.toArray();
+          xmlFiles = new String[result.length];
+          for (int i = 0; i < result.length; i++){
+              xmlFiles[i] = (String) result[i];
+          }
+      }
+      else
+      {
+          DirectoryScanner scanner = new DirectoryScanner();
+          scanner.setBasedir(new File(sourceDirectory, sourcePath));
+          scanner.addDefaultExcludes();
+          scanner.setIncludes(new String[] { "**/*.xml" });
+          if (excludes != null)
+              scanner.setExcludes(excludes);
+          scanner.scan();
+          
+          xmlFiles = scanner.getIncludedFiles();
+      }
 
-      String[] xmlFiles = scanner.getIncludedFiles();
+      
 
       long lastModified = 0L;
       for (int i=0; i < xmlFiles.length; i++)
@@ -140,7 +180,12 @@
    * @required
    */
   private File sourceDirectory;
-
+  
+  /**
+   * @parameter 
+   */  
+  private File inheritedDirectory;
+  
   /**
    * @parameter
    * @readonly

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/AbstractComponentGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/AbstractComponentGenerator.java?rev=635338&r1=635337&r2=635338&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/AbstractComponentGenerator.java
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/AbstractComponentGenerator.java
Sun Mar  9 12:55:02 2008
@@ -584,7 +584,9 @@
       PrettyWriter out) throws IOException
   {
     out.println();
-    out.println("@Override");
+    if (_is12){
+        out.println("@Override");
+    }
     out.println("public String getFamily()");
     out.println("{");
     out.indent();

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/MyFacesComponentGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/MyFacesComponentGenerator.java?rev=635338&r1=635337&r2=635338&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/MyFacesComponentGenerator.java
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/component/MyFacesComponentGenerator.java
Sun Mar  9 12:55:02 2008
@@ -48,7 +48,11 @@
   protected void addSpecificImports(Set imports, ComponentBean component)
   {
     imports.add("javax.faces.context.FacesContext");
-    imports.add("javax.el.ValueExpression");
+    if (_is12){
+        imports.add("javax.el.ValueExpression");
+    }else{
+        imports.add("javax.faces.el.ValueBinding");
+    }
     for (Iterator lIterator = component.properties(); lIterator.hasNext();)
     {
       PropertyBean lPropertyBean = (PropertyBean) lIterator.next();
@@ -71,6 +75,10 @@
     String propertyClass = Util.getClassFromFullClass(propertyFullClass);
     String propertyGenerics = Util.getGenericsFromProperty(property);
     String def = Util.getDefaultValue(property);
+    
+    if (propertyClass.endsWith("Boolean")){
+        def = "Boolean.valueOf("+def+")";
+    }
 
     out.println();
     out.println("// Property: " + propName);
@@ -306,13 +314,47 @@
       out.println("return " + property.getFieldPropertyName() + ";");
       out.unindent();
       out.println("}");
-      out.println("ValueExpression expression = getValueExpression(\"" + property.getPropertyName()
+ "\");");
-      out.println("if (expression != null)");
-      out.println("{");
-      out.indent();
-      out.println("return " + _castIfNecessary(propClass) + "expression.getValue(getFacesContext().getELContext());");
-      out.unindent();
-      out.println("}");
+      if (_is12){
+          out.println("ValueExpression expression = getValueExpression(\"" + property.getPropertyName()
+ "\");");
+          out.println("if (expression != null)");
+          out.println("{");
+          out.indent();
+          out.println("return " + _castIfNecessary(propClass) + "expression.getValue(getFacesContext().getELContext());");
+          out.unindent();
+          out.println("}");
+      }
+      else
+      {
+          out.println("ValueBinding vb = getValueBinding(\"" + property.getPropertyName()
+ "\");");
+          out.println("if (vb != null)");
+          out.println("{");
+          out.indent();
+          
+          if (Util.isPrimitiveClass(propFullClass))
+          {                 
+              out.println("return (" + _castIfNecessary(propClass) + "vb.getValue(getFacesContext()))."+propClass+"Value();");
+          }
+          else
+          {
+              String type = null; 
+              if ( (type = Util.getPrimitiveType(propClass)) != null)
+              {
+                  out.println("Object value = vb == null ? null : vb.getValue(getFacesContext());");
+                  out.println("if (!(value instanceof "+propClass+")){");
+                  out.indent();
+                  out.println("value = " + Util.getBoxedClass(type) +".valueOf(value.toString());");
+                  out.unindent();
+                  out.println("}");
+                  out.println("return " + _castIfNecessary(propClass) + "value;");      
           
+              }
+              else
+              {
+                  out.println("return " + _castIfNecessary(propClass) + "vb.getValue(getFacesContext());");
                 
+              }
+          }
+          out.unindent();
+          out.println("}");          
+      }
 
       String ret = Util.getDefaultValue(property);
       if (null != ret)
@@ -352,7 +394,9 @@
     int arraySize = component.propertiesSize() + primitivePropertiesCount + 1;
 
     out.println();
-    out.println("@Override");
+    if (_is12){
+        out.println("@Override");
+    }
     out.println("public Object saveState(FacesContext facesContext)");
     out.println("{");
     out.indent();
@@ -388,14 +432,24 @@
       }
       else
       {
-        out.println(arrayName + "[" + propIndex + "] = " + varName + ";");
+        if (!_is12 && Util.isPrimitiveClass(property.getPropertyClass())){
+            out.println(arrayName + "[" + propIndex + "] = "+Util.getBoxedClass(property.getPropertyClass())+".valueOf("
+ varName + ");");
+        }
+        else
+        {
+            out.println(arrayName + "[" + propIndex + "] = " + varName + ";");
+        }        
       }
 
       propIndex++;
 
       if (Util.isPrimitiveClass(property.getPropertyClass()) && !property.isTagAttributeExcluded())
       {
-        out.println(arrayName + "[" + propIndex + "] = " + _primitiveSetVarName(varName)
+ ";");
+        if (!_is12){
+            out.println(arrayName + "[" + propIndex + "] = Boolean.valueOf(" + _primitiveSetVarName(varName)
+ ");");
+        }else{
+            out.println(arrayName + "[" + propIndex + "] = " + _primitiveSetVarName(varName)
+ ";");
+        }
         propIndex++;
       }
     }
@@ -412,7 +466,9 @@
     String arrayName = "values";
 
     out.println();
-    out.println("@Override");
+    if (_is12){
+        out.println("@Override");
+    }
     out.println("public void restoreState(FacesContext facesContext, Object state)");
     out.println("{");
     out.indent();
@@ -456,16 +512,26 @@
       }
       else
       {
-        out.println(varName + " = " + _castIfNecessary(propClass)
-            + arrayName + "[" + propIndex + "];");
+        if (!_is12 && Util.isPrimitiveClass(property.getPropertyClass())){
+            out.println(varName + " = (" + _castIfNecessary(propClass)
+                    + arrayName + "[" + propIndex + "])."+propClass+"Value();");        
   
+        }else{
+            out.println(varName + " = " + _castIfNecessary(propClass)
+                    + arrayName + "[" + propIndex + "];");
+        }
       }
 
       propIndex++;
 
       if (Util.isPrimitiveClass(property.getPropertyClass()) && !property.isTagAttributeExcluded())
       {
-        out.println(_primitiveSetVarName(varName) + " = (Boolean)"
-            + arrayName + "[" + propIndex + "];");
+        if (!_is12){
+            out.println(_primitiveSetVarName(varName) + " = ((Boolean)"
+                    + arrayName + "[" + propIndex + "]).booleanValue();");
+        }else{
+            out.println(_primitiveSetVarName(varName) + " = (Boolean)"
+                    + arrayName + "[" + propIndex + "];");
+        }
         propIndex++;
       }
     }

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/AbstractComponentTagGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/AbstractComponentTagGenerator.java?rev=635338&r1=635337&r2=635338&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/AbstractComponentTagGenerator.java
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/AbstractComponentTagGenerator.java
Sun Mar  9 12:55:02 2008
@@ -246,7 +246,9 @@
     if (properties.hasNext() || special)
     {
       out.println();
-      out.println("@Override");
+      if (is12()){
+          out.println("@Override");
+      }
       out.println("public void release()");
       out.println("{");
       out.indent();

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java?rev=635338&r1=635337&r2=635338&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/generator/taglib/MyFacesComponentTagGenerator.java
Sun Mar  9 12:55:02 2008
@@ -62,6 +62,12 @@
     {
       imports.add("javax.el.ValueExpression");
     }
+    else
+    {
+      imports.add("javax.faces.el.ValueBinding");
+      imports.add("javax.faces.context.FacesContext");
+    }
+        
 
     Iterator properties = component.properties();
     properties = new FilteredIterator(properties, new TagAttributeFilter());
@@ -161,7 +167,9 @@
     out.println();
 
     // The superclass does not necessarily need to have this method
-    out.println("@Override");
+    if (is12()){
+        out.println("@Override");
+    }
     out.println("public String getComponentType()");
     out.println("{");
     out.indent();
@@ -241,7 +249,7 @@
 
     if (!_is12)
     {
-      out.println("FacesContext context = FacesContext.getCurrentInstance();");
+      out.println("FacesContext context = getFacesContext();");
     }
 
     while (properties.hasNext())
@@ -288,7 +296,26 @@
 
     if (property.isLiteralOnly())
     {
-      out.println("comp.getAttributes().put(\"" + propName + "\", " + propVar + ");");
+      if (_is12){
+          out.println("comp.getAttributes().put(\"" + propName + "\", " + propVar + ");");
+      }else{
+          String propertyClass = property.getPropertyClass().trim();
+          if (propertyClass.startsWith("java.lang.")){
+              propertyClass = propertyClass.replace("java.lang.", "");
+          }
+          
+          if (propertyClass.endsWith("eger")){
+              propertyClass = propertyClass.replace("eger", "");
+          }
+          
+          if (Util.isPrimitiveClass(propertyClass.toLowerCase())){
+              out.println("comp.getAttributes().put(\"" + propName + "\", " +
+                      Util.getBoxedClass(propertyClass.toLowerCase())+".valueOf(" + propVar
+ "));");                
+          }else{                
+              out.println("comp.getAttributes().put(\"" + propName + "\", " + propVar + ");");
+          }
+      }
+      
     }
     else if (_is12)
     {
@@ -296,7 +323,7 @@
     }
     else
     {
-      _writeSetValueBinding(out, propName, propVar);
+      _writeSetValueBinding(out, property, propName, propVar);
     }
     out.unindent();
     out.println("}");
@@ -304,20 +331,48 @@
 
   private void _writeSetValueBinding(
       PrettyWriter out,
+      PropertyBean property,
       String propName,
       String propVar)
   {
-    out.println("if (isValueReference(" + propVar + ")");
+    out.println("if (isValueReference(" + propVar + "))");
     out.println("{");
     out.indent();
     out.println("ValueBinding vb = context.getApplication().createValueBinding(" + propVar
+ ");");
-    out.println("comp.setValueBinding(\"" + propName + "\", " + propVar + ");");
+    out.println("comp.setValueBinding(\"" + propName + "\", vb);");
     out.unindent();
     out.println("}");
     out.println("else");
     out.println("{");
     out.indent();
-    out.println("comp.getAttributes().put(\"" + propName + "\", " + propVar + ");");
+    if (!is12() && "value".equals(propName))
+    {
+        out.println("comp.setValue(" + propVar + ");");
+    }
+    else
+    {
+        if (Util.isPrimitiveClass(property.getPropertyClass())){
+            out.println("comp.getAttributes().put(\"" + propName + "\", " +
+                    Util.getBoxedClass(property.getPropertyClass())+".valueOf(" + propVar
+ "));");
+        }else{
+            String propertyClass = property.getPropertyClass().trim();
+            if (propertyClass.startsWith("java.lang.")){
+                propertyClass = propertyClass.replace("java.lang.", "");
+            }
+            
+            if (propertyClass.endsWith("eger")){
+                propertyClass = propertyClass.replace("eger", "");
+            }
+            
+            if (Util.isPrimitiveClass(propertyClass.toLowerCase())){
+                out.println("comp.getAttributes().put(\"" + propName + "\", " +
+                        Util.getBoxedClass(propertyClass.toLowerCase())+".valueOf(" + propVar
+ "));");                
+            }else{                
+                out.println("comp.getAttributes().put(\"" + propName + "\", " + propVar +
");");
+                
+            }
+        }
+    }    
     out.unindent();
     out.println("}");
   }
@@ -391,26 +446,32 @@
       out.println("{");
       out.indent();
 
-      if (isStringMethodBindingReturnType(signature))
+      if (isStringMethodBindingReturnType(signature) || property.getJspPropertyName().equals("action"))
       {
         out.println("MethodBinding mb;");
         out.println("if (isValueReference(" + propVar + "))");
         out.indent();
-        out.println("mb = createMethodBinding(" + propVar + ", " + classArray + ");");
+        out.println("mb = context.getApplication().createMethodBinding(" + propVar + ", "
+ classArray + ");");
         out.unindent();
         out.println("else");
         out.indent();
-        out.println("mb = new org.apache.myfaces.trinidadinternal.taglib.ConstantMethodBinding("
+ propVar + ");");
+        
+        if (!is12() && property.getJspPropertyName().equals("action")){
+            out.println("mb = new org.apache.myfaces.shared_tomahawk.el.SimpleActionMethodBinding("+propVar+");");
+        }else{
+            out.println("throw new IllegalStateException(\"Invalid expression \" + "+propVar+");");
+        }
         out.unindent();
       }
       else
       {
         // never a literal, no need for ConstantMethodBinding
-        out.println("MethodBinding mb = createMethodBinding(" + propVar + ", " +
+        out.println("MethodBinding mb = context.getApplication().createMethodBinding(" +
propVar + ", " +
             classArray + ");");
       }
-
-      out.println("bean.setProperty(" + componentClass + "." + propKey + ", mb);");
+      String setMethod = Util.getPrefixedPropertyName("set", propName);
+      
+      out.println("comp."+setMethod+"(mb);");
       out.unindent();
       out.println("}");
     }
@@ -547,8 +608,8 @@
       out.println("if (isValueReference(" + propVar + "))");
       out.println("{");
       out.indent();
-      out.println("ValueBinding vb = createValueBinding(" + propVar + ");");
-      out.println("bean.setValueBinding(" + componentClass + "." + propKey + ", vb);");
+      out.println("ValueBinding vb = context.getApplication().createValueBinding(" + propVar
+ ");");
+      out.println("comp.setValueBinding(\"" +propName+ "\", vb);");
       out.unindent();
       out.println("}");
       out.println("else");
@@ -558,7 +619,7 @@
       out.indent();
       out.println("createConverter(" + propVar + ");");
       out.unindent();
-      out.println("bean.setProperty(" + componentClass + "." + propKey + ", converter);");
+      out.println("comp.setConverter(converter);");
       out.unindent();
       out.println("}");
     }

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/ComponentBean.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/ComponentBean.java?rev=635338&r1=635337&r2=635338&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/ComponentBean.java
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/ComponentBean.java
Sun Mar  9 12:55:02 2008
@@ -937,7 +937,8 @@
 
     ComponentBean parent = resolveSupertype();
     return (parent != null) ? parent.findComponentClass()
-                            : _TRINIDAD_COMPONENT_BASE;
+                            : (isTrinidadComponent() ? 
+                   _TRINIDAD_COMPONENT_BASE : _JSF_COMPONENT_BASE);
   }
 
   /**
@@ -953,7 +954,8 @@
 
     ComponentBean parent = resolveSupertype();
     return (parent != null) ? parent.findJspTagClass()
-                            : _TRINIDAD_COMPONENT_TAG;
+                            : (isTrinidadComponent() ?
+                  _TRINIDAD_COMPONENT_TAG : _JSF_COMPONENT_TAG);
   }
 
   /**
@@ -1116,5 +1118,11 @@
   static private final String _TRINIDAD_COMPONENT_TAG =
                          "org.apache.myfaces.trinidad.webapp.UIXComponentTag";
 
+  static private final String _JSF_COMPONENT_BASE =
+                         "javax.faces.component.UIComponentBase";
+
+  static private final String _JSF_COMPONENT_TAG =
+                         "javax.faces.webapp.UIComponentTag";
+  
   static private final Logger _LOG = Logger.getLogger(ComponentBean.class.getName());
 }

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/ConverterBean.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/ConverterBean.java?rev=635338&r1=635337&r2=635338&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/ConverterBean.java
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/ConverterBean.java
Sun Mar  9 12:55:02 2008
@@ -138,8 +138,17 @@
     addConverterClassModifier(_parseModifier(modifier));
   }
 
+  public void setTagClassExcluded(boolean tagClassExcluded)
+  {
+    _tagClassExcluded = tagClassExcluded;
+  }
 
+  public boolean isTagClassExcluded()
+  {
+    return _tagClassExcluded;
+  }
 
+  private boolean _tagClassExcluded;
   private String  _converterId;
   private String  _converterClass;
   private String  _converterSuperClass;

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/FacesConfigParser.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/FacesConfigParser.java?rev=635338&r1=635337&r2=635338&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/FacesConfigParser.java
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/FacesConfigParser.java
Sun Mar  9 12:55:02 2008
@@ -219,6 +219,8 @@
                                    "isGetLocalMethod");
     digester.addBeanPropertySetter("faces-config/component/property/property-extension/is-get-local-method-scope",
                                     "isGetLocalMethodScope");
+    digester.addBeanPropertySetter("faces-config/component/property/property-extension/rtexprvalue",
+                                    "rtexprvalue");
     
     digester.addCallMethod("faces-config/component/property/property-extension/property-values",
                            "parsePropertyValues", 1);
@@ -351,6 +353,8 @@
                                    "longDescription");
     digester.addBeanPropertySetter("faces-config/converter/converter-extension/tag-class",
                                    "tagClass");
+    digester.addBeanPropertySetter("faces-config/converter/converter-extension/tag-class-excluded",
+                                   "tagClassExcluded");
     digester.addRule("faces-config/converter/converter-extension/tag-name",
                      new BeanPropertySetterRule("tagName"));
     digester.addCallMethod("faces-config/converter/converter-extension/tag-class-modifier",
@@ -360,6 +364,8 @@
     // faces-config/converter/property/property-extension
     digester.addBeanPropertySetter("faces-config/converter/property/property-extension/tag-attribute-excluded",
                                    "tagAttributeExcluded");
+    digester.addBeanPropertySetter("faces-config/converter/property/property-extension/literal-only",
+                                   "literalOnly");
 
     // faces-config/validator/validator-extension
     digester.addBeanPropertySetter("faces-config/validator/validator-extension/long-description",

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/PropertyBean.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/PropertyBean.java?rev=635338&r1=635337&r2=635338&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/PropertyBean.java
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/parse/PropertyBean.java
Sun Mar  9 12:55:02 2008
@@ -469,6 +469,17 @@
     return _isGetLocalMethodScope;
   }
 
+  public void setRtexprvalue(boolean _rtexprvalue)
+  {
+    this._rtexprvalue = _rtexprvalue;
+  }
+
+  public boolean isRtexprvalue()
+  {
+    return _rtexprvalue;
+  }
+ 
+  private boolean _rtexprvalue;
   private String _isGetLocalMethodScope;
   private boolean _isGetLocalMethod;
   private String _isSetMethodScope;

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/util/Util.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/util/Util.java?rev=635338&r1=635337&r2=635338&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/util/Util.java
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/faces/util/Util.java
Sun Mar  9 12:55:02 2008
@@ -192,6 +192,27 @@
     
     return buffer.toString();
   }
+  
+  static public String getPrimitiveType(String className){      
+      if (className.startsWith("java.lang."))
+      {
+          className = className.replace("java.lang.", "");
+      }
+      
+      if (className.endsWith("eger"))
+      {
+          className = className.replace("eger", "");
+      }
+      
+      if (Util.isPrimitiveClass(className.toLowerCase()))
+      {
+          return className.toLowerCase();
+      }else
+      {
+          return null;
+      }
+      
+  }
 
   static public String getBoxedClass(
     String className)

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/resources/org/apache/myfaces/buildtools/maven2/plugin/faces/resources/transform.xsl
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/resources/org/apache/myfaces/buildtools/maven2/plugin/faces/resources/transform.xsl?rev=635338&r1=635337&r2=635338&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/resources/org/apache/myfaces/buildtools/maven2/plugin/faces/resources/transform.xsl
(original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-faces-plugin/src/main/resources/org/apache/myfaces/buildtools/maven2/plugin/faces/resources/transform.xsl
Sun Mar  9 12:55:02 2008
@@ -82,18 +82,33 @@
       <xsl:apply-templates select="javaee:factory" />
       <xsl:apply-templates select="javaee:component[not(contains(javaee:component-extension/mfp:component-class-modifier/text(),
'abstract')) and
                                                     starts-with(javaee:component-type, $typePrefix)]"
/>
-      <xsl:apply-templates select="javaee:converter[contains(javaee:converter-class, $packageContains)]"
/>
+      <!-- In tomahawk 1.1 some converters should be added
+      on faces-config.xml like javax.math.BigDecimal, if we
+      include javaee:converter[contains(javaee:converter-class, $packageContains)] 
+      this class references are not added to faces-config.xml. 
+      So we need to add this for avoid check packaageContains -->                    
                               
+      <xsl:apply-templates select="javaee:converter" />
       <xsl:apply-templates select="javaee:managed-bean[contains(javaee:managed-bean-class,
$packageContains)]" />
       <xsl:apply-templates select="javaee:navigation-rule" />
       <xsl:apply-templates select="javaee:referenced-bean" />
       <!-- merge the render-kits together -->
-      <xsl:for-each select="javaee:render-kit[contains(javaee:render-kit-class, $packageContains)]"
>
+      <!-- In tomahawk 1.1 we don't merge render-kit,
+      because we add all components to HTML_BASIC renderkit,
+      and the render-kit-class is missing (myfaces core or jsf ri
+      decide what class implement this). 
+      So, here we cannot put 
+      javaee:render-kit[contains(javaee:render-kit-class, $packageContains)]
+      again
+       -->      
+      <xsl:for-each select="javaee:render-kit" >
         <xsl:element name="render-kit" >
           <xsl:apply-templates select="javaee:description" />
           <xsl:apply-templates select="javaee:display-name" />
           <xsl:apply-templates select="javaee:icon" />
           <xsl:apply-templates select="javaee:render-kit-id" />
+          <!-- Not required in tomahawk 1.1 --> 
           <xsl:apply-templates select="javaee:render-kit-class" />
+           
           <!-- Drop renderers if desired -->
           <xsl:if test="$removeRenderers != 'true'">
             <xsl:for-each select="key('render-kit-id', javaee:render-kit-id/text())" >



Mime
View raw message