iqvoc 3.4.0 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (220) hide show
  1. data/CHANGELOG.md +5 -0
  2. data/Gemfile +5 -4
  3. data/Gemfile.lock +54 -27
  4. data/app/assets/javascripts/framework.js +0 -1
  5. data/app/assets/stylesheets/iqvoc/forms.css.erb +5 -1
  6. data/app/controllers/application_controller.rb +4 -107
  7. data/app/controllers/concepts/hierarchical_controller.rb +11 -12
  8. data/app/controllers/concepts/untranslated_controller.rb +1 -1
  9. data/app/controllers/instance_configuration_controller.rb +103 -0
  10. data/app/controllers/search_results_controller.rb +4 -3
  11. data/app/helpers/application_helper.rb +1 -1
  12. data/app/helpers/concepts_helper.rb +1 -1
  13. data/app/models/configuration_setting.rb +22 -0
  14. data/app/views/instance_configuration/index.html.erb +15 -0
  15. data/app/views/layouts/_controls.html.erb +3 -3
  16. data/app/views/layouts/_header.html.erb +1 -1
  17. data/app/views/layouts/_navigation.html.erb +6 -1
  18. data/app/views/layouts/application.html.erb +11 -4
  19. data/config/blazing.rb +36 -0
  20. data/config/database.yml +3 -16
  21. data/config/deploy.rb +1 -1
  22. data/config/engine.rb +8 -0
  23. data/config/environments/development.rb +2 -60
  24. data/config/environments/heroku.rb +1 -1
  25. data/config/environments/production.rb +2 -60
  26. data/config/environments/test.rb +2 -45
  27. data/config/initializers/iqvoc.rb +2 -12
  28. data/config/initializers/secret_token.rb +3 -1
  29. data/config/locales/de.yml +8 -0
  30. data/config/locales/en.yml +8 -0
  31. data/config/routes.rb +7 -1
  32. data/db/migrate/20120119000000_create_configuration_settings.rb +14 -0
  33. data/lib/debug.rb +4 -4
  34. data/lib/iqvoc.rb +11 -219
  35. data/lib/iqvoc/ability.rb +2 -1
  36. data/lib/iqvoc/configuration/collection.rb +22 -0
  37. data/lib/iqvoc/configuration/concept.rb +152 -0
  38. data/lib/iqvoc/configuration/core.rb +135 -0
  39. data/lib/iqvoc/configuration/label.rb +23 -0
  40. data/lib/iqvoc/controller_extensions.rb +115 -0
  41. data/lib/iqvoc/environments/development.rb +66 -0
  42. data/lib/iqvoc/environments/production.rb +64 -0
  43. data/lib/iqvoc/environments/test.rb +52 -0
  44. data/lib/iqvoc/instance_configuration.rb +122 -0
  45. data/lib/iqvoc/version.rb +1 -1
  46. data/public/assets/ajax-loader-5c1bf2208bffabddfb583013023b2b11.gif +0 -0
  47. data/public/assets/ajax-loader.gif +0 -0
  48. data/public/assets/arrow_down-e1f4aacd91274ce8d4db40d8b4ad781f.gif +0 -0
  49. data/public/assets/arrow_down.gif +0 -0
  50. data/public/assets/arrow_up-a48d7a55002e97f1b70e0e957edf3964.gif +0 -0
  51. data/public/assets/arrow_up.gif +0 -0
  52. data/public/assets/back-ffd41b7924770324ead91a4eb51604f6.png +0 -0
  53. data/public/assets/back.png +0 -0
  54. data/public/assets/blueprint/ie-d2ff4b1cc209dc6b08716b5e0098e106.css +36 -0
  55. data/public/assets/blueprint/ie-d2ff4b1cc209dc6b08716b5e0098e106.css.gz +0 -0
  56. data/public/assets/blueprint/ie.css +36 -0
  57. data/public/assets/blueprint/ie.css.gz +0 -0
  58. data/public/assets/blueprint/print-799a53ff649d9f14baf5f5fe643d04c4.css +30 -0
  59. data/public/assets/blueprint/print-799a53ff649d9f14baf5f5fe643d04c4.css.gz +0 -0
  60. data/public/assets/blueprint/print.css +30 -0
  61. data/public/assets/blueprint/print.css.gz +0 -0
  62. data/public/assets/blueprint/screen-d721f98ceac371a9294fc6f091ca1cb5.css +259 -0
  63. data/public/assets/blueprint/screen-d721f98ceac371a9294fc6f091ca1cb5.css.gz +0 -0
  64. data/public/assets/blueprint/screen.css +259 -0
  65. data/public/assets/blueprint/screen.css.gz +0 -0
  66. data/public/assets/branch-c950c8ac69ee2f753f86a75d944aa976.png +0 -0
  67. data/public/assets/branch.png +0 -0
  68. data/public/assets/categ-e1e1a5958017a5586456895785298c89.png +0 -0
  69. data/public/assets/categ.png +0 -0
  70. data/public/assets/categ_open-de616238db93a0645b4c4a2cdd4eece4.png +0 -0
  71. data/public/assets/categ_open.png +0 -0
  72. data/public/assets/excanvas-1f8c36f3578409126862b5c17e59b9bd.js +14 -0
  73. data/public/assets/excanvas-1f8c36f3578409126862b5c17e59b9bd.js.gz +0 -0
  74. data/public/assets/excanvas.js +14 -0
  75. data/public/assets/excanvas.js.gz +0 -0
  76. data/public/assets/file-48364459f087292aafa11168442bde71.gif +0 -0
  77. data/public/assets/file.gif +0 -0
  78. data/public/assets/folder-7e0f370ab3fcca5deab89784db42da4a.gif +0 -0
  79. data/public/assets/folder-closed-cb6c847cac4dea2cb59c98ecfc76b8ae.gif +0 -0
  80. data/public/assets/folder-closed.gif +0 -0
  81. data/public/assets/folder.gif +0 -0
  82. data/public/assets/footer-ea48e7e96122c8ab345da8ff67f29838.png +0 -0
  83. data/public/assets/footer.png +0 -0
  84. data/public/assets/go_there-ee7df641e73ef83e43180dbc07c40540.png +0 -0
  85. data/public/assets/go_there.png +0 -0
  86. data/public/assets/header_long-5c7970b5911f94433a696ae87918ecb0.png +0 -0
  87. data/public/assets/header_long.png +0 -0
  88. data/public/assets/iqvoc-ff2c5252d9877c38297164984d4a7a55.png +0 -0
  89. data/public/assets/iqvoc.png +0 -0
  90. data/public/assets/iqvoc/ie_fixes-7797396e9cd2f32961f56af18bacd33a.css +7 -0
  91. data/public/assets/iqvoc/ie_fixes-7797396e9cd2f32961f56af18bacd33a.css.gz +0 -0
  92. data/public/assets/iqvoc/ie_fixes.css +7 -0
  93. data/public/assets/iqvoc/ie_fixes.css.gz +0 -0
  94. data/public/assets/iqvoc/visualization-49b198ac7d8bc15fa13eafc528e96081.js +4 -0
  95. data/public/assets/iqvoc/visualization-49b198ac7d8bc15fa13eafc528e96081.js.gz +0 -0
  96. data/public/assets/iqvoc/visualization.js +4 -0
  97. data/public/assets/iqvoc/visualization.js.gz +0 -0
  98. data/public/assets/jit_rgraph-63bc6fa01820d73bb4076f2f62493e66.js +25 -0
  99. data/public/assets/jit_rgraph-63bc6fa01820d73bb4076f2f62493e66.js.gz +0 -0
  100. data/public/assets/jit_rgraph.js +25 -0
  101. data/public/assets/jit_rgraph.js.gz +0 -0
  102. data/public/assets/jquery-ui/ui-bg_flat_0_aaaaaa_40x100-951e2a65945b93d3f69c1994e5672f39.png +0 -0
  103. data/public/assets/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  104. data/public/assets/jquery-ui/ui-bg_flat_55_fbec88_40x100-befbc2de63b9556a093c0a5bb2e08a95.png +0 -0
  105. data/public/assets/jquery-ui/ui-bg_flat_55_fbec88_40x100.png +0 -0
  106. data/public/assets/jquery-ui/ui-bg_glass_75_d0e5f5_1x400-faa3341c6543985d2c94bd65e36bd6d8.png +0 -0
  107. data/public/assets/jquery-ui/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  108. data/public/assets/jquery-ui/ui-bg_glass_85_dfeffc_1x400-df1d30b336ee1530edc334458abd2417.png +0 -0
  109. data/public/assets/jquery-ui/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  110. data/public/assets/jquery-ui/ui-bg_glass_95_fef1ec_1x400-5767880afddd9b98f4b4cfd43a09947b.png +0 -0
  111. data/public/assets/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  112. data/public/assets/jquery-ui/ui-bg_gloss-wave_55_5c9ccc_500x100-c563cdeeac0f1479b69e36b21d785ac4.png +0 -0
  113. data/public/assets/jquery-ui/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  114. data/public/assets/jquery-ui/ui-bg_inset-hard_100_f5f8f9_1x100-b837a3b8315a7ff270664ce469f2e6d7.png +0 -0
  115. data/public/assets/jquery-ui/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  116. data/public/assets/jquery-ui/ui-bg_inset-hard_100_fcfdfd_1x100-b5d3cda0e6142534937f71cf4438e28a.png +0 -0
  117. data/public/assets/jquery-ui/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  118. data/public/assets/jquery-ui/ui-icons_217bc0_256x240-14e62c24f88d00f227d88e5b16406eec.png +0 -0
  119. data/public/assets/jquery-ui/ui-icons_217bc0_256x240.png +0 -0
  120. data/public/assets/jquery-ui/ui-icons_2e83ff_256x240-c15e521f58d397c2fa31f4214f92a399.png +0 -0
  121. data/public/assets/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
  122. data/public/assets/jquery-ui/ui-icons_469bdd_256x240-aceccf3311e1b369e71a4ac629953d61.png +0 -0
  123. data/public/assets/jquery-ui/ui-icons_469bdd_256x240.png +0 -0
  124. data/public/assets/jquery-ui/ui-icons_6da8d5_256x240-18148340aba4ce354c9d52c5aa2f5c0c.png +0 -0
  125. data/public/assets/jquery-ui/ui-icons_6da8d5_256x240.png +0 -0
  126. data/public/assets/jquery-ui/ui-icons_cd0a0a_256x240-279edbd373e73b1ecd1ea7a6ba19750d.png +0 -0
  127. data/public/assets/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
  128. data/public/assets/jquery-ui/ui-icons_d8e7f3_256x240-732b446e2e1d4f4fec4277e2632a9adf.png +0 -0
  129. data/public/assets/jquery-ui/ui-icons_d8e7f3_256x240.png +0 -0
  130. data/public/assets/jquery-ui/ui-icons_f9bd01_256x240-1ee933e5956743f5607f2075ed21fac5.png +0 -0
  131. data/public/assets/jquery-ui/ui-icons_f9bd01_256x240.png +0 -0
  132. data/public/assets/json2-fdda51ffce29dd4cb684dc7bd0aede01.js +157 -0
  133. data/public/assets/json2-fdda51ffce29dd4cb684dc7bd0aede01.js.gz +0 -0
  134. data/public/assets/json2.js +157 -0
  135. data/public/assets/json2.js.gz +0 -0
  136. data/public/assets/leaf_end-2ac151e8d7b4928bacb557f96cb5b517.png +0 -0
  137. data/public/assets/leaf_end.png +0 -0
  138. data/public/assets/leaf_end_filled-cdb0eb9ce60425bf0a1fd12226e502eb.png +0 -0
  139. data/public/assets/leaf_end_filled.png +0 -0
  140. data/public/assets/leaf_mid-966f99acaeaddfaedb6b602eb1eed7e0.png +0 -0
  141. data/public/assets/leaf_mid.png +0 -0
  142. data/public/assets/leaf_mid_filled-fecf059c72a649fe77052a886fb030d5.png +0 -0
  143. data/public/assets/leaf_mid_filled.png +0 -0
  144. data/public/assets/leaf_nothing-e8b5532117e55a184d93e8bf66afa20a.png +0 -0
  145. data/public/assets/leaf_nothing.png +0 -0
  146. data/public/assets/leaf_only-e4fe523e451ad9dea6bba08b44cf8039.png +0 -0
  147. data/public/assets/leaf_only.png +0 -0
  148. data/public/assets/leaf_only_filled-7b9a97903759b89facd5fb2e03ba14d1.png +0 -0
  149. data/public/assets/leaf_only_filled.png +0 -0
  150. data/public/assets/leaf_top-61fbce4d3adf2235964e828647a52149.png +0 -0
  151. data/public/assets/leaf_top.png +0 -0
  152. data/public/assets/leaf_top_filled-003d96425167d3b74e63eb75e12d163e.png +0 -0
  153. data/public/assets/leaf_top_filled.png +0 -0
  154. data/public/assets/manifest-c08ebf92c2ea89fbce8705f984a7c604.css +1139 -0
  155. data/public/assets/manifest-c08ebf92c2ea89fbce8705f984a7c604.css.gz +0 -0
  156. data/public/assets/manifest-c6d880245ce63929a5842e48cb7c65f2.js +21 -0
  157. data/public/assets/manifest-c6d880245ce63929a5842e48cb7c65f2.js.gz +0 -0
  158. data/public/assets/manifest.css +1139 -0
  159. data/public/assets/manifest.css.gz +0 -0
  160. data/public/assets/manifest.js +21 -0
  161. data/public/assets/manifest.js.gz +0 -0
  162. data/public/assets/manifest.yml +73 -0
  163. data/public/assets/minus-633f45b71e7552c36214c9d81fce94b0.gif +0 -0
  164. data/public/assets/minus.gif +0 -0
  165. data/public/assets/nothing-19b9650c540a8776b047d6dde27687b0.png +0 -0
  166. data/public/assets/nothing.png +0 -0
  167. data/public/assets/ok-96195c6d50075a63cbdfa11818301f56.png +0 -0
  168. data/public/assets/ok.png +0 -0
  169. data/public/assets/plus-dd3920a86d5ea72497854d875c6afc00.gif +0 -0
  170. data/public/assets/plus.gif +0 -0
  171. data/public/assets/rdf_flyer-b2cc2d8b2a537a9c74b39450f8e6b16f.gif +0 -0
  172. data/public/assets/rdf_flyer.gif +0 -0
  173. data/public/assets/red_arrow-875d1bca1c4b97ec82635af86032a024.png +0 -0
  174. data/public/assets/red_arrow.png +0 -0
  175. data/public/assets/shadow-2975795dc944082531617a0c3ad2da70.png +0 -0
  176. data/public/assets/shadow.png +0 -0
  177. data/public/assets/spinner-0b76e32ff4e68b1e8789b4d0fe991cd7.gif +0 -0
  178. data/public/assets/spinner.gif +0 -0
  179. data/public/assets/tokenizer_delete-94c9b41ce566e499de2090b552e0d167.png +0 -0
  180. data/public/assets/tokenizer_delete.png +0 -0
  181. data/public/assets/tokenizer_pencile-b508830af36466f05620d83c544b22ff.png +0 -0
  182. data/public/assets/tokenizer_pencile.png +0 -0
  183. data/public/assets/tokenizer_show-152443b9a6c0b058cfb51c51f567116f.png +0 -0
  184. data/public/assets/tokenizer_show.png +0 -0
  185. data/public/assets/top_01-fab0825c0529e87fddf883074490dc19.png +0 -0
  186. data/public/assets/top_01.png +0 -0
  187. data/public/assets/treeview-black-116394dbf5afda75949a9925de790795.gif +0 -0
  188. data/public/assets/treeview-black-line-142d898d1f095b3cec1a5dd204daae0d.gif +0 -0
  189. data/public/assets/treeview-black-line.gif +0 -0
  190. data/public/assets/treeview-black.gif +0 -0
  191. data/public/assets/treeview-default-01747815c9007458fc391092548255f8.gif +0 -0
  192. data/public/assets/treeview-default-line-9aecef4278b9e684f18f3c52e3607f80.gif +0 -0
  193. data/public/assets/treeview-default-line.gif +0 -0
  194. data/public/assets/treeview-default.gif +0 -0
  195. data/public/assets/treeview-famfamfam-c5f86a8a52aa48e87b4bd58878c81ad8.gif +0 -0
  196. data/public/assets/treeview-famfamfam-line-897ce097b7d84700985608f22e2403c3.gif +0 -0
  197. data/public/assets/treeview-famfamfam-line.gif +0 -0
  198. data/public/assets/treeview-famfamfam.gif +0 -0
  199. data/public/assets/treeview-gray-56089927c44332a8375be41ab13130c8.gif +0 -0
  200. data/public/assets/treeview-gray-line-d4be395725623b1f39a0964fa479774e.gif +0 -0
  201. data/public/assets/treeview-gray-line.gif +0 -0
  202. data/public/assets/treeview-gray.gif +0 -0
  203. data/public/assets/treeview-red-cb4ed4e5654d76aef755e5c55b63e91c.gif +0 -0
  204. data/public/assets/treeview-red-line-fdf843bbfba11d00897c7971dff7e806.gif +0 -0
  205. data/public/assets/treeview-red-line.gif +0 -0
  206. data/public/assets/treeview-red.gif +0 -0
  207. data/public/assets/trunk-5686782333e8b4c7e4468c452fb52cec.png +0 -0
  208. data/public/assets/trunk.png +0 -0
  209. data/public/assets/unfinished-1cb6bae22a5b855f4b51cb03a1cce928.png +0 -0
  210. data/public/assets/unfinished.png +0 -0
  211. data/test/integration/client_edit_concept_test.rb +0 -1
  212. data/test/integration/instance_configuration_test.rb +74 -0
  213. data/test/integration/untranslated_test.rb +1 -1
  214. data/test/integration_test_helper.rb +2 -0
  215. data/test/unit/concept_test.rb +1 -1
  216. data/test/unit/instance_configuration_test.rb +42 -0
  217. data/test/unit/skos_import_test.rb +4 -3
  218. data/vendor/assets/javascripts/json2.js +27 -25
  219. metadata +201 -19
  220. data/db/iqvoc_test.sqlite3 +0 -0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 3.5.0 (2012-02-01)
