myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r1414715 - in /myfaces/extensions/scripting/trunk: ./ extscript-core-root/ extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/adapters/ extscript-core-root/extscript-cdi/src/main/java/org/apache/myfa...
Date Wed, 28 Nov 2012 14:14:57 GMT
Author: werpu
Date: Wed Nov 28 14:14:54 2012
New Revision: 1414715

URL: http://svn.apache.org/viewvc?rev=1414715&view=rev
Log:
save state of affairs

Added:
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/adapters/
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/adapters/ClassLoaderServiceImpl.java
      - copied, changed from r1414709, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/ClassLoaderServiceImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService_
    myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello.java
      - copied, changed from r1414709, myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/java/JavaHello.java
    myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello2.java
      - copied, changed from r1414709, myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/java/JavaHello.java
    myfaces/extensions/scripting/trunk/src/site/mdtext/mojarra.mdtext
    myfaces/extensions/scripting/trunk/src/site/resources/images/mojarra-support.jpg
    myfaces/extensions/scripting/trunk/src/site/xdoc/mojarra.xml
Removed:
    myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/java/JavaHello.java
Modified:
    myfaces/extensions/scripting/trunk/.gitignore
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/core/ExtScriptScannerService.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/startup/StartupExtension.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/ClassLoaderServiceImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/adapters/ClassLoaderServiceImpl.java
    myfaces/extensions/scripting/trunk/extscript-core-root/pom.xml
    myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/helloWorld.xhtml
    myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/WEB-INF/web.xml
    myfaces/extensions/scripting/trunk/src/site/mdtext/installation.mdtext

Modified: myfaces/extensions/scripting/trunk/.gitignore
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/.gitignore?rev=1414715&r1=1414714&r2=1414715&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/.gitignore (original)
+++ myfaces/extensions/scripting/trunk/.gitignore Wed Nov 28 14:14:54 2012
@@ -14,6 +14,7 @@ groovy-bin/*
 .idea
 atlassian-ide-plugin.xml
 pom.xml.versionsBackup
+data
 
 
 

Copied: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/adapters/ClassLoaderServiceImpl.java
(from r1414709, myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/ClassLoaderServiceImpl.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/adapters/ClassLoaderServiceImpl.java?p2=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/adapters/ClassLoaderServiceImpl.java&p1=myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/ClassLoaderServiceImpl.java&r1=1414709&r2=1414715&rev=1414715&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/ClassLoaderServiceImpl.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/adapters/ClassLoaderServiceImpl.java
Wed Nov 28 14:14:54 2012
@@ -17,9 +17,11 @@
  * under the License.
  */
 
-package org.apache.myfaces.extensions.scripting.mojarra.adapters;
+package org.apache.myfaces.extensions.scripting.cdi.adapters;
 
+import org.apache.myfaces.extensions.scripting.cdi.core.CDIThrowAwayClassloader;
 import org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService;
+import org.apache.myfaces.extensions.scripting.core.common.util.ClassLoaderUtils;
 import org.apache.myfaces.extensions.scripting.core.engine.ThrowAwayClassloader;
 
 /**
@@ -27,21 +29,20 @@ import org.apache.myfaces.extensions.scr
  * @version $Revision$ $Date$
  */
 
