vraptor-scaffold 0.0.1.rc → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. data/.document +1 -1
  2. data/.gitignore +1 -0
  3. data/Gemfile +3 -3
  4. data/History.txt +10 -0
  5. data/README.textile +32 -0
  6. data/Rakefile +6 -7
  7. data/VERSION.yml +1 -1
  8. data/bin/vraptor +1 -1
  9. data/lib/configuration.rb +31 -0
  10. data/lib/generators/app_generator/app_generator.rb +75 -126
  11. data/lib/generators/app_generator/freemarker_template_engine.rb +50 -0
  12. data/lib/generators/app_generator/jsp_template_engine.rb +21 -0
  13. data/lib/generators/app_generator/templates/build.properties.erb +16 -0
  14. data/lib/generators/app_generator/templates/build.xml +109 -0
  15. data/lib/generators/app_generator/templates/decorators.erb +7 -0
  16. data/lib/generators/app_generator/templates/eclipse/classpath +23 -0
  17. data/lib/generators/app_generator/templates/eclipse/project.erb +36 -0
  18. data/lib/generators/app_generator/templates/eclipse/settings/org.eclipse.jdt.core.prefs +8 -0
  19. data/lib/generators/app_generator/templates/eclipse/settings/org.eclipse.wst.common.component.tt +10 -0
  20. data/lib/generators/app_generator/templates/eclipse/settings/org.eclipse.wst.common.project.facet.core.xml +10 -0
  21. data/lib/generators/app_generator/templates/eclipse/settings/org.eclipse.wst.jsdt.ui.superType.container +1 -0
  22. data/lib/generators/app_generator/templates/eclipse/settings/org.eclipse.wst.jsdt.ui.superType.name +1 -0
  23. data/lib/generators/app_generator/templates/freemarker/freemarker-ivy.xml +2 -0
  24. data/lib/generators/app_generator/templates/freemarker/freemarker-pom.xml +6 -0
  25. data/lib/generators/app_generator/templates/freemarker/freemarker-web.xml +23 -0
  26. data/lib/generators/app_generator/templates/freemarker/infrastructure/FreemarkerPathResolver.java.tt +21 -0
  27. data/lib/generators/app_generator/templates/{macros → freemarker/macros}/html.ftl +0 -0
  28. data/lib/generators/app_generator/templates/freemarker/main.ftl +14 -0
  29. data/lib/generators/app_generator/templates/ivy-2.2.0-rc1.jar +0 -0
  30. data/lib/generators/app_generator/templates/ivy.erb +35 -0
  31. data/lib/generators/app_generator/templates/jsp/main.jsp +16 -0
  32. data/lib/generators/app_generator/templates/pom.erb +24 -3
  33. data/lib/generators/app_generator/templates/{messages.properties → resources-test/.empty_directory} +0 -0
  34. data/lib/generators/app_generator/templates/{persistence.xml → resources/META-INF/persistence.xml} +0 -0
  35. data/lib/generators/app_generator/templates/{log4j.properties → resources/log4j.properties} +0 -0
  36. data/lib/generators/app_generator/templates/resources/messages.properties +0 -0
  37. data/lib/generators/app_generator/templates/src-test/controllers/.empty_directory +0 -0
  38. data/lib/generators/app_generator/templates/src-test/models/.empty_directory +0 -0
  39. data/lib/generators/app_generator/templates/src-test/repositories/.empty_directory +0 -0
  40. data/lib/generators/app_generator/templates/src/controllers/.empty_directory +0 -0
  41. data/lib/generators/app_generator/templates/src/models/Entity.java.tt +45 -0
  42. data/lib/generators/app_generator/templates/src/repositories/Repository.java.tt +43 -0
  43. data/lib/generators/app_generator/templates/vraptor-scaffold.erb +2 -0
  44. data/lib/generators/app_generator/templates/webapp/WEB-INF/web.xml +38 -0
  45. data/lib/generators/app_generator/templates/webapp/images/.empty_directory +0 -0
  46. data/lib/generators/app_generator/templates/{index.jsp → webapp/index.jsp} +0 -0
  47. data/lib/generators/app_generator/templates/{javascripts → webapp/javascripts}/jquery-1.4.2.min.js +0 -0
  48. data/lib/generators/app_generator/templates/{stylesheets → webapp/stylesheets}/scaffold.css +0 -0
  49. data/lib/generators/scaffold_generator/attribute.rb +14 -6
  50. data/lib/generators/scaffold_generator/base_scaffold.rb +14 -10
  51. data/lib/generators/scaffold_generator/controller_generator/controller_generator.rb +6 -6
  52. data/lib/generators/scaffold_generator/controller_generator/templates/controller.erb +7 -7
  53. data/lib/generators/scaffold_generator/controller_generator/templates/controller_test.erb +1 -1
  54. data/lib/generators/scaffold_generator/freemarker_generator/freemarker_generator.rb +5 -5
  55. data/lib/generators/scaffold_generator/freemarker_generator/templates/index.erb +2 -3
  56. data/lib/generators/scaffold_generator/jsp_generator/jsp_generator.rb +22 -0
  57. data/lib/generators/scaffold_generator/jsp_generator/templates/edit.erb +3 -0
  58. data/lib/generators/scaffold_generator/jsp_generator/templates/form.erb +27 -0
  59. data/lib/generators/scaffold_generator/jsp_generator/templates/index.erb +36 -0
  60. data/lib/generators/scaffold_generator/jsp_generator/templates/new.erb +3 -0
  61. data/lib/generators/scaffold_generator/jsp_generator/templates/show.erb +14 -0
  62. data/lib/generators/scaffold_generator/model_generator/model_generator.rb +5 -5
  63. data/lib/generators/scaffold_generator/model_generator/templates/model.erb +1 -1
  64. data/lib/generators/scaffold_generator/model_generator/templates/model_test.erb +1 -1
  65. data/lib/generators/scaffold_generator/repository_generator/repository_generator.rb +6 -5
  66. data/lib/generators/scaffold_generator/repository_generator/templates/repository.erb +17 -9
  67. data/lib/generators/scaffold_generator/repository_generator/templates/repository_impl.erb +16 -0
  68. data/lib/generators/scaffold_generator/repository_generator/templates/repository_test.erb +2 -2
  69. data/lib/generators/scaffold_generator/scaffold_generator.rb +31 -38
  70. data/lib/load_paths.rb +6 -2
  71. data/lib/vraptor-scaffold.rb +29 -5
  72. data/spec/lib/configuration_spec.rb +60 -0
  73. data/spec/lib/generators/app_generator/app_generator_spec.rb +237 -116
  74. data/spec/lib/generators/app_generator/freemarker_template_engine_spec.rb +92 -0
  75. data/spec/lib/generators/app_generator/jsp_template_engine_spec.rb +44 -0
  76. data/{lib → spec/lib}/generators/app_generator/templates/Entity.java +5 -2
  77. data/{lib → spec/lib}/generators/app_generator/templates/FreemarkerPathResolver.java +1 -1
  78. data/{lib → spec/lib}/generators/app_generator/templates/Repository.java +6 -6
  79. data/spec/lib/generators/app_generator/templates/build.properties +16 -0
  80. data/spec/lib/generators/app_generator/templates/decorators-jsp.xml +7 -0
  81. data/{lib → spec/lib}/generators/app_generator/templates/decorators.xml +2 -2
  82. data/spec/lib/generators/app_generator/templates/ivy.xml +35 -0
  83. data/spec/lib/generators/app_generator/templates/pom.xml +24 -3
  84. data/spec/lib/generators/scaffold_generator/attribute_spec.rb +47 -27
  85. data/spec/lib/generators/scaffold_generator/base_scaffold_spec.rb +31 -27
  86. data/spec/lib/generators/scaffold_generator/controller_generator/controller_generator_spec.rb +11 -9
  87. data/spec/lib/generators/scaffold_generator/controller_generator/templates/ProductController.java +2 -2
  88. data/spec/lib/generators/scaffold_generator/freemarker_generator/freemarker_generator_spec.rb +16 -14
  89. data/spec/lib/generators/scaffold_generator/jsp_generator/jsp_generator_spec.rb +34 -0
  90. data/spec/lib/generators/scaffold_generator/model_generator/model_generator_spec.rb +11 -9
  91. data/spec/lib/generators/scaffold_generator/repository_generator/repository_generator_spec.rb +17 -9
  92. data/spec/lib/generators/scaffold_generator/repository_generator/templates/ProductRepository.java +15 -7
  93. data/spec/lib/generators/scaffold_generator/repository_generator/templates/ProductRepositoryImpl.java +16 -0
  94. data/spec/lib/generators/scaffold_generator/scaffold_generator_spec.rb +55 -57
  95. data/spec/lib/vraptor-scaffold_spec.rb +77 -24
  96. data/spec/resources/vraptor-scaffold.properties +2 -0
  97. data/spec/spec_helper.rb +13 -1
  98. data/vraptor-scaffold.gemspec +82 -34
  99. metadata +86 -42
  100. data/README.rdoc +0 -104
  101. data/TODO.txt +0 -17
  102. data/lib/generators/app_generator/templates/main.ftl +0 -14
  103. data/lib/generators/app_generator/templates/web.xml +0 -61