2
+
3
+ * Instance configuration<br>
4
+ You are now able to provide configuration for certain settings in the browser.
5
+
1
6
  ## 3.4.0 (2012-01-27)
2
7
 
3
8
  * Rails 3.2
data/Gemfile CHANGED
@@ -32,12 +32,13 @@ gem 'cancan'
32
32
  gem 'iq_rdf', '~> 0.1.2'
33
33
  gem 'json'
34
34
  gem 'rails_autolink'
35
+ gem 'jruby-openssl', :platforms => :jruby
36
+ gem 'blazing'
37
+ gem 'blazing-passenger'
38
+ gem 'blazing-rails'
35
39
 
36
40
  group :development do
37
41
  gem 'awesome_print'
38
- gem 'capistrano'
39
- gem 'capistrano-ext'
40
- gem 'rvm' # RVM API (for Capistrano deployments)
41
42
  gem 'heroku'
42
43
  gem 'view_marker'
43
44
  end
@@ -70,7 +71,7 @@ end
70
71
 
71
72
  group :production do
72
73
  gem 'sqlite3', :platforms => :ruby
73
- gem 'activerecord-oracle_enhanced-adapter', :platforms => :ruby
74
+ gem 'activerecord-oracle_enhanced-adapter', :platforms => :jruby
74
75
  end
