vraptor-scaffold 1.0.0 → 1.1.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. data/Gemfile +2 -17
  2. data/Gemfile.lock +8 -10
  3. data/History.txt +18 -1
  4. data/Rakefile +3 -23
  5. data/bin/vraptor +1 -1
  6. data/lib/vraptor-scaffold.rb +25 -28
  7. data/lib/{configuration.rb → vraptor-scaffold/configuration.rb} +0 -0
  8. data/lib/{generators → vraptor-scaffold/generators}/app_generator/app_generator.rb +2 -1
  9. data/lib/{generators → vraptor-scaffold/generators}/app_generator/dependency.rb +0 -0
  10. data/lib/{generators → vraptor-scaffold/generators}/app_generator/dependency_manager.rb +4 -6
  11. data/lib/{generators → vraptor-scaffold/generators}/app_generator/freemarker_template_engine.rb +3 -4
  12. data/lib/vraptor-scaffold/generators/app_generator/jsp_template_engine.rb +33 -0
  13. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/build.gradle.erb +1 -0
  14. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/build.properties.erb +2 -0
  15. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/build.xml +32 -0
  16. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/decorators.erb +1 -1
  17. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/eclipse/classpath.erb +0 -0
  18. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/eclipse/project.erb +0 -0
  19. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/eclipse/settings/org.eclipse.jdt.core.prefs +0 -0
  20. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/eclipse/settings/org.eclipse.wst.common.component.tt +0 -0
  21. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/eclipse/settings/org.eclipse.wst.common.project.facet.core.xml +0 -0
  22. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/eclipse/settings/org.eclipse.wst.jsdt.ui.superType.container +0 -0
  23. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/eclipse/settings/org.eclipse.wst.jsdt.ui.superType.name +0 -0
  24. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/freemarker/freemarker-web.xml +0 -1
  25. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/freemarker/infrastructure/FreemarkerPathResolver.java.tt +0 -0
  26. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/freemarker/macros/html.ftl +0 -0
  27. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/freemarker/main.ftl +1 -1
  28. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/ivy-2.2.0.jar +0 -0
  29. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/ivy.erb +5 -1
  30. data/lib/vraptor-scaffold/generators/app_generator/templates/ivysettings.xml +9 -0
  31. data/lib/vraptor-scaffold/generators/app_generator/templates/jsp/jsp-web.xml +7 -0
  32. data/lib/vraptor-scaffold/generators/app_generator/templates/jsp/main.jsp +16 -0
  33. data/lib/vraptor-scaffold/generators/app_generator/templates/jsp/prelude.jspf +3 -0
  34. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/pom.erb +8 -0
  35. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/resources-test/.empty_directory +0 -0
  36. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/resources/META-INF/persistence.xml +2 -2
  37. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/resources/log4j.properties +0 -0
  38. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/resources/messages.properties +0 -0
  39. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/src-test/controllers/.empty_directory +0 -0
  40. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/src-test/models/.empty_directory +0 -0
  41. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/src-test/repositories/.empty_directory +0 -0
  42. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/src/controllers/.empty_directory +0 -0
  43. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/src/models/Entity.java.tt +0 -0
  44. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/src/repositories/Repository.java.tt +17 -12
  45. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/vraptor-scaffold.erb +0 -0
  46. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/webapp/WEB-INF/web.xml +0 -0
  47. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/webapp/images/.empty_directory +0 -0
  48. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/webapp/index.jsp +0 -0
  49. data/lib/vraptor-scaffold/generators/app_generator/templates/webapp/javascripts/jquery.min.js +16 -0
  50. data/lib/vraptor-scaffold/generators/app_generator/templates/webapp/stylesheets/common.css +3 -0
  51. data/lib/vraptor-scaffold/generators/app_generator/templates/webapp/stylesheets/reset.css +47 -0
  52. data/lib/{generators → vraptor-scaffold/generators}/app_generator/templates/webapp/stylesheets/scaffold.css +0 -0
  53. data/lib/vraptor-scaffold/generators/app_generator/templates/webapp/stylesheets/stylesheets.css +5 -0
  54. data/lib/{generators → vraptor-scaffold/generators}/base.rb +0 -0
  55. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/attribute.rb +0 -0
  56. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/base_scaffold.rb +0 -0
  57. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/controller_generator/controller_generator.rb +0 -0
  58. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/controller_generator/templates/controller.erb +9 -18
  59. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/controller_generator/templates/controller_test.erb +0 -0
  60. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/freemarker_generator/freemarker_generator.rb +0 -0
  61. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/freemarker_generator/templates/edit.erb +0 -0
  62. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/freemarker_generator/templates/form.erb +0 -0
  63. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/freemarker_generator/templates/index.erb +0 -0
  64. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/freemarker_generator/templates/new.erb +0 -0
  65. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/freemarker_generator/templates/show.erb +0 -0
  66. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/jsp_generator/jsp_generator.rb +1 -1
  67. data/lib/vraptor-scaffold/generators/scaffold_generator/jsp_generator/templates/edit.erb +6 -0
  68. data/lib/vraptor-scaffold/generators/scaffold_generator/jsp_generator/templates/form.erb +26 -0
  69. data/lib/vraptor-scaffold/generators/scaffold_generator/jsp_generator/templates/index.erb +36 -0
  70. data/lib/vraptor-scaffold/generators/scaffold_generator/jsp_generator/templates/new.erb +6 -0
  71. data/lib/vraptor-scaffold/generators/scaffold_generator/jsp_generator/templates/show.erb +14 -0
  72. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/model_generator/model_generator.rb +0 -0
  73. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/model_generator/templates/model.erb +0 -0
  74. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/model_generator/templates/model_test.erb +0 -0
  75. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/repository_generator/repository_generator.rb +0 -0
  76. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/repository_generator/templates/repository.erb +0 -0
  77. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/repository_generator/templates/repository_impl.erb +1 -1
  78. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/repository_generator/templates/repository_test.erb +0 -0
  79. data/lib/{generators → vraptor-scaffold/generators}/scaffold_generator/scaffold_generator.rb +0 -0
  80. data/lib/vraptor-scaffold/load_paths.rb +22 -0
  81. data/lib/vraptor-scaffold/version.rb +3 -0
  82. data/spec/{lib → vraptor-scaffold}/configuration_spec.rb +0 -0
  83. data/spec/{lib → vraptor-scaffold}/generators/app_generator/app_generator_spec.rb +6 -6
  84. data/spec/{lib → vraptor-scaffold}/generators/app_generator/dependency_manager_spec.rb +0 -0
  85. data/spec/{lib → vraptor-scaffold}/generators/app_generator/dependency_spec.rb +0 -0
  86. data/spec/{lib → vraptor-scaffold}/generators/app_generator/freemarker_template_engine_spec.rb +4 -4
  87. data/spec/{lib → vraptor-scaffold}/generators/app_generator/jsp_template_engine_spec.rb +12 -1
  88. data/spec/{lib → vraptor-scaffold}/generators/app_generator/templates/Entity.java +0 -0
  89. data/spec/{lib → vraptor-scaffold}/generators/app_generator/templates/FreemarkerPathResolver.java +0 -0
  90. data/spec/{lib → vraptor-scaffold}/generators/app_generator/templates/Repository.java +17 -12
  91. data/spec/{lib → vraptor-scaffold}/generators/app_generator/templates/build.gradle +4 -6
  92. data/spec/{lib → vraptor-scaffold}/generators/app_generator/templates/build.properties +2 -0
  93. data/spec/{lib → vraptor-scaffold}/generators/app_generator/templates/decorators-jsp.xml +0 -0
  94. data/spec/{lib → vraptor-scaffold}/generators/app_generator/templates/decorators.xml +0 -0
  95. data/spec/vraptor-scaffold/generators/app_generator/templates/freemarker-web.xml +60 -0
  96. data/spec/{lib → vraptor-scaffold}/generators/app_generator/templates/ivy.xml +8 -7
  97. data/spec/vraptor-scaffold/generators/app_generator/templates/jsp-web.xml +45 -0
  98. data/spec/{lib → vraptor-scaffold}/generators/app_generator/templates/pom.xml +11 -18
  99. data/spec/{lib → vraptor-scaffold}/generators/scaffold_generator/attribute_spec.rb +0 -0
  100. data/spec/{lib → vraptor-scaffold}/generators/scaffold_generator/base_scaffold_spec.rb +0 -0
  101. data/spec/{lib → vraptor-scaffold}/generators/scaffold_generator/controller_generator/controller_generator_spec.rb +0 -0
  102. data/spec/{lib → vraptor-scaffold}/generators/scaffold_generator/controller_generator/templates/ProductController.java +9 -18
  103. data/spec/{lib → vraptor-scaffold}/generators/scaffold_generator/freemarker_generator/freemarker_generator_spec.rb +0 -0
  104. data/spec/{lib → vraptor-scaffold}/generators/scaffold_generator/jsp_generator/jsp_generator_spec.rb +0 -0
  105. data/spec/{lib → vraptor-scaffold}/generators/scaffold_generator/model_generator/model_generator_spec.rb +0 -0
  106. data/spec/{lib → vraptor-scaffold}/generators/scaffold_generator/model_generator/templates/Product.java +0 -0
  107. data/spec/{lib → vraptor-scaffold}/generators/scaffold_generator/repository_generator/repository_generator_spec.rb +0 -0
  108. data/spec/{lib → vraptor-scaffold}/generators/scaffold_generator/repository_generator/templates/ProductRepository.java +0 -0
  109. data/spec/{lib → vraptor-scaffold}/generators/scaffold_generator/repository_generator/templates/ProductRepositoryImpl.java +1 -1
  110. data/spec/{lib → vraptor-scaffold}/generators/scaffold_generator/scaffold_generator_spec.rb +0 -0
  111. data/spec/{lib/vraptor-scaffold_spec.rb → vraptor-scaffold_spec.rb} +14 -14
  112. data/vraptor-scaffold.gemspec +24 -173
  113. metadata +226 -137
  114. data/VERSION.yml +0 -5
  115. data/lib/generators/app_generator/jsp_template_engine.rb +0 -24
  116. data/lib/generators/app_generator/templates/jsp/main.jsp +0 -16
  117. data/lib/generators/app_generator/templates/webapp/javascripts/jquery.min.js +0 -16
  118. data/lib/generators/scaffold_generator/jsp_generator/templates/edit.erb +0 -3
  119. data/lib/generators/scaffold_generator/jsp_generator/templates/form.erb +0 -27
  120. data/lib/generators/scaffold_generator/jsp_generator/templates/index.erb +0 -36
  121. data/lib/generators/scaffold_generator/jsp_generator/templates/new.erb +0 -3
  122. data/lib/generators/scaffold_generator/jsp_generator/templates/show.erb +0 -14
  123. data/lib/load_paths.rb +0 -22
