Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Saving work in progress

  • Loading branch information...
commit e6abfb07c0a5dbcd010edcd5d8821540deecfadc 1 parent 5f19b66
Jeremy Grelle authored
Showing with 2,994 additions and 286 deletions.
  1. +17 −2 .classpath
  2. +1 −1  .project
  3. +1 −1  .settings/org.eclipse.jdt.core.prefs
  4. +48 −3 .settings/org.eclipse.wst.common.component
  5. +306 −270 pom.xml
  6. BIN  soy-20100708.jar
  7. +66 −0 src/main/java/com/springsource/html5/appcache/template/SoyConfiguration.java
  8. +44 −0 src/main/java/com/springsource/html5/visualization/CommitRecord.java
  9. +29 −0 src/main/java/com/springsource/html5/visualization/CommitRecordFieldSetMapper.java
  10. +48 −0 src/main/java/com/springsource/html5/visualization/CommitRecordProcessingConfiguration.java
  11. +24 −0 src/main/java/com/springsource/html5/visualization/MessageSendingItemWriter.java
  12. +47 −0 src/main/java/com/springsource/petclinic/web/TemplateRefreshingHandlerInterceptor.java
  13. +242 −0 src/main/java/org/springframework/integration/comet/AsyncHttpRequestHandlingMessageAdapter.java
  14. +32 −0 src/main/java/org/springframework/integration/comet/HttpBroadcastMessage.java
  15. +133 −0 src/main/java/org/springframework/integration/comet/HttpMessageBroadcaster.java
  16. +175 −0 src/main/java/org/springframework/integration/comet/HttpMessageMapper.java
  17. +32 −0 src/main/java/org/springframework/web/servlet/resource/CacheManifest.java
  18. +151 −0 src/main/java/org/springframework/web/servlet/resource/CacheManifestHttpRequestHandler.java
  19. +8 −0 src/main/java/org/springframework/web/servlet/resource/CacheManifestStore.java
  20. +17 −0 src/main/java/org/springframework/web/servlet/resource/InMemoryCacheManifestStore.java
  21. +1 −0  src/main/resources/META-INF/spring/applicationContext.xml
  22. +1 −1  src/main/webapp/WEB-INF/layouts/default.jspx
  23. +151 −0 src/main/webapp/WEB-INF/layouts/html5-default.jspx
  24. +6 −0 src/main/webapp/WEB-INF/layouts/layouts.xml
  25. +234 −0 src/main/webapp/WEB-INF/soy/vet.soy
  26. +88 −0 src/main/webapp/WEB-INF/soy/vet.tmp
  27. +17 −4 src/main/webapp/WEB-INF/spring/webmvc-config.xml
  28. +1 −1  src/main/webapp/WEB-INF/tags/menu/item.tagx
  29. +3 −3 src/main/webapp/WEB-INF/tags/util/load-scripts.tagx
  30. +4 −0 src/main/webapp/WEB-INF/views/views.xml
  31. +880 −0 src/main/webapp/templates/soyutils.js
  32. +43 −0 src/test/java/com/springsource/html5/appcache/template/SoyConfigurationTests.java
  33. +53 −0 src/test/java/com/springsource/html5/visualization/CommitRecordFieldSetMapperTest.java
  34. +76 −0 src/test/java/org/springframework/web/servlet/resource/CacheManifestHttpRequestHandlerTests.java
  35. +15 −0 src/test/resources/com/springsource/html5/appcache/template/test.soy