75
76
 
76
77
  group :heroku do
data/Gemfile.lock CHANGED
@@ -29,7 +29,14 @@ GEM
29
29
  activesupport (= 3.2.1)
30
30
  arel (~> 3.0.0)
31
31
  tzinfo (~> 0.3.29)
32
- activerecord-oracle_enhanced-adapter (1.4.0)
32
+ activerecord-jdbc-adapter (1.2.2)
33
+ activerecord-jdbcmysql-adapter (1.2.2)
34
+ activerecord-jdbc-adapter (~> 1.2.2)
35
+ jdbc-mysql (~> 5.1.0)
36
+ activerecord-jdbcsqlite3-adapter (1.2.2)
37
+ activerecord-jdbc-adapter (~> 1.2.2)
38
+ jdbc-sqlite3 (~> 3.7.2)
39
+ activerecord-oracle_enhanced-adapter (1.4.1)
33
40
  activeresource (3.2.1)
34
41
  activemodel (= 3.2.1)
35
42
  activesupport (= 3.2.1)
@@ -37,22 +44,26 @@ GEM
37
44
  i18n (~> 0.6)
38
45
  multi_json (~> 1.0)
39
46
  addressable (2.2.6)
40
- ansi (1.4.1)
47
+ ansi (1.4.2)
41
48
  arel (3.0.0)
