iqvoc 3.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (376) hide show
  1. data/Gemfile +69 -0
  2. data/Gemfile.lock +134 -0
  3. data/LICENSE +13 -0
  4. data/README.md +68 -0
  5. data/Rakefile +23 -0
  6. data/app/controllers/application_controller.rb +125 -0
  7. data/app/controllers/collections/hierarchical_controller.rb +44 -0
  8. data/app/controllers/collections_controller.rb +124 -0
  9. data/app/controllers/concepts/alphabetical_controller.rb +39 -0
  10. data/app/controllers/concepts/hierarchical_controller.rb +74 -0
  11. data/app/controllers/concepts/untranslated_controller.rb +38 -0
  12. data/app/controllers/concepts/versions_controller.rb +119 -0
  13. data/app/controllers/concepts_controller.rb +174 -0
  14. data/app/controllers/dashboard_controller.rb +43 -0
  15. data/app/controllers/pages_controller.rb +22 -0
  16. data/app/controllers/rdf_controller.rb +43 -0
  17. data/app/controllers/search_results_controller.rb +101 -0
  18. data/app/controllers/triple_store_syncs_controller.rb +45 -0
  19. data/app/controllers/user_sessions_controller.rb +48 -0
  20. data/app/controllers/users_controller.rb +81 -0
  21. data/app/helpers/application_helper.rb +60 -0
  22. data/app/helpers/concepts_helper.rb +86 -0
  23. data/app/helpers/dashboard_helper.rb +46 -0
  24. data/app/helpers/rdf_helper.rb +63 -0
  25. data/app/helpers/search_results_helper.rb +32 -0
  26. data/app/models/collection/base.rb +161 -0
  27. data/app/models/collection/member/base.rb +23 -0
  28. data/app/models/collection/member/collection.rb +33 -0
  29. data/app/models/collection/member/concept.rb +33 -0
  30. data/app/models/collection/unordered.rb +18 -0
  31. data/app/models/concept/base.rb +418 -0
  32. data/app/models/concept/relation/base.rb +95 -0
  33. data/app/models/concept/relation/reverse_relation_extension.rb +49 -0
  34. data/app/models/concept/relation/skos/base.rb +37 -0
  35. data/app/models/concept/relation/skos/broader/base.rb +41 -0
  36. data/app/models/concept/relation/skos/broader/mono.rb +28 -0
  37. data/app/models/concept/relation/skos/broader/poly.rb +23 -0
  38. data/app/models/concept/relation/skos/narrower/base.rb +37 -0
  39. data/app/models/concept/relation/skos/related.rb +21 -0
  40. data/app/models/concept/skos/base.rb +28 -0
  41. data/app/models/label/base.rb +98 -0
  42. data/app/models/label/skos/base.rb +27 -0
  43. data/app/models/labeling/base.rb +81 -0
  44. data/app/models/labeling/skos/alt_label.rb +21 -0
  45. data/app/models/labeling/skos/base.rb +99 -0
  46. data/app/models/labeling/skos/hidden_label.rb +25 -0
  47. data/app/models/labeling/skos/pref_label.rb +30 -0
  48. data/app/models/match/base.rb +57 -0
  49. data/app/models/match/skos/base.rb +23 -0
  50. data/app/models/match/skos/broad_match.rb +21 -0
  51. data/app/models/match/skos/close_match.rb +21 -0
  52. data/app/models/match/skos/exact_match.rb +21 -0
  53. data/app/models/match/skos/mapping_relation.rb +21 -0
  54. data/app/models/match/skos/narrow_match.rb +21 -0
  55. data/app/models/match/skos/related_match.rb +21 -0
  56. data/app/models/note/annotated/base.rb +29 -0
  57. data/app/models/note/base.rb +127 -0
  58. data/app/models/note/skos/base.rb +52 -0
  59. data/app/models/note/skos/change_note.rb +38 -0
  60. data/app/models/note/skos/definition.rb +33 -0
  61. data/app/models/note/skos/editorial_note.rb +21 -0
  62. data/app/models/note/skos/example.rb +21 -0
  63. data/app/models/note/skos/history_note.rb +21 -0
  64. data/app/models/note/skos/scope_note.rb +21 -0
  65. data/app/models/origin_mapping.rb +58 -0
  66. data/app/models/rdf_store.rb +96 -0
  67. data/app/models/search_extension.rb +58 -0
  68. data/app/models/user.rb +49 -0
  69. data/app/models/user_session.rb +23 -0
  70. data/app/views/collections/_collection.html.erb +10 -0
  71. data/app/views/collections/_form.html.erb +47 -0
  72. data/app/views/collections/edit.html.erb +11 -0
  73. data/app/views/collections/index.html.erb +12 -0
  74. data/app/views/collections/new.html.erb +7 -0
  75. data/app/views/collections/show.html.erb +53 -0
  76. data/app/views/collections/show.iqrdf +22 -0
  77. data/app/views/concepts/_base_data.html.erb +72 -0
  78. data/app/views/concepts/_close_match.html.erb +16 -0
  79. data/app/views/concepts/_show_head.html.erb +23 -0
  80. data/app/views/concepts/_visualization.html.erb +9 -0
  81. data/app/views/concepts/alphabetical/_pref_labeling.html.erb +6 -0
  82. data/app/views/concepts/alphabetical/index.html.erb +17 -0
  83. data/app/views/concepts/edit.html.erb +32 -0
  84. data/app/views/concepts/hierarchical/_treeview.html.erb +20 -0
  85. data/app/views/concepts/hierarchical/index.html.erb +5 -0
  86. data/app/views/concepts/index.iqrdf +24 -0
  87. data/app/views/concepts/new.html.erb +3 -0
  88. data/app/views/concepts/show_published.html.erb +16 -0
  89. data/app/views/concepts/show_unpublished.html.erb +43 -0
  90. data/app/views/concepts/untranslated/index.html.erb +23 -0
  91. data/app/views/dashboard/index.html.erb +47 -0
  92. data/app/views/errors/access_denied.html.erb +3 -0
  93. data/app/views/errors/multiple_choices.html.erb +11 -0
  94. data/app/views/errors/not_found.html.erb +8 -0
  95. data/app/views/kaminari/_page.html.erb +6 -0
  96. data/app/views/kaminari/_paginator.html.erb +15 -0
  97. data/app/views/layouts/_controls.html.erb +37 -0
  98. data/app/views/layouts/_header.html.erb +1 -0
  99. data/app/views/layouts/_navigation.html.erb +27 -0
  100. data/app/views/layouts/_sections.html.erb +8 -0
  101. data/app/views/layouts/application.html.erb +83 -0
  102. data/app/views/pages/about.html.erb +77 -0
  103. data/app/views/partials/_rdf_logo.html.erb +4 -0
  104. data/app/views/partials/collection/_member.html.erb +14 -0
  105. data/app/views/partials/collection_label/_search_result.html.erb +5 -0
  106. data/app/views/partials/concept/_edit_link_base.html.erb +4 -0
  107. data/app/views/partials/concept/_inline_base.html.erb +4 -0
  108. data/app/views/partials/concept/_new_link_base.html.erb +4 -0
  109. data/app/views/partials/concept/relation/_base.html.erb +8 -0
  110. data/app/views/partials/concept/relation/_edit_base.html.erb +15 -0
  111. data/app/views/partials/concept/relation/skos/_narrower.html.erb +12 -0
  112. data/app/views/partials/concept/relation/skos/broader/_mono.html.erb +28 -0
  113. data/app/views/partials/concept/relation/skos/broader/_poly.html.erb +14 -0
  114. data/app/views/partials/labeling/skos/_base.html.erb +17 -0
  115. data/app/views/partials/labeling/skos/_edit_base.html.erb +7 -0
  116. data/app/views/partials/labeling/skos/_search_result.html.erb +12 -0
  117. data/app/views/partials/match/_base.html.erb +13 -0
  118. data/app/views/partials/match/_edit_base.html.erb +6 -0
  119. data/app/views/partials/note/_base.html.erb +15 -0
  120. data/app/views/partials/note/_edit_base.html.erb +28 -0
  121. data/app/views/partials/note/_note.html.erb +14 -0
  122. data/app/views/partials/note/_search_result.html.erb +8 -0
  123. data/app/views/partials/note/skos/_edit_change_note.html.erb +47 -0
  124. data/app/views/partials/note/skos/definition/_search_result.html.erb +8 -0
  125. data/app/views/rdf/show_concept.iqrdf +5 -0
  126. data/app/views/search_results/_head_contents.html.erb +4 -0
  127. data/app/views/search_results/_rdf_links.html.erb +4 -0
  128. data/app/views/search_results/index.html.erb +92 -0
  129. data/app/views/search_results/index.iqrdf +33 -0
  130. data/app/views/triple_store_syncs/new.html.erb +7 -0
  131. data/app/views/user_sessions/new.html.erb +11 -0
  132. data/app/views/users/_form.html.erb +45 -0
  133. data/app/views/users/_user_preference.html.erb +12 -0
  134. data/app/views/users/edit.html.erb +14 -0
  135. data/app/views/users/index.html.erb +29 -0
  136. data/app/views/users/new.html.erb +13 -0
  137. data/config/application.rb +82 -0
  138. data/config/boot.rb +29 -0
  139. data/config/database.template.yml +43 -0
  140. data/config/database.yml +40 -0
  141. data/config/deploy/common.rb +79 -0
  142. data/config/deploy/ec2.rb +43 -0
  143. data/config/deploy/history.rb +29 -0
  144. data/config/deploy/innoq.rb +37 -0
  145. data/config/deploy.rb +72 -0
  146. data/config/engine.rb +25 -0
  147. data/config/environment.rb +21 -0
  148. data/config/environments/development.rb +74 -0
  149. data/config/environments/production.rb +65 -0
  150. data/config/environments/production.template.rb +65 -0
  151. data/config/environments/production_internal.rb +65 -0
  152. data/config/environments/test.rb +51 -0
  153. data/config/initializers/action_view.rb +23 -0
  154. data/config/initializers/active_record.rb +18 -0
  155. data/config/initializers/backtrace_silencers.rb +23 -0
  156. data/config/initializers/inflections.rb +26 -0
  157. data/config/initializers/iqvoc.rb +50 -0
  158. data/config/initializers/jdbc.rb +23 -0
  159. data/config/initializers/kaminari_config.rb +8 -0
  160. data/config/initializers/language.rb +6 -0
  161. data/config/initializers/mime_types.rb +24 -0
  162. data/config/initializers/secret_token.rb +29 -0
  163. data/config/initializers/secret_token.rb.template +29 -0
  164. data/config/initializers/session_store.rb +24 -0
  165. data/config/locales/activerecord.de.yml +135 -0
  166. data/config/locales/activerecord.en.yml +135 -0
  167. data/config/locales/authlogic.de.yml +38 -0
  168. data/config/locales/authlogic.en.yml +38 -0
  169. data/config/locales/de.yml +326 -0
  170. data/config/locales/defaults.de.yml +153 -0
  171. data/config/locales/en.yml +332 -0
  172. data/config/routes.rb +53 -0
  173. data/config/warble.rb +158 -0
  174. data/db/iqvoc_test.sqlite3 +0 -0
  175. data/db/migrate/20100927101502_create_schema.rb +174 -0
  176. data/db/migrate/20101125141218_add_collection_tables.rb +32 -0
  177. data/db/migrate/20101129161528_add_type_to_collections.rb +24 -0
  178. data/db/migrate/20101202094602_add_origin_to_collections.rb +25 -0
  179. data/db/migrate/20101202135420_rename_collection_contents_to_collection_members.rb +25 -0
  180. data/db/migrate/20101208103531_add_type_to_collection_contents.rb +27 -0
  181. data/db/migrate/20101210153916_add_indexes_to_collections.rb +25 -0
  182. data/db/migrate/20110204121244_create_collection_labels.rb +32 -0
  183. data/db/migrate/20110208084250_change_origin_lengths.rb +27 -0
  184. data/db/migrate/20110328124300_discard_collection_specifics.rb +27 -0
  185. data/db/migrate/20110408120357_remove_classifications_and_classifiers.rb +32 -0
  186. data/db/migrate/20110408120740_remove_xl_specfic_stuff.rb +39 -0
  187. data/db/migrate/20110420133640_change_value_in_notes.rb +8 -0
  188. data/db/migrate/20110427120534_add_published_at_to_labels.rb +9 -0
  189. data/db/migrate/20110510162719_use_mono_hierarchy_instead_of_poly_hierarchy.rb +13 -0
  190. data/db/migrate/20110512132624_extend_notes_value_field_length.rb +8 -0
  191. data/db/migrate/20110525103100_separate_note_annotation_predicates.rb +38 -0
  192. data/db/migrate/20110615134040_change_umt_note_annotations_to_dct.rb +9 -0
  193. data/db/schema.rb +127 -0
  194. data/db/seeds.rb +37 -0
  195. data/iqvoc.gemspec +27 -0
  196. data/lib/engine_tasks/assets.rake +49 -0
  197. data/lib/engine_tasks/db.rake +18 -0
  198. data/lib/engine_tasks/release.rake +118 -0
  199. data/lib/iqvoc/ability.rb +44 -0
  200. data/lib/iqvoc/data_helper.rb +27 -0
  201. data/lib/iqvoc/deep_cloning.rb +92 -0
  202. data/lib/iqvoc/rdf_helper.rb +67 -0
  203. data/lib/iqvoc/skos_importer.rb +144 -0
  204. data/lib/iqvoc/version.rb +19 -0
  205. data/lib/iqvoc/versioning.rb +151 -0
  206. data/lib/iqvoc.rb +228 -0
  207. data/lib/maker.rb +144 -0
  208. data/lib/ojdbc14.jar +0 -0
  209. data/lib/string.rb +23 -0
  210. data/lib/tasks/importer.rake +16 -0
  211. data/lib/tasks/jdbc.rake +24 -0
  212. data/public/404.html +26 -0
  213. data/public/422.html +26 -0
  214. data/public/500.html +26 -0
  215. data/public/favicon.ico +0 -0
  216. data/public/images/iqvoc/add.png +0 -0
  217. data/public/images/iqvoc/arrow_down.gif +0 -0
  218. data/public/images/iqvoc/arrow_up.gif +0 -0
  219. data/public/images/iqvoc/footer.png +0 -0
  220. data/public/images/iqvoc/go_there.png +0 -0
  221. data/public/images/iqvoc/header.png +0 -0
  222. data/public/images/iqvoc/header_long.png +0 -0
  223. data/public/images/iqvoc/iqvoc.png +0 -0
  224. data/public/images/iqvoc/note_add.png +0 -0
  225. data/public/images/iqvoc/note_delete.png +0 -0
  226. data/public/images/iqvoc/note_edit.png +0 -0
  227. data/public/images/iqvoc/ok.png +0 -0
  228. data/public/images/iqvoc/rails.png +0 -0
  229. data/public/images/iqvoc/rdf_flyer.gif +0 -0
  230. data/public/images/iqvoc/red_arrow.png +0 -0
  231. data/public/images/iqvoc/remove.png +0 -0
  232. data/public/images/iqvoc/shadow.png +0 -0
  233. data/public/images/iqvoc/spinner.gif +0 -0
  234. data/public/images/iqvoc/tokenizer_delete.png +0 -0
  235. data/public/images/iqvoc/tokenizer_pencile.png +0 -0
  236. data/public/images/iqvoc/tokenizer_show.png +0 -0
  237. data/public/images/iqvoc/unfinished.png +0 -0
  238. data/public/javascripts/iqvoc/application.js +123 -0
  239. data/public/javascripts/iqvoc/entityselect.js +121 -0
  240. data/public/javascripts/iqvoc/excanvas.js +35 -0
  241. data/public/javascripts/iqvoc/iqvoc.js +118 -0
  242. data/public/javascripts/iqvoc/jit_rgraph.js +153 -0
  243. data/public/javascripts/iqvoc/jquery-1.6.2.min.js +18 -0
  244. data/public/javascripts/iqvoc/jquery-treeview/changelog.txt +29 -0
  245. data/public/javascripts/iqvoc/jquery-treeview/demo/async.html +44 -0
  246. data/public/javascripts/iqvoc/jquery-treeview/demo/bg.gif +0 -0
  247. data/public/javascripts/iqvoc/jquery-treeview/demo/demo.js +43 -0
  248. data/public/javascripts/iqvoc/jquery-treeview/demo/images.html +56 -0
  249. data/public/javascripts/iqvoc/jquery-treeview/demo/index.html +340 -0
  250. data/public/javascripts/iqvoc/jquery-treeview/demo/large.html +559 -0
  251. data/public/javascripts/iqvoc/jquery-treeview/demo/prerendered.html +621 -0
  252. data/public/javascripts/iqvoc/jquery-treeview/demo/screen.css +24 -0
  253. data/public/javascripts/iqvoc/jquery-treeview/demo/simple.html +82 -0
  254. data/public/javascripts/iqvoc/jquery-treeview/demo/source.php +87 -0
  255. data/public/javascripts/iqvoc/jquery-treeview/demo/source.phps +87 -0
  256. data/public/javascripts/iqvoc/jquery-treeview/images/ajax-loader.gif +0 -0
  257. data/public/javascripts/iqvoc/jquery-treeview/images/file.gif +0 -0
  258. data/public/javascripts/iqvoc/jquery-treeview/images/folder-closed.gif +0 -0
  259. data/public/javascripts/iqvoc/jquery-treeview/images/folder.gif +0 -0
  260. data/public/javascripts/iqvoc/jquery-treeview/images/minus.gif +0 -0
  261. data/public/javascripts/iqvoc/jquery-treeview/images/plus.gif +0 -0
  262. data/public/javascripts/iqvoc/jquery-treeview/images/treeview-black-line.gif +0 -0
  263. data/public/javascripts/iqvoc/jquery-treeview/images/treeview-black.gif +0 -0
  264. data/public/javascripts/iqvoc/jquery-treeview/images/treeview-default-line.gif +0 -0
  265. data/public/javascripts/iqvoc/jquery-treeview/images/treeview-default.gif +0 -0
  266. data/public/javascripts/iqvoc/jquery-treeview/images/treeview-famfamfam-line.gif +0 -0
  267. data/public/javascripts/iqvoc/jquery-treeview/images/treeview-famfamfam.gif +0 -0
  268. data/public/javascripts/iqvoc/jquery-treeview/images/treeview-gray-line.gif +0 -0
  269. data/public/javascripts/iqvoc/jquery-treeview/images/treeview-gray.gif +0 -0
  270. data/public/javascripts/iqvoc/jquery-treeview/images/treeview-red-line.gif +0 -0
  271. data/public/javascripts/iqvoc/jquery-treeview/images/treeview-red.gif +0 -0
  272. data/public/javascripts/iqvoc/jquery-treeview/jquery.treeview.async.js +82 -0
  273. data/public/javascripts/iqvoc/jquery-treeview/jquery.treeview.css +75 -0
  274. data/public/javascripts/iqvoc/jquery-treeview/jquery.treeview.js +251 -0
  275. data/public/javascripts/iqvoc/jquery-treeview/jquery.treeview.min.js +15 -0
  276. data/public/javascripts/iqvoc/jquery-treeview/jquery.treeview.pack.js +16 -0
  277. data/public/javascripts/iqvoc/jquery-treeview/lib/jquery.cookie.js +92 -0
  278. data/public/javascripts/iqvoc/jquery-treeview/lib/jquery.js +3363 -0
  279. data/public/javascripts/iqvoc/jquery-treeview/todo +8 -0
  280. data/public/javascripts/iqvoc/jquery-ui-1.8.13.custom.js +3229 -0
  281. data/public/javascripts/iqvoc/jquery-ui-1.8.13.custom.min.js +163 -0
  282. data/public/javascripts/iqvoc/jquery-ui.datepicker-de.js +22 -0
  283. data/public/javascripts/iqvoc/json2.js +480 -0
  284. data/public/javascripts/iqvoc/langselect.js +73 -0
  285. data/public/javascripts/iqvoc/rails.js +132 -0
  286. data/public/javascripts/iqvoc/storage.js +122 -0
  287. data/public/javascripts/iqvoc/visualization.js +321 -0
  288. data/public/robots.txt +5 -0
  289. data/public/stylesheets/iqvoc/blueprint/ie.css +35 -0
  290. data/public/stylesheets/iqvoc/blueprint/plugins/buttons/icons/cross.png +0 -0
  291. data/public/stylesheets/iqvoc/blueprint/plugins/buttons/icons/key.png +0 -0
  292. data/public/stylesheets/iqvoc/blueprint/plugins/buttons/icons/tick.png +0 -0
  293. data/public/stylesheets/iqvoc/blueprint/plugins/buttons/readme.txt +32 -0
  294. data/public/stylesheets/iqvoc/blueprint/plugins/buttons/screen.css +97 -0
  295. data/public/stylesheets/iqvoc/blueprint/plugins/fancy-type/readme.txt +14 -0
  296. data/public/stylesheets/iqvoc/blueprint/plugins/fancy-type/screen.css +71 -0
  297. data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/doc.png +0 -0
  298. data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/email.png +0 -0
  299. data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/external.png +0 -0
  300. data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/feed.png +0 -0
  301. data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/im.png +0 -0
  302. data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/pdf.png +0 -0
  303. data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/visited.png +0 -0
  304. data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/icons/xls.png +0 -0
  305. data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/readme.txt +18 -0
  306. data/public/stylesheets/iqvoc/blueprint/plugins/link-icons/screen.css +40 -0
  307. data/public/stylesheets/iqvoc/blueprint/plugins/rtl/readme.txt +10 -0
  308. data/public/stylesheets/iqvoc/blueprint/plugins/rtl/screen.css +110 -0
  309. data/public/stylesheets/iqvoc/blueprint/print.css +29 -0
  310. data/public/stylesheets/iqvoc/blueprint/screen.css +258 -0
  311. data/public/stylesheets/iqvoc/blueprint/src/forms.css +65 -0
  312. data/public/stylesheets/iqvoc/blueprint/src/grid.css +280 -0
  313. data/public/stylesheets/iqvoc/blueprint/src/grid.png +0 -0
  314. data/public/stylesheets/iqvoc/blueprint/src/ie.css +76 -0
  315. data/public/stylesheets/iqvoc/blueprint/src/print.css +85 -0
  316. data/public/stylesheets/iqvoc/blueprint/src/reset.css +45 -0
  317. data/public/stylesheets/iqvoc/blueprint/src/typography.css +106 -0
  318. data/public/stylesheets/iqvoc/forms.css +71 -0
  319. data/public/stylesheets/iqvoc/images/back.png +0 -0
  320. data/public/stylesheets/iqvoc/images/branch.png +0 -0
  321. data/public/stylesheets/iqvoc/images/categ.png +0 -0
  322. data/public/stylesheets/iqvoc/images/categ_open.png +0 -0
  323. data/public/stylesheets/iqvoc/images/go_there.png +0 -0
  324. data/public/stylesheets/iqvoc/images/iqvoc.png +0 -0
  325. data/public/stylesheets/iqvoc/images/leaf_end.png +0 -0
  326. data/public/stylesheets/iqvoc/images/leaf_end_filled.png +0 -0
  327. data/public/stylesheets/iqvoc/images/leaf_mid.png +0 -0
  328. data/public/stylesheets/iqvoc/images/leaf_mid_filled.png +0 -0
  329. data/public/stylesheets/iqvoc/images/leaf_nothing.png +0 -0
  330. data/public/stylesheets/iqvoc/images/leaf_only.png +0 -0
  331. data/public/stylesheets/iqvoc/images/leaf_only_filled.png +0 -0
  332. data/public/stylesheets/iqvoc/images/leaf_top.png +0 -0
  333. data/public/stylesheets/iqvoc/images/leaf_top_filled.png +0 -0
  334. data/public/stylesheets/iqvoc/images/nothing.png +0 -0
  335. data/public/stylesheets/iqvoc/images/top_01.png +0 -0
  336. data/public/stylesheets/iqvoc/images/trunk.png +0 -0
  337. data/public/stylesheets/iqvoc/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  338. data/public/stylesheets/iqvoc/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
  339. data/public/stylesheets/iqvoc/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  340. data/public/stylesheets/iqvoc/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  341. data/public/stylesheets/iqvoc/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  342. data/public/stylesheets/iqvoc/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  343. data/public/stylesheets/iqvoc/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  344. data/public/stylesheets/iqvoc/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  345. data/public/stylesheets/iqvoc/images/ui-icons_217bc0_256x240.png +0 -0
  346. data/public/stylesheets/iqvoc/images/ui-icons_2e83ff_256x240.png +0 -0
  347. data/public/stylesheets/iqvoc/images/ui-icons_469bdd_256x240.png +0 -0
  348. data/public/stylesheets/iqvoc/images/ui-icons_6da8d5_256x240.png +0 -0
  349. data/public/stylesheets/iqvoc/images/ui-icons_cd0a0a_256x240.png +0 -0
  350. data/public/stylesheets/iqvoc/images/ui-icons_d8e7f3_256x240.png +0 -0
  351. data/public/stylesheets/iqvoc/images/ui-icons_f9bd01_256x240.png +0 -0
  352. data/public/stylesheets/iqvoc/iqvoc.css +477 -0
  353. data/public/stylesheets/iqvoc/jquery-ui-1.8.13.custom.css +415 -0
  354. data/public/stylesheets/iqvoc/widgets.css +81 -0
  355. data/test/factories.rb +74 -0
  356. data/test/integration/alphabetical_test.rb +53 -0
  357. data/test/integration/authentication_test.rb +41 -0
  358. data/test/integration/browse_concepts_and_labels_test.rb +61 -0
  359. data/test/integration/browse_static_pages_test.rb +29 -0
  360. data/test/integration/client_augmentation_test.rb +42 -0
  361. data/test/integration/client_edit_concept_test.rb +72 -0
  362. data/test/integration/collection_circularity_test.rb +110 -0
  363. data/test/integration/concept_test.rb +61 -0
  364. data/test/integration/edit_concepts_test.rb +40 -0
  365. data/test/integration/note_annotations_test.rb +86 -0
  366. data/test/integration/search_test.rb +205 -0
  367. data/test/integration/tree_test.rb +31 -0
  368. data/test/integration/untranslated_test.rb +60 -0
  369. data/test/integration_test_helper.rb +45 -0
  370. data/test/performance/browsing_test.rb +25 -0
  371. data/test/test_helper.rb +29 -0
  372. data/test/unit/concept_test.rb +93 -0
  373. data/test/unit/note_test.rb +32 -0
  374. data/test/unit/origin_mapping_test.rb +70 -0
  375. data/test/unit/skos_import_test.rb +100 -0
  376. metadata +522 -0
