You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2010/06/28 11:55:27 UTC
svn commit: r958524 - in /myfaces/extensions/scripting/trunk: ./
extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/api/
extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core...
Author: werpu
Date: Mon Jun 28 09:55:26 2010
New Revision: 958524
URL: http://svn.apache.org/viewvc?rev=958524&view=rev
Log:
https://issues.apache.org/jira/browse/EXTSCRIPT-135
save also ongoing work on the eventing system
Added:
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ClassTaintedEvent.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEvent.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEventListener.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEventRegistry.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/RecompileRecommended.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ScanRecommended.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/SystemInitializedEvent.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/UpdateConfigurationRecommended.java
myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestResourceHandler.java
myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/
myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/HelloWorldBacking.java (contents, props changed)
- copied, changed from r939652, myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/HelloWorldBacking.java
myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/SpringBean.java (contents, props changed)
- copied, changed from r939652, myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/SpringBean.java
Removed:
myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/HelloWorldBacking.java
myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/SpringBean.java
Modified:
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/api/BaseWeaver.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/api/ScriptingConst.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/util/WeavingContext.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/util/WeavingContextInitializer.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/refresh/RefreshContext.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/servlet/CustomChainLoader.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/servlet/StartupServletContextPluginChainLoader.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces12-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ResourceHandlerProxy.java
myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/resources/META-INF/faces-config.xml
myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/faces-config.xml
myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/test/TestResourceHandler.groovy
myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/JavaTestBeanReplacement.java
myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean2.java
myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean4.java
myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml
myfaces/extensions/scripting/trunk/extscript-examples/pom.xml
myfaces/extensions/scripting/trunk/extscript-examples/spring-example/pom.xml
myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/applicationContext.xml
myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/faces-config.xml
myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovy/GroovyBean.groovy
myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/web.xml
myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/helloWorld.xhtml
myfaces/extensions/scripting/trunk/pom.xml
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/api/BaseWeaver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/api/BaseWeaver.java?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/api/BaseWeaver.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/api/BaseWeaver.java Mon Jun 28 09:55:26 2010
@@ -380,18 +380,26 @@ public abstract class BaseWeaver impleme
}
protected boolean isFullyRecompiled() {
- FacesContext context = FacesContext.getCurrentInstance();
- return context != null && context.getExternalContext().getRequestMap().containsKey(this.getClass().getName() + "_recompiled");
+ try {
+ FacesContext context = FacesContext.getCurrentInstance();
+ return context != null && context.getExternalContext().getRequestMap().containsKey(this.getClass().getName() + "_recompiled");
+ } catch (UnsupportedOperationException ex) {
+ //still in startup
+ return false;
+ }
}
public void markAsFullyRecompiled() {
- FacesContext context = FacesContext.getCurrentInstance();
- if (context != null) {
- //mark the request as tainted with recompile
- Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
- requestMap.put(this.getClass().getName() + "_recompiled", Boolean.TRUE);
+ try {
+ FacesContext context = FacesContext.getCurrentInstance();
+ if (context != null) {
+ //mark the request as tainted with recompile
+ Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
+ requestMap.put(this.getClass().getName() + "_recompiled", Boolean.TRUE);
+ }
+ WeavingContext.getRefreshContext().setRecompileRecommended(getScriptingEngine(), Boolean.FALSE);
+ } catch (UnsupportedOperationException ex) {
}
- WeavingContext.getRefreshContext().setRecompileRecommended(getScriptingEngine(), Boolean.FALSE);
}
/**
@@ -471,6 +479,8 @@ public abstract class BaseWeaver impleme
fullRecompile();
//we update our dependencies and annotation info prior to going
//into the refresh cycle
+
+
fullClassScan();
}
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/api/ScriptingConst.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/api/ScriptingConst.java?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/api/ScriptingConst.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/api/ScriptingConst.java Mon Jun 28 09:55:26 2010
@@ -90,6 +90,7 @@ public class ScriptingConst {
public static final String CTX_ATTR_STARTUP = "ExtScriptingStartup";
public static final String CTX_ATTR_SCRIPTING_WEAVER = "ScriptingWeaver";
public static final String CTX_ATTR_REFRESH_CONTEXT = "RefreshContext";
+ public static final String CTX_ATTR_EXTENSION_EVENT_SYSTEM = "ExtEventSystem";
public static final String FILE_EXTENSION_GROOVY = ".groovy";
public static final String GROOVY_FILE_ENDING = ".groovy";
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/util/WeavingContext.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/util/WeavingContext.java?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/util/WeavingContext.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/util/WeavingContext.java Mon Jun 28 09:55:26 2010
@@ -24,6 +24,7 @@ import org.apache.myfaces.extensions.scr
import org.apache.myfaces.extensions.scripting.refresh.FileChangedDaemon;
import org.apache.myfaces.extensions.scripting.refresh.RefreshContext;
import org.apache.myfaces.extensions.scripting.api.CompilationResult;
+import org.apache.myfaces.extensions.scripting.sandbox.extensionevents.ExtensionEventRegistry;
import javax.servlet.ServletContext;
import java.lang.reflect.InvocationHandler;
@@ -62,6 +63,7 @@ public class WeavingContext {
static final protected ThreadLocal<Object> _refreshContextHolder = new ThreadLocal<Object>();
static final protected ThreadLocal<Object> _configuration = new ThreadLocal<Object>();
static final protected ThreadLocal<Object> _externalContext = new ThreadLocal<Object>();
+ static final protected ThreadLocal<Object> _extensionEventSystem = new ThreadLocal<Object>();
private static final String WARN_WEAVER_NOT_SET = "[EXT-SCRIPTING] Scripting Weaver is not set. Disabling script reloading subsystem. Make sure you have the scripting servlet filter enabled in your web.xml";
@@ -92,6 +94,7 @@ public class WeavingContext {
WeavingContext.setWeaver(context.getAttribute(ScriptingConst.CTX_ATTR_SCRIPTING_WEAVER));
WeavingContext.setRefreshContext((RefreshContext) context.getAttribute(ScriptingConst.CTX_ATTR_REFRESH_CONTEXT));
WeavingContext.setConfiguration((Configuration) context.getAttribute(ScriptingConst.CTX_ATTR_CONFIGURATION));
+ WeavingContext.setExtensionEventRegistry((ExtensionEventRegistry)context.getAttribute(ScriptingConst.CTX_ATTR_EXTENSION_EVENT_SYSTEM));
WeavingContext.setExternalContext(context);
}
@@ -134,6 +137,14 @@ public class WeavingContext {
_configuration.set(configuration);
}
+ public static void setExtensionEventRegistry(ExtensionEventRegistry reg) {
+ _extensionEventSystem.set(reg);
+ }
+
+ public static ExtensionEventRegistry getExtensionEventRegistry() {
+ return (ExtensionEventRegistry) _extensionEventSystem.get();
+ }
+
/**
* the weavers are set from outside
* we have to provide the weaver facade
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/util/WeavingContextInitializer.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/util/WeavingContextInitializer.java?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/util/WeavingContextInitializer.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/core/util/WeavingContextInitializer.java Mon Jun 28 09:55:26 2010
@@ -29,6 +29,7 @@ import org.apache.myfaces.extensions.scr
import org.apache.myfaces.extensions.scripting.loaders.java.RecompiledClassLoader;
import org.apache.myfaces.extensions.scripting.refresh.FileChangedDaemon;
import org.apache.myfaces.extensions.scripting.refresh.RefreshContext;
+import org.apache.myfaces.extensions.scripting.sandbox.extensionevents.ExtensionEventRegistry;
import org.apache.myfaces.extensions.scripting.servlet.ScriptingServletFilter;
import javax.servlet.ServletContext;
@@ -76,6 +77,7 @@ public class WeavingContextInitializer {
WeavingContext.setScriptingEnabled(true);
validateWebXml(servletContext);
initConfiguration(servletContext);
+ initExtensionEventSystem(servletContext);
validateSecurityConstraints();
initWeavers(servletContext);
validateSourcePaths();
@@ -130,6 +132,14 @@ public class WeavingContextInitializer {
WeavingContext.getRefreshContext().setDaemon(FileChangedDaemon.getInstance());
}
+ private static void initExtensionEventSystem(ServletContext servletContext) {
+ ExtensionEventRegistry registry = new ExtensionEventRegistry();
+ servletContext.setAttribute(ScriptingConst.CTX_ATTR_EXTENSION_EVENT_SYSTEM, registry);
+ }
+
+
+
+
private static void initConfiguration(ServletContext servletContext) {
final Configuration configuration = new Configuration();
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/refresh/RefreshContext.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/refresh/RefreshContext.java?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/refresh/RefreshContext.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/refresh/RefreshContext.java Mon Jun 28 09:55:26 2010
@@ -246,22 +246,31 @@ public class RefreshContext {
}
public boolean isDependencyScanned(int scriptingEngine) {
- FacesContext ctx = FacesContext.getCurrentInstance();
- if (ctx == null) {
+ try {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ if (ctx == null) {
+ return false;
+ }
+ Map<String, Object> requestMap = (Map<String, Object>) ctx.getExternalContext().getRequestMap();
+ Boolean retVal = (Boolean) requestMap.get("isDependencyScanned_" + scriptingEngine);
+ return (retVal == null) ? false : retVal;
+ } catch (UnsupportedOperationException ex) {
+ //still in startup
return false;
}
- Map<String, Object> requestMap = (Map<String, Object>) ctx.getExternalContext().getRequestMap();
- Boolean retVal = (Boolean) requestMap.get("isDependencyScanned_" + scriptingEngine);
- return (retVal == null) ? false : retVal;
}
public void setDependencyScanned(int scriptingEngine, Boolean val) {
- FacesContext ctx = FacesContext.getCurrentInstance();
- if (ctx == null) {
- return;
+ try {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ if (ctx == null) {
+ return;
+ }
+ Map<String, Object> requestMap = (Map<String, Object>) ctx.getExternalContext().getRequestMap();
+ requestMap.put("isDependencyScanned_" + scriptingEngine, val);
+ } catch (UnsupportedOperationException ex) {
+ //still in startup
}
- Map<String, Object> requestMap = (Map<String, Object>) ctx.getExternalContext().getRequestMap();
- requestMap.put("isDependencyScanned_" + scriptingEngine, val);
}
public FileChangedDaemon getDaemon() {
Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ClassTaintedEvent.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ClassTaintedEvent.java?rev=958524&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ClassTaintedEvent.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ClassTaintedEvent.java Mon Jun 28 09:55:26 2010
@@ -0,0 +1,44 @@
+/*
+ * 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.sandbox.extensionevents;
+
+import org.apache.myfaces.extensions.scripting.refresh.ReloadingMetadata;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class ClassTaintedEvent extends ExtensionEvent{
+ ReloadingMetadata metaData;
+
+ public ClassTaintedEvent( ReloadingMetadata metaData) {
+ super(4);
+ this.metaData = metaData;
+ }
+
+ public ReloadingMetadata getMetaData() {
+ return metaData;
+ }
+
+ public void setMetaData(ReloadingMetadata metaData) {
+ this.metaData = metaData;
+ }
+}
Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEvent.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEvent.java?rev=958524&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEvent.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEvent.java Mon Jun 28 09:55:26 2010
@@ -0,0 +1,55 @@
+/*
+ * 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.sandbox.extensionevents;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ *
+ * Extension event class.
+ *
+ * The idea is that extensions attach themselves
+ * over an event/messaging system to achieve loose coupling
+ * between the core and an extension.
+ *
+ * Extensions will get following events.
+ *
+ * ScanRecommended
+ * CompileRecommended (for their own compilation directories)
+ * UpdateConfigurationRecommended
+ *
+ */
+
+public class ExtensionEvent {
+
+ int eventIdentifier;
+
+ public ExtensionEvent(int eventIdentifier) {
+ this.eventIdentifier = eventIdentifier;
+ }
+
+ public int getEventIdentifier() {
+ return eventIdentifier;
+ }
+
+ public void setEventIdentifier(int eventIdentifier) {
+ this.eventIdentifier = eventIdentifier;
+ }
+}
Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEventListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEventListener.java?rev=958524&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEventListener.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEventListener.java Mon Jun 28 09:55:26 2010
@@ -0,0 +1,29 @@
+package org.apache.myfaces.extensions.scripting.sandbox.extensionevents;
+
+import java.util.List;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ * <p/>
+ * Central external listener interface for the extension events
+ */
+public interface ExtensionEventListener {
+
+ /**
+ * The central event handling callback which gets
+ * the callback back
+ *
+ * @param ev
+ */
+ public void handleEvent(ExtensionEvent ev);
+
+ /**
+ * returns the event idenitifiers this listener
+ * is a listener for (additional hints which will speed up the event handling)
+ *
+ * @return
+ */
+ public List<Integer> listenerFor();
+
+}
Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEventRegistry.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEventRegistry.java?rev=958524&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEventRegistry.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ExtensionEventRegistry.java Mon Jun 28 09:55:26 2010
@@ -0,0 +1,53 @@
+/*
+ * 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.sandbox.extensionevents;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class ExtensionEventRegistry {
+
+ Collection<ExtensionEventListener> _listeners = new ConcurrentLinkedQueue<ExtensionEventListener>();
+
+ public void addListener(ExtensionEventListener listener) {
+ _listeners.add(listener);
+ }
+
+ public void removeListener(ExtensionEvent listener) {
+ _listeners.remove(listener);
+ }
+
+ public void clear() {
+ _listeners.clear();
+ }
+
+ public void sendEvent(ExtensionEvent evt) {
+ for (ExtensionEventListener listener : _listeners) {
+ listener.handleEvent(evt);
+ }
+ }
+
+}
Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/RecompileRecommended.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/RecompileRecommended.java?rev=958524&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/RecompileRecommended.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/RecompileRecommended.java Mon Jun 28 09:55:26 2010
@@ -0,0 +1,31 @@
+/*
+ * 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.sandbox.extensionevents;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class RecompileRecommended extends ExtensionEvent {
+ public RecompileRecommended() {
+ super(1);
+ }
+}
Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ScanRecommended.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ScanRecommended.java?rev=958524&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ScanRecommended.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/ScanRecommended.java Mon Jun 28 09:55:26 2010
@@ -0,0 +1,34 @@
+/*
+ * 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.sandbox.extensionevents;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class ScanRecommended extends ExtensionEvent {
+
+ public ScanRecommended() {
+ super(0);
+ }
+
+
+}
Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/SystemInitializedEvent.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/SystemInitializedEvent.java?rev=958524&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/SystemInitializedEvent.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/SystemInitializedEvent.java Mon Jun 28 09:55:26 2010
@@ -0,0 +1,31 @@
+/*
+ * 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.sandbox.extensionevents;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class SystemInitializedEvent extends ExtensionEvent {
+ public SystemInitializedEvent(int eventIdentifier) {
+ super(5);
+ }
+}
Added: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/UpdateConfigurationRecommended.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/UpdateConfigurationRecommended.java?rev=958524&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/UpdateConfigurationRecommended.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/sandbox/extensionevents/UpdateConfigurationRecommended.java Mon Jun 28 09:55:26 2010
@@ -0,0 +1,32 @@
+/*
+ * 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.sandbox.extensionevents;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class UpdateConfigurationRecommended extends ExtensionEvent {
+ public UpdateConfigurationRecommended() {
+ super(2);
+ }
+}
+
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/servlet/CustomChainLoader.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/servlet/CustomChainLoader.java?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/servlet/CustomChainLoader.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/servlet/CustomChainLoader.java Mon Jun 28 09:55:26 2010
@@ -44,7 +44,7 @@ public class CustomChainLoader extends C
public CustomChainLoader(ServletContext servletContext) {
_scriptingWeaver = WeavingContext.getWeaver();
}
-
+
public Class forName(String name) {
if(_scriptingWeaver == null || name == null) {
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/servlet/StartupServletContextPluginChainLoader.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/servlet/StartupServletContextPluginChainLoader.java?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/servlet/StartupServletContextPluginChainLoader.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/servlet/StartupServletContextPluginChainLoader.java Mon Jun 28 09:55:26 2010
@@ -66,7 +66,8 @@ public class StartupServletContextPlugin
private void initCompileAndScan() {
if (WeavingContext.isScriptingEnabled()) {
_log.info("[EXT-SCRIPTING] Compiling all sources for the first time");
- WeavingContext.getWeaver().postStartupActions();
+ //WeavingContext.getWeaver().postStartupActions();
+ WeavingContext.getWeaver().fullRecompile();
}
}
@@ -94,6 +95,7 @@ public class StartupServletContextPlugin
public void postInit(ServletContextEvent evt) {
//tell the system that the startup phase is done
+ WeavingContext.getWeaver().fullClassScan();
evt.getServletContext().setAttribute(ScriptingConst.CTX_ATTR_STARTUP, new AtomicBoolean(Boolean.FALSE));
}
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces12-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces12-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces12-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces12-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java Mon Jun 28 09:55:26 2010
@@ -95,13 +95,17 @@ public class RenderkitProxy extends Rend
}
private final boolean alreadyWovenInRequest(String clazz) {
- //portlets now can be enabled thanks to the jsf2 indirections regarding the external context
- ServletRequest req = (ServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
- if (req.getAttribute(ScriptingConst.SCRIPTING_REQUSINGLETON + clazz) == null) {
- req.setAttribute(ScriptingConst.SCRIPTING_REQUSINGLETON + clazz, "");
- return false;
+ try {//portlets now can be enabled thanks to the jsf2 indirections regarding the external context
+ ServletRequest req = (ServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
+ if (req.getAttribute(ScriptingConst.SCRIPTING_REQUSINGLETON + clazz) == null) {
+ req.setAttribute(ScriptingConst.SCRIPTING_REQUSINGLETON + clazz, "");
+ return false;
+ }
+ return true;
+ } catch(UnsupportedOperationException ex) {
+ //still in startup no additional weaving here
+ return true;
}
- return true;
}
}
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ELResolverProxy.java Mon Jun 28 09:55:26 2010
@@ -99,10 +99,6 @@ public class ELResolverProxy extends ELR
_delegate = delegate;
}
- public ELResolverProxy() {
-
- }
-
public Object getDelegate() {
return _delegate; //To change body of implemented methods use File | Settings | File Templates.
}
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/RenderkitProxy.java Mon Jun 28 09:55:26 2010
@@ -56,7 +56,7 @@ public class RenderkitProxy extends Rend
weaveDelegate();
//wo do it brute force here because we have sometimes casts and hence cannot rely on proxies
//renderers itself are flyweight patterns which means they are shared over objects
-
+
renderer = (Renderer) reloadInstance(renderer, ScriptingConst.ARTIFACT_TYPE_RENDERER);
_delegate.addRenderer(componentFamily, rendererType, renderer);
@@ -78,7 +78,6 @@ public class RenderkitProxy extends Rend
return rendr;
}
-
private ClientBehaviorRenderer handleAnnotationChangeBehaviorRenderer(String s) {
ClientBehaviorRenderer rendr2;
@@ -117,7 +116,6 @@ public class RenderkitProxy extends Rend
return (ResponseStream) reloadInstance(_delegate.createResponseStream(outputStream), ScriptingConst.ARTIFACT_TYPE_RESPONSESTREAM);
}
-
@Override
public void addClientBehaviorRenderer(String s, ClientBehaviorRenderer renderer) {
@@ -182,13 +180,19 @@ public class RenderkitProxy extends Rend
}
private boolean alreadyWovenInRequest(String clazz) {
- //portlets now can be enabled thanks to the jsf2 indirections regarding the external context
- Map<String, Object> req = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
- if (req.get(ScriptingConst.SCRIPTING_REQUSINGLETON + clazz) == null) {
- req.put(ScriptingConst.SCRIPTING_REQUSINGLETON + clazz, "");
- return false;
+ try {//portlets now can be enabled thanks to the jsf2 indirections regarding the external context
+
+ //portlets now can be enabled thanks to the jsf2 indirections regarding the external context
+ Map<String, Object> req = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
+ if (req.get(ScriptingConst.SCRIPTING_REQUSINGLETON + clazz) == null) {
+ req.put(ScriptingConst.SCRIPTING_REQUSINGLETON + clazz, "");
+ return false;
+ }
+ return true;
+ } catch (UnsupportedOperationException ex) {
+ //still in startup no additional weaving here
+ return true;
}
- return true;
}
}
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ResourceHandlerProxy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ResourceHandlerProxy.java?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ResourceHandlerProxy.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/java/org/apache/myfaces/extensions/scripting/jsf/dynamicdecorators/implemetations/ResourceHandlerProxy.java Mon Jun 28 09:55:26 2010
@@ -28,6 +28,16 @@ import javax.faces.context.FacesContext;
/**
* @author Werner Punz (latest modification by $Author$)
* @version $Revision$ $Date$
+ *
+ * Problem the resource request is issued on servlet level before
+ * our compile triggers can trigger from the phase listener
+ * this is evil
+ *
+ * We probably have to reissue the compile from the resource handler
+ * directly upfront :-( or mark the resource handler as something like double tainted!
+ *
+ * This problem will resolve itself with async compile
+ *
*/
public class ResourceHandlerProxy extends ResourceHandler {
@@ -61,12 +71,14 @@ public class ResourceHandlerProxy extend
weaveDelegate();
_delegate.handleResourceRequest(context);
}
-
+
public boolean isResourceRequest(FacesContext context) {
+ weaveDelegate();
return _delegate.isResourceRequest(context);
}
public boolean libraryExists(String libraryName) {
+ weaveDelegate();
return _delegate.libraryExists(libraryName);
}
Modified: myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/resources/META-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/resources/META-INF/faces-config.xml?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/resources/META-INF/faces-config.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-core-root/extscript-myfaces2-extensions/src/main/resources/META-INF/faces-config.xml Mon Jun 28 09:55:26 2010
@@ -25,6 +25,7 @@
<lifecycle>
<phase-listener>org.apache.myfaces.extensions.scripting.jsf.RefreshPhaseListener</phase-listener>
+
</lifecycle>
<component>
@@ -49,7 +50,6 @@
<renderer-type>org.apache.myfaces.extensions.scripting.components.TaintHistoryRenderer</renderer-type>
<renderer-class>org.apache.myfaces.extensions.scripting.components.TaintHistoryRenderer</renderer-class>
</renderer>
-
</render-kit>
@@ -58,25 +58,31 @@
all these factories are replacements for the normal ones
issue is we have to make a codeweaving for every bean created
-->
+
<application-factory>
org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.factories.ScriptingApplicationFactory
</application-factory>
+
<faces-context-factory>
org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.factories.ScriptingFacesContextFactory
</faces-context-factory>
+
+
<lifecycle-factory>
org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.factories.ScriptingLifecycleFactory
</lifecycle-factory>
+
<render-kit-factory>
org.apache.myfaces.extensions.scripting.jsf.dynamicdecorators.factories.ScriptingRenderkitFactory
</render-kit-factory>
+
<tag-handler-delegate-factory>
org.apache.myfaces.extensions.scripting.facelet.TagHandlerDelegateFactoryImpl
</tag-handler-delegate-factory>
-
</factory>
+
<!--
<application>
Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/faces-config.xml?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/faces-config.xml Mon Jun 28 09:55:26 2010
@@ -122,8 +122,8 @@
<system-event-listener-class>org.apache.myfaces.javaloader.eventTest.TestListener</system-event-listener-class>
<system-event-class>javax.faces.event.PreRenderViewEvent</system-event-class>
</system-event-listener>
- <!--
- <resource-handler>org.apache.myfaces.groovyloader.test.TestResourceHandler</resource-handler>
- -->
+
+ <resource-handler>org.apache.myfaces.javaloader.test.TestResourceHandler</resource-handler>
+
</application>
</faces-config>
\ No newline at end of file
Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/test/TestResourceHandler.groovy
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/test/TestResourceHandler.groovy?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/test/TestResourceHandler.groovy (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/test/TestResourceHandler.groovy Mon Jun 28 09:55:26 2010
@@ -11,7 +11,7 @@ import javax.faces.application.Resource
*/
public class TestResourceHandler extends ResourceHandler {
- TestResourceHandler _delegate
+ ResourceHandler _delegate
public TestResourceHandler(delegate) {
_delegate = delegate;
@@ -51,11 +51,11 @@ public class TestResourceHandler extends
}
- public TestResourceHandler getDelegate() {
+ public ResourceHandler getDelegate() {
return _delegate
}
- public void setDelegate(TestResourceHandler delegate) {
+ public void setDelegate(ResourceHandler delegate) {
_delegate = delegate
}
}
\ No newline at end of file
Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/JavaTestBeanReplacement.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/JavaTestBeanReplacement.java?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/JavaTestBeanReplacement.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/JavaTestBeanReplacement.java Mon Jun 28 09:55:26 2010
@@ -29,6 +29,7 @@ import javax.faces.event.ComponentSystem
* @version $Revision$ $Date$
*/
+
public class JavaTestBeanReplacement {
Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean2.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean2.java?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean2.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean2.java Mon Jun 28 09:55:26 2010
@@ -27,6 +27,7 @@ import javax.faces.event.ComponentSystem
import javax.el.ELContext;
+
@ManagedBean(name = "javatestbean")
@RequestScoped
public class TestBean2 {
Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean4.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean4.java?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean4.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean4.java Mon Jun 28 09:55:26 2010
@@ -26,7 +26,7 @@ import javax.faces.bean.SessionScoped;
public class TestBean4 {
- private String hello = "Hello world from test bean 4";
+ private String hello = "Hello world from test Bean 4";
public String getHello() {
return hello;
Added: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestResourceHandler.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestResourceHandler.java?rev=958524&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestResourceHandler.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestResourceHandler.java Mon Jun 28 09:55:26 2010
@@ -0,0 +1,96 @@
+/*
+ * 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.javaloader.test;
+
+import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
+import javax.faces.context.FacesContext;
+import java.io.IOException;
+import java.util.logging.Logger;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class TestResourceHandler extends ResourceHandler {
+
+ ResourceHandler _delegate;
+
+ Logger _logger = Logger.getLogger("TestResourceHandler");
+
+ public TestResourceHandler(ResourceHandler delegate) {
+ //bug in myfaces the resource handlers are attached twice
+ while(delegate instanceof TestResourceHandler) {
+ delegate = ((TestResourceHandler)delegate).getDelegate();
+ }
+ _delegate = delegate;
+ }
+
+ public TestResourceHandler() {
+ }
+
+ @Override
+ public Resource createResource(String resourceName) {
+ return _delegate.createResource(resourceName);
+ }
+
+ @Override
+ public Resource createResource(String resourceName, String libraryName) {
+ return _delegate.createResource(resourceName, libraryName);
+ }
+
+ @Override
+ public Resource createResource(String resourceName, String libraryName, String contentType) {
+ return _delegate.createResource(resourceName, libraryName, contentType);
+ }
+
+ @Override
+ public String getRendererTypeForResourceName(String resourceName) {
+ return _delegate.getRendererTypeForResourceName(resourceName);
+ }
+
+ @Override
+ public void handleResourceRequest(FacesContext context) throws IOException {
+ _delegate.handleResourceRequest(context);
+ }
+
+ @Override
+ public boolean isResourceRequest(FacesContext context) {
+ _logger.info("TestResourceHandler.isResourceRequest");
+
+ return _delegate.isResourceRequest(context);
+ }
+
+ @Override
+ public boolean libraryExists(String libraryName) {
+ return _delegate.libraryExists(libraryName);
+ }
+
+ //we have to expose the internal delegate because we have
+ //to copy it
+ public ResourceHandler getDelegate() {
+ return _delegate;
+ }
+
+ public void setDelegate(ResourceHandler delegate) {
+ _delegate = delegate;
+ }
+}
Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml Mon Jun 28 09:55:26 2010
@@ -122,11 +122,12 @@
/WEB-INF/facelets/groovy-taglib.xml;/WEB-INF/facelets/tomahawk.taglib.xml
</param-value>
</context-param>
+ <!--
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/faces-config.xml</param-value>
</context-param>
-
+ -->
<filter>
<filter-name>scriptingFilter</filter-name>
Modified: myfaces/extensions/scripting/trunk/extscript-examples/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/pom.xml?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/pom.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/pom.xml Mon Jun 28 09:55:26 2010
@@ -56,7 +56,6 @@
</build>
<modules>
<module>myfaces12-example</module>
- <module>myfaces20-example</module>
<module>spring-example</module>
</modules>
Modified: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/spring-example/pom.xml?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/spring-example/pom.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/spring-example/pom.xml Mon Jun 28 09:55:26 2010
@@ -13,6 +13,10 @@
<version>1.0-SNAPSHOT</version>
<url>http://www.apache.org</url>
+ <properties>
+ <spring.version>3.0.2.RELEASE</spring.version>
+ </properties>
+
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/myfaces/extensions/scripting/trunk/extscript-examples/spring-example</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/myfaces/extensions/scripting/trunk/extscript-examples/spring-example</developerConnection>
@@ -28,70 +32,70 @@
<dependency>
<groupId>org.apache.myfaces.extensions.scripting</groupId>
- <artifactId>extscript-core</artifactId>
- <version>1.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.myfaces.extensions.scripting</groupId>
- <artifactId>extscript-core-java6</artifactId>
- <version>1.0-SNAPSHOT</version>
- </dependency>
-
-
- <dependency>
- <groupId>org.apache.myfaces.extensions.scripting</groupId>
- <artifactId>extscript-myfaces12-extensions</artifactId>
+ <artifactId>extscript-myfaces20-bundle</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>${myfaces12.version}</version>
+ <version>${myfaces2.version}</version>
<scope>compile</scope>
</dependency>
+
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>${myfaces12.version}</version>
+ <version>${myfaces2.version}</version>
<scope>compile</scope>
</dependency>
+
<dependency>
- <groupId>javax.portlet</groupId>
- <artifactId>portlet-api</artifactId>
- <version>1.0</version>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.version}</version>
</dependency>
-
<dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <version>1.1.11</version>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${spring.version}</version>
</dependency>
- <!-- jstl because of facelets -->
<dependency>
- <groupId>jstl</groupId>
- <artifactId>jstl</artifactId>
- <version>1.2</version>
- <scope>runtime</scope>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${spring.version}</version>
</dependency>
-
+
<dependency>
- <groupId>org.apache.myfaces.tomahawk</groupId>
- <artifactId>tomahawk</artifactId>
- <version>1.1.6</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <artifactId>jstl</artifactId>
- <groupId>javax.servlet</groupId>
- </exclusion>
- </exclusions>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <version>2.7.7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <version>3.0.1</version>
</dependency>
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
- <version>2.5.6</version>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.6.8</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <version>1.6.8</version>
</dependency>
</dependencies>
</project>
Copied: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/HelloWorldBacking.java (from r939652, myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/HelloWorldBacking.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/HelloWorldBacking.java?p2=myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/HelloWorldBacking.java&p1=myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/HelloWorldBacking.java&r1=939652&r2=958524&rev=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/HelloWorldBacking.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/HelloWorldBacking.java Mon Jun 28 09:55:26 2010
@@ -16,15 +16,27 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces;
+package org.apache.myfaces.springTest;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
/**
* A typical simple backing bean, that is backed to <code>helloworld.jsp</code>
*
* @author <a href="mailto:matzew@apache.org">Matthias We�endorf</a>
*/
+@Component("helloWorldBacking")
+@Scope("session")
+@Lazy
public class HelloWorldBacking {
+ @Autowired
+ SpringBean springBean;
+
+
//properties
private String name;
@@ -44,11 +56,20 @@ public class HelloWorldBacking {
this.name = name;
}
+ public SpringBean getSpringBean() {
+ return springBean;
+ }
+
+ public void setSpringBean(SpringBean springBean) {
+ this.springBean = springBean;
+ }
+
/**
* Method that is backed to a submit button of a form.
*/
public String send() {
//do real logic
+ this.name = springBean.getValue();
return ("success");
}
}
\ No newline at end of file
Propchange: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/HelloWorldBacking.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/HelloWorldBacking.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Copied: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/SpringBean.java (from r939652, myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/SpringBean.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/SpringBean.java?p2=myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/SpringBean.java&p1=myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/SpringBean.java&r1=939652&r2=958524&rev=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/SpringBean.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/SpringBean.java Mon Jun 28 09:55:26 2010
@@ -1,5 +1,12 @@
-package org.apache.myfaces;
+package org.apache.myfaces.springTest;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+@Component("springBean")
+@Scope("request")
+@Lazy
public class SpringBean {
private String value = "hello world from the spring bean";
Propchange: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/SpringBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/java/org/apache/myfaces/springTest/SpringBean.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/applicationContext.xml?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/applicationContext.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/applicationContext.xml Mon Jun 28 09:55:26 2010
@@ -1,11 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:tx="http://www.springframework.org/schema/tx"
+ xmlns:p="http://www.springframework.org/schema/p"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
-
-
- <bean name="springBean" id="springBean" class="org.apache.myfaces.SpringBean" scope="request"/>
+ <context:component-scan base-package="org.apache.myfaces.springTest" scoped-proxy="targetClass"/>
+ <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
+
</beans>
\ No newline at end of file
Modified: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/faces-config.xml?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/faces-config.xml Mon Jun 28 09:55:26 2010
@@ -1,27 +1,40 @@
<?xml version="1.0"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ version="2.0">
-<!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd" >
-<faces-config>
-
- <application>
- <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
-
- <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
-
- </application>
<!-- managed beans of the simple hello world app -->
+ <!--
<managed-bean>
<managed-bean-name>helloWorldBacking</managed-bean-name>
<managed-bean-class>
- org.apache.myfaces.HelloWorldBacking
+ org.apache.myfaces.springTest.HelloWorldBacking
</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
-
+ -->
+ <!--
<managed-bean>
<managed-bean-name>groovyBean</managed-bean-name>
@@ -32,7 +45,8 @@
<value>#{springBean}</value>
</managed-property>
</managed-bean>
-
+ -->
+
<!-- navigation rules for helloWorld.jsp -->
<navigation-rule>
<from-view-id>/helloWorld.xhtml</from-view-id>
@@ -50,4 +64,8 @@
<to-view-id>/helloWorld.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
+
+ <application>
+ <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
+ </application>
</faces-config>
\ No newline at end of file
Modified: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovy/GroovyBean.groovy
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovy/GroovyBean.groovy?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovy/GroovyBean.groovy (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovy/GroovyBean.groovy Mon Jun 28 09:55:26 2010
@@ -1,6 +1,7 @@
package org.apache.myfaces.groovy
-import org.apache.myfaces.SpringBean;
+import org.apache.myfaces.springTest.SpringBean
+import org.apache.myfaces.springTest.SpringBean;
public class GroovyBean {
String value = "Hello world from the groovy bean"
Modified: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/web.xml?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/WEB-INF/web.xml Mon Jun 28 09:55:26 2010
@@ -61,7 +61,7 @@
of the deployment dir
</description>
<param-name>org.apache.myfaces.extensions.scripting.groovy.LOADER_PATHS</param-name>
- <param-value>D:/dev/work/ideaprojects/threads/extscript/examples/spring-example/src/main/webapp/WEB-INF/groovy
+ <param-value>/Users/werpu2/development/workspace/extension-scripting4/extscript-examples/spring-example/src/main/webapp/WEB-INF/groovy
</param-value>
</context-param>
@@ -70,7 +70,7 @@
of the deployment dir
</description>
<param-name>org.apache.myfaces.extensions.scripting.java.LOADER_PATHS</param-name>
- <param-value>D:/dev/work/ideaprojects/threads/extscript/examples/spring-example/src/main/webapp/WEB-INF/java
+ <param-value>/Users/werpu2/development/workspace/extension-scripting4/extscript-examples/spring-example/src/main/java
</param-value>
</context-param>
@@ -223,33 +223,7 @@
<!-- Extensions Filter -->
- <filter>
- <filter-name>extensionsFilter</filter-name>
- <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
- <init-param>
- <description>Set the size limit for uploaded files.
- Format: 10 - 10 bytes
- 10k - 10 KB
- 10m - 10 MB
- 1g - 1 GB
- </description>
- <param-name>uploadMaxFileSize</param-name>
- <param-value>100m</param-value>
- </init-param>
- <init-param>
- <description>Set the threshold size - files
- below this limit are stored in memory, files above
- this limit are stored on disk.
-
- Format: 10 - 10 bytes
- 10k - 10 KB
- 10m - 10 MB
- 1g - 1 GB
- </description>
- <param-name>uploadThresholdSize</param-name>
- <param-value>100k</param-value>
- </init-param>
- </filter>
+
<filter>
<filter-name>scriptingFilter</filter-name>
@@ -264,15 +238,6 @@
<dispatcher>ERROR</dispatcher>
</filter-mapping>
- <filter-mapping>
- <filter-name>extensionsFilter</filter-name>
- <url-pattern>*.jsf</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>extensionsFilter</filter-name>
- <url-pattern>/faces/*</url-pattern>
- </filter-mapping>
-
<!-- Listener, to allow Jetty serving MyFaces apps -->
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
Modified: myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/helloWorld.xhtml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/helloWorld.xhtml?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/helloWorld.xhtml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/spring-example/src/main/webapp/helloWorld.xhtml Mon Jun 28 09:55:26 2010
@@ -14,16 +14,18 @@
<h:form id="form">
<h:panelGrid id="grid" columns="2">
<h:outputText id="output1" value="Please enter your name"/>
+ <h:outputText id="input1x" value="#{helloWorldBacking.springBean.value}" />
<h:inputText id="input1" value="#{helloWorldBacking.name}"
required="true"/>
<h:commandButton id="button1" value="press me"
action="#{helloWorldBacking.send}"/>
<h:message id="message1" for="input1"/>
-
+ <!--
<h:outputText value="#{groovyBean.value}"/>
<h:outputText value="#{groovyBean.secondBean.value}"/>
+ -->
</h:panelGrid>
</h:form>
</ui:define>
Modified: myfaces/extensions/scripting/trunk/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/pom.xml?rev=958524&r1=958523&r2=958524&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/pom.xml (original)
+++ myfaces/extensions/scripting/trunk/pom.xml Mon Jun 28 09:55:26 2010
@@ -11,7 +11,7 @@
<properties>
<myfaces12.version>1.2.8</myfaces12.version>
- <myfaces2.version>2.0.0</myfaces2.version>
+ <myfaces2.version>2.0.1-SNAPSHOT</myfaces2.version>
<groovy.version>1.7.1</groovy.version>
<extval.version>2.0.3</extval.version>
</properties>