data/Gemfile CHANGED
@@ -1,17 +1,2 @@
1
- source :rubygems
2
-
3
- gem "thor", "0.14.6"
4
- gem "rake", "0.8.7"
5
- gem "activesupport", "3.0.1"
6
-
7
- gem "ruby-debug", :group => [:development, :test]
8
-
9
- group :development do
10
- gem "jeweler", "1.4.0"
11
- end
12
-
13
- group :test do
14
- gem "ZenTest", "4.4.0"
15
- gem "rspec", "1.3.1", :require => "spec"
16
- gem "rcov", "0.9.9"
17
- end
1
+ source "http://rubygems.org"
2
+ gemspec
@@ -1,16 +1,16 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ vraptor-scaffold (0.0.1)
5
+ activesupport (= 3.0.1)
6
+ thor (= 0.14.6)
7
+
1
8
  GEM
2
9
  remote: http://rubygems.org/
3
10
  specs:
4
11
  ZenTest (4.4.0)
5
12
  activesupport (3.0.1)
6
13
  columnize (0.3.2)
7
- gemcutter (0.6.1)
8
- git (1.2.5)
9
- jeweler (1.4.0)
10
- gemcutter (>= 0.1.0)
11
- git (>= 1.2.5)
12
- rubyforge (>= 2.0.0)
13
- json_pure (1.4.6)
14
14
  linecache (0.43)
