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 2012/03/19 14:10:17 UTC
svn commit: r1302412 - in
/myfaces/extensions/scripting/trunk/extscript-examples: ./ blog-example/
blog-example/src/ blog-example/src/main/ blog-example/src/main/webapp/
blog-example/src/main/webapp/WEB-INF/
blog-example/src/main/webapp/WEB-INF/java/ b...
Author: werpu
Date: Mon Mar 19 13:10:16 2012
New Revision: 1302412
URL: http://svn.apache.org/viewvc?rev=1302412&view=rev
Log:
https://issues.apache.org/jira/browse/EXTSCRIPT-158 moving to jetty 8 and isolating the blogging example for easier debugging
Added:
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/pom.xml
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/faces-config.xml
- copied, changed from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BaseInterface.java
- copied, changed from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/Blog.java
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogEntry.java
- copied, changed from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogService.java
- copied, changed from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogService.java
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogServiceInterface.java
- copied, changed from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/DependencyTestAnnotation.java
- copied, changed from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/JSFUtilJava.java
- copied, changed from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/web.xml
- copied, changed from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/WEB-INF/web.xml
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/javablog.xhtml
- copied, changed from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/javablog.xhtml
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/greet/
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/greet/greet.xhtml
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/greet/greet2.xhtml
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/gradient1.jpg
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/gradient2.png
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/license.txt
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/sig07-009_mac.jpg
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/styles/
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/styles/compilerWindow.css
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/styles/main.css
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/template.xhtml
myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/template2.xhtml
Modified:
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/blog/BlogEntry.groovy
myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogService.groovy
myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java
myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogService.java
myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/blog.xhtml
myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/javablog.xhtml
myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/WEB-INF/web.xml
myfaces/extensions/scripting/trunk/extscript-examples/pom.xml
Added: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/pom.xml?rev=1302412&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/blog-example/pom.xml (added)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/pom.xml Mon Mar 19 13:10:16 2012
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <artifactId>extscript-examples</artifactId>
+ <groupId>org.apache.myfaces.extensions.scripting</groupId>
+ <version>1.0.3-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.myfaces.extensions.scripting</groupId>
+ <artifactId>blog-example</artifactId>
+ <packaging>war</packaging>
+ <name>A custom project using myfaces 2.0</name>
+ <version>1.0.3-SNAPSHOT</version>
+ <url>http://www.apache.org</url>
+
+ <scm>
+ <connection>
+ scm:svn:http://svn.apache.org/repos/asf/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example
+ </connection>
+ <developerConnection>
+ scm:svn:https://svn.apache.org/repos/asf/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example
+ </developerConnection>
+ <url>http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example</url>
+ </scm>
+
+ <repositories>
+ <repository>
+ <id>jboss</id>
+ <url>http://repository.jboss.com/maven2/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+
+ </repositories>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+
+
+ </plugins>
+ </build>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>${myfaces2.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>${myfaces2.version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.scripting</groupId>
+ <artifactId>extscript-core</artifactId>
+ <version>1.0.3-SNAPSHOT</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>
+ </dependency>
+ </dependencies>
+</project>
Copied: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/faces-config.xml (from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/faces-config.xml?p2=myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/faces-config.xml&p1=myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy&r1=1302411&r2=1302412&rev=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/faces-config.xml Mon Mar 19 13:10:16 2012
@@ -1,4 +1,5 @@
-/*
+<?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
@@ -15,22 +16,14 @@
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- */
-package org.apache.myfaces.groovyloader.blog;
-
-/**
- * The entry class
- */
-public class BlogEntry {
-
- String firstName = ""
- String lastName = ""
- String topic = ""
- String content = ""
-
-
- public String getTopic() {
- return topic;
- }
-
-}
\ No newline at end of file
+-->
+<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">
+ <managed-bean>
+ <managed-bean-name>javaBlogView</managed-bean-name>
+ <managed-bean-class>blog.Blog</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+</faces-config>
\ No newline at end of file
Copied: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BaseInterface.java (from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BaseInterface.java?p2=myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BaseInterface.java&p1=myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy&r1=1302411&r2=1302412&rev=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BaseInterface.java Mon Mar 19 13:10:16 2012
@@ -16,21 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.groovyloader.blog;
+package blog;
/**
- * The entry class
+ * Base interface to test inheritance detection
+ *
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
*/
-public class BlogEntry {
- String firstName = ""
- String lastName = ""
- String topic = ""
- String content = ""
-
-
- public String getTopic() {
- return topic;
- }
-
-}
\ No newline at end of file
+public interface BaseInterface {
+}
Added: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/Blog.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/Blog.java?rev=1302412&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/Blog.java (added)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/Blog.java Mon Mar 19 13:10:16 2012
@@ -0,0 +1,149 @@
+/*
+ * 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 blog;
+
+import java.util.logging.Logger;
+
+import static blog.JSFUtilJava.resolveVariable;
+
+/**
+ * Our Blog View controller
+ * (note we have a dummy annotation here for testing purposes)
+ *
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+@DependencyTestAnnotation
+public class Blog {
+
+
+ String title = "<h3>Hello to the MyFaces Dynamic Blogging Example</h3>";
+ String title1 = "You can alter the code for this small blogging application on the fly, " +
+ "you even can add new classes on the fly and Java will pick it up";
+
+ String firstName = "";
+ String lastName = "";
+ String topic = "";
+
+ String content = "";
+
+ private Logger getLog() {
+ return Logger.getLogger(this.getClass().getName());
+ }
+
+ public String addEntry() {
+ getLog().info("adding entry");
+
+ /*important we have an indirection over an interface here*/
+ BlogServiceInterface service = (BlogServiceInterface) resolveVariable("javaBlogService");
+
+ if (service == null) {
+ getLog().severe("service not found");
+ } else {
+ getLog().fine("service found");
+ }
+
+ BlogEntry entry = new BlogEntry();
+ //we now map it in the verbose way, the lean way would be to do direct introspection attribute mapping
+
+ entry.setFirstName(firstName);
+ entry.setLastName(lastName);
+ entry.setTopic(topic);
+
+ entry.setContent(content);
+
+ if (service != null) {
+ /*convenience method to call a method on an object dynamically
+ * executeMethod and cast are static imports which encapsulates the
+ * ugly stuff the java introspection provides and reduce
+ * the loc down to sane levels
+ *
+ * note the behavior in case of calling errors
+ * is changed from the default managed behavior
+ * to an unmanaged behavior. This is mostly
+ * the same behavior you get from scripting engines!
+ *
+ */
+
+ //include for presentation 3
+ //entry.setTopic(debuggingTest());
+
+ service.addEntry(entry);
+ }
+
+ //we stay on the same page
+ return null;
+ }
+
+ //include for presentation 3
+ /*public String debuggingTest() {
+ return "Debugging Topic set via dynamic code";
+ }*/
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getTitle1() {
+ return title1;
+ }
+
+ public void setTitle1(String title1) {
+ this.title1 = title1;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public String getTopic() {
+ return topic;
+ }
+
+ public void setTopic(String topic) {
+ this.topic = topic;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+
+
+}
Copied: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogEntry.java (from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogEntry.java?p2=myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogEntry.java&p1=myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java&r1=1302411&r2=1302412&rev=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogEntry.java Mon Mar 19 13:10:16 2012
@@ -16,21 +16,26 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.javaloader.blog;
+package blog;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
/**
* Domain object for our mini blogging example
* Holds the entered blogging data
*/
+
public class BlogEntry {
+
String firstName = "";
String lastName = "";
String topic = "";
String content = "";
public String getFirstName() {
- return firstName;
+ return firstName+"aaa";
}
public void setFirstName(String firstName) {
Copied: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogService.java (from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogService.java)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogService.java?p2=myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogService.java&p1=myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogService.java&r1=1302411&r2=1302412&rev=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogService.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogService.java Mon Mar 19 13:10:16 2012
@@ -16,8 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.javaloader.blog;
+package blog;
+import javax.faces.bean.ApplicationScoped;
+import javax.faces.bean.ManagedBean;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -26,6 +28,8 @@ import java.util.List;
* Application scoped bean (defined in the faces-config for testing purposes)
* which stores the blog entries
*/
+@ManagedBean(name="javaBlogService")
+@ApplicationScoped
public class BlogService implements BlogServiceInterface {
List<Object> blogEntries = Collections.synchronizedList(new LinkedList<Object>());
@@ -38,11 +42,9 @@ public class BlogService implements Blog
*
* @param entry the entry to be added
*/
-
@DependencyTestAnnotation
public void addEntry(BlogEntry entry) {
if (entry != null) {
- entry.setContent("hello world dlskjfgls kdj");
blogEntries.add(entry);
}
}
Copied: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogServiceInterface.java (from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogServiceInterface.java?p2=myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogServiceInterface.java&p1=myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy&r1=1302411&r2=1302412&rev=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/BlogServiceInterface.java Mon Mar 19 13:10:16 2012
@@ -16,21 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.groovyloader.blog;
+package blog;
/**
- * The entry class
+ * Test for indirect dependency over interfaces
*/
-public class BlogEntry {
+public interface BlogServiceInterface extends BaseInterface {
- String firstName = ""
- String lastName = ""
- String topic = ""
- String content = ""
-
-
- public String getTopic() {
- return topic;
- }
-
-}
\ No newline at end of file
+ public void addEntry(BlogEntry entry);
+
+}
Copied: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/DependencyTestAnnotation.java (from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/DependencyTestAnnotation.java?p2=myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/DependencyTestAnnotation.java&p1=myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy&r1=1302411&r2=1302412&rev=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/DependencyTestAnnotation.java Mon Mar 19 13:10:16 2012
@@ -16,21 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.groovyloader.blog;
+package blog;
-/**
- * The entry class
- */
-public class BlogEntry {
-
- String firstName = ""
- String lastName = ""
- String topic = ""
- String content = ""
+import java.lang.annotation.*;
- public String getTopic() {
- return topic;
- }
+@Retention(RetentionPolicy.RUNTIME)
+public @interface DependencyTestAnnotation {
}
\ No newline at end of file
Copied: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/JSFUtilJava.java (from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/JSFUtilJava.java?p2=myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/JSFUtilJava.java&p1=myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy&r1=1302411&r2=1302412&rev=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java/blog/JSFUtilJava.java Mon Mar 19 13:10:16 2012
@@ -16,21 +16,37 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.groovyloader.blog;
+package blog;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.faces.context.FacesContext;
+
/**
- * The entry class
+ * @author werpu2
+ * @date: 01.09.2009
+ * <p/>
+ * A helper for JSF and introspection related tasks
*/
-public class BlogEntry {
+public class JSFUtilJava {
+
+ public JSFUtilJava() {
+ }
- String firstName = ""
- String lastName = ""
- String topic = ""
- String content = ""
+ /**
+ * resolves a variable in the current facesContext
+ *
+ * @param beanName
+ * @return
+ */
+ public static Object resolveVariable(String beanName) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ELContext elContext = facesContext.getELContext();
+ ELResolver elResolver =elContext.getELResolver();
- public String getTopic() {
- return topic;
- }
+ return elResolver.getValue(elContext, null, beanName);
+ }
-}
\ No newline at end of file
+}
Copied: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/web.xml (from r1302411, 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/blog-example/src/main/webapp/WEB-INF/web.xml?p2=myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/web.xml&p1=myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-extscript-helloworld/src/main/webapp/WEB-INF/web.xml&r1=1302411&r2=1302412&rev=1302412&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/blog-example/src/main/webapp/WEB-INF/web.xml Mon Mar 19 13:10:16 2012
@@ -26,28 +26,28 @@
<description>Webproject.xml</description>
- <!--
- Note this entry is vital it plugs the ext-scripting system into
- a myfaces extension point
- -->
<context-param>
<description>
Initializes the plugins for our groovy handlers
</description>
<param-name>org.apache.myfaces.FACES_INIT_PLUGINS</param-name>
- <param-value>org.apache.myfaces.extensions.scripting.servlet.StartupServletContextPluginChainLoader
+ <param-value>org.apache.myfaces.extensions.scripting.jsf.startup.StartupServletContextPluginChainLoader
</param-value>
</context-param>
- <!--
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</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
</description>
<param-name>org.apache.myfaces.extensions.scripting.groovy.LOADER_PATHS</param-name>
<param-value>
- /whatever/development/workspace/extensions-scripting3/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy
+ /Users/werpu2/development/workspace/extscript_trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/groovy
</param-value>
</context-param>
@@ -58,7 +58,7 @@
</description>
<param-name>org.apache.myfaces.extensions.scripting.java.LOADER_PATHS</param-name>
<param-value>
- /whatever/development/workspace/extensions-scripting3/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java
+ /Users/werpu2/development/workspace/extscript_trunk/extscript-examples/blog-example/src/main/webapp/WEB-INF/java
</param-value>
</context-param>
@@ -66,56 +66,10 @@
<description>resource paths for our custom JSF2 resource resolver</description>
<param-name>org.apache.myfaces.extensions.scripting.resources.LOADER_PATHS</param-name>
<param-value>
- /whatever/development/workspace/extensions-scripting3/extscript-examples/myfaces20-example/src/main/webapp
+ /Users/werpu2/development/workspace/extscript_trunk/extscript-examples/blog-example/src/main/webapp
</param-value>
</context-param>
- <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.facelet.ReroutingResourceResolver</param-value>
- </context-param>
- -->
- <!--
- <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</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
- </description>
- <param-name>org.apache.myfaces.extensions.scripting.groovy.LOADER_PATHS</param-name>
- <param-value>D:/whatever/threads/extscript/examples/myfaces20-example/src/main/webapp/WEB-INF/groovy</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
- </description>
- <param-name>org.apache.myfaces.extensions.scripting.java.LOADER_PATHS</param-name>
- <param-value>D:/whatever/threads/extscript/examples/myfaces20-example/src/main/webapp/WEB-INF/java</param-value>
- </context-param>
-
-
- -->
-
-
- <context-param>
- <param-name>javax.faces.PROJECT_STAGE</param-name>
- <param-value>Development</param-value>
- </context-param>
-
<context-param>
<description>State saving method: "client" or "server" (= default)
@@ -126,13 +80,17 @@
</context-param>
- <!--
- Note, this servlet filter is vital without it Ext-Scripting will not work,
- if you do not set it you will get an appropriate warning in the command line
- -->
+ <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.MyFacesReroutingResourceResolver</param-value>
+ </context-param>
+
<filter>
<filter-name>scriptingFilter</filter-name>
- <filter-class>org.apache.myfaces.extensions.scripting.servlet.ScriptingServletFilter</filter-class>
+ <filter-class>org.apache.myfaces.extensions.scripting.core.servlet.ScriptingServletFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>scriptingFilter</filter-name>
@@ -143,6 +101,10 @@
<dispatcher>ERROR</dispatcher>
</filter-mapping>
+ <!--
+ Note, this servlet filter is vital without it Ext-Scripting will not work,
+ if you do not set it you will get an appropriate warning in the command line
+ -->
<!-- Listener, to allow Jetty serving MyFaces apps -->
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
Copied: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/javablog.xhtml (from r1302411, myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/javablog.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/javablog.xhtml?p2=myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/javablog.xhtml&p1=myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/javablog.xhtml&r1=1302411&r2=1302412&rev=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/javablog.xhtml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/javablog.xhtml Mon Mar 19 13:10:16 2012
@@ -20,7 +20,6 @@
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
- xmlns:t="http://myfaces.apache.org/tomahawk" xmlns:grv="http://myfaces.apache.org/groovy"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
<title>Hello World</title>
@@ -75,7 +74,7 @@
</h:panelGrid>
</div>
<h:panelGrid id="content" columns="1" styleClass="right">
- <c:forEach items="#{javaBlogService.blogEntries}" var="item">
+ <ui:repeat value="#{javaBlogService.blogEntries}" var="item">
<h:panelGrid columns="1" styleClass="messageBox">
<h:panelGroup styleClass="topic">
<h:outputLabel styleClass="label" value="Topic"/>
@@ -86,8 +85,7 @@
<h:outputFormat escape="false" value="#{item.content}"/>
</h:panelGroup>
</h:panelGrid>
- <br/>
- </c:forEach>
+ </ui:repeat>
</h:panelGrid>
</h:form>
</ui:define>
Added: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/greet/greet.xhtml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/greet/greet.xhtml?rev=1302412&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/greet/greet.xhtml (added)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/greet/greet.xhtml Mon Mar 19 13:10:16 2012
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:composite="http://java.sun.com/jsf/composite">
+<head>
+ <title>My First Composite Component</title>
+</head>
+<body>
+
+<composite:interface>
+ <composite:attribute name="who"/>
+</composite:interface>
+
+<composite:implementation>
+ <h:outputText value="Hello composite change, #{cc.attrs.who}!"/>
+</composite:implementation>
+
+</body>
+</html>
Added: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/greet/greet2.xhtml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/greet/greet2.xhtml?rev=1302412&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/greet/greet2.xhtml (added)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/greet/greet2.xhtml Mon Mar 19 13:10:16 2012
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:composite="http://java.sun.com/jsf/composite">
+<head>
+ <title>My First Composite Component</title>
+</head>
+<body>
+
+<composite:interface>
+ <composite:attribute name="who"/>
+</composite:interface>
+
+<composite:implementation>
+ <h:outputText value="Hello composite greet2, #{cc.attrs.who}!"/>
+</composite:implementation>
+
+</body>
+</html>
\ No newline at end of file
Added: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/gradient1.jpg
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/gradient1.jpg?rev=1302412&view=auto
==============================================================================
Files myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/gradient1.jpg (added) and myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/gradient1.jpg Mon Mar 19 13:10:16 2012 differ
Added: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/gradient2.png
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/gradient2.png?rev=1302412&view=auto
==============================================================================
Files myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/gradient2.png (added) and myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/gradient2.png Mon Mar 19 13:10:16 2012 differ
Added: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/license.txt
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/license.txt?rev=1302412&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/license.txt (added)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/license.txt Mon Mar 19 13:10:16 2012
@@ -0,0 +1,6 @@
+sig07-009_mac.jpg is from the nasa public domain image archive.
+
+http://www.nasaimages.org/luna/servlet/detail/nasaNAS~12~12~64153~168545:Multiwavelength-M81?qvq=q:galaxy+or+constellation+or+hubble+or+spitzer;lc:NVA2~35~35,NVA2~32~32,NVA2~31~31,NVA2~19~19,nasaNAS~16~16,nasaNAS~2~2,NSVS~3~3,nasaNAS~9~9,NVA2~4~4,NVA2~15~15,NVA2~24~24,NVA2~29~29,nasaNAS~12~12,nasaNAS~8~8,nasaNAS~7~7,NVA2~22~22,nasaNAS~10~10,NVA2~13~13,NVA2~18~18,NVA2~27~27,NVA2~9~9,NVA2~1~1,nasaNAS~6~6,NVA2~25~25,NVA2~20~20,nasaNAS~13~13,nasaNAS~22~22,NVA2~16~16,NVA2~8~8,nasaNAS~5~5,nasaNAS~4~4,NVA2~28~28,NVA2~14~14,nasaNAS~20~20,NVA2~17~17,NVA2~30~30,NVA2~21~21,NVA2~26~26,NVA2~23~23,NVA2~44~44,NVA2~42~42,NVA2~38~38,NVA2~45~45,NVA2~39~39,NVA2~43~43,NVA2~41~41,NVA2~37~37,NVA2~49~49,NVA2~53~53,NVA2~51~51,NVA2~56~56,NVA2~47~47,NVA2~54~54,NVA2~33~33,NVA2~36~36,NVA2~34~34,NVA2~57~57,NVA2~52~52,NVA2~48~48,NVA2~50~50,NVA2~46~46,NVA2~55~55&mi=0&trs=8854
+
+license
+http://www.nasa.gov/audience/formedia/features/MP_Photo_Guidelines.html
Added: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/sig07-009_mac.jpg
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/sig07-009_mac.jpg?rev=1302412&view=auto
==============================================================================
Files myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/sig07-009_mac.jpg (added) and myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/img/sig07-009_mac.jpg Mon Mar 19 13:10:16 2012 differ
Added: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/styles/compilerWindow.css
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/styles/compilerWindow.css?rev=1302412&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/styles/compilerWindow.css (added)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/styles/compilerWindow.css Mon Mar 19 13:10:16 2012
@@ -0,0 +1,15 @@
+div#menu {
+ display: none;
+}
+
+div.centerDiv {
+ width: auto;
+}
+
+div.errorBox {
+ width: auto;
+}
+
+div.errorBox .line {
+ width: auto;
+}
\ No newline at end of file
Added: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/styles/main.css
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/styles/main.css?rev=1302412&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/styles/main.css (added)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/resources/styles/main.css Mon Mar 19 13:10:16 2012
@@ -0,0 +1,268 @@
+body {
+ background-color: white;
+}
+
+div.centerDiv {
+ margin-left: auto;
+ margin-right: auto;
+ width: 900px;
+}
+
+div.centerDiv form {
+ position: relative;
+}
+
+h1 {
+ color: #9999ff;
+ text-align: center;
+}
+
+div#backGroundFloat {
+ position: fixed;
+ z-index: -1;
+ background-color: black;
+ left: 0px;
+ top: 0px;
+ width: 100%;
+ height: 100%;
+ background-image: url("../resources/img/sig07-009_mac.jpg");
+ background-repeat: no-repeat;
+ overflow: hidden;
+}
+
+#hello {
+ background-color: yellow;
+}
+
+.stdBox, .stdBoxBig, .messageBox {
+ display: block;
+ width: 400px;
+ border: 1px solid white;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ padding: 5px;
+ border-radius: 8px;
+ background-repeat: repeat-x;
+ margin-bottom: 5px;
+ min-height: 120px;
+
+}
+
+.stdBoxBig {
+ width: 800px;
+}
+
+.stdBox, .stdBoxBig {
+ background-color: white;
+ background-image: url("../resources/img/gradient1.jpg");
+}
+
+.messageBox {
+ background-image: url("../resources/img/gradient2.png");
+}
+
+/*=================================================
+Standard Menu
+===================================================*/
+div#menu {
+ background-color: white;
+ opacity: 0.9;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ width: 100%;
+ padding: 5px;
+ font-weight: bold;
+
+}
+
+div#menu a {
+ color: blue;
+ margin-right: 10px;
+}
+
+div#menu a:hover {
+ color: red;
+}
+
+/*==================================================
+ Basic CSS information for our
+ taint history component
+ we do not use the compound
+ css for error and history
+ for readability reasons
+ although we have load
+ of duplication here
+====================================================*/
+
+div.historyBox {
+ width: 820px;
+ heigh: 200px;
+
+ display: block;
+ overflow: auto;
+ border: 1px solid white;
+ color: #dedddd;
+ opacity: 0.92;
+
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 5px;
+
+ padding: 5px;
+ margin-left: 10px;
+
+ background-image: url("../resources/img/gradient2.png");
+ background-repeat: repeat-x;
+}
+
+div.historyBox .line {
+ display: table;
+ width: 780px;
+
+ border: 1px dashed black;
+ background-color: #ccccff;
+ color: black;
+ padding: 5px;
+ margin-top: 10px;
+ margin-left: auto;
+ margin-right: auto;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+
+ border-radius: 5px;
+}
+
+div.historyBox .line .timestamp {
+ width: 120px;
+ float: left;
+ color: red;
+}
+
+div.historyBox .line .changedFile {
+ width: 650px;
+ overflow: hidden;
+ display: block;
+ float: left;
+}
+
+/*==================================================
+ Basic CSS information for our compiler
+ output component
+====================================================*/
+
+div.errorsLabel {
+ font-size: large;
+ padding-top: 5px;
+ padding-bottom: 10px;
+ padding-left: 5px;
+}
+
+div.warningsLabel {
+ font-size: large;
+ padding-top: 5px;
+ padding-bottom: 10px;
+ padding-left: 5px;
+ width: 100%;
+ margin-top: 10px;
+ border-top: 1px solid black;
+}
+
+div.errorBox {
+ width: 820px;
+ heigh: 200px;
+
+ display: block;
+ overflow: auto;
+ border: 1px solid white;
+ color: #dedddd;
+ opacity: 0.92;
+
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 5px;
+
+ padding: 5px;
+ margin-left: 10px;
+
+ background-image: url("../resources/img/gradient2.png");
+ background-repeat: repeat-x;
+}
+
+div.errorBox .line {
+ display: table;
+ width: 780px;
+
+ border: 1px dashed black;
+ background-color: #ccccff;
+ color: black;
+ padding: 5px;
+ margin-top: 10px;
+ margin-left: auto;
+ margin-right: auto;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+
+ border-radius: 5px;
+}
+
+div.errorBox .line .lineNo {
+ width: 40px;
+ float: left;
+ color: red;
+}
+
+div.errorBox .line .lineNo {
+ width: 30px;
+ float: left;
+ padding-left: 5px;
+ font-weight: bold;
+ font-size: large;
+}
+
+div.errorBox .line .message {
+ width: 738px;
+ display: block;
+ float: left;
+}
+
+.left {
+ position: absolute;
+ left: 10px;
+ top: 20px;
+}
+
+.right {
+ position: absolute;
+ left: 430px;
+ top: 20px;
+}
+
+.label {
+ font-weight: bold;
+ color: black;
+ width: 150px;
+ padding-right: 5px;
+}
+
+.input input, .input textArea {
+ width: 200px;
+}
+
+input, textArea {
+ border: 1px solid black;
+}
+
+input:focus, textArea:focus {
+ background-color: yellow;
+}
+
+input.btn {
+ width: 100px;
+ margin-left: 263px;
+}
+
+
+.celltop {
+ vertical-align:top;
+}
\ No newline at end of file
Added: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/template.xhtml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/template.xhtml?rev=1302412&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/template.xhtml (added)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/template.xhtml Mon Mar 19 13:10:16 2012
@@ -0,0 +1,67 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ * 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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:exs="http://myfaces.apache.org/ext-scripting"
+ xmlns:h="http://java.sun.com/jsf/html">
+<h:head>
+
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Myfaces Example Facelets</title>
+ <link type="text/css" rel="stylesheet" href="#{resource['styles:main.css']}"/>
+ <ui:insert name="additionalHeadIncludes">
+ </ui:insert>
+</h:head>
+
+<h:body>
+ <div id="menu">
+ <h:panelGroup>
+ <h:outputLink value="./helloWorld.jsf">Hello world Example</h:outputLink>
+ <h:outputLink value="./blog.jsf">Groovy Blogging Example</h:outputLink>
+ <h:outputLink value="./javablog.jsf">Java Blogging Example</h:outputLink>
+ <h:outputLink value="./componentTest.jsf">Component Testcase</h:outputLink>
+ <h:outputLink value="./compilerWindow.jsf" target="_blank">Compiler Output</h:outputLink>
+ </h:panelGroup>
+ </div>
+
+ <div id="backGroundFloat">
+ </div>
+ <div class="centerDiv">
+ <h:panelGroup>
+ <h3>
+ <h:outputFormat value="Compiler Output" escape="false"/>
+ </h3>
+ <exs:compilerOutput errorsLabel="Errors:" warningsLabel="Warnings:" scriptingLanguage=""/>
+ </h:panelGroup>
+ <h:panelGroup>
+ <h3>
+ <h:outputFormat value="Change History" escape="false"/>
+ </h3>
+ <exs:taintHistory noEntries="5"/>
+ </h:panelGroup>
+
+ <p>
+ <ui:insert name="body">Hello World Example!</ui:insert>
+ </p>
+ </div>
+</h:body>
+
+</html>
Added: myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/template2.xhtml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/template2.xhtml?rev=1302412&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/template2.xhtml (added)
+++ myfaces/extensions/scripting/trunk/extscript-examples/blog-example/src/main/webapp/template2.xhtml Mon Mar 19 13:10:16 2012
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+ * 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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:grv="http://myfaces.apache.org/groovy"
+ xmlns:h="http://java.sun.com/jsf/html">
+<head>
+
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
+ <title>Myfaces Example Facelets</title>
+
+ <link type="text/css" rel="stylesheet" href="#{resource['styles:main.css']}"/>
+</head>
+
+<body>
+
+<h:panelGroup>
+ <h3>
+ <h:outputFormat value="Compiler Output" escape="false"/>
+ </h3>
+ <grv:compilerOutput errorsLabel="Errors:" warningsLabel="Warnings:" scriptingLanguage=""/>
+</h:panelGroup>
+
+
+<h1>
+ <ui:insert name="title">Component Testcase</ui:insert>
+</h1>
+
+
+<p>
+ <ui:insert name="body">Hello World Example!</ui:insert>
+</p>
+</body>
+</html>
\ No newline at end of file
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=1302412&r1=1302411&r2=1302412&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 Mar 19 13:10:16 2012
@@ -49,13 +49,13 @@
<managed-bean-class>org.apache.myfaces.javaloader.blog.Blog</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
-
+ <!--
<managed-bean>
<managed-bean-name>javaBlogService</managed-bean-name>
<managed-bean-class>org.apache.myfaces.javaloader.blog.BlogService</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
-
+ -->
<application>
<navigation-handler>
org.apache.myfaces.groovyloader.test.TestNavigationHandler
Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.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/blog/BlogEntry.groovy?rev=1302412&r1=1302411&r2=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogEntry.groovy Mon Mar 19 13:10:16 2012
@@ -26,8 +26,7 @@ public class BlogEntry {
String firstName = ""
String lastName = ""
String topic = ""
- String content = ""
-
+ String content = "ddddddd"
public String getTopic() {
return topic;
Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogService.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/blog/BlogService.groovy?rev=1302412&r1=1302411&r2=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogService.groovy (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/groovy/org/apache/myfaces/groovyloader/blog/BlogService.groovy Mon Mar 19 13:10:16 2012
@@ -44,7 +44,7 @@ public class BlogService {
Logger log = Logger.getLogger(BlogService.class.getName())
log.info("Adding entry, topic: " + entry.topic)
- entry.topic = "bla bla2"
+ //entry.topic = "bla bla2"
blogEntries.add(entry)
log.info("blogentries size" + blogEntries.size())
Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.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/blog/BlogEntry.java?rev=1302412&r1=1302411&r2=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogEntry.java Mon Mar 19 13:10:16 2012
@@ -18,19 +18,24 @@
*/
package org.apache.myfaces.javaloader.blog;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+
/**
* Domain object for our mini blogging example
* Holds the entered blogging data
*/
+
public class BlogEntry {
+
String firstName = "";
String lastName = "";
String topic = "";
String content = "";
public String getFirstName() {
- return firstName;
+ return firstName+"aaa";
}
public void setFirstName(String firstName) {
Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogService.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/blog/BlogService.java?rev=1302412&r1=1302411&r2=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogService.java (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/blog/BlogService.java Mon Mar 19 13:10:16 2012
@@ -18,6 +18,8 @@
*/
package org.apache.myfaces.javaloader.blog;
+import javax.faces.bean.ApplicationScoped;
+import javax.faces.bean.ManagedBean;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -26,6 +28,8 @@ import java.util.List;
* Application scoped bean (defined in the faces-config for testing purposes)
* which stores the blog entries
*/
+@ManagedBean(name="javaBlogService")
+@ApplicationScoped
public class BlogService implements BlogServiceInterface {
List<Object> blogEntries = Collections.synchronizedList(new LinkedList<Object>());
@@ -38,11 +42,9 @@ public class BlogService implements Blog
*
* @param entry the entry to be added
*/
-
@DependencyTestAnnotation
public void addEntry(BlogEntry entry) {
if (entry != null) {
- entry.setContent("hello world dlskjfgls kdj");
blogEntries.add(entry);
}
}
Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/blog.xhtml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/blog.xhtml?rev=1302412&r1=1302411&r2=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/blog.xhtml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/blog.xhtml Mon Mar 19 13:10:16 2012
@@ -69,7 +69,7 @@
</h:panelGrid>
</div>
<h:panelGrid id="content" columns="1" styleClass="right">
- <c:forEach items="#{blogService.blogEntries}" var="item">
+ <ui:repeat value="#{blogService.blogEntries}" var="item">
<h:panelGrid columns="1" styleClass="messageBox">
<h:panelGroup styleClass="topic">
<h:outputLabel styleClass="label" value="Topic"/>
@@ -81,7 +81,7 @@
</h:panelGroup>
</h:panelGrid>
<br/>
- </c:forEach>
+ </ui:repeat>
</h:panelGrid>
</h:form>
</ui:define>
Modified: myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/javablog.xhtml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/javablog.xhtml?rev=1302412&r1=1302411&r2=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/javablog.xhtml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/myfaces20-example/src/main/webapp/javablog.xhtml Mon Mar 19 13:10:16 2012
@@ -75,7 +75,7 @@
</h:panelGrid>
</div>
<h:panelGrid id="content" columns="1" styleClass="right">
- <c:forEach items="#{javaBlogService.blogEntries}" var="item">
+ <ui:repeat value="#{javaBlogService.blogEntries}" var="item">
<h:panelGrid columns="1" styleClass="messageBox">
<h:panelGroup styleClass="topic">
<h:outputLabel styleClass="label" value="Topic"/>
@@ -86,8 +86,7 @@
<h:outputFormat escape="false" value="#{item.content}"/>
</h:panelGroup>
</h:panelGrid>
- <br/>
- </c:forEach>
+ </ui:repeat>
</h:panelGrid>
</h:form>
</ui:define>
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=1302412&r1=1302411&r2=1302412&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 Mon Mar 19 13:10:16 2012
@@ -35,7 +35,7 @@
Initializes the plugins for our groovy handlers
</description>
<param-name>org.apache.myfaces.FACES_INIT_PLUGINS</param-name>
- <param-value>org.apache.myfaces.extensions.scripting.servlet.StartupServletContextPluginChainLoader
+ <param-value>org.apache.myfaces.extensions.scripting.jsf.startup.StartupServletContextPluginChainLoader
</param-value>
</context-param>
Modified: myfaces/extensions/scripting/trunk/extscript-examples/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/extscript-examples/pom.xml?rev=1302412&r1=1302411&r2=1302412&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/extscript-examples/pom.xml (original)
+++ myfaces/extensions/scripting/trunk/extscript-examples/pom.xml Mon Mar 19 13:10:16 2012
@@ -30,11 +30,11 @@
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.12</version>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>8.1.2.v20120308</version>
<configuration>
<connectors>
- <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>9090</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
@@ -51,7 +51,6 @@
</plugin>
-
</plugins>
</build>
<modules>
@@ -60,6 +59,7 @@
-->
<module>myfaces20-example</module>
<module>myfaces20-extscript-helloworld</module>
+ <module>blog-example</module>
<!--
<module>spring-example</module>
-->