myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r1414694 - in /myfaces/extensions/scripting/trunk: extscript-bundles/ extscript-core-root/extscript-core/src/main/resources/META-INF/ extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/ extscript-core-root/extscript-moj...
Date Wed, 28 Nov 2012 14:05:59 GMT
Author: werpu
Date: Wed Nov 28 14:05:56 2012
New Revision: 1414694

URL: http://svn.apache.org/viewvc?rev=1414694&view=rev
Log:
adding latest mojarra changes moving changes into bundle moving the config files into their respective implementation directories

Added:
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingBehaviorTagHandlerDelegate.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingComponentTagHandlerDelegate.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingConverterTagHandlerDelegate.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingValidatorTagHandlerDelegate.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/TagHandlerDelegateFactoryImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/BeanPropertyTagRule.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/ComponentRule.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/InvokeDynamicBeanPropertyTagRule.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/MetadataImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/ParameterCheck.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/SwitchingBeanPropertyTagRule.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/SwitchingMetarulesetImpl.java
      - copied, changed from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/facelet/support/SwitchingMetarulesetImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/LICENSE.TXT
      - copied, changed from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/LICENSE.TXT
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/NOTICE.TXT
      - copied, changed from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/NOTICE.TXT
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/extscripting.taglib.xml
      - copied, changed from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/extscripting.taglib.xml
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/faces-config.xml
      - copied, changed from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/faces-config.xml
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/licenses/
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/licenses/asm-license.txt
      - copied, changed from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/asm-license.txt
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/licenses/facelets-license.txt
      - copied, changed from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/facelets-license.txt
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/LICENSE.TXT
      - copied, changed from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/LICENSE.TXT
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/NOTICE.TXT
      - copied, changed from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/NOTICE.TXT
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/extscripting.taglib.xml
      - copied, changed from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/extscripting.taglib.xml
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/faces-config.xml
      - copied, changed from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/faces-config.xml
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/licenses/
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/licenses/asm-license.txt
      - copied, changed from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/asm-license.txt
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/licenses/facelets-license.txt
      - copied, changed from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/facelets-license.txt
Removed:
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/LICENSE.TXT
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/NOTICE.TXT
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/extscripting.taglib.xml
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/faces-config.xml
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/asm-license.txt
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/facelets-license.txt
Modified:
    myfaces/extensions/scripting/trunk/extscript-bundles/pom.xml
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/pom.xml
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/facelet/support/SwitchingMetarulesetImpl.java
    myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/pom.xml
    myfaces/extensions/scripting/trunk/extscript-examples/weld-example/src/main/webapp/WEB-INF/web.xml

Modified: myfaces/extensions/scripting/trunk/extscript-bundles/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-bundles/pom.xml?rev=1414694&r1=1414693&r2=1414694&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-bundles/pom.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-bundles/pom.xml Wed Nov 28 14:05:56 2012
@@ -47,6 +47,7 @@
 
     <modules>
         <module>extscript-myfaces20-bundle</module>
+        <module>extscript-mojarra-bundle</module>
     </modules>
 
 

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/pom.xml?rev=1414694&r1=1414693&r2=1414694&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/pom.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/pom.xml Wed Nov 28 14:05:56 2012
@@ -52,11 +52,12 @@
             <artifactId>extscript-core</artifactId>
             <version>1.0.5-SNAPSHOT</version>
         </dependency>
+
         <dependency>