15
15
  rake (0.8.7)
16
16
  rcov (0.9.9)
@@ -20,8 +20,6 @@ GEM
20
20
  ruby-debug-base (~> 0.10.4.0)
21
21
  ruby-debug-base (0.10.4)
22
22
  linecache (>= 0.3)
23
- rubyforge (2.0.4)
24
- json_pure (>= 1.1.7)
25
23
  thor (0.14.6)
26
24
 
27
25
  PLATFORMS
@@ -30,9 +28,9 @@ PLATFORMS
30
28
  DEPENDENCIES
31
29
  ZenTest (= 4.4.0)
32
30
  activesupport (= 3.0.1)
33
- jeweler (= 1.4.0)
34
31
  rake (= 0.8.7)
35
32
  rcov (= 0.9.9)
36
33
  rspec (= 1.3.1)
37
34
  ruby-debug
38
35
  thor (= 0.14.6)
36
+ vraptor-scaffold!
@@ -1,9 +1,26 @@
1
+ === 1.1.0 / 2011-??-??
2
+
3
+ == New Features
4
+ * JPA 2 support using hibernate 3.6.1.Final. (Issue 13)
5
+ * ant task to minify js and css. (Issue 27)
6
+ * created prelude to automatic import taglibs in jsp.
7
+ * added css reset to reduce browsers inconsistencies.
8
+
9
+ == Improvements
10
+ * updated hibernate validator to 4.1.0.Final.
11
+ * changed html DTD to XHTML.
12
+ * declared css encoding.
13
+ * better repository and controller encapsulation.
14
+ * added head with title tag for sitemesh capture it in jsp views.
15
+ * updated vraptor to 3.3.1.
16
+ * updated jquery to 1.5.1.
17
+
1
18
  === 1.0.0 / 2011-02-04