42
49
  authlogic (3.1.0)
43
50
  activerecord (>= 3.0.7)
44
51
  activerecord (>= 3.0.7)
45
52
  awesome_print (1.0.2)
53
+ blazing (0.2.7)
54
+ activesupport
55
+ grit
56
+ i18n
57
+ logging
58
+ blazing-passenger (0.2.3)
59
+ blazing (>= 0.2.5)
60
+ httparty
61
+ blazing-rails (0.1.3)
62
+ blazing (>= 0.2.5)
63
+ httparty
64
+ bouncy-castle-java (1.5.0146.1)
46
65
  builder (3.0.0)
47
66
  cancan (1.6.7)
48
- capistrano (2.9.0)
49
- highline
50
- net-scp (>= 1.0.0)
51
- net-sftp (>= 2.0.0)
52
- net-ssh (>= 2.0.14)
53
- net-ssh-gateway (>= 1.1.0)
54
- capistrano-ext (1.2.1)
55
- capistrano (>= 1.0.0)
56
67
  capybara (1.1.2)
57
68
  mime-types (>= 1.16)
58
69
  nokogiri (>= 1.3.3)
@@ -66,6 +77,7 @@ GEM
66
77
  childprocess (0.3.0)
67
78
  ffi (~> 1.0.6)