-                    <groupId>jsf</groupId>
-                    <artifactId>jsf</artifactId>
-                    <version>2.2-SNAPSHOT</version>
-                    <scope>provided</scope>
-                </dependency>
+            <groupId>jsf</groupId>
+            <artifactId>jsf</artifactId>
+            <version>2.2-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 </project>
\ No newline at end of file

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingBehaviorTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingBehaviorTagHandlerDelegate.java?rev=1414694&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingBehaviorTagHandlerDelegate.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingBehaviorTagHandlerDelegate.java Wed Nov 28 14:05:56 2012
@@ -0,0 +1,71 @@
+/*
+ * 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.extensions.scripting.mojarra.facelet;
+
+import com.sun.faces.facelets.tag.jsf.BehaviorTagHandlerDelegateImpl;
+import org.apache.myfaces.extensions.scripting.core.api.ScriptingConst;
+import org.apache.myfaces.extensions.scripting.core.api.WeavingContext;
+
+import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.BehaviorHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRuleset;
+import javax.faces.view.facelets.TagHandlerDelegate;
+import java.io.IOException;
+
+/**
+ * Behavior Tag Handler which introduces reloading behavior
+ *
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class ReloadingBehaviorTagHandlerDelegate extends TagHandlerDelegate {
+
+    BehaviorHandler _owner;
+    TagHandlerDelegate _delegate;
+
+    public ReloadingBehaviorTagHandlerDelegate(BehaviorHandler owner) {
+        applyOwner(owner);
+    }
+
+    private void applyOwner(BehaviorHandler owner) {
+        _owner = owner;
+        _delegate = new BehaviorTagHandlerDelegateImpl(_owner);
+    }
+
+    @Override
+    public void apply(FaceletContext ctx, UIComponent comp) throws IOException {
+        if (WeavingContext.getInstance().isDynamic(_owner.getClass())) {
+            BehaviorHandler newOwner = (BehaviorHandler) WeavingContext.getInstance().reload(_owner,
+                    ScriptingConst.ARTIFACT_TYPE_BEHAVIOR_HANDLER);
+            if (!newOwner.getClass().equals(_owner.getClass())) {
+                applyOwner(newOwner);
+            }
+        }
+        _owner.apply(ctx, comp);
+    }
+
+    @Override
+    public MetaRuleset createMetaRuleset(Class type) {
+        return _delegate.createMetaRuleset(type);
+    }
+
+}

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingComponentTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingComponentTagHandlerDelegate.java?rev=1414694&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingComponentTagHandlerDelegate.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingComponentTagHandlerDelegate.java Wed Nov 28 14:05:56 2012
@@ -0,0 +1,110 @@
+/*
+ * 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.extensions.scripting.mojarra.facelet;
+
+import com.sun.faces.facelets.tag.jsf.ActionSourceRule;
+import com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl;
+import com.sun.faces.facelets.tag.jsf.EditableValueHolderRule;
+import com.sun.faces.facelets.tag.jsf.ValueHolderRule;
+import org.apache.myfaces.extensions.scripting.core.api.ScriptingConst;
+import org.apache.myfaces.extensions.scripting.core.api.WeavingContext;
+import org.apache.myfaces.extensions.scripting.mojarra.facelet.support.ComponentRule;
+import org.apache.myfaces.extensions.scripting.mojarra.facelet.support.SwitchingMetarulesetImpl;
+
+import javax.faces.component.ActionSource;
+import javax.faces.component.EditableValueHolder;
+import javax.faces.component.UIComponent;
+import javax.faces.component.ValueHolder;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRuleset;
+import javax.faces.view.facelets.TagHandlerDelegate;
+import java.io.IOException;
+
+/**
+ * we provide our own component tag handler factory impl
+ * so that we can deal with refreshing of components
+ * on Facelets level without running into
+ * nasty type exceptions
+ */
+public class ReloadingComponentTagHandlerDelegate extends TagHandlerDelegate {
+
+    ComponentHandler _owner;
+    TagHandlerDelegate _delegate;
+
+    public ReloadingComponentTagHandlerDelegate(ComponentHandler owner) {
+        applyOwner(owner);
+    }
+
+    private void applyOwner(ComponentHandler owner) {
+        _owner = owner;
+        _delegate = new ComponentTagHandlerDelegateImpl(_owner);
+    }
+
+    @Override
+    public void apply(FaceletContext ctx, UIComponent comp) throws IOException {
+        if (WeavingContext.getInstance().isDynamic(_owner.getClass())) {
+            ComponentHandler newOwner = (ComponentHandler) WeavingContext.getInstance().reload(_owner,
+                    ScriptingConst.ARTIFACT_TYPE_COMPONENT_HANDLER);
+            if (!newOwner.getClass().equals(_owner.getClass())) {
+                applyOwner(newOwner);
+            }
+        }
+        _delegate.apply(ctx, comp);
+    }
+
+    public MetaRuleset createMetaRuleset(Class type) {
+        //We have to create a different meta rule set for dynamic classes
+        //which have weaver instantiation criteria, the original meta rule set
+        //first applies the attributes and then calls BeanPropertyTagRule
+        //that one however caches the current method and does not take into consideration
+        //that classes can be changed on the fly
+
+        // if (WeavingContext.isDynamic(type)) {
+        MetaRuleset m = new SwitchingMetarulesetImpl(_owner.getTag(), type);
+        // ignore standard component attributes
+        m.ignore("binding").ignore("id");
+
+        // add auto wiring for attributes
+        m.addRule(ComponentRule.Instance);
+
+        // if it's an ActionSource
+        if (ActionSource.class.isAssignableFrom(type)) {
+            m.addRule(ActionSourceRule.Instance);
+        }
+
+        // if it's a ValueHolder
+        if (ValueHolder.class.isAssignableFrom(type)) {
+            m.addRule(ValueHolderRule.Instance);
+
+            // if it's an EditableValueHolder
+            if (EditableValueHolder.class.isAssignableFrom(type)) {
+                m.ignore("submittedValue");
+                m.ignore("valid");
+                m.addRule(EditableValueHolderRule.Instance);
+            }
+        }
+
+        return m;
+        //}
+
+        //return _delegate.createMetaRuleset(type);
+    }
+}

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingConverterTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingConverterTagHandlerDelegate.java?rev=1414694&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingConverterTagHandlerDelegate.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingConverterTagHandlerDelegate.java Wed Nov 28 14:05:56 2012
@@ -0,0 +1,69 @@
+/*
+ * 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.extensions.scripting.mojarra.facelet;
+
+import com.sun.faces.facelets.tag.jsf.ConverterTagHandlerDelegateImpl;
+import org.apache.myfaces.extensions.scripting.core.api.ScriptingConst;
+import org.apache.myfaces.extensions.scripting.core.api.WeavingContext;
+
+import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.ConverterHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRuleset;
+import javax.faces.view.facelets.TagHandlerDelegate;
+import java.io.IOException;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class ReloadingConverterTagHandlerDelegate extends TagHandlerDelegate {
+
+        ConverterHandler _owner;
+        TagHandlerDelegate _delegate;
+
+        public ReloadingConverterTagHandlerDelegate(ConverterHandler owner) {
+            applyOwner(owner);
+        }
+
+    private void applyOwner(ConverterHandler owner) {
+        _owner = owner;
+        _delegate = new ConverterTagHandlerDelegateImpl(_owner);
+    }
+
+    @Override
+        public void apply(FaceletContext ctx, UIComponent comp) throws IOException {
+            if (WeavingContext.getInstance().isDynamic(_owner.getClass())) {
+                ConverterHandler newOwner = (ConverterHandler) WeavingContext.getInstance().reload(_owner,
+                        ScriptingConst.ARTIFACT_TYPE_CONVERTER_HANDLER);
+                if(!newOwner.getClass().equals(_owner.getClass())) {
+                    applyOwner(newOwner);
+                }
+            }
+            _delegate.apply(ctx, comp);
+        }
+
+        @Override
+        public MetaRuleset createMetaRuleset(Class type) {
+            return _delegate.createMetaRuleset(type);
+        }
+
+}

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingValidatorTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingValidatorTagHandlerDelegate.java?rev=1414694&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingValidatorTagHandlerDelegate.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/ReloadingValidatorTagHandlerDelegate.java Wed Nov 28 14:05:56 2012
@@ -0,0 +1,68 @@
+/*
+ * 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.extensions.scripting.mojarra.facelet;
+
+import com.sun.faces.facelets.tag.jsf.ValidatorTagHandlerDelegateImpl;
+import org.apache.myfaces.extensions.scripting.core.api.ScriptingConst;
+import org.apache.myfaces.extensions.scripting.core.api.WeavingContext;
+
+import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRuleset;
+import javax.faces.view.facelets.TagHandlerDelegate;
+import javax.faces.view.facelets.ValidatorHandler;
+import java.io.IOException;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class ReloadingValidatorTagHandlerDelegate extends TagHandlerDelegate {
+
+    ValidatorHandler _owner;
+    TagHandlerDelegate _delegate;
+
+    public ReloadingValidatorTagHandlerDelegate(ValidatorHandler owner) {
+        applyOwner(owner);
+    }
+
+    private void applyOwner(ValidatorHandler owner) {
+        _owner = owner;
+        _delegate = new ValidatorTagHandlerDelegateImpl(_owner);
+    }
+
+    @Override
+    public void apply(FaceletContext ctx, UIComponent comp) throws IOException {
+        if (WeavingContext.getInstance().isDynamic(_owner.getClass())) {
+            ValidatorHandler newOwner = (ValidatorHandler) WeavingContext.getInstance().reload(_owner,
+                    ScriptingConst.ARTIFACT_TYPE_VALIDATOR_HANDLER);
+            if (!newOwner.getClass().equals(_owner.getClass())) {
+                applyOwner(newOwner);
+            }
+        }
+        _owner.apply(ctx, comp);
+    }
+
+    @Override
+    public MetaRuleset createMetaRuleset(Class type) {
+        return _delegate.createMetaRuleset(type);
+    }
+}

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/TagHandlerDelegateFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/TagHandlerDelegateFactoryImpl.java?rev=1414694&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/TagHandlerDelegateFactoryImpl.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/TagHandlerDelegateFactoryImpl.java Wed Nov 28 14:05:56 2012
@@ -0,0 +1,76 @@
+/*
+ * 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.extensions.scripting.mojarra.facelet;
+
+import com.sun.faces.facelets.tag.jsf.BehaviorTagHandlerDelegateImpl;
+import com.sun.faces.facelets.tag.jsf.ConverterTagHandlerDelegateImpl;
+import com.sun.faces.facelets.tag.jsf.ValidatorTagHandlerDelegateImpl;
+import org.apache.myfaces.extensions.scripting.core.api.WeavingContext;
+
+import javax.faces.view.facelets.BehaviorHandler;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.ConverterHandler;
+import javax.faces.view.facelets.TagHandlerDelegate;
+import javax.faces.view.facelets.TagHandlerDelegateFactory;
+import javax.faces.view.facelets.ValidatorHandler;
+
+/**
+ * Tag handler delegate factory which injects reloading
+ * proxies for our facelet artifacts
+ */
+public class TagHandlerDelegateFactoryImpl extends TagHandlerDelegateFactory {
+
+    @Override
+    public TagHandlerDelegate createBehaviorHandlerDelegate(
+            BehaviorHandler owner) {
+        if (WeavingContext.getInstance().isDynamic(owner.getClass())) {
+            return new ReloadingBehaviorTagHandlerDelegate(owner);
+        } else {
+            return new BehaviorTagHandlerDelegateImpl(owner);
+        }
+    }
+
+    @Override
+    public TagHandlerDelegate createComponentHandlerDelegate(
+            ComponentHandler owner) {
+        return new ReloadingComponentTagHandlerDelegate(owner);
+    }
+
+    @Override
+    public TagHandlerDelegate createConverterHandlerDelegate(
+            ConverterHandler owner) {
+        if (WeavingContext.getInstance().isDynamic(owner.getClass())) {
+            return new ReloadingConverterTagHandlerDelegate(owner);
+        } else {
+            return new ConverterTagHandlerDelegateImpl(owner);
+        }
+    }
+
+    @Override
+    public TagHandlerDelegate createValidatorHandlerDelegate(
+            ValidatorHandler owner) {
+        if (WeavingContext.getInstance().isDynamic(owner.getClass())) {
+            return new ReloadingValidatorTagHandlerDelegate(owner);
+        } else {
+            return new ValidatorTagHandlerDelegateImpl(owner);
+        }
+    }
+}
+

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/BeanPropertyTagRule.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/BeanPropertyTagRule.java?rev=1414694&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/BeanPropertyTagRule.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/BeanPropertyTagRule.java Wed Nov 28 14:05:56 2012
@@ -0,0 +1,130 @@
+/*
+ * 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.extensions.scripting.mojarra.facelet.support;
+
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagAttributeException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public final class BeanPropertyTagRule extends MetaRule
+{
+    public final static BeanPropertyTagRule INSTANCE = new BeanPropertyTagRule();
+
+    public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta)
+    {
+        Method m = meta.getWriteMethod(name);
+
+        // if the property is writable
+        if (m != null)
+        {
+            if (attribute.isLiteral())
+            {
+                return new LiteralPropertyMetadata(m, attribute);
+            }
+            else
+            {
+                return new DynamicPropertyMetadata(m, attribute);
+            }
+        }
+
+        return null;
+    }
+
+    final static class LiteralPropertyMetadata extends Metadata
+    {
+
+        private final Method method;
+
+        private final TagAttribute attribute;
+
+        private Object[] value;
+
+        public LiteralPropertyMetadata(Method method, TagAttribute attribute)
+        {
+            this.method = method;
+            this.attribute = attribute;
+        }
+
+        public void applyMetadata(FaceletContext ctx, Object instance)
+        {
+            if (value == null)
+            {
+                String str = this.attribute.getValue();
+                value = new Object[] { ctx.getExpressionFactory().coerceToType(str, method.getParameterTypes()[0]) };
+            }
+            try
+            {
+                method.invoke(instance, this.value);
+            }
+            catch (InvocationTargetException e)
+            {
+                throw new TagAttributeException(this.attribute, e.getCause());
+            }
+            catch (Exception e)
+            {
+                throw new TagAttributeException(this.attribute, e);
+            }
+        }
+
+    }
+
+    final static class DynamicPropertyMetadata extends Metadata
+    {
+
+        private final Method method;
+
+        private final TagAttribute attribute;
+
+        private final Class<?> type;
+
+        public DynamicPropertyMetadata(Method method, TagAttribute attribute)
+        {
+            this.method = method;
+            this.type = method.getParameterTypes()[0];
+            this.attribute = attribute;
+        }
+
+        public void applyMetadata(FaceletContext ctx, Object instance)
+        {
+            try
+            {
+                method.invoke(instance, new Object[] { attribute.getObject(ctx, type) });
+            }
+            catch (InvocationTargetException e)
+            {
+                throw new TagAttributeException(attribute, e.getCause());
+            }
+            catch (Exception e)
+            {
+                throw new TagAttributeException(attribute, e);
+            }
+        }
+    }
+}

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/ComponentRule.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/ComponentRule.java?rev=1414694&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/ComponentRule.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/ComponentRule.java Wed Nov 28 14:05:56 2012
@@ -0,0 +1,106 @@
+/*
+ * 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.extensions.scripting.mojarra.facelet.support;
+
+import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * we have to re implement the component rule class here
+ * because it is declared private in the original
+ * implementation
+ */
+public final class ComponentRule extends MetaRule {
+
+    final class LiteralAttributeMetadata extends Metadata {
+        private final String _name;
+        private final String _value;
+
+        public LiteralAttributeMetadata(String name, String value) {
+            _name = name;
+            _value = value;
+        }
+
+        public void applyMetadata(FaceletContext ctx, Object instance) {
+            ((UIComponent) instance).getAttributes().put(_name, _value);
+        }
+    }
+
+    final static class ValueExpressionMetadata extends Metadata {
+        private final String _name;
+
+        private final TagAttribute _attr;
+
+        private final Class<?> _type;
+
+        public ValueExpressionMetadata(String name, Class<?> type, TagAttribute attr) {
+            _name = name;
+            _attr = attr;
+            _type = type;
+        }
+
+        public void applyMetadata(FaceletContext ctx, Object instance) {
+            ((UIComponent) instance).setValueExpression(_name, _attr.getValueExpression(ctx, _type));
+        }
+    }
+
+    //private final static Logger log = Logger.getLogger("facelets.tag.component");
+    private final static Logger log = Logger.getLogger(ComponentRule.class.getName());
+
+    public final static ComponentRule Instance = new ComponentRule();
+
+    public ComponentRule() {
+        super();
+    }
+
+    public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
+        if (meta.isTargetInstanceOf(UIComponent.class)) {
+            // if component and dynamic, then must set expression
+            if (!attribute.isLiteral()) {
+                Class<?> type = meta.getPropertyType(name);
+                if (type == null) {
+                    type = Object.class;
+                }
+
+                return new ValueExpressionMetadata(name, type, attribute);
+            } else if (meta.getWriteMethod(name) == null) {
+
+                // this was an attribute literal, but not property
+                warnAttr(attribute, meta.getTargetClass(), name);
+
+                return new LiteralAttributeMetadata(name, attribute.getValue());
+            }
+        }
+        return null;
+    }
+
+    private static void warnAttr(TagAttribute attr, Class<?> type, String n) {
+        if (log.isLoggable(Level.FINER)) {
+            log.finer(attr + " Property '" + n + "' is not on type: " + type.getName());
+        }
+    }
+
+}
+

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/InvokeDynamicBeanPropertyTagRule.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/InvokeDynamicBeanPropertyTagRule.java?rev=1414694&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/InvokeDynamicBeanPropertyTagRule.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/InvokeDynamicBeanPropertyTagRule.java Wed Nov 28 14:05:56 2012
@@ -0,0 +1,107 @@
+/*
+ * 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.extensions.scripting.mojarra.facelet.support;
+
+
+import org.apache.myfaces.extensions.scripting.core.common.util.ReflectUtil;
+
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+import java.lang.reflect.Method;
+
+/**
+ * We have to introduce a BeanPropertyTagRule
+ * which calls the setter of a given component
+ * on a weaker base than the original facelets component
+ * property tag rule does.
+ * By not enforcing a strict per object/class policy on calling
+ * the setter we are able to reload the classes on the fly
+ * <p/>
+ * the original approach was to cache the classes, and then
+ * call the invoke method on the existing class
+ * if we now exchange the classes we have a problem...
+ * By making the invocation of the method independend from the underlying
+ * class (sort of calling an invokedynamic) we can bypass this problem
+ * on facelets level.
+ */
+public class InvokeDynamicBeanPropertyTagRule {
+    public final static InvokeDynamicBeanPropertyTagRule Instance = new InvokeDynamicBeanPropertyTagRule();
+
+    public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
+        Method m = meta.getWriteMethod(name);
+
+        // if the property is writable
+        if (m != null) {
+            if (attribute.isLiteral()) {
+                return new LiteralPropertyMetadata(m, attribute);
+            } else {
+                return new DynamicPropertyMetadata(m, attribute);
+            }
+        }
+
+        return null;
+    }
+
+    final static class LiteralPropertyMetadata extends Metadata {
+
+        private final Method method;
+
+        private final TagAttribute attribute;
+
+        private Object[] value;
+
+        public LiteralPropertyMetadata(Method method, TagAttribute attribute) {
+            this.method = method;
+            this.attribute = attribute;
+        }
+
+        public void applyMetadata(FaceletContext ctx, Object instance) {
+            if (value == null) {
+                String str = this.attribute.getValue();
+                value = new Object[]{ctx.getExpressionFactory().coerceToType(str, method.getParameterTypes()[0])};
+            }
+            //What we do here is simply to call an invoke dynamic on the method with the same name
+            //but on the new instance of, that way we can bypass class problems
+            //because the method reference has stored the old class in our case
+            ReflectUtil.executeMethod(instance, method.getName(), this.value);
+        }
+
+    }
+
+    final static class DynamicPropertyMetadata extends Metadata {
+
+        private final Method method;
+
+        private final TagAttribute attribute;
+
+        private final Class<?> type;
+
+        public DynamicPropertyMetadata(Method method, TagAttribute attribute) {
+            this.method = method;
+            this.type = method.getParameterTypes()[0];
+            this.attribute = attribute;
+        }
+
+        public void applyMetadata(FaceletContext ctx, Object instance) {
+            ReflectUtil.executeMethod(instance, method.getName(), new Object[]{attribute.getObject(ctx, type)});
+        }
+    }
+}

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/MetadataImpl.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/MetadataImpl.java?rev=1414694&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/MetadataImpl.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/MetadataImpl.java Wed Nov 28 14:05:56 2012
@@ -0,0 +1,49 @@
+/*
+ * 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.extensions.scripting.mojarra.facelet.support;
+
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.Metadata;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public final class MetadataImpl extends Metadata
+{
+    private final Metadata[] _mappers;
+    private final int _size;
+
+    public MetadataImpl(Metadata[] mappers)
+    {
+        _mappers = mappers;
+        _size = mappers.length;
+    }
+
+    public void applyMetadata(FaceletContext ctx, Object instance)
+    {
+        // TODO: PROFILE - Check if saving the _size worth it or if an enhanced for is better
+        for (int i = 0; i < _size; i++)
+        {
+            _mappers[i].applyMetadata(ctx, instance);
+        }
+    }
+}

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/ParameterCheck.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/ParameterCheck.java?rev=1414694&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/ParameterCheck.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/ParameterCheck.java Wed Nov 28 14:05:56 2012
@@ -0,0 +1,36 @@
+/*
+ * 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.extensions.scripting.mojarra.facelet.support;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class ParameterCheck
+{
+    public final static void notNull(String name, Object value) throws NullPointerException
+    {
+        if (value == null)
+        {
+            throw new NullPointerException("Parameter '" + name + "' cannot be null");
+        }
+    }
+}

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/SwitchingBeanPropertyTagRule.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/SwitchingBeanPropertyTagRule.java?rev=1414694&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/SwitchingBeanPropertyTagRule.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/SwitchingBeanPropertyTagRule.java Wed Nov 28 14:05:56 2012
@@ -0,0 +1,50 @@
+/*
+ * 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.extensions.scripting.mojarra.facelet.support;
+
+import org.apache.myfaces.extensions.scripting.core.api.WeavingContext;
+
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+
+/**
+ * Bean property tag rule
+ * which switches between the fast static
+ * version and the slower invoke dynamic
+ * version depending on the class type of
+ * the incoming instance
+ */
+public class SwitchingBeanPropertyTagRule extends MetaRule {
+
+    InvokeDynamicBeanPropertyTagRule _invokeDynamic = InvokeDynamicBeanPropertyTagRule.Instance;
+    BeanPropertyTagRule _invokeStatic = BeanPropertyTagRule.INSTANCE;
+
+    public static volatile SwitchingBeanPropertyTagRule Instance = new SwitchingBeanPropertyTagRule();
+
+    @Override
+    public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
+        if (WeavingContext.getInstance().isDynamic(meta.getTargetClass())) {
+            return _invokeDynamic.applyRule(name, attribute, meta);
+        } else {
+            return _invokeStatic.applyRule(name, attribute, meta);
+        }
+    }
+}

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/SwitchingMetarulesetImpl.java (from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/facelet/support/SwitchingMetarulesetImpl.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/SwitchingMetarulesetImpl.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/SwitchingMetarulesetImpl.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/facelet/support/SwitchingMetarulesetImpl.java&r1=1414693&r2=1414694&rev=1414694&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/facelet/support/SwitchingMetarulesetImpl.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/facelet/support/SwitchingMetarulesetImpl.java Wed Nov 28 14:05:56 2012
@@ -16,12 +16,8 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.myfaces.extensions.scripting.jsf.facelet.support;
+package org.apache.myfaces.extensions.scripting.mojarra.facelet.support;
 
-import org.apache.myfaces.view.facelets.tag.MetaRulesetImpl;
-import org.apache.myfaces.view.facelets.tag.MetadataImpl;
-import org.apache.myfaces.view.facelets.tag.MetadataTargetImpl;
-import org.apache.myfaces.view.facelets.util.ParameterCheck;
 
 import javax.faces.view.facelets.FaceletContext;
 import javax.faces.view.facelets.MetaRule;
@@ -39,6 +35,8 @@ import java.util.Map;
 import java.util.WeakHashMap;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+import com.sun.faces.facelets.tag.MetadataTargetImpl;
+
 
 /**
  * we have to to do a full reimplementation of the rule set
@@ -49,7 +47,7 @@ public class SwitchingMetarulesetImpl ex
     private final static Metadata NONE = new NullMetadata();
 
     //private final static Logger log = Logger.getLogger("facelets.tag.meta");
-    private final static Logger log = Logger.getLogger(MetaRulesetImpl.class.getName());
+    private final static Logger log = Logger.getLogger(SwitchingMetarulesetImpl.class.getName());
 
     private final static WeakHashMap<String, MetadataTarget> _metadata = new WeakHashMap<String, MetadataTarget>();
 
@@ -63,6 +61,9 @@ public class SwitchingMetarulesetImpl ex
 
     private final Class<?> _type;
 
+
+
+
     public SwitchingMetarulesetImpl(Tag tag, Class<?> type) {
         _tag = tag;
         _type = type;

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/LICENSE.TXT (from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/LICENSE.TXT)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/LICENSE.TXT?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/LICENSE.TXT&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/LICENSE.TXT&r1=1414693&r2=1414694&rev=1414694&view=diff
==============================================================================
    (empty)

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/NOTICE.TXT (from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/NOTICE.TXT)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/NOTICE.TXT?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/NOTICE.TXT&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/NOTICE.TXT&r1=1414693&r2=1414694&rev=1414694&view=diff
==============================================================================
    (empty)

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/extscripting.taglib.xml (from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/extscripting.taglib.xml)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/extscripting.taglib.xml?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/extscripting.taglib.xml&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/extscripting.taglib.xml&r1=1414693&r2=1414694&rev=1414694&view=diff
==============================================================================
    (empty)

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/faces-config.xml (from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/faces-config.xml)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/faces-config.xml?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/faces-config.xml&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/faces-config.xml&r1=1414693&r2=1414694&rev=1414694&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/faces-config.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/faces-config.xml Wed Nov 28 14:05:56 2012
@@ -55,8 +55,7 @@
         -->
     </factory>
     <lifecycle>
-        <phase-listener>org.apache.myfaces.extensions.scripting.jsf.startup.RefreshPhaseListener
-        </phase-listener>
+        <phase-listener>org.apache.myfaces.extensions.scripting.jsf.startup.RefreshPhaseListener</phase-listener>
     </lifecycle>
 
     <!--

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/licenses/asm-license.txt (from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/asm-license.txt)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/licenses/asm-license.txt?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/licenses/asm-license.txt&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/asm-license.txt&r1=1414693&r2=1414694&rev=1414694&view=diff
==============================================================================
    (empty)

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/licenses/facelets-license.txt (from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/facelets-license.txt)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/licenses/facelets-license.txt?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/resources/META-INF/licenses/facelets-license.txt&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/facelets-license.txt&r1=1414693&r2=1414694&rev=1414694&view=diff
==============================================================================
    (empty)

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/facelet/support/SwitchingMetarulesetImpl.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/facelet/support/SwitchingMetarulesetImpl.java?rev=1414694&r1=1414693&r2=1414694&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/facelet/support/SwitchingMetarulesetImpl.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/facelet/support/SwitchingMetarulesetImpl.java Wed Nov 28 14:05:56 2012
@@ -18,7 +18,6 @@
  */
 package org.apache.myfaces.extensions.scripting.jsf.facelet.support;
 
-import org.apache.myfaces.view.facelets.tag.MetaRulesetImpl;
 import org.apache.myfaces.view.facelets.tag.MetadataImpl;
 import org.apache.myfaces.view.facelets.tag.MetadataTargetImpl;
 import org.apache.myfaces.view.facelets.util.ParameterCheck;
@@ -49,7 +48,7 @@ public class SwitchingMetarulesetImpl ex
     private final static Metadata NONE = new NullMetadata();
 
     //private final static Logger log = Logger.getLogger("facelets.tag.meta");
-    private final static Logger log = Logger.getLogger(MetaRulesetImpl.class.getName());
+    private final static Logger log = Logger.getLogger(SwitchingMetarulesetImpl.class.getName());
 
     private final static WeakHashMap<String, MetadataTarget> _metadata = new WeakHashMap<String, MetadataTarget>();
 

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/LICENSE.TXT (from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/LICENSE.TXT)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/LICENSE.TXT?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/LICENSE.TXT&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/LICENSE.TXT&r1=1414693&r2=1414694&rev=1414694&view=diff
==============================================================================
    (empty)

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/NOTICE.TXT (from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/NOTICE.TXT)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/NOTICE.TXT?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/NOTICE.TXT&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/NOTICE.TXT&r1=1414693&r2=1414694&rev=1414694&view=diff
==============================================================================
    (empty)

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/extscripting.taglib.xml (from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/extscripting.taglib.xml)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/extscripting.taglib.xml?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/extscripting.taglib.xml&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/extscripting.taglib.xml&r1=1414693&r2=1414694&rev=1414694&view=diff
==============================================================================
    (empty)

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/faces-config.xml (from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/faces-config.xml)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/faces-config.xml?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/faces-config.xml&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/faces-config.xml&r1=1414693&r2=1414694&rev=1414694&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/faces-config.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/faces-config.xml Wed Nov 28 14:05:56 2012
@@ -55,8 +55,7 @@
         -->
     </factory>
     <lifecycle>
-        <phase-listener>org.apache.myfaces.extensions.scripting.jsf.startup.RefreshPhaseListener
-        </phase-listener>
+        <phase-listener>org.apache.myfaces.extensions.scripting.jsf.startup.RefreshPhaseListener</phase-listener>
     </lifecycle>
 
     <!--

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/licenses/asm-license.txt (from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/asm-license.txt)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/licenses/asm-license.txt?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/licenses/asm-license.txt&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/asm-license.txt&r1=1414693&r2=1414694&rev=1414694&view=diff
==============================================================================
    (empty)

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/licenses/facelets-license.txt (from r1414693, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/facelets-license.txt)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/licenses/facelets-license.txt?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/resources/META-INF/licenses/facelets-license.txt&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/resources/META-INF/licenses/facelets-license.txt&r1=1414693&r2=1414694&rev=1414694&view=diff
==============================================================================
    (empty)

Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/pom.xml?rev=1414694&r1=1414693&r2=1414694&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/pom.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/pom.xml Wed Nov 28 14:05:56 2012
@@ -85,7 +85,7 @@
                  </dependency>
                  <dependency>
                      <groupId>org.apache.myfaces.extensions.scripting</groupId>
-                     <artifactId>extscript-mojarra</artifactId>
+                     <artifactId>extscript-mojarra-bundle</artifactId>
                      <version>1.0.5-SNAPSHOT</version>
                  </dependency>
             </dependencies>
@@ -112,7 +112,7 @@
 
                 <dependency>
                     <groupId>org.apache.myfaces.extensions.scripting</groupId>
-                    <artifactId>extscript-myfaces</artifactId>
+                    <artifactId>extscript-myfaces20-bundle</artifactId>
                     <version>1.0.5-SNAPSHOT</version>
                 </dependency>
             </dependencies>
@@ -145,11 +145,6 @@
             <version>1.0.3-SNAPSHOT</version>
         </dependency>
         -->
-        <dependency>
-            <groupId>org.apache.myfaces.extensions.scripting</groupId>
-            <artifactId>extscript-core</artifactId>
-            <version>1.0.5-SNAPSHOT</version>
-        </dependency>
 
         <!-- bean validation dependencies -->
         <!--

Modified: myfaces/extensions/scripting/trunk/extscript-examples/weld-example/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/weld-example/src/main/webapp/WEB-INF/web.xml?rev=1414694&r1=1414693&r2=1414694&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/weld-example/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/weld-example/src/main/webapp/WEB-INF/web.xml Wed Nov 28 14:05:56 2012
@@ -25,7 +25,6 @@
 
     <description>Webproject.xml</description>
 
-
     <!--
     Note this entry is vital it plugs the ext-scripting system into
     a myfaces extension point



Mime
View raw message