2
19
 
3
20
  == Improvements
4
21
  * updated vraptor to 3.3.0
5
22
  * updated jquery to 1.5
6
- * decorators folder inside WEB-INF
23
+ * decorators folder inside WEB-INF (Issue 24)
7
24
  * removed spring 3 option.
8
25
 
9
26
  === 0.0.4 / 2010-11-20
data/Rakefile CHANGED
@@ -1,24 +1,5 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "vraptor-scaffold"
8
- gem.summary = "VRaptor Scaffold."
9
- gem.description = "VRaptor scaffold extension to make it easier configuring new projects and plugins."
10
- gem.email = "rodolfoliviero@gmail.com"
11
- gem.homepage = "http://github.com/caelum/vraptor-scaffold"
12
- gem.authors = ["Rodolfo Liviero"]
13
- gem.add_dependency "thor", "0.14.6"
14
- gem.add_dependency "rake", "0.8.7"
15
- gem.add_dependency "activesupport", "3.0.1"
16
- gem.post_install_message = "Thank you for installing vraptor-scaffold. Please read http://github.com/caelum/vraptor-scaffold/blob/master/README.textile for more information."
17
- end
18
- Jeweler::GemcutterTasks.new
19
- rescue LoadError
20
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
21
- end
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
22
3
 
23
4
  require 'spec/rake/spectask'
24
5
  Spec::Rake::SpecTask.new(:spec) do |spec|
@@ -34,7 +15,7 @@ end
34
15
 
35
16
  require 'rake/rdoctask'
36
17
  Rake::RDocTask.new do |rdoc|
37
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
18
+ version = VraptorScaffold::VERSION
38
19
 
39
20
  rdoc.rdoc_dir = 'rdoc'
40
21
  rdoc.title = "vraptor-scaffold #{version}"
@@ -42,5 +23,4 @@ Rake::RDocTask.new do |rdoc|
42
23
  rdoc.rdoc_files.include('lib/**/*.rb')
43
24
  end
44
25
 
45
- task :spec => :check_dependencies
46
26
  task :default => [:spec]
@@ -3,5 +3,5 @@
3
3
  require File.dirname(__FILE__) + '/../lib/vraptor-scaffold'
4
4
 
5
5
  begin