@@ -0,0 +1,109 @@
1
+ <project name="vraptor-scaffold" default="war" xmlns:ivy="antlib:org.apache.ivy.ant">
2
+
3
+ <property file="build.properties" />
4
+
5
+ <!-- paths -->
6
+ <path id="lib.path.id">
7
+ <fileset dir="${lib.dir}" />
8
+ <fileset dir="lib/provided" />
9
+ </path>
10
+ <path id="test.path.id">
11
+ <fileset dir="lib/test" />
12
+ <path refid="lib.path.id" />
13
+ <pathelement location="${build.dir}" />
14
+ <pathelement location="${test.build.dir}" />
15
+ </path>
16
+
17
+ <!-- =================================
18
+ target: resolve
19
+ ================================= -->
20
+ <target name="resolve" description="--> retrieve dependencies with ivy">
21
+ <path id="ivy.lib.path">
22
+ <pathelement location="${ivy.jar.file}" />
23
+ </path>
24
+ <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" />
25
+
26
+ <ivy:retrieve pattern="lib/[conf]/[artifact]-[revision].[ext]" sync="true" />
27
+ <delete dir="${lib.dir}" includes="**/*.*" />
28
+ <copy todir="${lib.dir}">
29
+ <fileset dir="lib/default">
30
+ <include name="*.jar" />
31
+ </fileset>
32
+ </copy>
33
+ </target>
34
+
35
+ <!-- =================================
36
+ target: compile
37
+ ================================= -->
38
+ <target name="compile" depends="resolve" description="--> compile">
39
+ <mkdir dir="${build.dir}" />
40
+ <delete dir="${build.dir}" includes="**/*.*" />
41
+ <javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="lib.path.id" debug="on" />
42
+ <copy todir="${build.dir}">
43
+ <fileset dir="${resources.dir}">
44
+ <include name="**/*.*" />
45
+ </fileset>
46
+ </copy>
47
+ </target>
48
+
49
+ <!-- =================================
50
+ target: compile test
51
+ ================================= -->
52
+ <target name="compile-test" depends="compile" description="--> compile test">
53
+ <mkdir dir="${test.build.dir}" />
54
+ <delete dir="${test.build.dir}" includes="**/*.*" />
55
+ <javac srcdir="${test.src.dir}" destdir="${test.build.dir}" classpathref="test.path.id" debug="on" />
56
+ <copy todir="${test.build.dir}">
57
+ <fileset dir="${test.resources.dir}">
58
+ <include name="**/*.*" />
59
+ </fileset>
60
+ </copy>
61
+ </target>
62
+
63
+ <!-- =================================
64
+ target: run tests
65
+ ================================= -->
66
+ <target name="test" depends="compile-test" description="--> run all tests">
67
+ <mkdir dir="${output.dir}/test-results" />
68
+ <junit haltonfailure="yes">
69
+ <batchtest fork="yes" todir="${output.dir}/test-results">
70
+ <fileset dir="${test.src.dir}">
71
+ <include name="**/*Test.java" />
72
+ </fileset>
73
+ </batchtest>
74
+ <formatter type="xml" />
75
+ <classpath refid="test.path.id" />
76
+ </junit>
77
+ </target>
78
+
79
+ <!-- =================================
80
+ target: war
81
+ ================================= -->
82
+ <target name="war" description="--> generate war file" depends="test">
83
+ <war destfile="${output.dir}/${project.name}.war">
84
+ <zipfileset dir="${webapp.dir}" />
85
+ </war>
86
+ </target>
87
+
88
+ <!-- =================================
89
+ target: jetty.run
90
+ ================================= -->
91
+ <target name="jetty.run" description="--> run jetty server" depends="compile">
92
+ <path id="jetty.path.id">
93
+ <fileset dir="lib/jetty" />
94
+ </path>
95
+ <taskdef classpathref="jetty.path.id" resource="tasks.properties" loaderref="jetty.loader" />
96
+ <jetty tempDirectory="${output.dir}/jetty-temp">
97
+ <webApp name="${project.name}" warfile="${webapp.dir}" contextpath="/" scanIntervalSeconds="3" />
98
+ </jetty>
99
+ </target>
100
+
101
+ <!-- =================================
102
+ target: report
103
+ ================================= -->
104
+ <target name="report" depends="resolve" description="--> generates a report of dependencies">
105
+ <mkdir dir="${output.dir}/reports" />
106
+ <ivy:report todir="${output.dir}/reports" />
107
+ </target>
108
+
109
+ </project>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="ISO-8859-1"?>
2
+
3
+ <decorators defaultdir="/WEB-INF/decorators">
4
+ <decorator name="main" page="main.<%= extension %>">
5
+ <pattern>/*</pattern>
6
+ </decorator>
7
+ </decorators>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <classpath>
3
+ <classpathentry kind="src" path="src/main/java"/>
4
+ <classpathentry kind="src" path="src/main/resources"/>
5
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
6
+ <classpathentry kind="src" path="src/test/resources" output="target/test-classes"/>
7
+ <classpathentry kind="output" path="src/main/webapp/WEB-INF/classes"/>
8
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_20">
9
+ <attributes>
10
+ <attribute name="owner.project.facets" value="java"/>
11
+ </attributes>
12
+ </classpathentry>
13
+ <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0">
14
+ <attributes>
15
+ <attribute name="owner.project.facets" value="jst.web"/>
16
+ </attributes>
17
+ </classpathentry>
18
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
19
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
20
+ <classpathentry kind="lib" path="lib/test/hamcrest-all-1.1.jar"/>
21
+ <classpathentry kind="lib" path="lib/test/junit-4.8.1.jar"/>
22
+ <classpathentry kind="lib" path="lib/test/mockito-all-1.8.5.jar"/>
23
+ </classpath>
@@ -0,0 +1,36 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <projectDescription>
3
+ <name><%= @project_name %></name>
4
+ <comment></comment>
5
+ <projects>
6
+ </projects>
7
+ <buildSpec>
8
+ <buildCommand>
9
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
10
+ <arguments>
11
+ </arguments>
12
+ </buildCommand>
13
+ <buildCommand>
14
+ <name>org.eclipse.jdt.core.javabuilder</name>
15
+ <arguments>
16
+ </arguments>
17
+ </buildCommand>
18
+ <buildCommand>
19
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
20
+ <arguments>
21
+ </arguments>
22
+ </buildCommand>
23
+ <buildCommand>
24
+ <name>org.eclipse.wst.validation.validationbuilder</name>
25
+ <arguments>
26
+ </arguments>
27
+ </buildCommand>
28
+ </buildSpec>
29
+ <natures>
30
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
31
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
32
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
33
+ <nature>org.eclipse.jdt.core.javanature</nature>
34
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
35
+ </natures>
36
+ </projectDescription>
@@ -0,0 +1,8 @@
1
+ #Sun Oct 03 01:41:37 BRT 2010
2
+ eclipse.preferences.version=1
3
+ org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
4
+ org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
5
+ org.eclipse.jdt.core.compiler.compliance=1.6
6
+ org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
7
+ org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
8
+ org.eclipse.jdt.core.compiler.source=1.6
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project-modules id="moduleCoreId" project-version="1.5.0">
3
+ <wb-module deploy-name="<%= @project_name %>">
4
+ <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
5
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
6
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
7
+ <property name="context-root" value="/"/>
8
+ <property name="java-output-path" value="/src/main/webapp/WEB-INF/classes"/>
9
+ </wb-module>
10
+ </project-modules>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <faceted-project>
3
+ <runtime name="Apache Tomcat v6.0"/>
4
+ <fixed facet="jst.web"/>
5
+ <fixed facet="wst.jsdt.web"/>
6
+ <fixed facet="java"/>
7
+ <installed facet="java" version="1.6"/>
8
+ <installed facet="jst.web" version="2.5"/>
9
+ <installed facet="wst.jsdt.web" version="1.0"/>
10
+ </faceted-project>
@@ -0,0 +1 @@
1
+ org.eclipse.wst.jsdt.launching.baseBrowserLibrary
@@ -0,0 +1,2 @@
1
+
2
+ <dependency org="org.freemarker" name="freemarker" rev="2.3.16" conf="default"/>
@@ -0,0 +1,6 @@
1
+
2
+ <dependency>
3
+ <groupId>org.freemarker</groupId>
4
+ <artifactId>freemarker</artifactId>
5
+ <version>2.3.16</version>
6
+ </dependency>
@@ -0,0 +1,23 @@
1
+ <servlet>
2
+ <servlet-name>sitemesh-freemarker</servlet-name>
3
+ <servlet-class>com.opensymphony.module.sitemesh.freemarker.FreemarkerDecoratorServlet</servlet-class>
4
+ <init-param>
5
+ <param-name>TemplatePath</param-name>
6
+ <param-value>/</param-value>
7
+ </init-param>
8
+ <init-param>
9
+ <param-name>default_encoding</param-name>
10
+ <param-value>UTF-8</param-value>
11
+ </init-param>
12
+ <init-param>
13
+ <param-name>auto_import</param-name>
14
+ <param-value>macros/html.ftl as html</param-value>
15
+ </init-param>
16
+ <load-on-startup>1</load-on-startup>
17
+ </servlet>
18
+
19
+ <servlet-mapping>
20
+ <servlet-name>sitemesh-freemarker</servlet-name>
21
+ <url-pattern>*.ftl</url-pattern>
22
+ </servlet-mapping>
23
+
@@ -0,0 +1,21 @@
1
+ package <%= package %>.infrastructure;
2
+
3
+ import br.com.caelum.vraptor.http.FormatResolver;
4
+ import br.com.caelum.vraptor.ioc.Component;
5
+ import br.com.caelum.vraptor.view.DefaultPathResolver;
6
+
7
+ @Component
8
+ public class FreemarkerPathResolver extends DefaultPathResolver {
9
+
10
+ public FreemarkerPathResolver(FormatResolver resolver) {
11
+ super(resolver);
12
+ }
13
+
14
+ protected String getPrefix() {
15
+ return "/WEB-INF/views/";
16
+ }
17
+
18
+ protected String getExtension() {
19
+ return "ftl";
20
+ }
21
+ }
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <@html.css "scaffold"/>
6
+ <title>Vraptor Scaffold</title>
7
+ ${head}
8
+ </head>
9
+
10
+ <body>
11
+ ${body}
12
+ <@html.js "jquery-1.4.2.min"/>
13
+ </body>
14
+ </html>
@@ -0,0 +1,35 @@
1
+ <ivy-module version="2.0">
2
+ <info organisation="<%= @project_name %>" module="<%= @project_name %>" />
3
+
4
+ <configurations>
5
+ <conf name="default" description="dependencies used for compile" />
6
+ <conf name="test" description="dependencies used for tests" visibility="public" />
7
+ <conf name="jetty" description="dependencies used for jetty" visibility="public" />
8
+ <conf name="provided" description="dependencies used for compile but is not packaged" visibility="public" />
9
+ </configurations>
10
+
11
+ <dependencies>
12
+ <dependency org="hsqldb" name="hsqldb" rev="1.8.0.10" conf="default" />
13
+ <dependency org="br.com.caelum" name="vraptor" rev="3.1.3" conf="default" />
14
+ <dependency org="opensymphony" name="sitemesh" rev="2.4.2" conf="default" />
15
+ <dependency org="javax.servlet" name="jstl" rev="1.2" conf="default" />
16
+ <dependency org="javax.persistence" name="persistence-api" rev="1.0" conf="default" />
17
+ <dependency org="org.hibernate" name="hibernate-entitymanager" rev="3.4.0.GA" conf="default" />
18
+ <dependency org="org.hibernate" name="hibernate-core" rev="3.3.2.GA" conf="default" />
19
+ <dependency org="org.hibernate" name="hibernate-validator" rev="3.1.0.GA" conf="default" />
20
+ <dependency org="joda-time" name="joda-time" rev="1.6" conf="default" />
21
+
22
+ <!-- Provided dependencies -->
23
+ <dependency org="javax.servlet" name="servlet-api" rev="2.5" conf="provided->default" />
24
+
25
+ <!-- Test dependencies -->
26
+ <dependency org="junit" name="junit" rev="4.8.1" conf="test->default" />
27
+ <dependency org="org.hamcrest" name="hamcrest-all" rev="1.1" conf="test->default" />
28
+ <dependency org="org.mockito" name="mockito-all" rev="1.8.5" conf="test->default" />
29
+
30
+ <!-- Ant dependencies -->
31
+ <dependency org="org.mortbay.jetty" name="jsp-api-2.1" rev="6.1.14" conf="jetty->default"/>
32
+ <dependency org="org.mortbay.jetty" name="jsp-2.1" rev="6.1.14" conf="jetty->default"/>
33
+ <dependency org="org.mortbay.jetty" name="jetty-ant" rev="6.1.14" conf="jetty->default" />
34
+ </dependencies>
35
+ </ivy-module>
@@ -0,0 +1,16 @@
1
+ <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
2
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
3
+
4
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5
+ <html>
6
+ <head>
7
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
8
+ <title><decorator:title default="Vraptor Scaffold"/></title>
9
+ <link rel="stylesheet" type="text/css" href="<c:url value="/stylesheets/scaffold.css"/>" />
10
+ <decorator:head/>
11
+ </head>
12
+ <body>
13
+ <decorator:body/>
14
+ <script type="text/javascript" src="<c:url value="/javascripts/jquery-1.4.2.min.js"/>"></script>
15
+ </body>
16
+ </html>
@@ -12,6 +12,7 @@
12
12
  </properties>
13
13
 
14
14
  <build>
15
+ <outputDirectory>${basedir}/<%= Configuration::WEB_INF %>/classes</outputDirectory>
15
16
  <plugins>
16
17
  <plugin>
17
18
  <artifactId>maven-compiler-plugin</artifactId>
@@ -24,6 +25,7 @@
24
25
  </plugin>
25
26
  <plugin>
26
27
  <artifactId>maven-eclipse-plugin</artifactId>
28
+ <version>2.8</version>
27
29
  <configuration>
28
30
  <downloadSources>true</downloadSources>
29
31
  <downloadJavadocs>true</downloadJavadocs>
@@ -83,9 +85,9 @@
83
85
  <version>2.4.2</version>
84
86
  </dependency>
85
87
  <dependency>
86
- <groupId>org.freemarker</groupId>
87
- <artifactId>freemarker</artifactId>
88
- <version>2.3.16</version>
88
+ <groupId>javax.servlet</groupId>
89
+ <artifactId>jstl</artifactId>
90
+ <version>1.2</version>
89
91
  </dependency>
90
92
  <dependency>
91
93
  <groupId>javax.persistence</groupId>
@@ -96,6 +98,21 @@
96
98
  <groupId>org.hibernate</groupId>
97
99
  <artifactId>hibernate-entitymanager</artifactId>
98
100
  <version>3.4.0.GA</version>
101
+ <exclusions>
102
+ <exclusion>
103
+ <artifactId>slf4j-api</artifactId>
104
+ <groupId>org.slf4j</groupId>
105
+ </exclusion>
106
+ <exclusion>
107
+ <artifactId>org.hibernate</artifactId>
108
+ <groupId>hibernate-core</groupId>
109
+ </exclusion>
110
+ </exclusions>
111
+ </dependency>
112
+ <dependency>
113
+ <groupId>org.hibernate</groupId>
114
+ <artifactId>hibernate-core</artifactId>
115
+ <version>3.3.2.GA</version>
99
116
  <exclusions>
100
117
  <exclusion>
101
118
  <artifactId>slf4j-api</artifactId>
@@ -112,6 +129,10 @@
112
129
  <artifactId>slf4j-api</artifactId>
113
130
  <groupId>org.slf4j</groupId>
114
131
  </exclusion>
132
+ <exclusion>
133
+ <artifactId>org.hibernate</artifactId>
134
+ <groupId>hibernate-core</groupId>
135
+ </exclusion>
115
136
  </exclusions>
116
137
  </dependency>
117
138
  <dependency>
@@ -0,0 +1,45 @@
1
+ package <%= options[:package] %>.models;
2
+
3
+ import javax.persistence.GeneratedValue;
4
+ import javax.persistence.Id;
5
+ import javax.persistence.MappedSuperclass;
6
+
7
+ @MappedSuperclass
8
+ public class Entity {
9
+
10
+ @Id @GeneratedValue
11
+ private Long id;
12
+
13
+ public void setId(Long id) {
14
+ this.id = id;
15
+ }
16
+
17
+ public Long getId() {
18
+ return id;
19
+ }
20
+
21
+ @Override
22
+ public boolean equals(Object obj) {
23
+ if (obj == null) {
24
+ return false;
25
+ }
26
+ if (this == obj) {
27
+ return true;
28
+ }
29
+ if (getClass() != obj.getClass()) {
30
+ return false;
31
+ }
32
+ final Entity other = (Entity) obj;
33
+ if (id != other.id && (id == null || !id.equals(other.id))) {
34
+ return false;
35
+ }
36
+ return true;
37
+ }
38
+
39
+ @Override
40
+ public int hashCode() {
41
+ int hash = 7;
42
+ hash = 17 * hash + (this.getId() != null ? this.getId().hashCode() : 0);
43
+ return hash;
44
+ }
45
+ }