@@ -0,0 +1,33 @@
1
+ Iqvoc.default_rdf_namespace_helper_methods.each do |meth|
2
+ document.namespaces(self.send(meth))
3
+ end
4
+
5
+ document.namespaces(
6
+ :search => url_for(request.query_parameters.merge(:page => @results && @results.current_page, :only_path => false, :anchor => "")),
7
+ :sdc => "http://sindice.com/vocab/search#"
8
+ )
9
+
10
+ document << IqRdf.build_full_uri_subject(URI.parse(url_for(request.query_parameters.merge(:page => nil, :only_path => false))), IqRdf::Sdc::build_uri('Query')) do |query|
11
+ query.Sdc::totalResults(@results.total_count)
12
+ query.Sdc::itemsPerPage(@results.limit_value)
13
+ query.Sdc::searchTerms(params[:query])
14
+ query.Sdc::first(URI.parse(url_for(request.query_parameters.merge(:page => 1, :only_path => false))))
15
+ query.Sdc::last(URI.parse(url_for(request.query_parameters.merge(:page => @results.num_pages, :only_path => false))))
16
+ i = 0
17
+ @results.each do
18
+ query.Sdc::result(IqRdf::Search::build_uri("result#{i+=1}"))
19
+ end
20
+ end
21
+
22
+ document << IqRdf.build_full_uri_subject(URI.parse(url_for(request.query_parameters.merge(:page => @results.current_page, :only_path => false))), IqRdf::Sdc::build_uri('Page')) do |page|
23
+ page.Sdc::startIndex((@results.current_page - 1) * @results.limit_value + 1)
24
+ page.Sdc::previous(URI.parse(url_for(request.query_parameters.merge(:page => @results.current_page - 1, :only_path => false)))) if @results.current_page > 1
25
+ page.Sdc::next(URI.parse(url_for(request.query_parameters.merge(:page => @results.current_page + 1, :only_path => false)))) if @results.current_page < @results.num_pages
26
+ end
27
+
28
+ i = 0
29
+ @results.each do |result|
30
+ document << IqRdf::Search::build_uri("result#{i+=1}", IqRdf::Sdc::build_uri('Result')) do |result_node|
31
+ result.build_search_result_rdf(document, result_node)
32
+ end
33
+ end
@@ -0,0 +1,7 @@
1
+ <%= flash[:notice] %>
2
+
3
+ <h2>Triple Store Sync</h2>
4
+
5
+ <%= form_tag triple_store_syncs_path, :method => :post do %>
6
+ <%= submit_tag "Sync" %>
7
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <h2><%= t("txt.views.user_sessions.header") %></h2>
2
+
3
+ <%= form_for @user_session, :url => user_session_path(:back_to => params[:back_to]) do |f| %>
4
+ <%= f.label :email, t("txt.views.user_sessions.email") %><br />
5
+ <%= f.text_field :email %><br />
6
+ <br />
7
+ <%= f.label :password, t("txt.views.user_sessions.password") %><br />
8
+ <%= f.password_field :password %><br />
9
+ <br />
10
+ <%= f.submit t("txt.views.user_sessions.login") %>
11
+ <% end %>
@@ -0,0 +1,45 @@
1
+ <fieldset>
2
+ <ol>
3
+ <li>
4
+ <%= f.label :forename, User.human_attribute_name(:forename) %>
5
+ <%= f.text_field :forename %>
6
+ </li>
7
+
8
+ <li>
9
+ <%= f.label :surname, User.human_attribute_name(:surname) %>
10
+ <%= f.text_field :surname %>
11
+ </li>
12
+
13
+ <li>
14
+ <%= f.label :email, User.human_attribute_name(:email) %>
15
+ <%= f.text_field :email %>
16
+ </li>
17
+
18
+ <li>
19
+ <%= f.label :telephone_number, User.human_attribute_name(:telephone_number) %>
20
+ <%= f.text_field :telephone_number %>
21
+ </li>
22
+
23
+ <li>
24
+ <%= f.label :password, User.human_attribute_name(:password) %>
25
+ <%= f.password_field :password %>
26
+ </li>
27
+
28
+ <li>
29
+ <%= f.label :password_confirmation, User.human_attribute_name(:password_confirmation) %>
30
+ <%= f.password_field :password_confirmation %>
31
+ </li>
32
+
33
+ <li>
34
+ <%= f.label :role, User.human_attribute_name(:role) %>
35
+ <%= f.select :role, User::ROLES.map {|r| [r.humanize, r]} %>
36
+ </li>
37
+
38
+ <li>
39
+ <%= f.check_box :active %>
40
+ <%= f.label :active, User.human_attribute_name(:active) %>
41
+ </li>
42
+ </ol>
43
+ </fieldset>
44
+
45
+ <%= f.submit t('txt.views.users.submit') %>
@@ -0,0 +1,12 @@
1
+ <div class="user_preference">
2
+ <% new_or_existing = user_preference.new_record? ? 'new' : 'existing' %>
3
+ <% prefix = "user[#{new_or_existing}_preferences_attributes][]" -%>
4
+
5
+ <% fields_for prefix, user_preference do |preference_form| %>
6
+ <label for="<%= dom_id user_preference %>_key"><%= t('Name') %>:</label><br />
7
+ <%= preference_form.text_field :key, :size => 20 %><br />
8
+ <label for="<%= dom_id user_preference %>_value"><%= t('Value') %>:</label><br />
9
+ <%= preference_form.text_field :value, :size => 20 %>
10
+ <%= link_to_function image_tag('iqvoc/remove.png'), "$(this).up('.user_preference').remove()", :title => t('Remove') %>
11
+ <% end -%>
12
+ </div>
@@ -0,0 +1,14 @@
1
+ <h2><%= t('txt.views.users.edit.header') %></h2>
2
+
3
+ <%= error_messages_for @user %>
4
+
5
+ <%= form_for(@user, :url => user_path(:id => @user), :html => {:class => "form"}) do |f| %>
6
+ <%= render :partial => "form", :locals => { :f => f } %>
7
+ <% end %>
8
+
9
+ <%= content_for :sub_navigation do %>
10
+ <ul>
11
+ <li><%= link_to t('txt.common.back'), users_path, :class => 'back' %> | </li>
12
+ <li><%= link_to t('txt.views.users.new_link'), new_user_path%></li>
13
+ </ul>
14
+ <% end %>
@@ -0,0 +1,29 @@
1
+ <h2><%= t('txt.views.users.index.header') %></h2>
2
+
3
+ <table class="management">
4
+ <tr>
5
+ <th><%= t('txt.views.users.name') %></th>
6
+ <th><%= t('txt.views.users.email') %></th>
7
+ <th><%= t('txt.views.users.telephone_number') %></th>
8
+ <th><%= t('txt.views.users.role') %></th>
9
+ <th><%= t('txt.views.users.active') %></th>
10
+ </tr>
11
+
12
+ <% @users.each do |user| %>
13
+ <tr>
14
+ <td><%=h user.name %></td>
15
+ <td><%=h user.email %></td>
16
+ <td><%=h user.telephone_number %></td>
17
+ <td><%=h user.role.humanize %></td>
18
+ <td><%=h user.active? ? 1 : 0 %></td>
19
+ <td><%= link_to t('txt.views.users.edit_link'), edit_user_path(:id => user), :class => "button" %></td>
20
+ <td><%= button_to t('txt.views.users.destroy_link'), user_path(:id => user), :confirm => t('txt.views.users.sure'), :method => :delete %></td>
21
+ </tr>
22
+ <% end %>
23
+ </table>
24
+
25
+ <%= content_for :sub_navigation do %>
26
+ <ul>
27
+ <li><%= link_to t('txt.views.users.new_link'), new_user_path, :class => "button" %></li>
28
+ </ul>
29
+ <% end %>
@@ -0,0 +1,13 @@
1
+ <h2><%= t('txt.views.users.new.header') %></h2>
2
+
3
+ <%= error_messages_for @user %>
4
+
5
+ <%= form_for(@user, :url => users_path, :html => {:class => "form"}) do |f| %>
6
+ <%= render :partial => "form", :locals => { :f => f } %>
7
+ <% end %>
8
+
9
+ <%= content_for :sub_navigation do %>
10
+ <ul>
11
+ <li><%= link_to t('txt.common.back'), users_path, :class => 'back' %></li>
12
+ </ul>
13
+ <% end %>
@@ -0,0 +1,82 @@
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 File.expand_path('../boot', __FILE__)
18
+
19
+ require 'rails/all'
20
+
21
+ # If you have a Gemfile, require the gems listed there, including any gems
22
+ # you've limited to :test, :development, or :production.
23
+ Bundler.require(:default, Rails.env) if defined?(Bundler)
24
+
25
+ module Iqvoc
26
+ class Application < Rails::Application
27
+ # Settings in config/environments/* take precedence over those specified here.
28
+ # Application configuration should go into files in config/initializers
29
+ # -- all .rb files in that directory are automatically loaded.
30
+
31
+ # Custom directories with classes and modules you want to be autoloadable.
32
+ # config.autoload_paths += %W(#{config.root}/extras)
33
+
34
+ # Only load the plugins named here, in the order given (default is alphabetical).
35
+ # :all can be used as a placeholder for all plugins not explicitly named.
36
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
37
+
38
+ # Activate observers that should always be running.
39
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
40
+
41
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
42
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
43
+ # config.time_zone = 'Central Time (US & Canada)'
44
+
45
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
46
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
47
+ # config.i18n.default_locale = :en
48
+ # config.i18n.available_locales = [:de, :en]
49
+ # See: config/initializers/iqvoc.rb
50
+
51
+ # JavaScript files you want as :defaults (application.js is always included).
52
+ # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
53
+
54
+ # Configure the default encoding used in templates for Ruby 1.9.
55
+ config.encoding = "utf-8"
56
+
57
+ # Configure sensitive parameters which will be filtered from the log file.
58
+ config.filter_parameters += [:password, :password_confirmation]
59
+
60
+ # TODO This must be refactored!
61
+
62
+ # The JDBC driver url for the coinnection to the virtuoso triple store.
63
+ # Login crdentials have to be stored here too. See
64
+ # http://docs.openlinksw.com/virtuoso/VirtuosoDriverJDBC.html#jdbcurl4mat for
65
+ # more details.
66
+ # Example: "jdbc:virtuoso://localhost:1111/UID=dba/PWD=dba"
67
+ # Use nil to disable virtuoso triple synchronization
68
+ config.virtuoso_jdbc_driver_url = nil
69
+
70
+ # Set up the virtuoso synchronization (which is a triggered pull from the
71
+ # virtuoso server) to be run in a new thread.
72
+ # This is needed in environments where the webserver only runs in a single
73
+ # process/thread (mostly in development environments).
74
+ # When a synchronizaion would be triggered e.g. from a running
75
+ # update action in the UPB, the update would trigger virtuoso to do a HTTP GET
76
+ # back to the UPB to fetch the RDF data. But the only process in the UPB would be
77
+ # blocked by the update... => Deadlock. You can avoid this by using the threaded
78
+ # mode.
79
+ config.virtuoso_sync_threaded = false
80
+
81
+ end
82
+ end
data/config/boot.rb ADDED
@@ -0,0 +1,29 @@
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 'rubygems'
18
+
19
+ # Set up gems listed in the Gemfile.
20
+ gemfile = File.expand_path('../../Gemfile', __FILE__)
21
+ begin
22
+ ENV['BUNDLE_GEMFILE'] = gemfile
23
+ require 'bundler'
24
+ Bundler.setup
25
+ rescue Bundler::GemNotFound => e
26
+ STDERR.puts e.message
27
+ STDERR.puts "Try running `bundle install`."
28
+ exit!
29
+ end if File.exist?(gemfile)
@@ -0,0 +1,43 @@
1
+ <% detect_socket = lambda {
2
+ ["/tmp/mysql.sock",
3
+ "/opt/local/var/run/mysql5/mysqld.sock",
4
+ "/tmp/mysqld.sock",
5
+ "/var/run/mysqld.sock"
6
+ ].detect{ |socket| File.exist?(socket) }
7
+ } %>
8
+
9
+ development: &DEVELOPMENT
10
+ encoding: utf8
11
+ username: root
12
+ password:
13
+ database: iqvoc_development
14
+ <% if defined?(JRuby) %>
15
+ adapter: jdbcmysql
16
+ hostname: localhost
17
+ <% else %>
18
+ adapter: mysql2
19
+ socket: <%= detect_socket.call %>
20
+ <% end %>
21
+
22
+ # Warning: The database defined as 'test' will be erased and
23
+ # re-generated from your development database when you run 'rake'.
24
+ # Do not set this db to the same as development or production.
25
+ test: &TEST
26
+ adapter: sqlite3
27
+ database: db/iqvoc_test.sqlite3
28
+ pool: 5
29
+ timeout: 5000
30
+
31
+ production_internal:
32
+ encoding: utf8
33
+ username: iqvoc
34
+ password: iqvoc
35
+ database: iqvocspez
36
+ adapter: oracle_enhanced
37
+
38
+ production:
39
+ encoding: utf8
40
+ username: iqvoc
41
+ password: iqvoc
42
+ database: iqvoc
43
+ adapter: oracle_enhanced
@@ -0,0 +1,40 @@
1
+ <% socket = ["/tmp/mysql.sock",
2
+ "/opt/local/var/run/mysql5/mysqld.sock",
3
+ "/tmp/mysqld.sock",
4
+ "/var/run/mysqld.sock"].detect { |socket| File.exist?(socket) } %>
5
+
6
+ development: &DEVELOPMENT
7
+ encoding: utf8
8
+ username: root
9
+ password:
10
+ database: iqvoc_development
11
+ <% if defined?(JRuby) %>
12
+ adapter: jdbcmysql
13
+ hostname: localhost
14
+ <% else %>
15
+ adapter: mysql2
16
+ socket: <%= socket %>
17
+ <% end %>
18
+
19
+ # Warning: The database defined as 'test' will be erased and
20
+ # re-generated from your development database when you run 'rake'.
21
+ # Do not set this db to the same as development or production.
22
+ test: &TEST
23
+ adapter: sqlite3
24
+ # database: ":memory:"
25
+ database: db/iqvoc_test.sqlite3
26
+ timeout: 5000
27
+
28
+ production_internal:
29
+ encoding: utf8
30
+ username: iqvoc
31
+ password: iqvoc
32
+ database: iqvocspez
33
+ adapter: oracle_enhanced
34
+
35
+ production:
36
+ encoding: utf8
37
+ username: iqvoc
38
+ password: iqvoc
39
+ database: iqvoc
40
+ adapter: oracle_enhanced
@@ -0,0 +1,79 @@
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
+ desc "Runs a rake task on the remote system. Use TASK'<taskname + parameters>' to specify the task."
18
+ task :invoke_task do
19
+ prefix = fetch(:invokeable_task_prefix, "")
20
+ if ENV['TASK'] and ENV['TASK'] =~ /^#{prefix}/
21
+ run("cd #{deploy_to}/current; rake --trace #{ENV['TASK']} RAILS_ENV=production")
22
+ else
23
+ run("cd #{deploy_to}/current; rake -T #{prefix} --trace RAILS_ENV=production")
24
+ end
25
+ end
26
+
27
+ desc "Tail production log files"
28
+ task :tail_logs, :roles => :app do
29
+ run "tail -f #{shared_path}/log/production.log" do |channel, stream, data|
30
+ puts # for an extra line break before the host name
31
+ puts "#{channel[:host]}: #{data}"
32
+ break if stream == :err
33
+ end
34
+ end
35
+
36
+ namespace :deploy do
37
+
38
+ desc "Generate a secret for the server"
39
+ task :generate_secret, :roles => :app do
40
+ require 'securerandom'
41
+
42
+ template = File.expand_path("config/initializers/secret_token.rb.template")
43
+ raise "File not found: #{template}" unless File.exist?(template)
44
+
45
+ path = "#{shared_path}/config/initializers"
46
+ file_name = "#{path}/secret_token.rb"
47
+
48
+ token = SecureRandom.hex(64)
49
+ txt = File.read(template)
50
+ txt.gsub!(/#(Iqvoc::Application.config.secret_token) = '.*?'$/, "\\1 = '#{token}'")
51
+
52
+ run "mkdir -p #{path}"
53
+ put txt, file_name
54
+ end
55
+
56
+ desc "Copy your current config/database.yml to the server"
57
+ task :database_config_copy, :roles => :app do
58
+ file_name = File.expand_path("config/database.yml")
59
+ raise "File not found: #{file_name}" unless File.exist?(file_name)
60
+ run "mkdir -p #{shared_path}/config/"
61
+ put File.open(file_name).read, "#{shared_path}/config/database.yml"
62
+ end
63
+
64
+ desc "Create default SQLite3 config/database.yml"
65
+ task :database_config_sqlite3, :roles => :app do
66
+ config = {
67
+ 'production' => {
68
+ "adapter" => "sqlite3",
69
+ "database" => "#{shared_path}/db/production.sqlite3",
70
+ "pool" => 5,
71
+ "timeout" => 5000,
72
+ }
73
+ }
74
+ run "mkdir -p #{shared_path}/config/"
75
+ run "mkdir -p #{shared_path}/db/"
76
+ put config.to_yaml, "#{shared_path}/config/database.yml"
77
+ end
78
+
79
+ end
@@ -0,0 +1,43 @@
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
+ @capistrano_history ||= {}
18
+
19
+ # main details
20
+ servername = Capistrano::CLI.ui.ask("Please enter the IP or Hostname of the ec2 instance to deploy to [#{@capistrano_history['last_servername']}]: ")
21
+ servername = @capistrano_history['last_servername'] if servername == ""
22
+ @capistrano_history['last_servername'] = servername
23
+ role :web, servername
24
+ role :app, servername
25
+ role :db, servername, :primary => true
26
+
27
+ keyfile = 'doesnt_exist'
28
+ while !File.exist?(File.expand_path(keyfile))
29
+ keyfile = Capistrano::CLI.ui.ask("Please enter the file holding the ssh key for user 'passenger' [#{@capistrano_history['last_keyfile']}]: ")
30
+ keyfile = @capistrano_history['last_keyfile'] if keyfile == ""
31
+ @capistrano_history['last_keyfile'] = keyfile
32
+ end
33
+ ssh_options[:keys] = [File.expand_path(keyfile)]
34
+
35
+ # server details
36
+ default_run_options[:pty] = true
37
+ ssh_options[:forward_agent] = true
38
+ set :deploy_to, "/var/www/default"
39
+ set :deploy_via, :remote_cache
40
+ set :user, "passenger"
41
+ set :use_sudo, false
42
+
43
+ save_history if defined?(save_history)
@@ -0,0 +1,29 @@
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
+ # load .capistrano_history.yml to @capistrano_history
18
+ def load_history
19
+ @capistrano_history = {}
20
+ @capistrano_history = YAML::load(File.open(".capistrano_history.yml")) if File.exist?(".capistrano_history.yml")
21
+ end
22
+
23
+ # Write history file to prevent too much typing the next time :-)
24
+ def save_history
25
+ File.open(".capistrano_history.yml", 'w') do |f|
26
+ f.write(@capistrano_history.to_yaml)
27
+ end
28
+ end
29
+
@@ -0,0 +1,37 @@
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
+ @capistrano_history ||= {}
18
+
19
+ # main details
20
+ servername = "iqvoc.innoq.com"
21
+ role :web, servername
22
+ role :app, servername
23
+ role :db, servername, :primary => true
24
+
25
+ username = Capistrano::CLI.ui.ask("Please enter a ssh username for #{servername} [#{@capistrano_history['last_user']}]: ")
26
+ username = @capistrano_history['last_user'] if username == ""
27
+ @capistrano_history['last_user'] = username
28
+
29
+ # server details
30
+ default_run_options[:pty] = true
31
+ ssh_options[:forward_agent] = true
32
+ set :deploy_to, "/var/www/iqvoc"
33
+ set :deploy_via, :remote_cache
34
+ set :user, username
35
+ set :use_sudo, false
36
+
37
+ save_history if defined?(save_history)
data/config/deploy.rb ADDED
@@ -0,0 +1,72 @@
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 "#{File.dirname(__FILE__)}/deploy/history"
18
+ load_history
19
+
20
+ load "#{File.dirname(__FILE__)}/deploy/common.rb"
21
+
22
+ set :default_stage, "innoq"
23
+ set :stages, %w(ec2 innoq)
24
+ require 'capistrano/ext/multistage'
25
+
26
+ # RVM bootstrap
27
+ $:.unshift(File.expand_path('./lib', ENV['rvm_path']))
28
+ require 'rvm/capistrano'
29
+ set :rvm_ruby_string, '1.9.2'
30
+ # set :rvm_type, :user
31
+
32
+ # bundler bootstrap
33
+ require 'bundler/capistrano'
34
+
35
+ # main details
36
+ set :application, "iqvoc"
37
+
38
+ # repo details
39
+ set :scm, :git
40
+ set :git_enable_submodules, 1
41
+ # set :scm_username, "passenger"
42
+ set :repository, "git@github.com:innoq/iqvoc.git"
43
+ @capistrano_history['last_branch'] = "master" if @capistrano_history['last_branch'].nil? || @capistrano_history['last_branch'] == ""
44
+ set :branch, Capistrano::CLI.ui.ask("Please enter the branch or tag we should use [#{@capistrano_history['last_branch']}]: ")
45
+ set :branch, @capistrano_history['last_branch'] if fetch(:branch) == ""
46
+ @capistrano_history['last_branch'] = fetch(:branch)
47
+
48
+ save_history
49
+
50
+ # tasks
51
+ namespace :deploy do
52
+ task :start, :roles => :app do
53
+ run "touch #{current_path}/tmp/restart.txt"
54
+ end
55
+
56
+ task :stop, :roles => :app do
57
+ # Do nothing.
58
+ end
59
+
60
+ desc "Restart Application"
61
+ task :restart, :roles => :app do
62
+ run "touch #{current_path}/tmp/restart.txt"
63
+ end
64
+
65
+ desc "Symlink shared resources on each release"
66
+ task :symlink_shared, :roles => :app do
67
+ run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
68
+ run "ln -nfs #{shared_path}/config/initializers/secret_token.rb #{release_path}/config/initializers/secret_token.rb"
69
+ end
70
+ end
71
+
72
+ after 'deploy:update_code', 'deploy:symlink_shared'
data/config/engine.rb ADDED
@@ -0,0 +1,25 @@
1
+ require 'rails'
2
+
3
+ # An engine doesn't require it's own dependencies automatically. We also don't
4
+ # want the applications to have to do that.
5
+ require 'cancan'
6
+ require 'authlogic'
7
+ require 'kaminari'
8
+ require 'iq_rdf'
9
+ require 'json'
10
+
11
+ module Iqvoc
12
+
13
+ class Engine < Rails::Engine
14
+
15
+ paths.lib.tasks << "lib/engine_tasks"
16
+
17
+ # This will be defined in Rails 3.1 (as well as all the tasks in lib/engine_tasks)
18
+ def self.load_seed
19
+ seed_file = Iqvoc::Engine.find_root_with_flag("db").join('db/seeds.rb')
20
+ load(seed_file) if File.exist?(seed_file)
21
+ end
22
+
23
+ end
24
+
25
+ end