6
- VraptorScaffold::Main.execute(ARGV.dup)
6
+ VraptorScaffold.execute(ARGV.dup)
7
7
  end
@@ -1,36 +1,33 @@
1
- require File.dirname(__FILE__) + '/load_paths'
1
+ require File.dirname(__FILE__) + '/vraptor-scaffold/load_paths'
2
2
 
3
3
  module VraptorScaffold
4
- class Main
5
-
6
- def self.execute(args)
7
- action = args.shift
8
- print_help(AppGenerator) if help? action
9
- run_app_generator(args.shift, args) if action == "new"
10
- run_scaffold_generator(args) if action == "scaffold"
11
- end
12
-
13
- def self.run_app_generator(project_path, args)
14
- print_help(AppGenerator) if help? project_path
15
- AppGenerator.new(project_path, args).invoke_all
16
- end
4
+ def self.execute(args)
5
+ action = args.shift
6
+ print_help(AppGenerator) if help? action
7
+ run_app_generator(args.shift, args) if action == "new"
8
+ run_scaffold_generator(args) if action == "scaffold"
9
+ end
17
10
 
18
- def self.run_scaffold_generator(args)
19
- print_help(ScaffoldGenerator) if help? args.first
20
- unless File.exist?("src")
21
- puts "To run vraptor scaffold please go to the project root folder."
22
- Kernel::exit
23
- end
24
- ScaffoldGenerator.new(args).invoke_all
25
- end
11
+ def self.run_app_generator(project_path, args)
12
+ print_help(AppGenerator) if help? project_path
13
+ AppGenerator.new(project_path, args).invoke_all
14
+ end
26
15
 
27
- def self.print_help(generator)
28
- generator.start(["-h"])
16
+ def self.run_scaffold_generator(args)
17
+ print_help(ScaffoldGenerator) if help? args.first
18
+ unless File.exist?("src")
19
+ puts "To run vraptor scaffold please go to the project root folder."
29
20
  Kernel::exit
30
21
  end
22
+ ScaffoldGenerator.new(args).invoke_all
23
+ end
24
+
25
+ def self.print_help(generator)
26
+ generator.start(["-h"])
27
+ Kernel::exit
28
+ end
31
29
 
32
- def self.help?(command)
33
- [nil, "-h", "--help"].include?(command)
34
- end
30
+ def self.help?(command)
31
+ [nil, "-h", "--help"].include?(command)
35
32
  end
36
- end
33
+ end
@@ -47,7 +47,8 @@ class AppGenerator < VraptorScaffold::Base
47
47
  create_eclipse_files unless options[:skip_eclipse]
48
48
  copy_file("build.xml")
49
49
  template("build.properties.erb", "build.properties")
50
- template("ivy.erb", "ivy.xml")
50
+ template("ivy.erb", "ivy.xml")
51
+ copy_file("ivysettings.xml")
51
52
  copy_file(IVY_JAR)
52
53
  end
53
54
  end
@@ -22,13 +22,11 @@ class DependencyManager
22
22
 
23
23
  private
24
24
  def default_dependencies