68
79
  database_cleaner (0.7.1)
80
+ diff-lcs (1.1.3)
69
81
  erubis (2.7.0)
70
82
  execjs (1.3.0)
71
83
  multi_json (~> 1.0)
@@ -75,26 +87,44 @@ GEM
75
87
  factory_girl (~> 2.5.0)
76
88
  railties (>= 3.0.0)
77
89
  ffi (1.0.11)
78
- heroku (2.19.0)
90
+ ffi (1.0.11-java)
91
+ grit (2.4.1)
92
+ diff-lcs (~> 1.1)
93
+ mime-types (~> 1.15)
94
+ heroku (2.19.1)
79
95
  launchy (>= 0.3.2)
80
96
  rest-client (~> 1.6.1)
81
97
  rubyzip
82
98
  term-ansicolor (~> 1.0.5)
83
- highline (1.6.11)
84
99
  hike (1.2.1)
100
+ httparty (0.8.1)
101
+ multi_json
102
+ multi_xml
85
103
  i18n (0.6.0)
86
104
  iq_rdf (0.1.2)
87
105
  builder
88
106
  bundler
107
+ jdbc-mysql (5.1.13)
108
+ jdbc-sqlite3 (3.7.2)
89
109
  journey (1.0.1)
110
+ jruby-openssl (0.7.5)
111
+ bouncy-castle-java (>= 1.5.0146.1)
90
112
  json (1.6.5)
113
+ json (1.6.5-java)
91
114
  kaminari (0.13.0)