19 .classpath
View
@@ -4,14 +4,20 @@
<classpathentry kind="src" path="src/main/java" including="**/*.java|**/*.aj"/>
<classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
<classpathentry kind="output" path="target/classes"/>
- <classpathentry kind="var" path="M2_REPO/javax/el/el-api/1.0/el-api-1.0.jar" sourcepath="M2_REPO/javax/el/el-api/1.0/el-api-1.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/el/el-api/1.0/el-api-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar" sourcepath="M2_REPO/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/servlet/jstl/1.2/jstl-1.2.jar" sourcepath="M2_REPO/javax/servlet/jstl/1.2/jstl-1.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/transaction/jta/1.1/jta-1.1.jar" sourcepath="M2_REPO/javax/transaction/jta/1.1/jta-1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar" sourcepath="M2_REPO/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar" sourcepath="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" sourcepath="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/atmosphere/atmosphere-compat-jbossweb/0.7-SNAPSHOT/atmosphere-compat-jbossweb-0.7-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/atmosphere/atmosphere-compat-tomcat/0.7-SNAPSHOT/atmosphere-compat-tomcat-0.7-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/atmosphere/atmosphere-compat-weblogic/0.7-SNAPSHOT/atmosphere-compat-weblogic-0.7-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/atmosphere/atmosphere-runtime/0.7-SNAPSHOT/atmosphere-runtime-0.7-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/cglib/cglib-nodep/2.2/cglib-nodep-2.2.jar" sourcepath="M2_REPO/cglib/cglib-nodep/2.2/cglib-nodep-2.2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/google/closure/closure-templates/20100708/closure-templates-20100708.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.8.0/commons-beanutils-1.8.0.jar" sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.8.0/commons-beanutils-1.8.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar" sourcepath="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-dbcp/commons-dbcp/1.3/commons-dbcp-1.3.jar" sourcepath="M2_REPO/commons-dbcp/commons-dbcp/1.3/commons-dbcp-1.3-sources.jar"/>
@@ -27,8 +33,11 @@
<classpathentry kind="var" path="M2_REPO/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.0.Final/hibernate-jpa-2.0-api-1.0.0.Final.jar" sourcepath="M2_REPO/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.0.Final/hibernate-jpa-2.0-api-1.0.0.Final-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-validator/4.1.0.Final/hibernate-validator-4.1.0.Final.jar" sourcepath="M2_REPO/org/hibernate/hibernate-validator/4.1.0.Final/hibernate-validator-4.1.0.Final-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hsqldb/hsqldb/2.0.0/hsqldb-2.0.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.5.3/jackson-core-asl-1.5.3.jar" sourcepath="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.5.3/jackson-core-asl-1.5.3-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-mapper-asl/1.5.3/jackson-mapper-asl-1.5.3.jar" sourcepath="M2_REPO/org/codehaus/jackson/jackson-mapper-asl/1.5.3/jackson-mapper-asl-1.5.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/codehaus/jettison/jettison/1.1/jettison-1.1.jar" sourcepath="M2_REPO/org/codehaus/jettison/jettison/1.1/jettison-1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/joda-time/joda-time/1.6/joda-time-1.6.jar" sourcepath="M2_REPO/joda-time/joda-time/1.6/joda-time-1.6-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.8.1/junit-4.8.1.jar" sourcepath="M2_REPO/junit/junit/4.8.1/junit-4.8.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar" sourcepath="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16-sources.jar"/>
@@ -42,13 +51,17 @@
<attribute name="org.eclipse.ajdt.aspectpath" value="true"/>
</attributes>
</classpathentry>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/batch/spring-batch-core/2.1.3.RELEASE/spring-batch-core-2.1.3.RELEASE.jar" sourcepath="M2_REPO/org/springframework/batch/spring-batch-core/2.1.3.RELEASE/spring-batch-core-2.1.3.RELEASE-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/batch/spring-batch-infrastructure/2.1.3.RELEASE/spring-batch-infrastructure-2.1.3.RELEASE.jar" sourcepath="M2_REPO/org/springframework/batch/spring-batch-infrastructure/2.1.3.RELEASE/spring-batch-infrastructure-2.1.3.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-beans/3.0.4.RELEASE/spring-beans-3.0.4.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-beans/3.0.4.RELEASE/spring-beans-3.0.4.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-context/3.0.4.RELEASE/spring-context-3.0.4.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-context/3.0.4.RELEASE/spring-context-3.0.4.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-context-support/3.0.4.RELEASE/spring-context-support-3.0.4.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-context-support/3.0.4.RELEASE/spring-context-support-3.0.4.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-core/3.0.4.RELEASE/spring-core-3.0.4.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-core/3.0.4.RELEASE/spring-core-3.0.4.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-expression/3.0.4.RELEASE/spring-expression-3.0.4.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-expression/3.0.4.RELEASE/spring-expression-3.0.4.RELEASE-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/integration/spring-integration-core/2.0.0.M7/spring-integration-core-2.0.0.M7.jar" sourcepath="M2_REPO/org/springframework/integration/spring-integration-core/2.0.0.M7/spring-integration-core-2.0.0.M7-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/integration/spring-integration-http/2.0.0.M7/spring-integration-http-2.0.0.M7.jar" sourcepath="M2_REPO/org/springframework/integration/spring-integration-http/2.0.0.M7/spring-integration-http-2.0.0.M7-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-jdbc/3.0.4.RELEASE/spring-jdbc-3.0.4.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-jdbc/3.0.4.RELEASE/spring-jdbc-3.0.4.RELEASE-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/springframework/webflow/spring-js/2.1.1.RELEASE/spring-js-2.1.1.RELEASE.jar" sourcepath="M2_REPO/org/springframework/webflow/spring-js/2.1.1.RELEASE/spring-js-2.1.1.RELEASE-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/springframework/webflow/spring-js-resources/2.2.0.BUILD-SNAPSHOT/spring-js-resources-2.2.0.BUILD-SNAPSHOT.jar" sourcepath="M2_REPO/org/springframework/webflow/spring-js-resources/2.2.0.BUILD-SNAPSHOT/spring-js-resources-2.2.0.BUILD-SNAPSHOT-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-orm/3.0.4.RELEASE/spring-orm-3.0.4.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-orm/3.0.4.RELEASE/spring-orm-3.0.4.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-test/3.0.4.RELEASE/spring-test-3.0.4.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-test/3.0.4.RELEASE/spring-test-3.0.4.RELEASE-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/springframework/spring-tx/3.0.4.RELEASE/spring-tx-3.0.4.RELEASE.jar" sourcepath="M2_REPO/org/springframework/spring-tx/3.0.4.RELEASE/spring-tx-3.0.4.RELEASE-sources.jar"/>
@@ -60,6 +73,8 @@
<classpathentry kind="var" path="M2_REPO/org/apache/tiles/tiles-servlet/2.2.1/tiles-servlet-2.2.1.jar" sourcepath="M2_REPO/org/apache/tiles/tiles-servlet/2.2.1/tiles-servlet-2.2.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/tiles/tiles-template/2.2.1/tiles-template-2.2.1.jar" sourcepath="M2_REPO/org/apache/tiles/tiles-template/2.2.1/tiles-template-2.2.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar" sourcepath="M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3.jar" sourcepath="M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.ajdt.core.ASPECTJRT_CONTAINER"/>
</classpath>
2  .project
View
@@ -1,5 +1,5 @@
<projectDescription>
- <name>petclinic</name>
+ <name>spring-html5</name>
<comment/>
<projects/>
<buildSpec>
2  .settings/org.eclipse.jdt.core.prefs
View
@@ -1,4 +1,4 @@
-#Thu Sep 16 15:47:41 PDT 2010
+#Fri Sep 17 09:19:37 PDT 2010
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.6
51 .settings/org.eclipse.wst.common.component
View
@@ -1,6 +1,6 @@
<project-modules id="moduleCoreId" project-version="2.0">
- <wb-module deploy-name="petclinic">
- <property name="context-root" value="petclinic"/>
+ <wb-module deploy-name="spring-html5">
+ <property name="context-root" value="spring-html5"/>
<wb-resource deploy-path="/" source-path="src/main/webapp"/>
<property name="java-output-path" value="/target/classes"/>
<dependent-module archiveName="antlr-2.7.6.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar">
@@ -12,9 +12,24 @@
<dependent-module archiveName="aspectjrt-1.6.10.M1.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/aspectj/aspectjrt/1.6.10.M1/aspectjrt-1.6.10.M1.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
+ <dependent-module archiveName="atmosphere-compat-jbossweb-0.7-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/atmosphere/atmosphere-compat-jbossweb/0.7-SNAPSHOT/atmosphere-compat-jbossweb-0.7-SNAPSHOT.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="atmosphere-compat-tomcat-0.7-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/atmosphere/atmosphere-compat-tomcat/0.7-SNAPSHOT/atmosphere-compat-tomcat-0.7-SNAPSHOT.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="atmosphere-compat-weblogic-0.7-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/atmosphere/atmosphere-compat-weblogic/0.7-SNAPSHOT/atmosphere-compat-weblogic-0.7-SNAPSHOT.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="atmosphere-runtime-0.7-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/atmosphere/atmosphere-runtime/0.7-SNAPSHOT/atmosphere-runtime-0.7-SNAPSHOT.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
<dependent-module archiveName="cglib-nodep-2.2.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/cglib/cglib-nodep/2.2/cglib-nodep-2.2.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
+ <dependent-module archiveName="closure-templates-20100708.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/com/google/closure/closure-templates/20100708/closure-templates-20100708.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
<dependent-module archiveName="commons-beanutils-1.8.0.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/commons-beanutils/commons-beanutils/1.8.0/commons-beanutils-1.8.0.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
@@ -60,15 +75,27 @@
<dependent-module archiveName="hsqldb-2.0.0.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/hsqldb/hsqldb/2.0.0/hsqldb-2.0.0.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
+ <dependent-module archiveName="jackson-core-asl-1.5.3.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/codehaus/jackson/jackson-core-asl/1.5.3/jackson-core-asl-1.5.3.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="jackson-mapper-asl-1.5.3.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/codehaus/jackson/jackson-mapper-asl/1.5.3/jackson-mapper-asl-1.5.3.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
<dependent-module archiveName="javassist-3.9.0.GA.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/javassist/javassist/3.9.0.GA/javassist-3.9.0.GA.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="jcl-over-slf4j-1.6.1.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
+ <dependent-module archiveName="jettison-1.1.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/codehaus/jettison/jettison/1.1/jettison-1.1.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
<dependent-module archiveName="joda-time-1.6.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/joda-time/joda-time/1.6/joda-time-1.6.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
+ <dependent-module archiveName="jsr250-api-1.0.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
<dependent-module archiveName="jstl-1.2.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/javax/servlet/jstl/1.2/jstl-1.2.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
@@ -93,6 +120,12 @@
<dependent-module archiveName="spring-aspects-3.0.4.RELEASE.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-aspects/3.0.4.RELEASE/spring-aspects-3.0.4.RELEASE.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
+ <dependent-module archiveName="spring-batch-core-2.1.3.RELEASE.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/batch/spring-batch-core/2.1.3.RELEASE/spring-batch-core-2.1.3.RELEASE.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-batch-infrastructure-2.1.3.RELEASE.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/batch/spring-batch-infrastructure/2.1.3.RELEASE/spring-batch-infrastructure-2.1.3.RELEASE.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
<dependent-module archiveName="spring-beans-3.0.4.RELEASE.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-beans/3.0.4.RELEASE/spring-beans-3.0.4.RELEASE.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
@@ -108,10 +141,16 @@
<dependent-module archiveName="spring-expression-3.0.4.RELEASE.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-expression/3.0.4.RELEASE/spring-expression-3.0.4.RELEASE.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
+ <dependent-module archiveName="spring-integration-core-2.0.0.M7.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/integration/spring-integration-core/2.0.0.M7/spring-integration-core-2.0.0.M7.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="spring-integration-http-2.0.0.M7.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/integration/spring-integration-http/2.0.0.M7/spring-integration-http-2.0.0.M7.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
<dependent-module archiveName="spring-jdbc-3.0.4.RELEASE.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-jdbc/3.0.4.RELEASE/spring-jdbc-3.0.4.RELEASE.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
- <dependent-module archiveName="spring-js-2.1.1.RELEASE.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/webflow/spring-js/2.1.1.RELEASE/spring-js-2.1.1.RELEASE.jar">
+ <dependent-module archiveName="spring-js-resources-2.2.0.BUILD-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/webflow/spring-js-resources/2.2.0.BUILD-SNAPSHOT/spring-js-resources-2.2.0.BUILD-SNAPSHOT.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="spring-orm-3.0.4.RELEASE.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/org/springframework/spring-orm/3.0.4.RELEASE/spring-orm-3.0.4.RELEASE.jar">
@@ -147,6 +186,12 @@
<dependent-module archiveName="xml-apis-1.0.b2.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
+ <dependent-module archiveName="xpp3_min-1.1.4c.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
+ <dependent-module archiveName="xstream-1.3.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/var/M2_REPO/com/thoughtworks/xstream/xstream/1.3/xstream-1.3.jar">
+ <dependency-type>uses</dependency-type>
+ </dependent-module>
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/resources"/>
</wb-module>
576 pom.xml
View
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<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">
+<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">
<modelVersion>4.0.0</modelVersion>
- <groupId>com.springsource.petclinic</groupId>
- <artifactId>petclinic</artifactId>
+ <groupId>com.springsource.html5</groupId>
+ <artifactId>spring-html5</artifactId>
<packaging>war</packaging>
<version>0.1.0.BUILD-SNAPSHOT</version>
- <name>petclinic</name>
+ <name>spring-html5</name>
<properties>
<roo.version>1.1.0.M3</roo.version>
<spring.version>3.0.4.RELEASE</spring.version>
@@ -14,44 +15,44 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
- <repository>
- <id>spring-maven-release</id>
- <name>Spring Maven Release Repository</name>
- <url>http://maven.springframework.org/release</url>
- </repository>
- <repository>
- <id>spring-maven-milestone</id>
- <name>Spring Maven Milestone Repository</name>
- <url>http://maven.springframework.org/milestone</url>
- </repository>
- <repository>
- <id>spring-roo-repository</id>
- <name>Spring Roo Repository</name>
- <url>http://spring-roo-repository.springsource.org/release</url>
- </repository>
- <repository>
- <id>JBoss Repo</id>
- <url>https://repository.jboss.org/nexus/content/repositories/releases</url>
- <name>JBoss Repo</name>
- </repository>
- </repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>spring-maven-release</id>
- <name>Spring Maven Release Repository</name>
- <url>http://maven.springframework.org/release</url>
- </pluginRepository>
- <pluginRepository>
- <id>spring-maven-milestone</id>
- <name>Spring Maven Milestone Repository</name>
- <url>http://maven.springframework.org/milestone</url>
- </pluginRepository>
- <pluginRepository>
- <id>spring-roo-repository</id>
- <name>Spring Roo Repository</name>
- <url>http://spring-roo-repository.springsource.org/release</url>
- </pluginRepository>
- </pluginRepositories>
+ <repository>
+ <id>spring-maven-release</id>
+ <name>Spring Maven Release Repository</name>
+ <url>http://maven.springframework.org/release</url>
+ </repository>
+ <repository>
+ <id>spring-maven-milestone</id>
+ <name>Spring Maven Milestone Repository</name>
+ <url>http://maven.springframework.org/milestone</url>
+ </repository>
+ <repository>
+ <id>spring-roo-repository</id>
+ <name>Spring Roo Repository</name>
+ <url>http://spring-roo-repository.springsource.org/release</url>
+ </repository>
+ <repository>
+ <id>JBoss Repo</id>
+ <url>https://repository.jboss.org/nexus/content/repositories/releases</url>
+ <name>JBoss Repo</name>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>spring-maven-release</id>
+ <name>Spring Maven Release Repository</name>
+ <url>http://maven.springframework.org/release</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>spring-maven-milestone</id>
+ <name>Spring Maven Milestone Repository</name>
+ <url>http://maven.springframework.org/milestone</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>spring-roo-repository</id>
+ <name>Spring Roo Repository</name>
+ <url>http://spring-roo-repository.springsource.org/release</url>
+ </pluginRepository>
+ </pluginRepositories>
<dependencies>
<!-- General dependencies for standard applications -->
<dependency>
@@ -147,218 +148,249 @@
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
- <dependency>
- <groupId>org.hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <version>2.0.0</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>3.5.5-Final</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <version>3.5.5-Final</version>
- <exclusions>
- <exclusion>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- </exclusion>
- <exclusion>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.hibernate.javax.persistence</groupId>
- <artifactId>hibernate-jpa-2.0-api</artifactId>
- <version>1.0.0.Final</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- <version>4.1.0.Final</version>
- <exclusions>
- <exclusion>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</artifactId>
- <version>1.0.0.GA</version>
- </dependency>
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- <version>2.2</version>
- </dependency>
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-orm</artifactId>
- <version>${spring.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-pool</groupId>
- <artifactId>commons-pool</artifactId>
- <version>1.5.4</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-pool</groupId>
- <artifactId>commons-pool</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xerces</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.tiles</groupId>
- <artifactId>tiles-core</artifactId>
- <version>2.2.1</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.tiles</groupId>
- <artifactId>tiles-jsp</artifactId>
- <version>2.2.1</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-web</artifactId>
- <version>${spring.version}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- <version>${spring.version}</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.springframework.webflow</groupId>
- <artifactId>spring-js</artifactId>
- <version>2.1.1.RELEASE</version>
- <exclusions>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context-support</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-digester</groupId>
- <artifactId>commons-digester</artifactId>
- <version>2.0</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.2.1</version>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <version>1.2</version>
- </dependency>
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>joda-time</groupId>
- <artifactId>joda-time</artifactId>
- <version>1.6</version>
- </dependency>
- </dependencies>
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>2.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>3.5.5-Final</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>3.5.5-Final</version>
+ <exclusions>
+ <exclusion>
+ <groupId>cglib</groupId>
+ <artifactId>cglib</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <version>1.0.0.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>4.1.0.Final</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ <version>1.0.0.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>2.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-jdbc</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-orm</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-pool</groupId>
+ <artifactId>commons-pool</artifactId>
+ <version>1.5.4</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <version>1.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-pool</groupId>
+ <artifactId>commons-pool</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xerces</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tiles</groupId>
+ <artifactId>tiles-core</artifactId>
+ <version>2.2.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tiles</groupId>
+ <artifactId>tiles-jsp</artifactId>
+ <version>2.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>${spring.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.webflow</groupId>
+ <artifactId>spring-js-resources</artifactId>
+ <version>2.2.0.BUILD-SNAPSHOT</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>2.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.2.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>1.6</version>
+ </dependency>
+ <!-- Manually added dependencies -->
+ <dependency>
+ <groupId>org.atmosphere</groupId>
+ <artifactId>atmosphere-runtime</artifactId>
+ <version>0.7-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.integration</groupId>
+ <artifactId>spring-integration-http</artifactId>
+ <version>2.0.0.M7</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.batch</groupId>
+ <artifactId>spring-batch-core</artifactId>
+ <version>2.1.3.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>1.5.3</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.closure</groupId>
+ <artifactId>closure-templates</artifactId>
+ <version>20100708</version>
+ </dependency>
+ </dependencies>
<build>
<plugins>
<plugin>
@@ -383,7 +415,10 @@
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.0</version>
<dependencies>
- <!-- NB: You must use Maven 2.0.9 or above or these are ignored (see MNG-2972) -->
+ <!--
+ NB: You must use Maven 2.0.9 or above or these are ignored (see
+ MNG-2972)
+ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
@@ -454,6 +489,7 @@
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.7</version> <!-- Note 2.8 does not work with AspectJ aspect path -->
<configuration>
+ <useProjectReferences>false</useProjectReferences>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<wtpversion>2.0</wtpversion>
@@ -494,22 +530,22 @@
<artifactId>jetty-maven-plugin</artifactId>
<version>7.1.2.v20100523</version>
<configuration>
- <webAppConfig>
- <contextPath>/${project.name}</contextPath>
- </webAppConfig>
+ <webAppConfig>
+ <contextPath>/${project.name}</contextPath>
+ </webAppConfig>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>selenium-maven-plugin</artifactId>
+ <version>1.0.1</version>
+ <configuration>
+ <suite>src/main/webapp/selenium/test-suite.xhtml</suite>
+ <browser>*firefox</browser>
+ <results>${project.build.directory}/target/selenium.txt</results>
+ <startURL>http://localhost:4444/</startURL>
</configuration>
</plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>selenium-maven-plugin</artifactId>
- <version>1.0.1</version>
- <configuration>
- <suite>src/main/webapp/selenium/test-suite.xhtml</suite>
- <browser>*firefox</browser>
- <results>${project.build.directory}/target/selenium.txt</results>
- <startURL>http://localhost:4444/</startURL>
- </configuration>
- </plugin>
- </plugins>
+ </plugins>
</build>
</project>
BIN  soy-20100708.jar
View
Binary file not shown
66 src/main/java/com/springsource/html5/appcache/template/SoyConfiguration.java
View
@@ -0,0 +1,66 @@
+package com.springsource.html5.appcache.template;
+
+import static com.google.template.soy.SoyFileSet.Builder;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+
+import org.springframework.context.ResourceLoaderAware;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Scope;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.ResourceLoader;
+import org.springframework.core.io.support.ResourcePatternResolver;
+import org.springframework.util.Assert;
+import org.springframework.util.FileCopyUtils;
+
+import com.google.template.soy.SoyFileSet;
+import com.google.template.soy.jssrc.SoyJsSrcOptions;
+import com.google.template.soy.tofu.SoyTofu;
+
+@Configuration
+public class SoyConfiguration implements ResourceLoaderAware {
+
+ private ResourcePatternResolver resourceResolver;
+
+ @Bean
+ @Scope(value="prototype")
+ public SoyFileSet soyFileSet() throws IOException {
+ List<Resource> resources = Arrays.asList(resourceResolver.getResources("WEB-INF/soy/*.soy"));
+ Builder builder = new Builder();
+ for (Resource resource : resources) {
+ builder.add(resource.getURL());
+ }
+ return builder.build();
+ }
+
+ @Bean
+ public SoyTofu soyTofu() throws IOException {
+ return soyFileSet().compileToJavaObj();
+ }
+
+ /*@Bean
+ public List<String> soyJavaScript() throws IOException {
+ SoyJsSrcOptions options = new SoyJsSrcOptions();
+ List<String> jsSrc = soyFileSet().compileToJsSrc(options, null);
+ Resource targetDir = resourceResolver.getResource("templates/");
+ if (targetDir.exists()) {
+ String combinedSource = "";
+ for (String src : jsSrc) {
+ combinedSource += src;
+ }
+ File target = new File(targetDir.getFile(), "template.js");
+ FileCopyUtils.copy(combinedSource.getBytes(), target);
+ }
+ return jsSrc;
+ }*/
+
+ @Override
+ public void setResourceLoader(ResourceLoader resourceLoader) {
+ Assert.isInstanceOf(ResourcePatternResolver.class, resourceLoader, "Expected an instance of ResourcePatternResolver");
+ this.resourceResolver = (ResourcePatternResolver) resourceLoader;
+ }
+}
44 src/main/java/com/springsource/html5/visualization/CommitRecord.java
View
@@ -0,0 +1,44 @@
+package com.springsource.html5.visualization;
+
+public class CommitRecord {
+
+ private final long timestamp;
+
+ private final String username;
+
+ private final String commitType;
+
+ private final String moduleName;
+
+ public CommitRecord(long timestamp, String username, String commitType,
+ String moduleName) {
+
+ this.timestamp = timestamp;
+ this.username = username;
+ this.commitType = commitType;
+ this.moduleName = moduleName;
+ }
+
+ public long getTimestamp() {
+ return timestamp;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public String getCommitType() {
+ return commitType;
+ }
+
+ public String getModuleName() {
+ return moduleName;
+ }
+
+ @Override
+ public String toString() {
+ return "CommitRecord [commitType=" + commitType + ", moduleName="
+ + moduleName + ", timestamp=" + timestamp + ", username="
+ + username + "]";
+ }
+}
29 src/main/java/com/springsource/html5/visualization/CommitRecordFieldSetMapper.java
View
@@ -0,0 +1,29 @@
+package com.springsource.html5.visualization;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.springframework.batch.item.file.mapping.FieldSetMapper;
+import org.springframework.batch.item.file.transform.FieldSet;
+import org.springframework.validation.BindException;
+
+public class CommitRecordFieldSetMapper implements FieldSetMapper<CommitRecord> {
+
+ private final Pattern modulePattern = Pattern.compile("(/trunk/org\\.springframework\\.)([a-z\\.]*)/(.*)");
+
+ public CommitRecord mapFieldSet(FieldSet fieldSet) throws BindException {
+ long timestamp = fieldSet.readLong(0);
+ String username = fieldSet.readString(1);
+ String commitType = fieldSet.readString(2);
+ String rawFileName = fieldSet.readString(3);
+
+ String moduleName = "infrastructure";
+ Matcher moduleMatcher = modulePattern.matcher(rawFileName);
+ if (moduleMatcher.matches()) {
+ moduleName = moduleMatcher.group(2);
+ }
+
+ return new CommitRecord(timestamp, username, commitType, moduleName);
+ }
+
+}
48 src/main/java/com/springsource/html5/visualization/CommitRecordProcessingConfiguration.java
View
@@ -0,0 +1,48 @@
+package com.springsource.html5.visualization;
+
+import javax.annotation.Resource;
+
+import org.springframework.batch.item.ItemReader;
+import org.springframework.batch.item.ItemWriter;
+import org.springframework.batch.item.file.FlatFileItemReader;
+import org.springframework.batch.item.file.mapping.DefaultLineMapper;
+import org.springframework.batch.item.file.transform.DelimitedLineTokenizer;
+import org.springframework.context.ResourceLoaderAware;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.io.ResourceLoader;
+import org.springframework.integration.MessageChannel;
+
+//@Configuration
+public class CommitRecordProcessingConfiguration implements ResourceLoaderAware{
+
+ private ResourceLoader resourceLoader;
+
+ private MessageChannel commitRecordChannel;
+
+ @Bean
+ public ItemReader<CommitRecord> commitRecordReader() {
+ FlatFileItemReader<CommitRecord> reader = new FlatFileItemReader<CommitRecord>();
+ reader.setResource(resourceLoader.getResource("classpath:spring-gource.log"));
+ DefaultLineMapper<CommitRecord> lineMapper = new DefaultLineMapper<CommitRecord>();
+ lineMapper.setLineTokenizer(new DelimitedLineTokenizer('|'));
+ lineMapper.setFieldSetMapper(new CommitRecordFieldSetMapper());
+ reader.setLineMapper(lineMapper);
+ return reader;
+ }
+
+ @Bean
+ public ItemWriter<CommitRecord> commitRecordWriter() {
+ MessageSendingItemWriter<CommitRecord> writer = new MessageSendingItemWriter<CommitRecord>(commitRecordChannel);
+ return writer;
+ }
+
+ @Resource
+ public void setCommitRecordChannel(MessageChannel commitRecordChannel) {
+ this.commitRecordChannel = commitRecordChannel;
+ }
+
+ public void setResourceLoader(ResourceLoader resourceLoader) {
+ this.resourceLoader = resourceLoader;
+ }
+}
24 src/main/java/com/springsource/html5/visualization/MessageSendingItemWriter.java
View
@@ -0,0 +1,24 @@
+package com.springsource.html5.visualization;
+
+import java.util.List;
+
+import org.springframework.batch.item.ItemWriter;
+import org.springframework.integration.Message;
+import org.springframework.integration.MessageChannel;
+import org.springframework.integration.support.MessageBuilder;
+
+public class MessageSendingItemWriter<T> implements ItemWriter<T> {
+
+ private final MessageChannel outputChannel;
+
+ public MessageSendingItemWriter(MessageChannel outputChannel) {
+ this.outputChannel = outputChannel;
+ }
+
+ public void write(List<? extends T> items) throws Exception {
+ for (T item : items) {
+ Message<?> message = MessageBuilder.withPayload(item).build();
+ outputChannel.send(message);
+ }
+ }
+}
47 src/main/java/com/springsource/petclinic/web/TemplateRefreshingHandlerInterceptor.java
View
@@ -0,0 +1,47 @@
+package com.springsource.petclinic.web;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.core.io.Resource;
+import org.springframework.util.FileCopyUtils;
+import org.springframework.web.servlet.mvc.WebContentInterceptor;
+
+import com.google.template.soy.SoyFileSet;
+import com.google.template.soy.jssrc.SoyJsSrcOptions;
+
+public class TemplateRefreshingHandlerInterceptor extends WebContentInterceptor{
+
+ //private AtomicLong
+
+ @Override
+ public boolean preHandle(HttpServletRequest request,
+ HttpServletResponse response, Object handler)
+ throws ServletException {
+ SoyFileSet sfs = super.getApplicationContext().getBean(SoyFileSet.class);
+ SoyJsSrcOptions options = new SoyJsSrcOptions();
+ List<String> jsSrc = sfs.compileToJsSrc(options, null);
+ Resource targetDir = getApplicationContext().getResource("templates/");
+ if (targetDir.exists()) {
+ String combinedSource = "";
+ for (String src : jsSrc) {
+ combinedSource += src;
+ }
+ try {
+ File target = new File(targetDir.getFile(), "template.js");
+ FileCopyUtils.copy(combinedSource.getBytes(), target);
+ } catch (IOException e) {
+ throw new ServletException("Failed to regenerate Soy JS Templates", e);
+ }
+ }
+ return true;
+ }
+
+
+
+}
242 src/main/java/org/springframework/integration/comet/AsyncHttpRequestHandlingMessageAdapter.java
View
@@ -0,0 +1,242 @@
+package org.springframework.integration.comet;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.Future;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.atmosphere.cpr.AtmosphereResource;
+import org.atmosphere.cpr.AtmosphereServlet;
+import org.atmosphere.cpr.Broadcaster;
+import org.atmosphere.cpr.BroadcasterFactory;
+import org.atmosphere.cpr.DefaultBroadcaster;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.server.ServletServerHttpRequest;
+import org.springframework.http.server.ServletServerHttpResponse;
+import org.springframework.integration.Message;
+import org.springframework.integration.MessageChannel;
+import org.springframework.integration.MessageDeliveryException;
+import org.springframework.integration.MessageHandlingException;
+import org.springframework.integration.MessageRejectedException;
+import org.springframework.integration.core.MessageHandler;
+import org.springframework.integration.core.PollableChannel;
+import org.springframework.integration.core.SubscribableChannel;
+import org.springframework.integration.endpoint.AbstractEndpoint;
+import org.springframework.integration.endpoint.EventDrivenConsumer;
+import org.springframework.integration.endpoint.PollingConsumer;
+import org.springframework.integration.http.DefaultHttpHeaderMapper;
+import org.springframework.integration.mapping.HeaderMapper;
+import org.springframework.integration.support.MessageBuilder;
+import org.springframework.util.Assert;
+import org.springframework.util.StringUtils;
+import org.springframework.web.HttpRequestHandler;
+
+public class AsyncHttpRequestHandlingMessageAdapter extends AbstractEndpoint
+ implements MessageHandler, HttpRequestHandler {
+
+ public static final String ENDPOINT_PATH_HEADER = "endpoint-path";
+
+ private static final Log log = LogFactory.getLog(AsyncHttpRequestHandlingMessageAdapter.class);
+
+ private volatile MessageChannel messageChannel;
+
+ private volatile AbstractEndpoint consumerEndpoint;
+
+ private final HttpMessageMapper messageMapper = new HttpMessageMapper();
+
+ private volatile HeaderMapper<HttpHeaders> headerMapper = new DefaultHttpHeaderMapper();
+
+ private volatile Class<?> requestPayloadType = null;
+
+ private volatile boolean extractResponsePayload = true;
+
+ //Hopefully this threshold handling is temporary until we get the BroadcasterCache working as it should, though it might still be a useful
+ //feature if someone wants to control the rate of messages to cut down on HTTP traffic
+ private volatile int messageThreshold = 0;
+
+ private volatile BlockingQueue<HttpBroadcastMessage> messageQueue;
+
+ public void handleMessage(Message<?> message)
+ throws MessageRejectedException, MessageHandlingException,
+ MessageDeliveryException {
+ try {
+ HttpBroadcastMessage httpMessage = new HttpBroadcastMessage(MessageBuilder.fromMessage(message).setHeaderIfAbsent(ENDPOINT_PATH_HEADER,
+ this.getComponentName()).build(), this.extractResponsePayload, this.headerMapper);
+ messageQueue.add(httpMessage);
+ if (messageQueue.size() >= messageThreshold) {
+ Broadcaster broadcaster = BroadcasterFactory.getDefault().lookup(DefaultBroadcaster.class, this.getComponentName());
+ if (broadcaster == null) {
+ //TODO - This will potentially cause lost messages...fix that
+ log.warn("Message received but no Broadcaster available.");
+ return;
+ }
+ List<HttpBroadcastMessage> broadcastMessages = new ArrayList<HttpBroadcastMessage>();
+ messageQueue.drainTo(broadcastMessages);
+ if (broadcastMessages.size() > 0) {
+ if (log.isInfoEnabled()) {
+ log.info("Broadcasting message "+message.toString()+" to "+broadcaster.getAtmosphereResources().size()+ " suspended resources.");
+ }
+ Future<Object> future = broadcaster.broadcast(broadcastMessages);
+ if (future != null) {
+ future.get();
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Broadcast operation for "+broadcastMessages+" executed.");
+ }
+ }
+ }
+ } catch (Exception ex) {
+ throw new IllegalStateException("Broadcast failed", ex);
+ }
+ }
+
+ public void handleRequest(HttpServletRequest request,
+ HttpServletResponse response) throws ServletException, IOException {
+
+ AtmosphereResource<HttpServletRequest, HttpServletResponse> resource = getAtmosphereResource(request);
+
+ if (!this.getComponentName().equals(resource.getBroadcaster().getID())) {
+ resource.getBroadcaster().setID(this.getComponentName());
+ }
+
+ if (request.getMethod().equalsIgnoreCase("GET")) {
+ subscribe(resource);
+ } else if (request.getMethod().equalsIgnoreCase("POST")){
+ publish(resource);
+ }
+ }
+
+ @Override
+ protected void onInit() throws Exception {
+ super.onInit();
+ if (this.messageChannel instanceof PollableChannel) {
+ this.consumerEndpoint = new PollingConsumer(
+ (PollableChannel) this.messageChannel, this);
+ } else if (this.messageChannel instanceof SubscribableChannel) {
+ this.consumerEndpoint = new EventDrivenConsumer(
+ (SubscribableChannel) this.messageChannel, this);
+ }
+ }
+
+ private void subscribe(
+ AtmosphereResource<HttpServletRequest, HttpServletResponse> resource) {
+ if (log.isInfoEnabled()) {
+ log.info("Handling subscription request for resource with broadcaster ID: "+resource.getBroadcaster().getID());
+ }
+ //Write a content type (for all future responses) as best guessed from the configured converters, since this is our
+ //only chance to write the headers.
+ ServletServerHttpRequest request = new ServletServerHttpRequest(resource.getRequest());
+ ServletServerHttpResponse response = new ServletServerHttpResponse(resource.getResponse());
+ for (HttpMessageConverter<?> converter : this.messageMapper.getMessageConverters()) {
+ for (MediaType acceptType : request.getHeaders().getAccept()) {
+ for (MediaType supportedMediaType : converter.getSupportedMediaTypes()) {
+ if (!MediaType.ALL.equals(supportedMediaType) && supportedMediaType.isCompatibleWith(acceptType)) {
+ if (!supportedMediaType.isWildcardType() && !supportedMediaType.isWildcardSubtype()) {
+ response.getHeaders().setContentType(supportedMediaType);
+ } else {
+ //Try to guess the "default" type for the converter
+ MediaType defaultType = converter.getSupportedMediaTypes().get(0);
+ if (!defaultType.isWildcardType() && !defaultType.isWildcardSubtype()) {
+ response.getHeaders().setContentType(defaultType);
+ }
+ }
+ doSuspend(resource);
+ if (log.isInfoEnabled()) {
+ log.info("Resource with broadcaster ID: "+resource.getBroadcaster().getID()+" suspended.");
+ }
+ return;
+ }
+ }
+ }
+ }
+
+ doSuspend(resource);
+
+ if (log.isInfoEnabled()) {
+ log.info("Resource with broadcaster ID: "+resource.getBroadcaster().getID()+" suspended without writing a Content-Type.");
+ }
+ }
+
+ private void doSuspend(
+ AtmosphereResource<HttpServletRequest, HttpServletResponse> resource) {
+ boolean flushComment = isFlushCommentsRequired(resource.getRequest());
+ setResumeOnBroadcast(resource.getRequest());
+
+ //TODO - Allow setting an explicit long-poll timeout
+ resource.suspend(-1L, flushComment);
+ }
+
+ private boolean isFlushCommentsRequired(HttpServletRequest request) {
+ String upgrade = request.getHeader("Connection");
+ if (StringUtils.hasText(upgrade) && upgrade.equalsIgnoreCase("Upgrade")) {
+ return false;
+ } else if (isLongPolling(request)) {
+ return false;
+ }
+ return true;
+ }
+
+ private void setResumeOnBroadcast(HttpServletRequest request) {
+ if (isLongPolling(request)) {
+ request.setAttribute(AtmosphereServlet.RESUME_ON_BROADCAST, new Boolean(true));
+ }
+ }
+
+ private boolean isLongPolling(HttpServletRequest request) {
+ String transport = request.getHeader("X-Atmosphere-Transport");
+ return StringUtils.hasText(transport) && transport.equals("long-polling");
+ }
+
+ private void publish(
+ AtmosphereResource<HttpServletRequest, HttpServletResponse> resource) {
+ Message<?> message;
+ try {
+ message = messageMapper.readMessage(resource.getRequest(), this.requestPayloadType, this.headerMapper);
+ } catch (Exception ex) {
+ throw new IllegalStateException("Could not read request body.", ex);
+ }
+ this.messageChannel.send(message);
+ }
+
+ @SuppressWarnings("unchecked")
+ private AtmosphereResource<HttpServletRequest, HttpServletResponse> getAtmosphereResource(
+ HttpServletRequest request) {
+ AtmosphereResource<HttpServletRequest, HttpServletResponse> resource = (AtmosphereResource<HttpServletRequest, HttpServletResponse>) request
+ .getAttribute(AtmosphereServlet.ATMOSPHERE_RESOURCE);
+ Assert
+ .notNull(
+ resource,
+ "AtmosphereResource could not be located for the request. Check that AtmosphereServlet is configured correctly in web.xml");
+ return resource;
+ }
+
+ @Override
+ protected void doStart() {
+ this.messageQueue = new LinkedBlockingQueue<HttpBroadcastMessage>();
+ this.consumerEndpoint.start();
+ }
+
+ @Override
+ protected void doStop() {
+ this.consumerEndpoint.stop();
+ }
+
+ public void setMessageChannel(MessageChannel messageChannel) {
+ this.messageChannel = messageChannel;
+ }
+
+ public void setMessageThreshold(int messageThreshold) {
+ this.messageThreshold = messageThreshold;
+ }
+}
32 src/main/java/org/springframework/integration/comet/HttpBroadcastMessage.java
View
@@ -0,0 +1,32 @@
+package org.springframework.integration.comet;
+
+import org.springframework.http.HttpHeaders;
+import org.springframework.integration.Message;
+import org.springframework.integration.mapping.HeaderMapper;
+
+public class HttpBroadcastMessage {
+
+ private final Message<?> message;
+
+ private final boolean extractPayload;
+
+ private final HeaderMapper<HttpHeaders> headerMapper;
+
+ public HttpBroadcastMessage(Message<?> message, boolean extractPayload, HeaderMapper<HttpHeaders> headerMapper) {
+ this.message = message;
+ this.extractPayload = extractPayload;
+ this.headerMapper = headerMapper;
+ }
+
+ public boolean isExtractPayload() {
+ return extractPayload;
+ }
+
+ public Message<?> getMessage() {
+ return message;
+ }
+
+ public HeaderMapper<HttpHeaders> getHeaderMapper() {
+ return headerMapper;
+ }
+}
133 src/main/java/org/springframework/integration/comet/HttpMessageBroadcaster.java
View
@@ -0,0 +1,133 @@
+package org.springframework.integration.comet;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.atmosphere.cpr.AtmosphereResource;
+import org.atmosphere.cpr.AtmosphereResourceEvent;
+import org.atmosphere.cpr.AtmosphereServlet;
+import org.atmosphere.cpr.DefaultBroadcaster;
+import org.springframework.http.HttpHeaders;
+import org.springframework.integration.Message;
+import org.springframework.integration.MessagingException;
+import org.springframework.integration.http.DefaultHttpHeaderMapper;
+import org.springframework.integration.mapping.HeaderMapper;
+import org.springframework.integration.support.MessageBuilder;
+
+public class HttpMessageBroadcaster extends DefaultBroadcaster {
+
+ private static final Log log = LogFactory.getLog(HttpMessageBroadcaster.class);
+
+ private final HttpMessageMapper messageMapper = new HttpMessageMapper();
+
+ private volatile HeaderMapper<HttpHeaders> headerMapper = new DefaultHttpHeaderMapper();
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ protected void broadcast(AtmosphereResource<?, ?> resource, AtmosphereResourceEvent event) {
+ List<HttpBroadcastMessage> messages = new ArrayList<HttpBroadcastMessage>();
+ if (event.getMessage() instanceof List) {
+ List messageBacklog = (List) event.getMessage();
+ if (!messageBacklog.isEmpty() && messageBacklog.get(0) instanceof HttpBroadcastMessage) {
+ messages.addAll(messageBacklog);
+ } else {
+ super.broadcast(resource, event);
+ return;
+ }
+ } else if (HttpBroadcastMessage.class.isAssignableFrom(event.getMessage().getClass())){
+ messages.add((HttpBroadcastMessage) event.getMessage());
+ } else {
+ super.broadcast(resource, event);
+ return;
+ }
+
+ Message<?> broadcastMessage = mergeMessagesForBroadcast(messages);
+ HttpServletRequest request = (HttpServletRequest) resource.getRequest();
+ HttpServletResponse response = (HttpServletResponse) resource.getResponse();
+ try {
+ response.getOutputStream();
+ } catch (Exception ex) {
+ throw new MessagingException("Cannot get the Servlet OutputStream for delivering async Message to browser client. " +
+ "Ensure that you've set 'useStreamForFlushingComments' to true in the AtmosphereServlet.", ex);
+ }
+
+ HttpMessageBroadcasterResponseWrapper responseWrapper = new HttpMessageBroadcasterResponseWrapper(response);
+ messageMapper.writeMessage(request, responseWrapper, broadcastMessage, true, headerMapper);
+ try {
+ response.getOutputStream().write(responseWrapper.toByteArray());
+ if (log.isInfoEnabled()) {
+ log.info("Wrote "+responseWrapper.toByteArray().length+" bytes to response.");
+ }
+ response.getOutputStream().flush();
+ } catch (IOException ex) {
+ throw new MessagingException("Failed to write async Message to browser client.", ex);
+ }
+
+ Boolean resumeOnBroadcast = (Boolean) request.getAttribute(AtmosphereServlet.RESUME_ON_BROADCAST);
+ if (resumeOnBroadcast != null && resumeOnBroadcast) {
+ resource.resume();
+ }
+ }
+
+ private Message<?> mergeMessagesForBroadcast(List<HttpBroadcastMessage> messages) {
+ List<Object> payloads = new ArrayList<Object>();
+ for(HttpBroadcastMessage message : messages) {
+ payloads.add(message.getMessage().getPayload());
+ }
+ return MessageBuilder.withPayload(payloads).build();
+ }
+
+ private static class HttpMessageBroadcasterResponseWrapper extends HttpServletResponseWrapper {
+
+ private final ByteArrayOutputStream content = new ByteArrayOutputStream();
+
+ private final ServletOutputStream outputStream = new ResponseServletOutputStream();
+
+ private HttpMessageBroadcasterResponseWrapper(HttpServletResponse response) {
+ super(response);
+ }
+
+ @Override
+ public ServletOutputStream getOutputStream() {
+ return this.outputStream;
+ }
+
+ @Override
+ public void resetBuffer() {
+ this.content.reset();
+ }
+
+ @Override
+ public void reset() {
+ super.reset();
+ resetBuffer();
+ }
+
+ private byte[] toByteArray() {
+ return this.content.toByteArray();
+ }
+
+ private class ResponseServletOutputStream extends ServletOutputStream {
+
+ @Override
+ public void write(int b) throws IOException {
+ content.write(b);
+ }
+
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException {
+ content.write(b, off, len);
+ }
+ }
+ }
+
+}
175 src/main/java/org/springframework/integration/comet/HttpMessageMapper.java
View
@@ -0,0 +1,175 @@
+package org.springframework.integration.comet;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+import org.springframework.http.converter.ByteArrayHttpMessageConverter;
+import org.springframework.http.converter.HttpMessageConverter;
+import org.springframework.http.converter.ResourceHttpMessageConverter;
+import org.springframework.http.converter.StringHttpMessageConverter;
+import org.springframework.http.converter.json.MappingJacksonHttpMessageConverter;
+import org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter;
+import org.springframework.http.converter.xml.SourceHttpMessageConverter;
+import org.springframework.http.server.ServletServerHttpRequest;
+import org.springframework.http.server.ServletServerHttpResponse;
+import org.springframework.integration.Message;
+import org.springframework.integration.MessagingException;
+import org.springframework.integration.support.MessageBuilder;
+import org.springframework.integration.http.MultipartAwareFormHttpMessageConverter;
+import org.springframework.integration.http.SerializingHttpMessageConverter;
+import org.springframework.integration.mapping.HeaderMapper;
+import org.springframework.util.ClassUtils;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+
+public class HttpMessageMapper {
+
+ private static final Log log = LogFactory.getLog(HttpMessageMapper.class);
+
+ private static final boolean jaxb2Present = ClassUtils.isPresent(
+ "javax.xml.bind.Binder", HttpMessageMapper.class
+ .getClassLoader());
+
+ private static final boolean jacksonPresent = ClassUtils.isPresent(
+ "org.codehaus.jackson.map.ObjectMapper",
+ HttpMessageMapper.class.getClassLoader())
+ && ClassUtils.isPresent("org.codehaus.jackson.JsonGenerator",
+ HttpMessageMapper.class.getClassLoader());
+
+ private static boolean romePresent = ClassUtils.isPresent(
+ "com.sun.syndication.feed.WireFeed",
+ HttpMessageMapper.class.getClassLoader());
+
+ private volatile List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>();
+
+ @SuppressWarnings("unchecked")
+ public HttpMessageMapper() {
+ this.messageConverters.add(new MultipartAwareFormHttpMessageConverter());
+ this.messageConverters.add(new SerializingHttpMessageConverter());
+ if (jacksonPresent) {
+ this.messageConverters.add(new MappingJacksonHttpMessageConverter());
+ }
+ this.messageConverters.add(new ByteArrayHttpMessageConverter());
+ this.messageConverters.add(new StringHttpMessageConverter());
+ this.messageConverters.add(new ResourceHttpMessageConverter());
+ this.messageConverters.add(new SourceHttpMessageConverter());
+ if (jaxb2Present) {
+ this.messageConverters.add(new Jaxb2RootElementHttpMessageConverter());
+ }
+ if (romePresent) {
+ // TODO add deps for:
+ //this.messageConverters.add(new AtomFeedHttpMessageConverter());
+ //this.messageConverters.add(new RssChannelHttpMessageConverter());
+ }
+ }
+
+ public Message<?> readMessage(HttpServletRequest servletRequest, Class<?> expectedType, HeaderMapper<HttpHeaders> headerMapper) {
+ ServletServerHttpRequest request = new ServletServerHttpRequest(servletRequest);
+ Object payload = null;
+ if (this.isReadable(request)) {
+ payload = this.generatePayloadFromRequestBody(request, null);
+ }
+ else {
+ payload = this.convertParameterMap(servletRequest.getParameterMap());
+ }
+ Map<String, ?> headers = headerMapper.toHeaders(request.getHeaders());
+ return MessageBuilder.withPayload(payload)
+ .copyHeaders(headers)
+ .setHeader(org.springframework.integration.http.HttpHeaders.REQUEST_URL, request.getURI().toString())
+ .setHeader(org.springframework.integration.http.HttpHeaders.REQUEST_METHOD, request.getMethod().toString())
+ .setHeader(org.springframework.integration.http.HttpHeaders.USER_PRINCIPAL, servletRequest.getUserPrincipal())
+ .build();
+ }
+
+ @SuppressWarnings("unchecked")
+ public void writeMessage(HttpServletRequest servletRequest, HttpServletResponse servletResponse, Message<?> message, boolean extractPayload, HeaderMapper<HttpHeaders> headerMapper) {
+ ServletServerHttpRequest request = new ServletServerHttpRequest(servletRequest);
+ ServletServerHttpResponse response = new ServletServerHttpResponse(servletResponse);
+ Object content = message;
+ if(extractPayload) {
+ headerMapper.fromHeaders(message.getHeaders(), response.getHeaders());
+ content = message.getPayload();
+ }
+ for (HttpMessageConverter converter : this.getMessageConverters()) {
+ if (CollectionUtils.isEmpty(request.getHeaders().getAccept())) {
+ //TODO - This is needed because the headers never get set with WebSocket. Make this configurable.
+ request.getHeaders().set("Accept", "application/json");
+ }
+ for (MediaType acceptType : request.getHeaders().getAccept()) {
+ if (converter.canWrite(content.getClass(), acceptType)) {
+ try {
+ converter.write(content, acceptType, response);
+ } catch (Exception e) {
+ throw new MessagingException("Could not convert reply: failed to convert response of type [" +
+ content.getClass().getName() + "] to accepted type [" + acceptType + "]");
+ }
+ return;
+ }
+ }
+ }
+ throw new MessagingException("Could not convert reply: no suitable HttpMessageConverter found for type [" +
+ content.getClass().getName() + "] and accept types [" + request.getHeaders().getAccept() + "]");
+ }
+
+ /**
+ * Checks if the request has a readable body (not a GET, HEAD, or OPTIONS request)
+ * and a Content-Type header.
+ */
+ private boolean isReadable(ServletServerHttpRequest request) {
+ HttpMethod method = request.getMethod();
+ if (HttpMethod.GET.equals(method) || HttpMethod.HEAD.equals(method) || HttpMethod.OPTIONS.equals(method)) {
+ return false;
+ }
+ return request.getHeaders().getContentType() != null;
+ }
+
+ /**
+ * Converts a servlet request's parameterMap to a {@link MultiValueMap}.
+ */
+ @SuppressWarnings("unchecked")
+ private LinkedMultiValueMap<String, String> convertParameterMap(Map parameterMap) {
+ LinkedMultiValueMap<String, String> convertedMap = new LinkedMultiValueMap<String, String>();
+ for (Object key : parameterMap.keySet()) {
+ String[] values = (String[]) parameterMap.get(key);
+ for (String value : values) {
+ convertedMap.add((String) key, value);
+ }
+ }
+ return convertedMap;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Object generatePayloadFromRequestBody(ServletServerHttpRequest request, Class<?> expectedType) {
+ MediaType contentType = request.getHeaders().getContentType();
+ if (expectedType == null) {
+ expectedType = ("text".equals(contentType.getType())) ? String.class : byte[].class;
+ }
+ for (HttpMessageConverter<?> converter : getMessageConverters()) {
+ if (converter.canRead(expectedType, contentType)) {
+ try {
+ return converter.read((Class) expectedType, request);
+ } catch (Exception ex) {
+ throw new MessagingException("Could not convert request: failure occurred during conversion of expected type [" +
+ expectedType.getName() + "] from content type [" + contentType + "]", ex);
+ }
+ }
+ }
+ throw new MessagingException("Could not convert request: no suitable HttpMessageConverter found for expected type [" +
+ expectedType.getName() + "] and content type [" + contentType + "]");
+ }
+
+ protected List<HttpMessageConverter<?>> getMessageConverters() {
+ return this.messageConverters;
+ }
+
+}
32 src/main/java/org/springframework/web/servlet/resource/CacheManifest.java
View
@@ -0,0 +1,32 @@
+package org.springframework.web.servlet.resource;
+
+import java.io.Serializable;
+
+public class CacheManifest implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private final byte[] content;
+
+ private final long timestamp;
+
+ private final String hash;
+
+ public CacheManifest(byte[] content, long timestamp, String hash) {
+ this.content = content;
+ this.timestamp = timestamp;
+ this.hash = hash;
+ }
+
+ public byte[] getContent() {
+ return content;
+ }
+
+ public long getTimestamp() {
+ return timestamp;
+ }
+
+ public String getHash() {
+ return hash;
+ }
+}
151 src/main/java/org/springframework/web/servlet/resource/CacheManifestHttpRequestHandler.java
View
@@ -0,0 +1,151 @@
+package org.springframework.web.servlet.resource;
+
+import java.io.BufferedWriter;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.nio.charset.Charset;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.core.io.Resource;
+import org.springframework.http.MediaType;
+import org.springframework.util.Assert;
+import org.springframework.util.FileCopyUtils;
+import org.springframework.web.HttpRequestHandler;
+import org.springframework.web.context.request.ServletWebRequest;
+import org.springframework.web.context.support.ServletContextResource;
+import org.springframework.web.servlet.HandlerMapping;
+import org.springframework.web.servlet.support.WebContentGenerator;
+
+public class CacheManifestHttpRequestHandler extends WebContentGenerator implements HttpRequestHandler {
+
+ private static final String PREAMBLE = "CACHE MANIFEST";
+
+ private static final String CACHE_SECTION = "CACHE:";
+
+ private static final String NETWORK_SECTION = "NETWORK:";
+
+ private static final String FALLBACK_SECTION = "FALLBACK:";
+
+ private static final MediaType CONTENT_TYPE = new MediaType("text","cache-manifest", Charset.forName("UTF-8"));
+
+ private boolean alwaysRegenerate = false;
+
+ private List<Resource> cachedResources;
+
+ private CacheManifestStore store = new InMemoryCacheManifestStore();
+
+ public CacheManifestHttpRequestHandler() {
+ super(METHOD_GET, METHOD_HEAD);
+ }
+
+ public void handleRequest(HttpServletRequest request,
+ HttpServletResponse response) throws ServletException, IOException {
+
+ checkAndPrepare(request, response, true);
+
+ CacheManifest manifest = getCacheManifest(request);
+
+ setHeaders(response, manifest);
+ if (new ServletWebRequest(request, response).checkNotModified(manifest.getTimestamp())) {
+ logger.debug("Resource not modified - returning 304");
+ return;
+ }
+
+ writeContent(response, manifest);
+ }
+
+ public void setCachedResources(Resource[] cachedResources) {
+ Assert.notEmpty(cachedResources, "Cached resource list must not be empty");
+ this.cachedResources = Arrays.asList(cachedResources);
+ }
+
+ protected CacheManifest getCacheManifest(HttpServletRequest request) throws IOException {
+ //TODO - Implement handling for NETWORK and FALLBACK sections of manifest
+ String key = (String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
+ CacheManifest manifest = store.get(key);
+ if (manifest != null && manifest.getHash().equals(getHash())) {
+ return manifest;
+ }
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out, Charset.forName("UTF-8"))));
+ writer.println(PREAMBLE);
+ writer.println(CACHE_SECTION);
+ for (Resource resource : cachedResources) {
+ Assert.isInstanceOf(ServletContextResource.class, resource, "Cache Manifest resources must be relative to the ServletContext");
+ String path = ((ServletContextResource)resource).getPathWithinContext();
+ writer.println(path.startsWith("/") ? path.substring(1) : path);
+ }
+ writer.println(NETWORK_SECTION);
+ writer.println("*");
+ String hash = getHash();
+ writer.println("#SHA-1: "+getHash());
+ writer.flush();
+ writer.close();
+
+ manifest = new CacheManifest(out.toByteArray(), new Date().getTime(), hash);
+ store.put(key, manifest);
+ return manifest;
+ }
+
+ protected String getHash() throws IOException {
+ //TODO - add further config options such as a minimum time period to wait before re-calculating the hash
+ MessageDigest md;
+ try {
+ md = MessageDigest.getInstance("SHA-1");
+ } catch (NoSuchAlgorithmException ex) {
+ throw new IOException("Unable to generate unique key for cache manifest.", ex);
+ }
+ if (alwaysRegenerate) {
+ md.update(String.valueOf(new Date().getTime()).getBytes());
+ } else {
+ for (Resource resource : cachedResources) {
+ md.update(FileCopyUtils.copyToByteArray(resource.getInputStream()));
+ }
+ }
+ return new String(Hex.encode(md.digest()));
+ }
+
+ protected void setHeaders(HttpServletResponse response, CacheManifest manifest) throws IOException {
+ long length = manifest.getContent().length;
+ if (length > Integer.MAX_VALUE) {
+ throw new IOException("Cache manifest content too long (beyond Integer.MAX_VALUE): " + manifest);
+ }
+ response.setContentLength((int) length);
+ response.setContentType(CONTENT_TYPE.toString());
+ }
+
+ protected void writeContent(HttpServletResponse response, CacheManifest manifest) throws IOException {
+ FileCopyUtils.copy(manifest.getContent(), response.getOutputStream());
+ }
+
+ private static final class Hex {
+ private static final char[] HEX = {
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
+ };
+
+ public static char[] encode(byte[] bytes) {
+ final int nBytes = bytes.length;
+ char[] result = new char[2*nBytes];
+
+ int j = 0;
+ for (int i=0; i < nBytes; i++) {
+ // Char for top 4 bits
+ result[j++] = HEX[(0xF0 & bytes[i]) >>> 4 ];
+ // Bottom 4
+ result[j++] = HEX[(0x0F & bytes[i])];
+ }
+ return result;
+ }
+ }
+}
8 src/main/java/org/springframework/web/servlet/resource/CacheManifestStore.java
View
@@ -0,0 +1,8 @@
+package org.springframework.web.servlet.resource;
+
+public interface CacheManifestStore {
+
+ public CacheManifest get(String key);
+
+ public void put(String key, CacheManifest manifest);
+}
17 src/main/java/org/springframework/web/servlet/resource/InMemoryCacheManifestStore.java
View
@@ -0,0 +1,17 @@
+package org.springframework.web.servlet.resource;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+public class InMemoryCacheManifestStore implements CacheManifestStore {
+
+ private final Map<String, CacheManifest> manifests = new ConcurrentHashMap<String, CacheManifest>();
+
+ public CacheManifest get(String key) {
+ return manifests.get(key);
+ }
+
+ public void put(String key, CacheManifest manifest) {
+ manifests.put(key, manifest);
+ }
+}
1  src/main/resources/META-INF/spring/applicationContext.xml
View
@@ -47,6 +47,7 @@
<context:exclude-filter expression=".*_Roo_.*" type="regex"/>
<context:exclude-filter expression="org.springframework.stereotype.Controller" type="annotation"/>
</context:component-scan>
+ <context:component-scan base-package="com.springsource.html5"/>
<bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource">
<property name="driverClassName" value="${database.driverClassName}"/>
<property name="url" value="${database.url}"/>
2  src/main/webapp/WEB-INF/layouts/default.jspx
View
@@ -14,7 +14,7 @@
<title><spring:message code="welcome_h3" arguments="${app_name}" /></title>
</head>
- <body class="tundra spring">
+ <body class="claro spring">
<div id="wrapper">
<tiles:insertAttribute name="header" ignore="true" />
<tiles:insertAttribute name="menu" ignore="true" />
151 src/main/webapp/WEB-INF/layouts/html5-default.jspx
View
@@ -0,0 +1,151 @@
+<html xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tiles="http://tiles.apache.org/tags-tiles" xmlns:spring="http://www.springframework.org/tags" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util">
+
+ <jsp:output doctype-root-element="HTML" doctype-system="about:legacy-compat" />
+
+ <jsp:directive.page contentType="text/html;charset=UTF-8" />
+
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=8" />
+ <spring:message code="application_name" var="app_name"/>
+ <title><spring:message code="welcome_h3" arguments="${app_name}" /></title>
+ <util:load-scripts />
+ <script type="text/javascript" language="JavaScript" src="templates/soyutils.js"><!-- required for FF3 and Opera --></script>
+ <script type="text/javascript" language="JavaScript" src="templates/template.js"><!-- required for FF3 and Opera --></script>
+
+ <script type="text/javascript">
+ dojo.require("dijit.form.SimpleTextarea");
+ dojo.require("dijit.form.FilteringSelect");
+ dojo.require("dijit.form.Form");
+ dojo.addOnLoad(function(){
+ dojo.declare("Model", null, {
+ data : null,
+
+ constructor : function(url, callback) {
+ var resultHandler = this.load;
+ var onload = (!callback ? function(){} : callback);
+ var deferred = dojo.xhrGet({
+ url : url,
+
+ preventCache : true,
+
+ handleAs : "json",
+
+ headers : {
+ "Content-Type": "application/json",
+ "Accept": "application/json"
+ }
+ });
+ var that = this;
+ deferred.addCallback(function(result){
+ that.data = result;
+ onload();
+ });
+ }
+ });
+
+ var controller = {
+ basePath : location.protocol + "//" + location.host + "/" + (location.pathname.search(/spring-html5/) > -1 ? "spring-html5/" : ""),
+ getView : function(url) {
+ var view = { requiresModel : true };
+ var hasIdentifier = false;
+ var paths = url.match(new RegExp(this.basePath+"(.[^?]*)"))[1].split("/");
+ var template = views;
+ for(var x in paths) {
+ if (paths[x].search(/\d/) > -1) {
+ hasIdentifier = true;
+ continue;
+ }
+ if (!template.hasOwnProperty(paths[x])) {
+ return null;
+ }
+ template = template[paths[x]];
+ }
+ if (url.search(/\?form/) > -1) {
+ template = template["form"];
+ view.requiresModel = false;
+ } else if(hasIdentifier){
+ template = template["detail"];
+ } else {
+ template = template["list"];
+ }
+ view.template = template;
+ return dojo.isFunction(view.template) ? view : null;
+ },
+ renderView : function(view, url) {
+ if (view.requiresModel) {
+ var model = new Model(url, function(){
+ var content = view.template.apply(window, [{model : model.data}]);
+ dojo.html.set(main, content, {parseContent:true,
+ onBegin: function(){
+ var existing = dijit.byId("content");
+ if (existing) {
+ existing.destroyRecursive();
+ }
+ },
+ onEnd: function(){
+ this.inherited("onEnd", arguments);
+ dojo.query("#content a").forEach(function(navItem) {
+ dojo.connect(navItem, "onclick", function(e) {
+ var main = dojo.byId("main");
+ var view = controller.getView(navItem.href);
+ if (view) {
+ dojo.stopEvent(e);
+ controller.renderView(view, navItem.href);
+ }
+ });
+ });
+ }
+ });
+ });
+ } else {
+ var content = view.template.apply(window);
+ dojo.html.set(main, content, {parseContent:true,
+ onBegin: function(){
+ var existing = dijit.byId("content");
+ if (existing) {
+ existing.destroyRecursive();
+ }
+ }
+ });
+ }
+ if(location.href != url) {
+ history.pushState({}, "", url);
+ }
+ }
+ };
+ dojo.query("a.menuItem").forEach(function(menuItem) {
+ dojo.connect(menuItem, "onclick", function(e) {
+ var main = dojo.byId("main");
+ var view = controller.getView(menuItem.href);
+ if (view) {
+ dojo.stopEvent(e);
+ controller.renderView(view, menuItem.href);
+ }
+ });
+ });
+ dojo.connect(window, "onpopstate", function(e){
+ if(location.href.search(/html5-index/) > -1) {
+ location.reload();
+ return;
+ }
+ var view = controller.getView(location.href);
+ if (view) {
+ controller.renderView(view, location.href);
+ }
+ });
+ });
+ </script>
+ </head>
+
+ <body class="claro spring">
+ <div id="wrapper">
+ <tiles:insertAttribute name="header" ignore="true" />
+ <tiles:insertAttribute name="menu" ignore="true" />
+ <div id="main">
+ <tiles:insertAttribute name="body"/>
+ <tiles:insertAttribute name="footer" ignore="true"/>
+ </div>
+ </div>
+ </body>
+</html>
6 src/main/webapp/WEB-INF/layouts/layouts.xml
View
@@ -10,6 +10,12 @@
<put-attribute name="menu" value="/WEB-INF/views/menu.jspx" />
<put-attribute name="footer" value="/WEB-INF/views/footer.jspx" />
</definition>
+
+ <definition name="html5-default" template="/WEB-INF/layouts/html5-default.jspx">
+ <put-attribute name="header" value="/WEB-INF/views/header.jspx" />
+ <put-attribute name="menu" value="/WEB-INF/views/menu.jspx" />
+ <put-attribute name="footer" value="/WEB-INF/views/footer.jspx" />
+ </definition>
<definition name="public" template="/WEB-INF/layouts/default.jspx">
<put-attribute name="header" value="/WEB-INF/views/header.jspx" />
234 src/main/webapp/WEB-INF/soy/vet.soy
View
@@ -0,0 +1,234 @@
+{namespace views.vets}
+
+/**
+ * Vet form
+ */
+{template .form}
+<div version="2.0">
+<div id="content" dojoType="dijit.TitlePane" title="Vet" open>
+<form id="vet" action="/spring-html5/vets" method="POST">
+<div id="rangeTest"><label
+ for="_range_id">Range : </label><input id="_range_id"
+ name="rangeTest" type="number" value="5" min="2" max="20" /><br />
+</div>
+<div id="_c_com_springsource_petclinic_domain_Vet_firstName_id"><label
+ for="_firstName_id">First Name : </label><input id="_firstName_id"
+ dojoType="dijit.form.ValidationTextBox" promptMessage="Enter First Name" invalidMessage="Please enter valid First Name"
+ name="firstName" type="text" value="" /><br />
+</div>
+<br />
+<div id="_c_com_springsource_petclinic_domain_Vet_lastName_id"><label
+ for="_lastName_id">Last Name : </label><input id="_lastName_id"
+ dojoType="dijit.form.ValidationTextBox" promptMessage="Enter Last Name (required)" invalidMessage="Please enter valid Last Name" required
+ name="lastName" type="text" value="" /><br />
+</div>
+<br />
+<div id="_c_com_springsource_petclinic_domain_Vet_address_id"><label
+ for="_address_id">Address : </label><textarea id="_address_id"
+ dojoType="dijit.form.SimpleTextarea"
+ name="address"></textarea><br />
+</div>
+<br />
+<div id="_c_com_springsource_petclinic_domain_Vet_city_id"><label
+ for="_city_id">City : </label><input id="_city_id" name="city"
+ dojoType="dijit.form.ValidationTextBox" promptMessage="Enter City (required)" invalidMessage="Please enter valid City" required
+ type="text" value="" /><br />
+</div>
+<br />
+<div id="_c_com_springsource_petclinic_domain_Vet_telephone_id"><label
+ for="_telephone_id">Telephone : </label><input id="_telephone_id"
+ dojoType="dijit.form.ValidationTextBox" promptMessage="Enter Telephone (required)" invalidMessage="Please enter valid Telephone" required
+ name="telephone" type="text" value="" /><br />
+</div>
+<br />
+<div id="_c_com_springsource_petclinic_domain_Vet_homePage_id"><label
+ for="_homePage_id">Home Page : </label><input id="_homePage_id"
+ dojoType="dijit.form.ValidationTextBox" promptMessage="Enter Home Page" invalidMessage="Please enter valid Home Page"
+ name="homePage" type="text" value="" /><br />
+</div>
+<br />
+<div id="_c_com_springsource_petclinic_domain_Vet_email_id"><label
+ for="_email_id">Email : </label><input id="_email_id" name="email"
+ dojoType="dijit.form.ValidationTextBox" promptMessage="Enter Email" invalidMessage="Please enter valid Email"
+ type="text" value="" /><br />
+</div>
+<br />
+<div id="__id"><label for="_birthDay_id">Birth Day : </label><input
+ id="_birthDay_id" name="birthDay"
+ dojoType="dijit.form.DateTextBox" promptMessage="Enter Birth Day (required)" invalidMessage="Please enter valid Birth Day" required datePattern="M\/d\/yy"
+ type="text" value=""/><br />
+</div>
+<br />
+<div id="__id"><label for="_employedSince_id">Employed Since : </label><input
+ id="_employedSince_id" name="employedSince"
+ dojoType="dijit.form.DateTextBox" promptMessage="Enter Employed Since (required)" invalidMessage="Please enter valid Employed Since" required datePattern="M\/d\/yy"
+ type="text" value="" /><br />
+</div>
+<br />
+<div id="_c_com_springsource_petclinic_domain_Vet_specialty_id"><label
+ for="_specialty_id">Specialty : </label><select id="_specialty_id"
+ name="specialty" dojoType="dijit.form.FilteringSelect" hasDownArrow>
+ <option value="Cardiology">Cardiology</option>
+ <option value="Dentistry">Dentistry</option>
+ <option value="Nutrition">Nutrition</option>
+</select><br />
+</div>
+<br />
+<div id="fc_com_springsource_petclinic_domain_Vet_submit" class="submit">
+ <input value="Save" type="submit" id="proceed" />
+</div>
+</form>
+</div>
+{/template}
+
+/**
+ * Vets List
+ * @param model The model to render
+ */
+{template .list}
+<div version="2.0">
+<div id="content" dojoType="dijit.TitlePane" title="List all Vets" open>
+<table>
+ <thead>
+ <tr>
+ <th>First Name</th>
+ <th>Last Name</th>
+ <th>Address</th>
+ <th>City</th>
+ <th>Telephone</th>
+ <th>Home Page</th>
+ <th />
+ <th />
+ <th />
+ </tr>
+ </thead>
+ {foreach $vet in $model}
+ <tr>
+ <td>{$vet.firstName}</td>
+ <td>{$vet.lastName}</td>
+ <td>{$vet.address}</td>
+ <td>{$vet.city}</td>
+ <td>{$vet.telephone}</td>
+ <td>{$vet.homePage}</td>
+ <td><a title="Show Vet" alt="Show Vet"
+ href="/spring-html5/vets/1"><img title="Show Vet"
+ src="/spring-html5/resources/images/show.png" class="image"
+ alt="Show Vet" /></a></td>
+ <td><a title="Update Vet" alt="Update Vet"
+ href="/spring-html5/vets/1?form"><img title="Update Vet"
+ src="/spring-html5/resources/images/update.png" class="image"
+ alt="Update Vet" /></a></td>
+ <td>
+ <form id="command" action="/spring-html5/vets/1" method="post"><input
+ type="hidden" name="_method" value="DELETE" /><input
+ value="Delete Vet" type="image" title="Delete Vet"
+ src="/spring-html5/resources/images/delete.png" class="image"
+ alt="Delete Vet" /><input value="1" type="hidden" name="page" /><input
+ value="10" type="hidden" name="size" /></form>
+ </td>
+ </tr>
+ {/foreach}
+ <tr class="footer">
+ <td colspan="10"><span class="new"><a
+ href="/spring-html5//vets?form"><img title="Create new Vet"
+ src="/spring-html5/resources/images/add.png" alt="Create new Vet" /></a></span>
+ List results per page: <a href="?page=1&amp;size=5">5</a> 10 <a
+ href="?page=1&amp;size=15">15</a> <a href="?page=1&amp;size=20">20</a>
+ <a href="?page=1&amp;size=25">25</a> | Page 1 of 1</td>
+ </tr>
+</table>
+</div>
+</div>
+{/template}
+
+/**
+ * Show Vet
+ * @param model The model to render
+ */
+{template .detail}
+<div version="2.0">
+<div id="content" dojoType="dijit.TitlePane" title="Show Vet" open>
+<div id="_s_com_springsource_petclinic_domain_Vet_firstName_id"><label
+ for="_firstName_id">First Name : </label>
+<div
+ id="_s_com_springsource_petclinic_domain_Vet_firstName_firstName_id"
+ class="box">{$model.firstName}</div>
+</div>
+<br />
+<div id="_s_com_springsource_petclinic_domain_Vet_lastName_id"><label
+ for="_lastName_id">Last Name : </label>
+<div id="_s_com_springsource_petclinic_domain_Vet_lastName_lastName_id"
+ class="box">{$model.lastName}</div>
+</div>
+<br />
+<div id="_s_com_springsource_petclinic_domain_Vet_address_id"><label
+ for="_address_id">Address : </label>
+<div id="_s_com_springsource_petclinic_domain_Vet_address_address_id"
+ class="box">{$model.address}</div>
+</div>
+<br />
+<div id="_s_com_springsource_petclinic_domain_Vet_city_id"><label
+ for="_city_id">City : </label>
+<div id="_s_com_springsource_petclinic_domain_Vet_city_city_id"
+ class="box">{$model.city}</div>
+</div>
+<br />
+<div id="_s_com_springsource_petclinic_domain_Vet_telephone_id"><label
+ for="_telephone_id">Telephone : </label>
+<div
+ id="_s_com_springsource_petclinic_domain_Vet_telephone_telephone_id"
+ class="box">{$model.telephone}</div>
+</div>
+<br />
+<div id="_s_com_springsource_petclinic_domain_Vet_homePage_id"><label
+ for="_homePage_id">Home Page : </label>
+<div id="_s_com_springsource_petclinic_domain_Vet_homePage_homePage_id"
+ class="box">{$model.homePage}</div>
+</div>
+<br />
+<div id="_s_com_springsource_petclinic_domain_Vet_email_id"><label
+ for="_email_id">Email : </label>
+<div id="_s_com_springsource_petclinic_domain_Vet_email_email_id"
+ class="box">{$model.email}</div>
+</div>
+<br />
+<div id="_s_com_springsource_petclinic_domain_Vet_birthDay_id"><label
+ for="_birthDay_id">Birth Day : </label>
+<div id="_s_com_springsource_petclinic_domain_Vet_birthDay_birthDay_id"
+ class="box">{$model.birthDay}</div>
+</div>
+<br />
+<div id="_s_com_springsource_petclinic_domain_Vet_employedSince_id"><label
+ for="_employedSince_id">Employed Since : </label>
+<div
+ id="_s_com_springsource_petclinic_domain_Vet_employedSince_employedSince_id"
+ class="box">{$model.employedSince}</div>
+</div>
+<br />
+<div id="_s_com_springsource_petclinic_domain_Vet_specialty_id"><label
+ for="_specialty_id">Specialty : </label>
+<div
+ id="_s_com_springsource_petclinic_domain_Vet_specialty_specialty_id"
+ class="box">{$model.specialty}</div>
+</div>
+<br />
+<div class="quicklinks"><span>
+<form id="command" action="/spring-html5/vets/1" method="post"><input
+ type="hidden" name="_method" value="DELETE" /><input value="Delete Vet"
+ type="image" title="Delete Vet"
+ src="/spring-html5/resources/images/delete.png" class="image"
+ alt="Delete Vet" /></form>
+</span><span><a title="Update Vet" alt="Update Vet"
+ href="/spring-html5/vets/1?form"><img title="Update Vet"
+ src="/spring-html5/resources/images/update.png" class="image"
+ alt="Update Vet" /></a></span><span><a title="Create new Vet"
+ alt="Create new Vet" href="/spring-html5/vets?form"><img
+ title="Create new Vet" src="/spring-html5/resources/images/create.png"
+ class="image" alt="Create new Vet" /></a></span><span><a title="" alt=""
+ href="/spring-html5/vets"><img title=""
+ src="/spring-html5/resources/images/list.png" class="image" alt="" /></a></span></div>
+</div>
+</div>
+{/template}
+
+#TODO - Don't forget this validation: <script type="text/javascript">Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:"proceed" event:"onclick"}));</script>
88 src/main/webapp/WEB-INF/soy/vet.tmp
View
@@ -0,0 +1,88 @@
+{namespace views.vets}
+
+/**
+ * Vet form
+ */
+{template .form}
+<div id="main">
+<div version="2.0"><script type="text/javascript">dojo.require("dijit.TitlePane");</script>
+<div id="_title_fc_com_springsource_petclinic_domain_Vet_id" dojoType="dijit.TitlePane" title="Create new Vet" open><script
+ type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : "_title_fc_com_springsource_petclinic_domain_Vet_id", widgetType : "dijit.TitlePane", widgetAttrs : {title: "Create new Vet", open: true}})); </script>
+<form id="vet" action="/spring-html5/vets" method="POST">
+<div id="_c_com_springsource_petclinic_domain_Vet_firstName_id"><label
+ for="_firstName_id">First Name : </label><input id="_firstName_id" dojoType="dijit.form.ValidationTextBox" promptMessage="Enter First Name", invalidMessage=""
+ name="firstName" type="text" value="" /><br />
+<script type="text/javascript">
+ Spring.addDecoration(new Spring.ElementDecoration({elementId : "_firstName_id", widgetType : "dijit.form.ValidationTextBox", widgetAttrs : {promptMessage: "Enter First Name", invalidMessage: "Please enter valid First Name", required: false}}));
+ </script></div>
+<br />
+<div id="_c_com_springsource_petclinic_domain_Vet_lastName_id"><label
+ for="_lastName_id">Last Name : </label><input id="_lastName_id"
+ name="lastName" type="text" value="" /><br />
+<script type="text/javascript">
+ Spring.addDecoration(new Spring.ElementDecoration({elementId : "_lastName_id", widgetType : "dijit.form.ValidationTextBox", widgetAttrs : {promptMessage: "Enter Last Name (required)", invalidMessage: "Please enter valid Last Name", required: true}}));
+ </script></div>
+<br />
+<script type="text/javascript">dojo.require("dijit.form.SimpleTextarea");</script>
+<div id="_c_com_springsource_petclinic_domain_Vet_address_id"><label
+ for="_address_id">Address : </label><textarea id="_address_id"
+ name="address"></textarea><br />
+<script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : "_address_id", widgetType : "dijit.form.SimpleTextarea", widgetAttrs : {disabled : false}})); </script></div>
+<br />
+<div id="_c_com_springsource_petclinic_domain_Vet_city_id"><label
+ for="_city_id">City : </label><input id="_city_id" name="city"
+ type="text" value="" /><br />
+<script type="text/javascript">
+ Spring.addDecoration(new Spring.ElementDecoration({elementId : "_city_id", widgetType : "dijit.form.ValidationTextBox", widgetAttrs : {promptMessage: "Enter City (required)", invalidMessage: "Please enter valid City", required: true}}));
+ </script></div>
+<br />
+<div id="_c_com_springsource_petclinic_domain_Vet_telephone_id"><label
+ for="_telephone_id">Telephone : </label><input id="_telephone_id"
+ name="telephone" type="text" value="" /><br />
+<script type="text/javascript">
+ Spring.addDecoration(new Spring.ElementDecoration({elementId : "_telephone_id", widgetType : "dijit.form.ValidationTextBox", widgetAttrs : {promptMessage: "Enter Telephone (required)", invalidMessage: "Please enter valid Telephone", required: true}}));
+ </script></div>
+<br />
+<div id="_c_com_springsource_petclinic_domain_Vet_homePage_id"><label
+ for="_homePage_id">Home Page : </label><input id="_homePage_id"
+ name="homePage" type="text" value="" /><br />
+<script type="text/javascript">
+ Spring.addDecoration(new Spring.ElementDecoration({elementId : "_homePage_id", widgetType : "dijit.form.ValidationTextBox", widgetAttrs : {promptMessage: "Enter Home Page", invalidMessage: "Please enter valid Home Page", required: false}}));
+ </script></div>
+<br />
+<div id="_c_com_springsource_petclinic_domain_Vet_email_id"><label
+ for="_email_id">Email : </label><input id="_email_id" name="email"
+ type="text" value="" /><br />
+<script type="text/javascript">