25
- [ Dependency.new("br.com.caelum", "vraptor", "3.3.0"),
26
- Dependency.new("net.sf.scannotation", "scannotation", "1.0.2"), Dependency.new("org.hsqldb", "hsqldb", "2.0.0"),
25
+ [ Dependency.new("br.com.caelum", "vraptor", "3.3.1"),
26
+ Dependency.new("org.hsqldb", "hsqldb", "2.0.0"),
27
27
  Dependency.new("opensymphony", "sitemesh", "2.4.2"), Dependency.new("javax.servlet", "jstl", "1.2"),
28
- Dependency.new("javax.persistence", "persistence-api", "1.0"),
29
- Dependency.new("org.hibernate", "hibernate-entitymanager", "3.4.0.GA"),
30
- Dependency.new("org.hibernate", "hibernate-core", "3.3.2.GA"),
31
- Dependency.new("org.hibernate", "hibernate-validator", "3.1.0.GA"),
28
+ Dependency.new("org.hibernate", "hibernate-entitymanager", "3.6.1.Final"),
29
+ Dependency.new("org.hibernate", "hibernate-validator", "4.1.0.Final"),
32
30
  Dependency.new("joda-time", "joda-time", "1.6.2")]
33
31
  end
34
32
 
@@ -13,7 +13,7 @@ class FreemarkerTemplateEngine < VraptorScaffold::Base
13
13
  def configure
14
14
  directory("macros", File.join(Configuration::WEB_APP, "macros"))
15
15
  template("../decorators.erb", File.join(Configuration::WEB_INF, "decorators.xml"))
16
- copy_file("main.ftl", File.join(Configuration::WEB_INF, view_path, "main.ftl"))
16
+ copy_file("main.ftl", File.join(Configuration::WEB_INF, decorators_path, "main.ftl"))
17
17
  directory("infrastructure", infra_path)
18
18
  append_freemarker_servlet
19
19
  end
@@ -22,7 +22,7 @@ class FreemarkerTemplateEngine < VraptorScaffold::Base
22
22
  "ftl"
23
23
  end
24
24
 
25
- def view_path
25
+ def decorators_path
26
26
  File.join "views", "decorators"
27
27
  end
28
28
 
@@ -41,5 +41,4 @@ class FreemarkerTemplateEngine < VraptorScaffold::Base
41
41
  def infra_path
42
42
  File.join Configuration::MAIN_SRC, package.gsub(".", File::Separator), "infrastructure"
43
43
  end
44
-
45
- end
44
+ end
@@ -0,0 +1,33 @@
1
+ class JspTemplateEngine < VraptorScaffold::Base
2
+
3
+ def self.source_root
4
+ File.join(File.dirname(__FILE__), "templates", "jsp")
5
+ end
6
+
7
+ def initialize(project_path)
8
+ super
9
+ self.destination_root=(project_path)
10
+ end
11
+
12
+ def configure
13
+ template("../decorators.erb", File.join(Configuration::WEB_INF, "decorators.xml"))
14
+ copy_file("main.jsp", File.join(Configuration::WEB_INF, decorators_path, "main.jsp"))
15
+ copy_file("prelude.jspf", File.join(Configuration::WEB_INF, "jsp", "prelude.jspf"))
16
+ append_prelude_config
17
+ end
18
+
19
+ def extension
20
+ "jsp"
21
+ end
22
+
23
+ def decorators_path
24
+ File.join "jsp", "decorators"
25
+ end
26
+
27
+ private
28
+ def append_prelude_config
29
+ file = File.join(Configuration::WEB_INF, "web.xml")
30
+ template = File.join JspTemplateEngine.source_root, "jsp-web.xml"
31
+ inject_into_file(file, File.read(template), :before => "</web-app>", :verbose => false)
32
+ end
33
+ end
@@ -1,5 +1,6 @@
1
1
  repositories {
2
2
  mavenCentral()
3
+ mavenRepo urls: "https://repository.jboss.org/nexus/content/groups/public-jboss"
3
4
  }
4
5
 
5
6
  apply plugin: 'java'
@@ -4,6 +4,8 @@ output.dir=target
4
4
  test.build.dir=target/test-classes
5
5
 
6
6
  webapp.dir=<%= Configuration::WEB_APP %>
7
+ js.dir=<%= Configuration::WEB_APP %>/javascripts
8
+ css.dir=<%= Configuration::WEB_APP %>/stylesheets
7
9
  lib.dir=<%= Configuration::WEB_INF %>/lib
8
10
  build.dir=<%= Configuration::WEB_INF %>/classes
9
11
 
@@ -99,6 +99,38 @@
99
99
  </jetty>
100
100
  </target>
101
101
 
102
+ <!-- =================================
103
+ target: minify
104
+ ================================= -->
105
+ <target name="minify" depends="resolve" description="minify js and css">
106
+ <property name="yuicompressor.jar" value="lib/minify/yuicompressor-2.3.6.jar" />
107
+
108
+ <fileset dir="${js.dir}" includes="*.js" excludes="all.min.js" id="alljs" />
109
+ <fileset dir="${css.dir}" includes="*.css" excludes="*.min.css" id="allcss" />
110
+
111
+ <delete file="${css.dir}/all.css" />
112
+ <concat destfile="${css.dir}/all.css" fixlastline="true">
113
+ <fileset refid="allcss" />
114
+ </concat>
115
+
116
+ <java jar="${yuicompressor.jar}" fork="true">
117
+ <arg value="${css.dir}/all.css" />
118
+ <arg value="-o" />
119
+ <arg value="${css.dir}/all.min.css" />
120
+ </java>
121
+
122
+ <delete file="${js.dir}/all.js" />
123
+ <concat destfile="${js.dir}/all.js" fixlastline="true">
124
+ <fileset refid="alljs" />
125
+ </concat>
126
+
127
+ <java jar="${yuicompressor.jar}" fork="true">
128
+ <arg value="${js.dir}/all.js" />
129
+ <arg value="-o" />
130
+ <arg value="${js.dir}/all.min.js" />
131
+ </java>
132
+ </target>
133
+
102
134
  <!-- =================================
103
135
  target: report
104
136
  ================================= -->
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
 
3
- <decorators defaultdir="/WEB-INF/<%= view_path %>">
3
+ <decorators defaultdir="/WEB-INF/<%= decorators_path %>">
4
4
  <decorator name="main" page="main.<%= extension %>">
5
5
  <pattern>/*</pattern>
6
6
  </decorator>
@@ -20,4 +20,3 @@
20
20
  <servlet-name>sitemesh-freemarker</servlet-name>
21
21
  <url-pattern>*.ftl</url-pattern>
22
22
  </servlet-mapping>
23
-
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
2
  <html>
3
3
  <head>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -3,9 +3,10 @@
3
3
 
4
4
  <configurations>
5
5
  <conf name="default" description="dependencies used for compile" />
6
+ <conf name="provided" description="dependencies used for compile but is not packaged" visibility="public" />
6
7
  <conf name="test" description="dependencies used for tests" visibility="public" />
7
8
  <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
+ <conf name="minify" description="dependencies used to minify js and css" visibility="public" />
9
10
  </configurations>
10
11
 
11
12
  <dependencies><% @dependency_manager.compile_scope.each do |dependency| -%>
@@ -23,5 +24,8 @@
23
24
  <dependency org="org.mortbay.jetty" name="jsp-api-2.1" rev="6.1.14" conf="jetty->default" />
24
25
  <dependency org="org.mortbay.jetty" name="jsp-2.1" rev="6.1.14" conf="jetty->default" />
25
26
  <dependency org="org.mortbay.jetty" name="jetty-ant" rev="6.1.14" conf="jetty->default" />
27
+
28
+ <!-- Minify dependencies -->
29
+ <dependency org="com.yahoo.platform.yui" name="yuicompressor" rev="2.3.6" conf="minify->default" />
26
30
  </dependencies>
27
31
  </ivy-module>
@@ -0,0 +1,9 @@
1
+ <ivysettings>
2
+ <settings defaultResolver="chain" />
3
+ <resolvers>
4
+ <chain name="chain">
5
+ <ibiblio name="central" m2compatible="true" />
6
+ <ibiblio name="jboss" m2compatible="true" root="https://repository.jboss.org/nexus/content/groups/public-jboss" />
7
+ </chain>
8
+ </resolvers>
9
+ </ivysettings>
@@ -0,0 +1,7 @@
1
+ <jsp-config>
2
+ <jsp-property-group>
3
+ <url-pattern>*.jsp</url-pattern>
4
+ <page-encoding>UTF-8</page-encoding>
5
+ <include-prelude>/WEB-INF/jsp/prelude.jspf</include-prelude>
6
+ </jsp-property-group>
7
+ </jsp-config>
@@ -0,0 +1,16 @@
1
+ <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
2
+
3
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+
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="${pageContext.request.contextPath}/stylesheets/stylesheets.css"/>
10
+ <decorator:head/>
11
+ </head>
12
+ <body>
13
+ <decorator:body/>
14
+ <script type="text/javascript" src="${pageContext.request.contextPath}/javascripts/jquery.min.js"/></script>
15
+ </body>
16
+ </html>