92
115
  actionpack (>= 3.0.0)
93
116
  activesupport (>= 3.0.0)
94
117
  railties (>= 3.0.0)
95
118
  launchy (2.0.5)
96
119
  addressable (~> 2.2.6)
120
+ launchy (2.0.5-java)
121
+ addressable (~> 2.2.6)
122
+ ffi (~> 1.0.9)
123
+ spoon (~> 0.0.1)
97
124
  libv8 (3.3.10.4)
125
+ little-plugger (1.1.3)
126
+ logging (1.6.2)
127
+ little-plugger (>= 1.1.3)
98
128
  mail (2.4.1)
99
129
  i18n (>= 0.4.0)
100
130
  mime-types (~> 1.16)
@@ -102,15 +132,10 @@ GEM
102
132
  memory_test_fix (0.2.0)
103
133
  mime-types (1.17.2)
104
134
  multi_json (1.0.4)
135
+ multi_xml (0.4.1)
105
136
  mysql2 (0.3.11)
106
- net-scp (1.0.4)
107
- net-ssh (>= 1.99.1)
108
- net-sftp (2.0.5)
109
- net-ssh (>= 2.0.9)
110
- net-ssh (2.3.0)
111
- net-ssh-gateway (1.1.0)
112
- net-ssh (>= 1.99.1)
113
137
  nokogiri (1.5.0)
138
+ nokogiri (1.5.0-java)
114
139
  pg (0.12.2)
115
140
  polyglot (0.3.3)
116
141
  rack (1.4.1)
@@ -128,8 +153,8 @@ GEM
128
153
  activesupport (= 3.2.1)
129
154
  bundler (~> 1.0)
130
155
  railties (= 3.2.1)
131
- rails_autolink (1.0.4)
132
- rails (>= 3.1.0)
156
+ rails_autolink (1.0.5)
157
+ rails (~> 3.1)
133
158
  railties (3.2.1)
134
159
  actionpack (= 3.2.1)
135
160
  activesupport (= 3.2.1)
@@ -143,12 +168,12 @@ GEM
143
168
  rest-client (1.6.7)
144
169
  mime-types (>= 1.16)
145
170
  rubyzip (0.9.5)
146
- rvm (1.9.2)
147
- selenium-webdriver (2.17.0)
171
+ selenium-webdriver (2.18.0)
148
172
  childprocess (>= 0.2.5)
149
173
  ffi (~> 1.0.9)
150
174
  multi_json (~> 1.0.4)
151
175
  rubyzip
176
+ spoon (0.0.1)
152
177
  spork (0.9.0)
153
178
  sprockets (2.1.2)
154
179
  hike (~> 1.2)
@@ -166,7 +191,7 @@ GEM
166
191
  turn (0.8.3)
167
192
  ansi
168
193
  tzinfo (0.3.31)
169
- uglifier (1.2.2)
194
+ uglifier (1.2.3)
170
195
  execjs (>= 0.3.0)
171
196
  multi_json (>= 1.0.2)
172
197
  view_marker (1.0.0)
@@ -175,6 +200,7 @@ GEM
175
200
  nokogiri (~> 1.3)
176
201
 
177
202
  PLATFORMS
203
+ java
178
204
  ruby
179
205
 
180
206
  DEPENDENCIES
@@ -183,15 +209,17 @@ DEPENDENCIES
183
209
  activerecord-oracle_enhanced-adapter
184
210
  authlogic
185
211
  awesome_print
212
+ blazing
213
+ blazing-passenger
214
+ blazing-rails
186
215
  cancan
187
- capistrano
188
- capistrano-ext
189
216
  capybara
190
217
  capybara-webkit
191
218
  database_cleaner
192
219
  factory_girl_rails
193
220
  heroku
194
221
  iq_rdf (~> 0.1.2)
222
+ jruby-openssl
195
223
  json
196
224
  kaminari
197
225
  memory_test_fix
@@ -200,7 +228,6 @@ DEPENDENCIES
200
228
  pg
201
229
  rails (= 3.2.1)
202
230
  rails_autolink
203
- rvm
204
231
  spork (~> 0.9.0.rc)
205
232
  spork-testunit!
206
233
  sqlite3
@@ -5,4 +5,3 @@
5
5
  //= require jquery.treeview
6
6
  //= require jquery.treeview.async
7
7
  //= require storage
8
- //= require json2
@@ -68,4 +68,8 @@ form.form span.fieldWithErrors {
68
68
  height: 20px;
69
69
  display: inline-block;
70
70
  margin-left: 1em;
71
- }
71
+ }
72
+
73
+ form.large-labels label {
74
+ width: 350px;
75
+ }
@@ -14,113 +14,10 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
 