-public class ClassLoaderServiceImpl
-        implements ClassLoaderService
+public class ClassLoaderServiceImpl implements ClassLoaderService
 {
-    static ClassLoader _oldClassLoader = null;
+    volatile static ClassLoader _oldClassLoader = null;
 
-
-    static void internalRegisterThrowAwayClassloader()
+    @Override
+    public void registerThrowAwayClassloader()
     {
-        //we do not have the luxury of a pluggable classloading extensions like in myfaces
+         //we do not have the luxury of a pluggable classloading extensions like in myfaces
         // instead we have to provide our own classloader which is hooked in from time to
time into the running system
-        ClassLoader loader = org.apache.myfaces.extensions.scripting.core.common.util.ClassLoaderUtils.getDefaultClassLoader();
+        ClassLoader loader = ClassLoaderUtils.getDefaultClassLoader();
         boolean found = false;
         ClassLoader parent = loader;
         while(parent != null && !found) {
-            found = parent instanceof ThrowAwayClassloader;
+            found = parent instanceof CDIThrowAwayClassloader;
             if(!found) {
                 parent = parent.getParent();
             }
@@ -53,20 +54,14 @@ public class ClassLoaderServiceImpl
         if(_oldClassLoader != null && loader.equals(_oldClassLoader.getParent()))
{
             Thread.currentThread().setContextClassLoader(_oldClassLoader);
         } else {
-            _oldClassLoader = new ThrowAwayClassloader(loader);
+            _oldClassLoader = new CDIThrowAwayClassloader(loader);
             Thread.currentThread().setContextClassLoader(_oldClassLoader);
         }
     }
 
     @Override
-    public void registerThrowAwayClassloader()
-    {
-        internalRegisterThrowAwayClassloader();
-    }
-
-    @Override
     public int getPriority()
     {
-        return 0;  //default implementation, lowest priority
+        return 3;
     }
 }

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/core/ExtScriptScannerService.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/core/ExtScriptScannerService.java?rev=1414715&r1=1414714&r2=1414715&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/core/ExtScriptScannerService.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/core/ExtScriptScannerService.java
Wed Nov 28 14:14:54 2012
@@ -78,7 +78,7 @@ public class ExtScriptScannerService ext
         }
         catch (IOException e)
         {
-            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+            e.printStackTrace();
         }
     }
 
@@ -135,7 +135,14 @@ public class ExtScriptScannerService ext
         Set<String> listURL = new HashSet<String>();
 
         // Root with beans.xml marker.
-        String[] urls = findBeansXmlBases("META-INF/beans.xml", WebBeansUtil.getCurrentClassLoader());
+        ClassLoader classLoader = WebBeansUtil.getCurrentClassLoader();
+        if(classLoader instanceof CDIThrowAwayClassloader) {
+            classLoader = classLoader.getParent();
+            //for beans.xml discovery we use our old classloader
+            //because the new one fails at disovering
+            //TODO research this.
+        }
+        String[] urls = findBeansXmlBases("META-INF/beans.xml", classLoader);
 
         if (urls != null)
         {

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/startup/StartupExtension.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/startup/StartupExtension.java?rev=1414715&r1=1414714&r2=1414715&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/startup/StartupExtension.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/java/org/apache/myfaces/extensions/scripting/cdi/startup/StartupExtension.java
Wed Nov 28 14:14:54 2012
@@ -19,7 +19,10 @@
 
 package org.apache.myfaces.extensions.scripting.cdi.startup;
 
+//import org.apache.myfaces.extensions.scripting.cdi.core.CDIThrowAwayClassloader;
+
 import org.apache.myfaces.extensions.scripting.cdi.core.CDIThrowAwayClassloader;
+import org.apache.myfaces.extensions.scripting.core.common.util.ClassLoaderUtils;
 
 import javax.enterprise.event.Observes;
 import javax.enterprise.inject.spi.AfterBeanDiscovery;
@@ -34,7 +37,7 @@ import javax.enterprise.inject.spi.Exten
  *          An extension for cdi which does the initial lifecycle
  *          trigger from CDI instead of JSF since CDI is enabled
  *          before JSF we have to do it that way
- *
+ *          <p/>
  *          Stage 1 of our startup cycle
  */
 
@@ -48,22 +51,21 @@ public class StartupExtension implements
         //the compile runs but not with the daemon thread
         //after that we can load the classes
         //by temporarily plugging in our throw away classloader
-
-        //TODO unify the classloader setup because mojarra cannot handle
-        //changing classloaders, we have to stay on one classloader for the entire system
         _classLoaderHolder.set(Thread.currentThread().getContextClassLoader());
 
-       Thread.currentThread().setContextClassLoader(new CDIThrowAwayClassloader(Thread.currentThread().getContextClassLoader()));
+        Thread.currentThread().setContextClassLoader(new CDIThrowAwayClassloader(Thread.currentThread().getContextClassLoader()));
+        //since we have an override we now register
+        //ClassLoaderUtils.getDefaultClassLoaderService().registerThrowAwayClassloader();
     }
 
     void afterBeanDiscovery(@Observes AfterBeanDiscovery abd)
     {
-        //here we unplug our temporary classloader
-    }
 
+    }
 
     void afterDeploymentValidation(@Observes AfterDeploymentValidation abv)
-      {
-            Thread.currentThread().setContextClassLoader(_classLoaderHolder.get());
-      }
+    {
+        //here we unplug our temporary classloader
+       Thread.currentThread().setContextClassLoader(_classLoaderHolder.get());
+    }
 }

Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService_
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService_?rev=1414715&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService_
(added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-cdi/src/main/resources/META-INF/services/org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService_
Wed Nov 28 14:14:54 2012
@@ -0,0 +1 @@
+org.apache.myfaces.extensions.scripting.cdi.adapters.ClassLoaderServiceImpl
\ No newline at end of file

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/ClassLoaderServiceImpl.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/adapters/ClassLoaderServiceImpl.java?rev=1414715&r1=1414714&r2=1414715&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/ClassLoaderServiceImpl.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-mojarra/src/main/java/org/apache/myfaces/extensions/scripting/mojarra/adapters/ClassLoaderServiceImpl.java
Wed Nov 28 14:14:54 2012
@@ -20,8 +20,12 @@
 package org.apache.myfaces.extensions.scripting.mojarra.adapters;
 
 import org.apache.myfaces.extensions.scripting.core.api.ClassLoaderService;
+import org.apache.myfaces.extensions.scripting.core.common.util.ClassLoaderUtils;
 import org.apache.myfaces.extensions.scripting.core.engine.ThrowAwayClassloader;
 
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 /**
  * @author Werner Punz (latest modification by $Author$)
  * @version $Revision$ $Date$
@@ -32,39 +36,45 @@ public class ClassLoaderServiceImpl
 {
     static ClassLoader _oldClassLoader = null;
 
-
-    static void internalRegisterThrowAwayClassloader()
+    @Override
+    public void registerThrowAwayClassloader()
     {
         //we do not have the luxury of a pluggable classloading extensions like in myfaces
         // instead we have to provide our own classloader which is hooked in from time to
time into the running system
-        ClassLoader loader = org.apache.myfaces.extensions.scripting.core.common.util.ClassLoaderUtils.getDefaultClassLoader();
+        final ClassLoader loader = ClassLoaderUtils.getDefaultClassLoader();
         boolean found = false;
         ClassLoader parent = loader;
-        while(parent != null && !found) {
+        while (parent != null && !found)
+        {
             found = parent instanceof ThrowAwayClassloader;
-            if(!found) {
+            if (!found)
+            {
                 parent = parent.getParent();
             }
         }
-        if(found) {
+        if (found)
+        {
             return;
         }
         //in case of an unchanged classloader we can recycle our old throw away classloader
-        if(_oldClassLoader != null && loader.equals(_oldClassLoader.getParent()))
{
+        if (_oldClassLoader != null && loader.equals(_oldClassLoader.getParent()))
+        {
             Thread.currentThread().setContextClassLoader(_oldClassLoader);
-        } else {
-            _oldClassLoader = new ThrowAwayClassloader(loader);
+        } else
+        {
+            _oldClassLoader = (ClassLoader) AccessController.doPrivileged(
+                    new PrivilegedAction()
+                    {
+                        public Object run()
+                        {
+                            return new ThrowAwayClassloader(loader);
+                        }
+                    });
             Thread.currentThread().setContextClassLoader(_oldClassLoader);
         }
     }
 
     @Override
-    public void registerThrowAwayClassloader()
-    {
-        internalRegisterThrowAwayClassloader();
-    }
-
-    @Override
     public int getPriority()
     {
         return 0;  //default implementation, lowest priority

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/adapters/ClassLoaderServiceImpl.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/adapters/ClassLoaderServiceImpl.java?rev=1414715&r1=1414714&r2=1414715&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/adapters/ClassLoaderServiceImpl.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces/src/main/java/org/apache/myfaces/extensions/scripting/jsf/adapters/ClassLoaderServiceImpl.java
Wed Nov 28 14:14:54 2012
@@ -24,8 +24,12 @@ package org.apache.myfaces.extensions.sc
  * @version $Revision$ $Date$
  */
 
+import org.apache.myfaces.extensions.scripting.core.common.util.ClassLoaderUtils;
 import org.apache.myfaces.extensions.scripting.core.engine.ThrowAwayClassloader;
 
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
 /**
  * @author Werner Punz (latest modification by $Author$)
  * @version $Revision$ $Date$
@@ -37,11 +41,12 @@ public class ClassLoaderServiceImpl
 {
     static ClassLoader _oldClassLoader = null;
 
-    static void internalRegisterThrowAwayClassloader()
+    @Override
+    public void registerThrowAwayClassloader()
     {
         //we do not have the luxury of a pluggable classloading extensions like in myfaces
         // instead we have to provide our own classloader which is hooked in from time to
time into the running system
-        ClassLoader loader = org.apache.myfaces.extensions.scripting.core.common.util.ClassLoaderUtils.getDefaultClassLoader();
+        final ClassLoader loader = ClassLoaderUtils.getDefaultClassLoader();
         boolean found = false;
         ClassLoader parent = loader;
         while (parent != null && !found)
@@ -62,20 +67,21 @@ public class ClassLoaderServiceImpl
             Thread.currentThread().setContextClassLoader(_oldClassLoader);
         } else
         {
-            _oldClassLoader = new ThrowAwayClassloader(loader);
+            _oldClassLoader = (ClassLoader) AccessController.doPrivileged(
+                    new PrivilegedAction()
+                    {
+                        public Object run()
+                        {
+                            return new ThrowAwayClassloader(loader);
+                        }
+                    });
             Thread.currentThread().setContextClassLoader(_oldClassLoader);
         }
     }
 
     @Override
-    public void registerThrowAwayClassloader()
-    {
-        internalRegisterThrowAwayClassloader();
-    }
-
-    @Override
     public int getPriority()
     {
-        return 0;  //zero means we easily can override this one
+        return 0;  //default implementation, lowest priority
     }
 }

Modified: myfaces/extensions/scripting/trunk/extscript-core-root/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/pom.xml?rev=1414715&r1=1414714&r2=1414715&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/pom.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/pom.xml Wed Nov 28 14:14:54 2012
@@ -45,7 +45,9 @@
         <module>extscript-cdi</module>
         <module>extscript-spring</module>
         <module>extscript-myfaces</module>
+        <!--
         <module>extscript-mojarra</module>
+        -->
         <!--
         <module>extscript-weld</module>
         -->

Copied: myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello.java
(from r1414709, myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/java/JavaHello.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello.java?p2=myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello.java&p1=myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/java/JavaHello.java&r1=1414709&r2=1414715&rev=1414715&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/java/JavaHello.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello.java
Wed Nov 28 14:14:54 2012
@@ -30,7 +30,7 @@ import javax.inject.Named;
 @Named
 public class JavaHello
 {
-    String helloWorld = "Hello world from Java Bean";
+    String helloWorld = "Hello world from a dynamic Java Bean";
 
     public String getHelloWorld()
     {

Copied: myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello2.java
(from r1414709, myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/java/JavaHello.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello2.java?p2=myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello2.java&p1=myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/java/JavaHello.java&r1=1414709&r2=1414715&rev=1414715&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/java/JavaHello.java
(original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/WEB-INF/java/JavaHello2.java
Wed Nov 28 14:14:54 2012
@@ -17,20 +17,17 @@
  * under the License.
  */
 
-
-
-import javax.inject.Named;
-
 /**
  * @author Werner Punz (latest modification by $Author$)
  * @version $Revision$ $Date$
- *
- * Hello world CDI Java Bean for testing purposes
  */
-@Named
-public class JavaHello
+
+import javax.faces.bean.ManagedBean;
+
+@ManagedBean
+public class JavaHello2
 {
-    String helloWorld = "Hello world from Java Bean";
+    String helloWorld = "booga";
 
     public String getHelloWorld()
     {

Modified: myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/helloWorld.xhtml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/helloWorld.xhtml?rev=1414715&r1=1414714&r2=1414715&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/helloWorld.xhtml
(original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/cdi-example/src/main/webapp/helloWorld.xhtml
Wed Nov 28 14:14:54 2012
@@ -28,6 +28,7 @@
 <h:body>
 
     <h:outputText value="hello: #{javaHello.helloWorld}" />
-
+    <br />
+    <h:outputText value="hello: #{javaHello2.helloWorld}" />
 </h:body>
 </html>

Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/WEB-INF/web.xml?rev=1414715&r1=1414714&r2=1414715&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/WEB-INF/web.xml
(original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/WEB-INF/web.xml
Wed Nov 28 14:14:54 2012
@@ -38,7 +38,7 @@
         <param-value>org.apache.myfaces.extensions.scripting.jsf.startup.StartupServletContextPluginChainLoader
         </param-value>
     </context-param>
-
+    <!--
     <context-param>
         <description>Additional comma separated loader paths to allow direct editing
on the sources directory instead
             of the deployment dir
@@ -80,7 +80,7 @@
               /Users/werpu2/development/workspace/extscript_trunk/extscript-examples/myfaces20-extscript-helloworld/target/myfaces20-extscript-helloworld-1.0.5-SNAPSHOT/WEB-INF/classes</param-value>
       </context-param>
 
-
+      -->
     <!--
     <context-param>
         <description>Additional comma separated loader paths to allow direct editing
on the source

Modified: myfaces/extensions/scripting/trunk/src/site/mdtext/installation.mdtext
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/src/site/mdtext/installation.mdtext?rev=1414715&r1=1414714&r2=1414715&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/src/site/mdtext/installation.mdtext (original)
+++ myfaces/extensions/scripting/trunk/src/site/mdtext/installation.mdtext Wed Nov 28 14:14:54
2012
@@ -309,8 +309,7 @@
        This parameter points to the root of your dynamic resources, usually the same dir
                        as the root of your web application.
    </li>
-   <li><b>facelets.RESOURCE_RESOLVER</b> also needs to be set to <b>org.apache.myfaces.extensions.scripting.jsf.facelet.
-   ReroutingResourceResolver</b> if
+   <li><b>facelets.RESOURCE_RESOLVER</b> also needs to be set to <b>org.apache.myfaces.extensions.scripting.jsf.facelet.ReroutingResourceResolver</b>
if
    you want dynamic Facelet reloading enabled</li>
 </ul>
     <!-- ======================================================================================

Added: myfaces/extensions/scripting/trunk/src/site/mdtext/mojarra.mdtext
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/src/site/mdtext/mojarra.mdtext?rev=1414715&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/src/site/mdtext/mojarra.mdtext (added)
+++ myfaces/extensions/scripting/trunk/src/site/mdtext/mojarra.mdtext Wed Nov 28 14:14:54
2012
@@ -0,0 +1,126 @@
+<!--
+    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.
+-->
+ 
+ 
+#General Information
+ As of Ext-Scripting 1.0.5 basic Mojarra support has been implemented.
+ For now not the entire spectrum of services Ext-Scripting provides are enabled for Mojarra
+ but basic Ext-Scripting works out of the box.
+ Following compatibility diagram shows what
+ is provided for Mojarra and what is provided for MyFaces.
+ ![](images/mojarra-support.jpg)
+ Image: Mojarra compatibility
+ 
+#Setup Steps
+ The setup is fairly straight forward.
+ 
+ Add the support jars (extscript-mojarra-bundle.jar) and setup your loader paths
+ just like you would do it for MyFaces.
+ The main difference is setting up the loader paths for Mojarra is mandatory.
+ 
+ The mandatory loader paths are needed to avoid conflicts with Mojarras internal Groovy
+ support which utilizes the same paths. (This was a design decision to keep Mojarra compatibility
+ at a time Mojarra support was not really under discussion)
+ So here is an example configuration for Mojarra:
+
+    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+             version="3.0">
+          <!-- ======================================================================================
+                Loader path for Groovy files
+             ======================================================================================
-->
+        <context-param>
+            <description>Additional comma separated loader paths to allow direct editing
on the sources directory instead
+                of the deployment dir
+            </description>
+            <param-name>org.apache.myfaces.extensions.scripting.groovy.LOADER_PATHS</param-name>
+            <param-value>
+                /Users/werpu2/development/workspace/extensions-scripting3/examples/myfaces20-example/src/main/webapp/WEB-INF/groovy
+            </param-value>
+        </context-param>
+        <!-- ======================================================================================
+                Optional Loader Paths for Java Source Files
+             ======================================================================================
-->
+        <context-param>
+            <description>Additional comma separated loader paths to allow direct editing
on the sources directory instead
+                of the deployment dir
+            </description>
+            <param-name>org.apache.myfaces.extensions.scripting.java.LOADER_PATHS</param-name>
+            <param-value>
+                /Users/werpu2/development/workspace/extensions-scripting3/examples/myfaces20-example/src/main/webapp/WEB-INF/java
+            </param-value>
+        </context-param>
+        <!-- ======================================================================================
+                Loader path for Scala files
+             ======================================================================================
-->
+        <context-param>
+            <description>Additional comma separated loader paths to allow direct editing
on the sources directory instead
+                of the deployment dir
+            </description>
+            <param-name>org.apache.myfaces.extensions.scripting.scala.LOADER_PATHS</param-name>
+            <param-value>
+                /Users/werpu2/development/workspace/extensions-scripting3/examples/myfaces20-example/src/main/webapp/WEB-INF/scala
+            </param-value>
+        </context-param>
+        <!-- ======================================================================================
+                Optional Loader Paths for resource files
+             ======================================================================================
-->
+        <context-param>
+            <description>resource paths for our custom JSF2 resource resolver</description>
+            <param-name>org.apache.myfaces.extensions.scripting.resources.LOADER_PATHS</param-name>
+            <param-value>
+                /Users/werpu2/development/workspace/extensions-scripting3/examples/myfaces20-example/src/main/webapp
+            </param-value>
+        </context-param>
+        <!-- ======================================================================================
+                Optional: Tell Facelets to load the resources from your source dir
+             ======================================================================================
-->
+        <context-param>
+            <description>a redirecting Facelet resource resolver which allows to pick
up templates and resources from our
+                source dir
+            </description>
+            <param-name>facelets.RESOURCE_RESOLVER</param-name>
+            <param-value>org.apache.myfaces.extensions.scripting.jsf.facelet.ReroutingResourceResolver</param-value>
+        </context-param>
+        <!-- ======================================================================================
+                Optional: Whitelist of root packages where your sources should come from
+             ======================================================================================
-->
+        <context-param>
+            <description>a comma separated whitelist of root packages which are compiled
those and nothing else
+                will be compiled during all compile stages, all other files stay permanently
as they are
+            </description>
+            <param-name>org.apache.myfaces.extensions.scripting.PGK_WHITELIST</param-name>
+            <param-value>org.apache.myfaces.groovyloader.blog,org.apache.myfaces.javaloader.blog</param-value>
+        </context-param>
+        <!-- ======================================================================================
+                Optional Additional Classpath
+             ======================================================================================
-->
+        <context-param>
+            <description>
+                Additional Classpaths which will be added to the compilers classpath
+            </description>
+            <param-name>org.apache.myfaces.extensions.scripting.PGK_ADDITIONAL_CLASSPATH</param-name>
+            <param-value>/usr/lib/java/myjar.jar,/usr/lib/java/myjar2.jar</param-value>
+        </context-param>
+        ... faces config entries
+    </webapp>
+                
+ 
+ 

Added: myfaces/extensions/scripting/trunk/src/site/resources/images/mojarra-support.jpg
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/src/site/resources/images/mojarra-support.jpg?rev=1414715&view=auto
==============================================================================
Files myfaces/extensions/scripting/trunk/src/site/resources/images/mojarra-support.jpg (added)
and myfaces/extensions/scripting/trunk/src/site/resources/images/mojarra-support.jpg Wed Nov
28 14:14:54 2012 differ

Added: myfaces/extensions/scripting/trunk/src/site/xdoc/mojarra.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/src/site/xdoc/mojarra.xml?rev=1414715&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/src/site/xdoc/mojarra.xml (added)
+++ myfaces/extensions/scripting/trunk/src/site/xdoc/mojarra.xml Wed Nov 28 14:14:54 2012
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+    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.
+
+-->
+<document>
+    <properties>
+        <title>Using Ext-Scripting with Mojarra</title>
+    </properties>
+
+    <body>
+        <section name="General Information">
+            As of Ext-Scripting 1.0.5 basic Mojarra support has been implemented.
+            For now not the entire spectrum of services Ext-Scripting provides are enabled
for Mojarra
+            but basic Ext-Scripting works out of the box.
+            Following compatibility diagram shows what
+            is provided for Mojarra and what is provided for MyFaces.
+            <center><img src="images/mojarra-support.jpg" /></center>
+            Image: Mojarra compatibility
+        </section>
+
+
+        <section name="Setup Steps">
+            The setup is fairly straight forward.
+            <p/>
+            Add the support jars (extscript-mojarra-bundle.jar) and setup your loader paths
+            just like you would do it for MyFaces.
+            The main difference is setting up the loader paths for Mojarra is <b>mandatory</b>.
+            <p/>
+            The mandatory loader paths are needed to avoid conflicts with Mojarras internal
Groovy
+            support which utilizes the same paths. (This was a design decision to keep Mojarra
compatibility
+            at a time Mojarra support was not really under discussion)
+
+            So here is an example configuration for Mojarra:
+            <source><![CDATA[
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+         version="3.0">
+
+      <!-- ======================================================================================
+            Loader path for Groovy files
+         ======================================================================================
-->
+    <context-param>
+        <description>Additional comma separated loader paths to allow direct editing
on the sources directory instead
+            of the deployment dir
+        </description>
+        <param-name>org.apache.myfaces.extensions.scripting.groovy.LOADER_PATHS</param-name>
+        <param-value>
+            /Users/werpu2/development/workspace/extensions-scripting3/examples/myfaces20-example/src/main/webapp/WEB-INF/groovy
+        </param-value>
+    </context-param>
+
+    <!-- ======================================================================================
+            Optional Loader Paths for Java Source Files
+         ======================================================================================
-->
+    <context-param>
+        <description>Additional comma separated loader paths to allow direct editing
on the sources directory instead
+            of the deployment dir
+        </description>
+        <param-name>org.apache.myfaces.extensions.scripting.java.LOADER_PATHS</param-name>
+        <param-value>
+            /Users/werpu2/development/workspace/extensions-scripting3/examples/myfaces20-example/src/main/webapp/WEB-INF/java
+        </param-value>
+    </context-param>
+    <!-- ======================================================================================
+            Loader path for Scala files
+         ======================================================================================
-->
+    <context-param>
+        <description>Additional comma separated loader paths to allow direct editing
on the sources directory instead
+            of the deployment dir
+        </description>
+        <param-name>org.apache.myfaces.extensions.scripting.scala.LOADER_PATHS</param-name>
+        <param-value>
+            /Users/werpu2/development/workspace/extensions-scripting3/examples/myfaces20-example/src/main/webapp/WEB-INF/scala
+        </param-value>
+    </context-param>
+
+    <!-- ======================================================================================
+            Optional Loader Paths for resource files
+         ======================================================================================
-->
+    <context-param>
+        <description>resource paths for our custom JSF2 resource resolver</description>
+        <param-name>org.apache.myfaces.extensions.scripting.resources.LOADER_PATHS</param-name>
+        <param-value>
+            /Users/werpu2/development/workspace/extensions-scripting3/examples/myfaces20-example/src/main/webapp
+        </param-value>
+    </context-param>
+
+    <!-- ======================================================================================
+            Optional: Tell Facelets to load the resources from your source dir
+         ======================================================================================
-->
+    <context-param>
+        <description>a redirecting Facelet resource resolver which allows to pick up
templates and resources from our
+            source dir
+        </description>
+        <param-name>facelets.RESOURCE_RESOLVER</param-name>
+        <param-value>org.apache.myfaces.extensions.scripting.jsf.facelet.ReroutingResourceResolver</param-value>
+    </context-param>
+
+    <!-- ======================================================================================
+            Optional: Whitelist of root packages where your sources should come from
+         ======================================================================================
-->
+    <context-param>
+        <description>a comma separated whitelist of root packages which are compiled
those and nothing else
+            will be compiled during all compile stages, all other files stay permanently
as they are
+        </description>
+        <param-name>org.apache.myfaces.extensions.scripting.PGK_WHITELIST</param-name>
+        <param-value>org.apache.myfaces.groovyloader.blog,org.apache.myfaces.javaloader.blog</param-value>
+    </context-param>
+
+    <!-- ======================================================================================
+            Optional Additional Classpath
+         ======================================================================================
-->
+    <context-param>
+        <description>
+            Additional Classpaths which will be added to the compilers classpath
+        </description>
+        <param-name>org.apache.myfaces.extensions.scripting.PGK_ADDITIONAL_CLASSPATH</param-name>
+        <param-value>/usr/lib/java/myjar.jar,/usr/lib/java/myjar2.jar</param-value>
+    </context-param>
+
+
+    ... faces config entries
+</webapp>
+            ]]></source>
+
+
+
+        </section>
+
+    </body>
+</document>
\ No newline at end of file



Mime
View raw message