17
- class ApplicationController < ActionController::Base
18
-
19
- prepend_before_filter :set_locale
20
- before_filter :ensure_extension
21
- before_filter :require_user
22
-
23
- helper :all
24
- helper_method :current_user_session, :current_user, :concept_widget_data, :collection_widget_data, :label_widget_data
25
-
26
- rescue_from ActiveRecord::RecordNotFound, :with => :handle_not_found
27
- rescue_from CanCan::AccessDenied, :with => :handle_access_denied
17
+ require "iqvoc/controller_extensions"
28
18
 
19
+ class ApplicationController < ActionController::Base
20
+ include Iqvoc::ControllerExtensions
21
+
29
22
  protect_from_forgery
30
-
31
- protected
32
-
33
- def default_url_options(options = nil)
34
- { :format => params[:format], :lang => I18n.locale }.
35
- reject { |key, value| key == :lang and value.to_s.strip.blank? }. # Strip out the lang parameter if it's empty.
36
- merge(options || {})
37
- end
38
-
39
- # Force an extension to every url. (LOD)
40
- def ensure_extension
41
- unless params[:format] || request.method != "GET"
42
- flash.keep
43
- redirect_to url_for(params.merge(:format => (request.format && request.format.symbol) || :html))
44
- end
45
- end
46
-
47
- def handle_access_denied(exception)
48
- @exception = exception
49
- render :template => 'errors/access_denied', :status => :access_denied
50
- end
51
-
52
- def handle_multiple_choices(exception)
53
- @exception = exception
54
- render :template => 'errors/multiple_choices', :status => :multiple_choices
55
- end
56
-
57
- def handle_not_found(exception)
58
- @exception = exception
59
- SearchResultsController.prepare_basic_variables(self)
60
-
61
- respond_to do |format|
62
- format.html { render :template => 'errors/not_found', :status => :not_found }
63
- end
64
- end
65
-
66
- def set_locale
67
- if Iqvoc::Concept.pref_labeling_languages.include?(nil)
68
- I18n.locale = " "
69
- elsif params[:lang] && Iqvoc::Concept.pref_labeling_languages.include?(params[:lang].to_sym)
70
- I18n.locale = params[:lang]
71
- else
72
- I18n.locale = Iqvoc::Concept.pref_labeling_languages.first
73
- end
74
- end
75
-
76
- def concept_widget_data(concept)
77
- {
78
- :id => concept.origin,
79
- :name => concept.pref_label.value.to_s + (concept.additional_info ? " (#{concept.additional_info })" : "")
80
- }
81
- end
82
-
83
- def collection_widget_data(collection)
84
- {
85
- :id => collection.origin,
86
- :name => collection.pref_label.to_s
87
- }
88
- end
89
-
90
- def label_widget_data(label)
91
- {
92
- :id => label.origin,
93
- :name => label.value
94
- }
95
- end
96
-
97
- # Configurable Ability class
98
- def current_ability
99
- @current_ability ||= Iqvoc.ability_class.new(current_user)
100
- end
101
-
102
- def current_user_session
103
- return @current_user_session if defined?(@current_user_session)
104
- @current_user_session = UserSession.find
105
- end
106
-
107
- def current_user
108
- return @current_user if defined?(@current_user)
109
- @current_user = current_user_session && current_user_session.user
110
- end
111
-
112
- # TODO: Don't require an user (this is skipped in nearly every controller).
113
- # Use Abilitys instead and handle the AccessDeniedException: (#handle_access_denied)
114
- # * User logged in: Exception!
115
- # * User not logged in: Redirect to login path!
116
- # Don't forget to delete this method and all the /.*before_filter :require_user/
117
- # statements in the controllers.
118
- def require_user
119
- unless current_user
120
- flash[:error] = I18n.t("txt.controllers.application.login_required")
121
- redirect_to new_user_session_url(:back_to => request.fullpath)
122
- return false
123
- end
124
- end
125
-
126
23
  end
@@ -27,28 +27,27 @@ class Concepts::HierarchicalController < ConceptsController
27
27
  end
28
28
 
29
29
  # if params[:broader] is given, the action is handling the reversed tree
30
- @concepts = case params[:root]
31
- when /\d+/
32
- root_concept = Iqvoc::Concept.base_class.find(params[:root])
30
+ root_id = params[:root]
31
+ if root_id && root_id =~ /\d+/
32
+ # NB: order matters; see the following `where`
33
33
  if params[:broader]
34
- scope.
35
- includes(:narrower_relations, :broader_relations). # D A N G E R: the order matters!!! See the following where
36
- where(Concept::Relation::Base.arel_table[:target_id].eq(root_concept.id))
34
+ scope = scope.includes(:narrower_relations, :broader_relations)
37
35
  else
38
- scope.
39
- includes(:broader_relations, :narrower_relations). # D A N G E R: the order matters!!! See the following where
40
- where(Concept::Relation::Base.arel_table[:target_id].eq(root_concept.id))
36
+ scope = scope.includes(:broader_relations, :narrower_relations)
41
37
  end
38
+ @concepts = scope.where(Concept::Relation::Base.arel_table[:target_id].eq(root_id))
42
39
  else
43
40
  if params[:broader]
44
- scope.broader_tops.includes(:broader_relations)
41
+ @concepts = scope.broader_tops.includes(:broader_relations)
45
42
  else
46
- scope.tops.includes(:narrower_relations)
43
+ @concepts = scope.tops.includes(:narrower_relations)
47
44
  end
48
45
  end
46
+
49
47
  # When in single query mode, AR handles ALL includes to be loaded by that
50
48
  # one query. We don't want that! So let's do it manually :-)
51
- ActiveRecord::Associations::Preloader.new(@concepts, Iqvoc::Concept.base_class.default_includes + [:pref_labels]).run
49
+ ActiveRecord::Associations::Preloader.new(@concepts,
50
+ Iqvoc::Concept.base_class.default_includes + [:pref_labels]).run
52
51
 
53
52
  @concepts.sort! do |a, b|
54
53
  a.pref_label.to_s <=> b.pref_label.to_s
@@ -28,7 +28,7 @@ class Concepts::UntranslatedController < ConceptsController
28
28
  begins_with(params[:letter]).
29
29
  missing_translation(I18n.locale, Iqvoc::Concept.pref_labeling_languages.first)
30
30
 
31
- if I18n.locale == Iqvoc::Concept.pref_labeling_languages.first # TODO: Should be 404!
31
+ if I18n.locale.to_s == Iqvoc::Concept.pref_labeling_languages.first # TODO: Should be 404!
32
32
  @labels = []
33
33
  flash[:error] = I18n.t("txt.views.untranslated_concepts.unavailable")
34
34
  else
@@ -0,0 +1,103 @@
1
+ # encoding: UTF-8
2
+
3
+ # Copyright 2011 innoQ Deutschland GmbH
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require 'csv'
18
+
19
+ class InstanceConfigurationController < ApplicationController
20
+
21
+ def index
22
+ authorize! :show, Iqvoc.config
23
+
24
+ @settings = Iqvoc.config.defaults.each_with_object({}) { |(key, default_value), hsh|
25
+ hsh[key] = serialize(Iqvoc.config[key], default_value)
26
+ }
27
+ end
28
+
29
+ def update
30
+ authorize! :update, Iqvoc.config
31
+
32
+ # deserialize and save configuration settings
33
+ errors = []
34
+ params[:config].each { |key, value|
35
+ unless Iqvoc.config.defaults.include?(key)
36
+ errors << t("txt.controllers.instance_configuration.invalid_key", :key => key)
37
+ else
38
+ default_value = Iqvoc.config.defaults[key]
39
+ begin
40
+ Iqvoc.config[key] = deserialize(value, default_value)
41
+ rescue TypeError => exc
42
+ errors << t("txt.controllers.instance_configuration.invalid_value",
43
+ :key => key, :error_message => exc.message)
44
+ end
45
+ end
46
+ }
47
+
48
+ if errors.blank?
49
+ flash[:notice] = t("txt.controllers.instance_configuration.update_success")
50
+ else
51
+ flash[:error] = t("txt.controllers.instance_configuration.update_error",
52
+ :error_messages => errors.join("; "))
53
+ end
54
+
55
+ redirect_to instance_configuration_url
56
+ end
57
+
58
+ private
59
+
60
+ # default value determines value type
61
+ def serialize(value, default_value)
62
+ Iqvoc::InstanceConfiguration.validate_value(value)
63
+ if default_value.is_a?(Array)
64
+ return value.to_csv.strip
65
+ else # String, Fixnum / Float
66
+ return value.to_s
67
+ end
68
+ end
69
+
70
+ # default value determines expected type
71
+ # raises TypeError if deserialization fails
72
+ def deserialize(str, default_value)
73
+ str = str.strip
74
+ unless default_value.is_a? Array
75
+ return convert_value(str, default_value.class)
76
+ else
77
+ return str.blank? ? [] : str.parse_csv.map { |item|
78
+ item.strip!
79
+ convert_value(item, default_value[0].class)
80
+ }
81
+ end
82
+ end
83
+
84
+ # converts string to given (non-complex) type
85
+ # raises TypeError on failure
86
+ def convert_value(str, type)
87
+ if type == String
88
+ return str
89
+ elsif type == Fixnum
90
+ raise TypeError, "expected integer" unless str =~ /^[-+]?[0-9]+$/
91
+ return str.to_i
92
+ elsif type == Float
93
+ begin
94
+ return Float(str)
95
+ rescue ArgumentError
96
+ raise TypeError, "expected float"
97
+ end
98
+ else
99
+ raise TypeError, "unsupported type: #{type}"
100
+ end
101
+ end
102
+
103
+ end