hydra-head 3.0.0pre3 → 3.0.0pre4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (352) hide show
  1. data/.gitmodules +0 -3
  2. data/.rvmrc +6 -0
  3. data/BLACKLIGHT_CONFIG.textile +76 -0
  4. data/CREATE_RAILS_APP.textile +323 -0
  5. data/DEVELOP_PLUGIN.textile +90 -0
  6. data/GIT_WORKFLOW.textile +84 -0
  7. data/Gemfile.lock +82 -66
  8. data/HISTORY.textile +7 -0
  9. data/HOW_DO_I.textile +107 -0
  10. data/HOW_TO_DEFINE_A_HYDRA_CONTROLLER.textile +21 -0
  11. data/HOW_TO_DEFINE_A_HYDRA_MODEL.textile +64 -0
  12. data/HOW_TO_GET_STARTED.textile +100 -76
  13. data/INITIAL_APP_MODS.textile +60 -76
  14. data/INSTALL_PREREQ.textile +19 -0
  15. data/LICENSE +14 -0
  16. data/README.textile +89 -17
  17. data/README_RAKE_TASKS.textile +107 -0
  18. data/README_SUBTREE.textile +87 -0
  19. data/README_TERSE.textile +92 -0
  20. data/TESTING_PLUGIN.textile +134 -0
  21. data/app/controllers/assets_controller.rb +34 -4
  22. data/app/controllers/contributors_controller.rb +49 -1
  23. data/app/controllers/downloads_controller.rb +36 -0
  24. data/app/controllers/file_assets_controller.rb +43 -21
  25. data/app/controllers/generic_content_objects_controller.rb +38 -0
  26. data/app/controllers/get_controller.rb +39 -0
  27. data/app/controllers/permissions_controller.rb +33 -4
  28. data/app/controllers/user_sessions_controller.rb +0 -1
  29. data/app/helpers/application_helper.rb +183 -0
  30. data/app/helpers/blacklight_helper.rb +13 -8
  31. data/app/helpers/hydra_assets_helper.rb +6 -15
  32. data/app/helpers/hydra_fedora_metadata_helper.rb +51 -67
  33. data/app/helpers/hydra_helper.rb +35 -11
  34. data/app/helpers/javascript_includes_helper.rb +2 -4
  35. data/app/helpers/personalization_helper.rb +44 -0
  36. data/app/models/generic_content.rb +6 -3
  37. data/app/models/generic_image.rb +3 -1
  38. data/app/models/mods_asset.rb +12 -1
  39. data/app/models/user_attribute.rb +25 -0
  40. data/app/models/uses_default_partials.rb +14 -0
  41. data/app/views/_add_assets_links.html.erb +1 -0
  42. data/app/views/catalog/_edit_partials/_default.html.erb +5 -5
  43. data/app/views/catalog/_home_text.html.erb +2 -2
  44. data/app/views/catalog/_index_partials/_default_details.html.erb +10 -7
  45. data/app/views/catalog/_opensearch_response_metadata.html.erb +2 -0
  46. data/app/views/catalog/_search_form.html.erb +1 -1
  47. data/app/views/catalog/_show_partials/_default.html.erb +4 -2
  48. data/app/views/catalog/_show_partials/_default_details.html.erb +10 -7
  49. data/app/views/catalog/show.html.erb +20 -28
  50. data/app/views/contributors/_edit_person.html.erb +26 -29
  51. data/app/views/contributors/_index.html.erb +6 -7
  52. data/app/views/contributors/_show_conference.html.erb +5 -15
  53. data/app/views/contributors/_show_organization.html.erb +8 -16
  54. data/app/views/file_assets/_file_assets_form.html.erb +11 -0
  55. data/app/views/file_assets/_index.html.erb +21 -6
  56. data/app/views/file_assets/_new.html.erb +6 -2
  57. data/app/views/file_assets/_result.html.erb +2 -2
  58. data/app/views/fluid_infusion/_uploader.html.erb +4 -5
  59. data/app/views/generic_content_objects/_contributor_form.html.erb +11 -0
  60. data/app/views/generic_content_objects/_description_form.html.erb +7 -0
  61. data/app/views/generic_content_objects/_edit_description.html.erb +14 -41
  62. data/app/views/generic_content_objects/_show_description.html.erb +38 -63
  63. data/app/views/generic_contents/_edit.html.erb +1 -45
  64. data/app/views/generic_contents/_edit.html.erb_ +39 -0
  65. data/app/views/generic_contents/_index.html.erb +1 -3
  66. data/app/views/generic_contents/_show.html.erb +4 -14
  67. data/app/views/generic_contents/_show_content.html.erb +7 -4
  68. data/app/views/generic_images/_edit.html.erb +26 -32
  69. data/app/views/generic_images/_show.html.erb +7 -10
  70. data/app/views/generic_images/_show_all.html.erb +1 -1
  71. data/app/views/generic_images/_show_content.html.erb +7 -7
  72. data/app/views/layouts/application.html.erb +33 -41
  73. data/app/views/layouts/hydra-head.html.erb +52 -7
  74. data/app/views/mods_assets/_additional_info_form.html.erb +44 -0
  75. data/app/views/mods_assets/_contributor_form.html.erb +14 -0
  76. data/app/views/mods_assets/_edit.html.erb +8 -32
  77. data/app/views/mods_assets/_edit.html.erb_ +63 -0
  78. data/app/views/mods_assets/_edit_description.html.erb +52 -61
  79. data/app/views/mods_assets/_edit_journal.html.erb +49 -64
  80. data/app/views/mods_assets/_publication_form.html.erb +13 -0
  81. data/app/views/mods_assets/_show.html.erb +18 -23
  82. data/app/views/mods_assets/_show_additional_info.html.erb +17 -0
  83. data/app/views/mods_assets/_show_contributors.html.erb +7 -0
  84. data/app/views/mods_assets/_show_description.html.erb +3 -13
  85. data/app/views/mods_assets/_show_file_assets.html.erb +22 -0
  86. data/app/views/mods_assets/_show_journal.html.erb +3 -3
  87. data/app/views/mods_assets/_show_permissions.html.erb +1 -0
  88. data/app/views/mods_assets/_show_publication.html.erb +8 -0
  89. data/app/views/permissions/_edit_person_permissions.html.erb +4 -9
  90. data/app/views/permissions/_index.html.erb +9 -18
  91. data/app/views/permissions/_new.html.erb +13 -17
  92. data/app/views/permissions/_permissions_form.html.erb +24 -0
  93. data/app/views/user_sessions/_login_form.html.erb +1 -1
  94. data/assets/images/hydra/powered_by_hydra.png +0 -0
  95. data/assets/images/hydra/search-button.png +0 -0
  96. data/assets/javascripts/date-picker/booking/index.html +368 -0
  97. data/assets/javascripts/date-picker/calendarHTML.txt +84 -0
  98. data/assets/javascripts/date-picker/css/datepicker.css +511 -0
  99. data/assets/javascripts/date-picker/css/demo.css +229 -0
  100. data/assets/javascripts/date-picker/index.html +798 -0
  101. data/assets/javascripts/date-picker/js/datepicker.js +2898 -0
  102. data/assets/javascripts/date-picker/js/datepicker.packed.js +1 -0
  103. data/assets/javascripts/date-picker/js/lang/ar.js +9 -0
  104. data/assets/javascripts/date-picker/js/lang/cs.js +9 -0
  105. data/assets/javascripts/date-picker/js/lang/da.js +10 -0
  106. data/assets/javascripts/date-picker/js/lang/de.js +10 -0
  107. data/assets/javascripts/date-picker/js/lang/en.js +9 -0
  108. data/assets/javascripts/date-picker/js/lang/eo.js +13 -0
  109. data/assets/javascripts/date-picker/js/lang/es.js +9 -0
  110. data/assets/javascripts/date-picker/js/lang/et.js +23 -0
  111. data/assets/javascripts/date-picker/js/lang/fi.js +7 -0
  112. data/assets/javascripts/date-picker/js/lang/fr.js +69 -0
  113. data/assets/javascripts/date-picker/js/lang/he.js +9 -0
  114. data/assets/javascripts/date-picker/js/lang/hu.js +9 -0
  115. data/assets/javascripts/date-picker/js/lang/id.js +9 -0
  116. data/assets/javascripts/date-picker/js/lang/it.js +11 -0
  117. data/assets/javascripts/date-picker/js/lang/kr.js +9 -0
  118. data/assets/javascripts/date-picker/js/lang/lt.js +8 -0
  119. data/assets/javascripts/date-picker/js/lang/lv.js +9 -0
  120. data/assets/javascripts/date-picker/js/lang/nl.js +9 -0
  121. data/assets/javascripts/date-picker/js/lang/no.js +9 -0
  122. data/assets/javascripts/date-picker/js/lang/pl.js +10 -0
  123. data/assets/javascripts/date-picker/js/lang/pt-br.js +11 -0
  124. data/assets/javascripts/date-picker/js/lang/pt.js +9 -0
  125. data/assets/javascripts/date-picker/js/lang/ru.js +11 -0
  126. data/assets/javascripts/date-picker/js/lang/se.js +9 -0
  127. data/assets/javascripts/date-picker/js/lang/si.js +9 -0
  128. data/assets/javascripts/date-picker/js/lang/tr.js +9 -0
  129. data/assets/javascripts/date-picker/language/index.html +240 -0
  130. data/assets/javascripts/date-picker/media/Thumbs.db +0 -0
  131. data/assets/javascripts/date-picker/media/backstripes.gif +0 -0
  132. data/assets/javascripts/date-picker/media/bg_header.jpg +0 -0
  133. data/assets/javascripts/date-picker/media/bullet1.gif +0 -0
  134. data/assets/javascripts/date-picker/media/bullet2.gif +0 -0
  135. data/assets/javascripts/date-picker/media/cal-grey.gif +0 -0
  136. data/assets/javascripts/date-picker/media/cal.gif +0 -0
  137. data/assets/javascripts/date-picker/media/gradient-e5e5e5-ffffff.gif +0 -0
  138. data/assets/javascripts/hydra/hydra-head.js +195 -0
  139. data/assets/javascripts/hydra/mediashelf.datepicker.js +39 -0
  140. data/assets/javascripts/hydra/mediashelf.placeholder.js +67 -0
  141. data/assets/javascripts/jquery.form.js +675 -0
  142. data/assets/javascripts/jquery.ui.datepicker.js +1793 -0
  143. data/assets/javascripts/spin.min.js +2 -0
  144. data/assets/stylesheets/hydra/html_refactor.css +115 -0
  145. data/assets/stylesheets/hydra/hydrangea-split-button.css +18 -0
  146. data/assets/stylesheets/hydra/hydrangea.css +292 -0
  147. data/assets/stylesheets/hydra/ie-styles.css +240 -0
  148. data/assets/stylesheets/hydra/styles.css +2224 -0
  149. data/assets/stylesheets/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  150. data/assets/stylesheets/redmond/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
  151. data/assets/stylesheets/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  152. data/assets/stylesheets/redmond/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  153. data/assets/stylesheets/redmond/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  154. data/assets/stylesheets/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  155. data/assets/stylesheets/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  156. data/assets/stylesheets/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  157. data/assets/stylesheets/redmond/images/ui-icons_217bc0_256x240.png +0 -0
  158. data/assets/stylesheets/redmond/images/ui-icons_2e83ff_256x240.png +0 -0
  159. data/assets/stylesheets/redmond/images/ui-icons_469bdd_256x240.png +0 -0
  160. data/assets/stylesheets/redmond/images/ui-icons_6da8d5_256x240.png +0 -0
  161. data/assets/stylesheets/redmond/images/ui-icons_cd0a0a_256x240.png +0 -0
  162. data/assets/stylesheets/redmond/images/ui-icons_d8e7f3_256x240.png +0 -0
  163. data/assets/stylesheets/redmond/images/ui-icons_f9bd01_256x240.png +0 -0
  164. data/assets/stylesheets/redmond/jquery-ui-1.8.5.custom.css +572 -0
  165. data/config/fedora.yml +17 -0
  166. data/config/role_map_cucumber.yml +10 -0
  167. data/config/role_map_development.yml +12 -0
  168. data/config/role_map_production.yml +2 -0
  169. data/config/role_map_test.yml +14 -0
  170. data/config/solr.yml +10 -0
  171. data/config/solr_mappings.yml +22 -0
  172. data/db/migrate/20101105214243_add_user_attributes_table.rb +15 -0
  173. data/db/migrate/20101108192527_create_superusers.rb +12 -0
  174. data/fedora/conf/fedora.fcfg +1021 -0
  175. data/hydra-head.gemspec +7 -4
  176. data/init.rb +4 -0
  177. data/install.rb +1 -0
  178. data/lib/blacklight/catalog_helper.rb +44 -0
  179. data/lib/blacklight.rb +40 -0
  180. data/lib/block_mapper.rb +52 -0
  181. data/lib/djatoka.rb +59 -0
  182. data/lib/ead_mapper.rb +7 -0
  183. data/lib/field_maps.rb +507 -0
  184. data/lib/generators/hydra/assets_generator.rb +51 -0
  185. data/lib/generators/hydra/head_generator.rb +23 -4
  186. data/lib/generators/hydra/templates/config/initializers/blacklight_config.rb +2 -2
  187. data/lib/generators/hydra/templates/config/initializers/hydra_config.rb +26 -0
  188. data/lib/hydra/access_controls_enforcement.rb +3 -2
  189. data/lib/hydra/assets_controller_helper.rb +6 -0
  190. data/lib/hydra/catalog.rb +7 -3
  191. data/lib/hydra/controller.rb +27 -0
  192. data/lib/hydra/file_assets_helper.rb +25 -8
  193. data/lib/hydra/generic_user_attributes.rb +34 -0
  194. data/lib/hydra/model_methods.rb +4 -2
  195. data/lib/hydra/mods_article.rb +5 -2
  196. data/lib/hydra/submission_workflow.rb +137 -0
  197. data/lib/hydra-head/controller.rb +30 -0
  198. data/lib/hydra-head/engine.rb +22 -1
  199. data/lib/hydra-head/routes.rb +14 -3
  200. data/lib/hydra-head/version.rb +1 -1
  201. data/lib/hydra-head.rb +3 -3
  202. data/lib/hydra.rb +1 -1
  203. data/lib/jetty_cleaner.rb +27 -0
  204. data/lib/marc_mapper.rb +131 -0
  205. data/lib/marc_record_ext.rb +97 -0
  206. data/lib/mediashelf/active_fedora_helper.rb +7 -1
  207. data/lib/prev_next_links.rb +22 -0
  208. data/lib/railties/hydra-fixtures.rake +6 -1
  209. data/lib/railties/hyhead_cucumber.rake +1 -2
  210. data/lib/railties/hyhead_rspec.rake +7 -7
  211. data/lib/stanford_blacklight_extensions.rb +6 -0
  212. data/lib/user_attributes_loader.rb +17 -0
  213. data/solr/conf/schema.xml +116 -0
  214. data/solr/conf/solrconfig.xml +311 -0
  215. data/solr/solr.xml +35 -0
  216. data/spec/controllers/catalog_valid_html_spec.rb +128 -0
  217. data/spec-rails2/helpers/hydra_fedora_metadata_helper_spec.rb +219 -0
  218. data/spec-rails2/spec_helper.rb +88 -0
  219. data/tasks/hydra-head.rake +2 -4
  220. data/test_support/etc/Gemfile +6 -5
  221. data/test_support/features/absent_model_edit.feature +27 -0
  222. data/test_support/features/absent_model_search_result.feature +24 -0
  223. data/test_support/features/absent_model_show.feature +27 -0
  224. data/test_support/features/button_add_assets.feature +2 -2
  225. data/test_support/features/contributor_add.feature +21 -16
  226. data/test_support/features/default_partials_edit.feature +27 -0
  227. data/test_support/features/default_partials_search_result.feature +22 -0
  228. data/test_support/features/default_partials_show.feature +24 -0
  229. data/test_support/features/file_upload.feature +55 -22
  230. data/test_support/features/generic_content_create.feature +7 -0
  231. data/test_support/features/generic_content_edit.feature +21 -0
  232. data/test_support/features/generic_content_search_result.feature +22 -0
  233. data/test_support/features/generic_content_show.feature +20 -0
  234. data/test_support/features/generic_image_create.feature +7 -0
  235. data/test_support/features/generic_image_edit.feature +21 -0
  236. data/test_support/features/generic_image_search_result.feature +22 -0
  237. data/test_support/features/generic_image_show.feature +20 -0
  238. data/test_support/features/html_validity.feature +43 -0
  239. data/test_support/features/mods_asset_contributors_edit.feature +27 -19
  240. data/test_support/features/mods_asset_create.feature +13 -8
  241. data/test_support/features/mods_asset_edit.feature +48 -16
  242. data/test_support/features/mods_asset_edit_without_permission.feature +6 -1
  243. data/test_support/features/mods_asset_search_result.feature +15 -15
  244. data/test_support/features/mods_asset_show.feature +56 -5
  245. data/test_support/features/permissions_add.feature +5 -4
  246. data/test_support/features/permissions_edit.feature +9 -7
  247. data/test_support/features/step_definitions/html_validity_steps.rb +57 -0
  248. data/test_support/features/step_definitions/show_document_steps.rb +1 -1
  249. data/test_support/features/step_definitions/user_steps.rb +4 -4
  250. data/test_support/features/support/paths.rb +4 -1
  251. data/test_support/fixtures/hydra_test_default_partials.foxml.xml +80 -0
  252. data/test_support/fixtures/hydra_test_generic_content.foxml.xml +138 -0
  253. data/test_support/fixtures/hydra_test_generic_image.foxml.xml +395 -0
  254. data/test_support/fixtures/hydra_test_no_model.foxml.xml +79 -0
  255. data/test_support/fixtures/hydrus_admin_class1.foxml.xml +176 -0
  256. data/test_support/fixtures/libra-oa_7.foxml.xml +1735 -0
  257. data/test_support/spec/controllers/assets_controller_spec.rb +5 -4
  258. data/test_support/spec/controllers/catalog_controller_spec.rb +2 -2
  259. data/test_support/spec/controllers/file_assets_controller_spec.rb +16 -10
  260. data/test_support/spec/controllers/hydra_controller_spec.rb +2 -0
  261. data/test_support/spec/controllers/permissions_controller_spec.rb +1 -1
  262. data/test_support/spec/helpers/access_controls_enforcement_spec.rb +20 -219
  263. data/test_support/spec/helpers/blacklight_helper_spec.rb +3 -1
  264. data/test_support/spec/helpers/file_assets_helper_spec.rb +13 -10
  265. data/test_support/spec/helpers/hydra_assets_helper_spec.rb +5 -1
  266. data/test_support/spec/helpers/hydra_djatoka_helper_spec.rb +3 -1
  267. data/test_support/spec/helpers/hydra_fedora_metadata_helper_spec.rb +102 -69
  268. data/test_support/spec/helpers/hydra_helper_spec.rb +15 -0
  269. data/test_support/spec/lib/hydra_submission_workflow_spec.rb +141 -0
  270. data/test_support/spec/models/generic_image_spec.rb +6 -1
  271. data/uninstall.rb +1 -0
  272. data/vendor/cache/actionmailer-3.0.10.gem +0 -0
  273. data/vendor/cache/actionpack-3.0.10.gem +0 -0
  274. data/vendor/cache/activemodel-3.0.10.gem +0 -0
  275. data/vendor/cache/activerecord-3.0.10.gem +0 -0
  276. data/vendor/cache/activeresource-3.0.10.gem +0 -0
  277. data/vendor/cache/activesupport-3.0.10.gem +0 -0
  278. data/vendor/cache/capybara-1.1.1.gem +0 -0
  279. data/vendor/cache/childprocess-0.2.2.gem +0 -0
  280. data/vendor/cache/crack-0.3.1.gem +0 -0
  281. data/vendor/cache/cucumber-1.1.0.gem +0 -0
  282. data/vendor/cache/cucumber-rails-1.1.1.gem +0 -0
  283. data/vendor/cache/diff-lcs-1.1.3.gem +0 -0
  284. data/vendor/cache/equivalent-xml-0.2.8.gem +0 -0
  285. data/vendor/cache/factory_girl-2.1.2.gem +0 -0
  286. data/vendor/cache/gherkin-2.5.2.gem +0 -0
  287. data/vendor/cache/haml-3.1.3.gem +0 -0
  288. data/vendor/cache/httparty-0.8.1.gem +0 -0
  289. data/vendor/cache/json-1.6.1.gem +0 -0
  290. data/vendor/cache/json_pure-1.6.1.gem +0 -0
  291. data/vendor/cache/launchy-2.0.5.gem +0 -0
  292. data/vendor/cache/mediashelf-loggable-0.4.7.gem +0 -0
  293. data/vendor/cache/metaclass-0.0.1.gem +0 -0
  294. data/vendor/cache/mocha-0.10.0.gem +0 -0
  295. data/vendor/cache/multi_json-1.0.3.gem +0 -0
  296. data/vendor/cache/multi_xml-0.4.1.gem +0 -0
  297. data/vendor/cache/om-1.4.2.gem +0 -0
  298. data/vendor/cache/polyglot-0.3.2.gem +0 -0
  299. data/vendor/cache/rack-1.2.4.gem +0 -0
  300. data/vendor/cache/{rails-3.0.9.gem → rails-3.0.10.gem} +0 -0
  301. data/vendor/cache/railties-3.0.10.gem +0 -0
  302. data/vendor/cache/rcov-0.9.11.gem +0 -0
  303. data/vendor/cache/rdoc-3.10.gem +0 -0
  304. data/vendor/cache/rest-client-1.6.7.gem +0 -0
  305. data/vendor/cache/selenium-webdriver-2.8.0.gem +0 -0
  306. data/vendor/cache/solrizer-1.1.2.gem +0 -0
  307. data/vendor/cache/solrizer-fedora-1.1.2.gem +0 -0
  308. data/vendor/cache/sqlite3-1.3.4.gem +0 -0
  309. data/vendor/cache/term-ansicolor-1.0.7.gem +0 -0
  310. data/vendor/cache/treetop-1.4.10.gem +0 -0
  311. data/vendor/cache/tzinfo-0.3.30.gem +0 -0
  312. data/vendor/cache/will_paginate-3.0.2.gem +0 -0
  313. data/vendor/cache/xml-simple-1.1.1.gem +0 -0
  314. metadata +351 -121
  315. data/lib/engine.rb +0 -30
  316. data/test_support/features/file_assets_list.feature +0 -32
  317. data/vendor/cache/actionmailer-3.0.9.gem +0 -0
  318. data/vendor/cache/actionpack-3.0.9.gem +0 -0
  319. data/vendor/cache/activemodel-3.0.9.gem +0 -0
  320. data/vendor/cache/activerecord-3.0.9.gem +0 -0
  321. data/vendor/cache/activeresource-3.0.9.gem +0 -0
  322. data/vendor/cache/activesupport-3.0.9.gem +0 -0
  323. data/vendor/cache/capybara-1.0.0.gem +0 -0
  324. data/vendor/cache/childprocess-0.2.0.gem +0 -0
  325. data/vendor/cache/crack-0.1.8.gem +0 -0
  326. data/vendor/cache/cucumber-1.0.2.gem +0 -0
  327. data/vendor/cache/cucumber-rails-1.0.2.gem +0 -0
  328. data/vendor/cache/diff-lcs-1.1.2.gem +0 -0
  329. data/vendor/cache/equivalent-xml-0.2.7.gem +0 -0
  330. data/vendor/cache/factory_girl-1.3.3.gem +0 -0
  331. data/vendor/cache/gherkin-2.4.5.gem +0 -0
  332. data/vendor/cache/haml-3.1.2.gem +0 -0
  333. data/vendor/cache/httparty-0.7.8.gem +0 -0
  334. data/vendor/cache/json-1.5.3.gem +0 -0
  335. data/vendor/cache/json_pure-1.5.3.gem +0 -0
  336. data/vendor/cache/launchy-2.0.4.gem +0 -0
  337. data/vendor/cache/mediashelf-loggable-0.4.3.gem +0 -0
  338. data/vendor/cache/mocha-0.9.12.gem +0 -0
  339. data/vendor/cache/om-1.2.5.gem +0 -0
  340. data/vendor/cache/polyglot-0.3.1.gem +0 -0
  341. data/vendor/cache/rack-1.2.3.gem +0 -0
  342. data/vendor/cache/railties-3.0.9.gem +0 -0
  343. data/vendor/cache/rcov-0.9.9.gem +0 -0
  344. data/vendor/cache/rdoc-3.8.gem +0 -0
  345. data/vendor/cache/selenium-webdriver-0.2.2.gem +0 -0
  346. data/vendor/cache/solrizer-1.1.0.gem +0 -0
  347. data/vendor/cache/solrizer-fedora-1.1.0.gem +0 -0
  348. data/vendor/cache/term-ansicolor-1.0.5.gem +0 -0
  349. data/vendor/cache/treetop-1.4.9.gem +0 -0
  350. data/vendor/cache/tzinfo-0.3.29.gem +0 -0
  351. data/vendor/cache/will_paginate-2.3.15.gem +0 -0
  352. data/vendor/cache/xml-simple-1.1.0.gem +0 -0
@@ -23,95 +23,116 @@ describe HydraFedoraMetadataHelper do
23
23
  describe "fedora_text_field" do
24
24
  it "should generate a text field input with values from the given datastream" do
25
25
  generated_html = helper.fedora_text_field(@resource,"ng_ds",[:title, :main_title])
26
- generated_html.should have_selector "#title_main_title_0-container.editable-container" do |container|
27
- container.should have_selector "span#title_main_title_0-text.editable-text.text", "My Title"
28
- container.should have_selector "input#title_main_title_0.editable-edit.edit" do |input|
29
- input.should have_selector "[value=?]", "My Title"
30
- input.should have_selector "[name=?]", "asset[ng_ds][title_main_title][0]"
31
- input.should have_selector "[data-datastream-name=?]", "ng_ds"
32
- input.should have_selector "[rel=?]", "title_main_title"
33
- end
26
+ # For Rails3:
27
+ # generated_html.should have_selector "input.fieldselector" do |tag|
28
+ # tag.should have_selector "[value=?]", "title"
29
+ # tag.should have_selector "[value=?]", "main_title"
30
+ # end
31
+ # generated_html.should have_selector "input#title_main_title_0.editable-edit.edit" do |tag|
32
+ # tag.should have_selector "[value=?]", "My Title"
33
+ # tag.should have_selector "[name=?]","asset[ng_ds][title_main_title][0]"
34
+ # tag.should have_selector "[data-datastream-name=?]", "ng_ds"
35
+ generated_html.should have_selector "input.fieldselector" do |input|
36
+ with_tag "[value=?]", "title"
37
+ with_tag "[value=?]", "main_title"
38
+ end
39
+ generated_html.should have_selector "input#title_main_title_0.editable-edit.edit" do
40
+ input.should have_selector "[value=?]", "My Title"
41
+ input.should have_selector "[name=?]","asset[ng_ds][title_main_title][0]"
42
+ input.should have_selector "[data-datastream-name=?]", "ng_ds"
34
43
  end
35
44
  end
36
45
  it "should generate an ordered list of text field inputs" do
37
46
  generated_html = helper.fedora_text_field(@resource,"simple_ds","subject")
38
- generated_html.should have_selector "ol[rel=subject]" do |tag|
39
- tag.should have_selector "li#subject_0-container.editable-container.field" do |tag|
40
- tag.should have_selector "a.destructive.field"
41
- tag.should have_selector "span#subject_0-text.editable-text.text", "topic1"
42
- tag.should have_selector "input#subject_0.editable-edit.edit" do |tag|
43
- tag.should have_selector "[value=?]", "topic1"
44
- tag.should have_selector "[name=?]", "asset[simple_ds][subject][0]"
45
- end
46
- end
47
- tag.should have_selector "li#subject_1-container.editable-container.field" do |tag|
48
- tag.should have_selector "a.destructive.field"
49
- tag.should have_selector "span#subject_1-text.editable-text.text", "topic2"
50
- tag.should have_selector "input#subject_1.editable-edit.edit" do |tag|
51
- tag.should have_selector "[value=?]", "topic2"
52
- tag.should have_selector "[name=?]", "asset[simple_ds][subject][1]"
53
- end
54
- end
47
+ # For Rails3
48
+ # generated_html.should have_selector "input#subject_0.editable-edit.edit" do |tag|
49
+ # tag.should have_selector "[value=?]", "topic1"
50
+ # tag.should have_selector "[name=?]", "asset[simple_ds][subject][0]"
51
+ # end
52
+ # generated_html.should have_selector "input#subject_1.editable-edit.edit" do |tag|
53
+ # tag.should have_selector "[value=?]", "topic2"
54
+ # tag.should have_selector "[name=?]", "asset[simple_ds][subject][1]"
55
+ # end
56
+ # generated_html.should have_selector "a.destructive.field"
57
+ # generated_html.should have_selector "input", :class=>"editable-edit", :id=>"subject_1", :name=>"asset[simple_ds][subject_1]", :value=>"topic9"
58
+ # generated_html.should be_html_safe
59
+ # end
60
+ # it "should render an empty control if the field has no values" do
61
+ # helper.fedora_text_field(@resource,"empty_ds","something").should have_selector "#something_0.editable-edit.edit", :value=>''
62
+ # end
63
+ # it "should limit to single-value output with no ordered list if :multiple=>false" do
64
+ # generated_html = helper.fedora_text_field(@resource,"simple_ds","subject", :multiple=>false)
65
+ # generated_html.should have_selector "input#subject.editable-edit.edit[value=topic1]" do |tag|
66
+ # tag.should have_selector "[name=?]", "asset[simple_ds][subject][0]"
67
+ # end
68
+ generated_html.should have_selector "input#subject_0.editable-edit.edit" do |input|
69
+ input.should have_selector "[value=?]", "topic1"
70
+ input.should have_selector "[name=?]", "asset[simple_ds][subject][0]"
71
+ end
72
+ generated_html.should have_selector "input#subject_1.editable-edit.edit" do |input|
73
+ input.should have_selector "[value=?]", "topic2"
74
+ input.should have_selector "[name=?]", "asset[simple_ds][subject][1]"
55
75
  end
76
+ generated_html.should have_selector "a.destructive.field"
56
77
  generated_html.should have_selector "input", :class=>"editable-edit", :id=>"subject_1", :name=>"asset[simple_ds][subject_1]", :value=>"topic9"
57
- generated_html.should be_html_safe
58
78
  end
59
79
  it "should render an empty control if the field has no values" do
60
- helper.fedora_text_field(@resource,"empty_ds","something").should have_selector "li#something_0-container.editable-container" do |tag|
61
- tag.should have_selector "#something_0-text.editable-text.text", ""
62
- end
80
+ helper.fedora_text_field(@resource,"empty_ds","something").should have_selector "#something_0.editable-edit.edit", :value => ""
63
81
  end
64
82
  it "should limit to single-value output with no ordered list if :multiple=>false" do
65
- generated_html = helper.fedora_text_field(@resource,"simple_ds","subject", :multiple=>false)
66
- generated_html.should_not have_selector "ol"
67
- generated_html.should_not have_selector "li"
68
-
69
- generated_html.should have_selector "span#subject-container.editable-container.field" do |tag|
70
- tag.should have_selector "span#subject-text.editable-text.text", "topic1"
71
- tag.should have_selector "input#subject.editable-edit.edit[value=topic1]" do |tag|
72
- tag.should have_selector "[name=?]", "asset[simple_ds][subject][0]"
73
- end
74
- end
83
+ generated_html = helper.fedora_text_field(@resource,"simple_ds","subject", :multiple=>false)
84
+ generated_html.should have_selector "input#subject.editable-edit.edit[value=topic1]" do |input|
85
+ input.should have_selector "[name=?]", "asset[simple_ds][subject][0]"
86
+ end
75
87
  end
76
88
  end
77
89
 
78
90
  describe "fedora_text_area" do
79
91
  it "should generate an ordered list of textile-enabled text area with values from the given datastream" do
80
- helper.fedora_text_area(@resource,"simple_ds","subject").should have_selector "ol[rel=subject]" do |tag|
81
- tag.should have_selector "li#subject_0-container.field" do |tag|
82
- tag.should_not have_selector "a.destructive.field"
83
- tag.should have_selector "span#subject_0-text.editable-text.text[style=display:none;]", "topic1"
84
- tag.should have_selector "textarea#subject_0.editable-edit.edit", "topic1"
85
- end
86
- tag.should have_selector "li#subject_1-container.field" do |tag|
87
- tag.should have_selector "span#subject_1-text.editable-text.text[style=display:none;]","topic2"
88
- tag.should have_selector "textarea#subject_1.editable-edit.edit", "topic2"
89
- end
90
- end
92
+ generated_html = helper.fedora_text_area(@resource,"simple_ds","subject")
93
+ # Rails3:
94
+ # generated_html.should have_selector "textarea#subject_0.editable-edit.edit", :value=>"topic1"
95
+ # generated_html.should have_selector "textarea#subject_1.editable-edit.edit", :value=>"topic2"
96
+ # generated_html.should have_selector "a.destructive.field"
97
+ # end
98
+ # it "should render an empty control if the field has no values" do
99
+ # helper.fedora_text_area(@resource,"empty_ds","something").should have_selector "li#something_0-container.field" do |tag|
100
+ # tag.should have_selector "span#something_0-text.editable-text.text[style=display:none;]", ""
101
+ # tag.should have_selector "textarea#something_0.editable-edit.edit", ""
102
+ # end
103
+ # end
104
+ # it "should limit to single-value output if :multiple=>false" do
105
+ # generated_html = helper.fedora_text_area(@resource,"simple_ds","subject", :multiple=>false)
106
+ # generated_html.should_not have_selector "ol"
107
+ # generated_html.should_not have_selector "li"
108
+ # generated_html.should have_selector "span#subject-container.field" do |tag|
109
+ # tag.should have_selector "span#subject-text.editable-text.text[style=display:none;]", "topic1"
110
+ # tag.should have_selector "textarea#subject.editable-edit.edit", "topic1"
111
+ # end
112
+ # generated_html.should be_html_safe
113
+ generated_html.should have_selector "textarea#subject_0.editable-edit.edit", :value => "topic1"
114
+ generated_html.should have_selector "textarea#subject_1.editable-edit.edit", :value => "topic2"
115
+ generated_html.should have_selector "a.destructive.field"
91
116
  end
92
117
  it "should render an empty control if the field has no values" do
93
- helper.fedora_text_area(@resource,"empty_ds","something").should have_selector "li#something_0-container.field" do |tag|
94
- tag.should have_selector "span#something_0-text.editable-text.text[style=display:none;]", ""
95
- tag.should have_selector "textarea#something_0.editable-edit.edit", ""
96
- end
118
+ helper.fedora_text_area(@resource,"empty_ds","something").should have_selector "textarea#something_0.editable-edit.edit", :value => ""
97
119
  end
98
120
  it "should limit to single-value output if :multiple=>false" do
99
121
  generated_html = helper.fedora_text_area(@resource,"simple_ds","subject", :multiple=>false)
100
- generated_html.should_not have_selector "ol"
101
- generated_html.should_not have_selector "li"
102
- generated_html.should have_selector "span#subject-container.field" do |tag|
103
- tag.should have_selector "span#subject-text.editable-text.text[style=display:none;]", "topic1"
104
- tag.should have_selector "textarea#subject.editable-edit.edit", "topic1"
105
- end
106
- generated_html.should be_html_safe
122
+ generated_html.should have_selector "textarea#subject.editable-edit.edit", :value => "topic1"
107
123
  end
108
124
  end
109
125
 
110
126
  describe "fedora_select" do
111
127
  it "should generate a select with values from the given datastream" do
112
128
  generated_html = helper.fedora_select(@resource,"simple_ds","subject", :choices=>["topic1","topic2", "topic3"])
129
+ # Rails3:
130
+ # generated_html.should have_selector "select.metadata-dd[name='asset[simple_ds][subject][0]']" do |tag|
131
+ # tag.should have_selector "[rel=?]", "subject"
132
+ # tag.should have_selector "option[value=topic1][selected=selected]"
133
+ # tag.should have_selector "option[value=topic2][selected=selected]"
134
+ # tag.should have_selector "option[value=topic3]"
113
135
  generated_html.should have_selector "select.metadata-dd[name='asset[simple_ds][subject][0]']" do |tag|
114
- tag.should have_selector "[rel=?]", "subject"
115
136
  tag.should have_selector "option[value=topic1][selected=selected]"
116
137
  tag.should have_selector "option[value=topic2][selected=selected]"
117
138
  tag.should have_selector "option[value=topic3]"
@@ -127,8 +148,14 @@ describe HydraFedoraMetadataHelper do
127
148
  describe "fedora_date_select" do
128
149
  it "should generate a date picker with values from the given datastream" do
129
150
  generated_html = helper.fedora_date_select(@resource,"simple_ds","subject")
151
+ # Rails3
152
+ # generated_html.should have_selector ".date-select[name='asset[simple_ds][subject]']" do |tag|
153
+ # tag.should have_selector "[rel=?]", "subject"
154
+ # tag.should have_selector "input#subject-sel-y.controlled-date-part.w4em"
155
+ # tag.should have_selector "select#subject-sel-mm.controlled-date-part" do |tag|
156
+ # tag.should have_selector "option[value=01]", "January"
157
+ # tag.should have_selector "option[value=12]", "December"
130
158
  generated_html.should have_selector ".date-select[name='asset[simple_ds][subject]']" do |tag|
131
- tag.should have_selector "[rel=?]", "subject"
132
159
  tag.should have_selector "input#subject-sel-y.controlled-date-part.w4em"
133
160
  tag.should have_selector "select#subject-sel-mm.controlled-date-part" do |tag|
134
161
  tag.should have_selector "option[value=01]", "January"
@@ -184,13 +211,19 @@ describe HydraFedoraMetadataHelper do
184
211
  describe "field_selectors_for" do
185
212
  it "should generate any necessary field_selector values for the given field" do
186
213
  generated_html = helper.field_selectors_for("myDsName", [{:name => 3}, :name_part])
187
- generated_html.should have_selector "input.fieldselector[type=hidden][name='field_selectors[myDsName][name_3_name_part][][name]']" do |tag|
188
- tag.should have_selector "[rel=name_3_name_part]"
189
- tag.should have_selector "[value=3]"
214
+ # Rails3
215
+ # generated_html.should have_selector "input.fieldselector[type=hidden][name='field_selectors[myDsName][name_3_name_part][][name]']" do |tag|
216
+ # tag.should have_selector "[rel=name_3_name_part]"
217
+ # tag.should have_selector "[value=3]"
218
+ # end
219
+ # generated_html.should have_selector "input.fieldselector[type=hidden][name='field_selectors[myDsName][name_3_name_part][]']" do |tag|
220
+ # tag.should have_selector "[rel=name_3_name_part]"
221
+ # tag.should have_selector "[value=name_part]"
222
+ generated_html.should have_selector "input.fieldselector[type=hidden][name='field_selectors[myDsName][name_3_name_part][][name]']" do |input|
223
+ input.should have_selector "[value=3]"
190
224
  end
191
- generated_html.should have_selector "input.fieldselector[type=hidden][name='field_selectors[myDsName][name_3_name_part][]']" do |tag|
192
- tag.should have_selector "[rel=name_3_name_part]"
193
- tag.should have_selector "[value=name_part]"
225
+ generated_html.should have_selector "input.fieldselector[type=hidden][name='field_selectors[myDsName][name_3_name_part][]']" do |input|
226
+ input.should have_selector "[value=name_part]"
194
227
  end
195
228
  # ordering is important. this next line makes sure that the inputs are in the correct order
196
229
  # (tried using CSS3 nth-of-type selectors in have_selector but it didn't work)
@@ -70,4 +70,19 @@ describe HydraHelper do
70
70
  end
71
71
  end
72
72
 
73
+ describe "submit_name" do
74
+ it "should return 'Save' when the scripts session variable is set" do
75
+ stubs(:session).returns({:scripts=>true})
76
+ submit_name.should == "Save"
77
+ end
78
+ it "should return 'Continue' when the new_asset param is set" do
79
+ stubs(:params).returns({:new_asset=>true})
80
+ submit_name.should == "Continue"
81
+ end
82
+ it "should return 'Save and Continue' if all else fails" do
83
+ stubs(:params).returns({})
84
+ submit_name.should == "Save and Continue"
85
+ end
86
+ end
87
+
73
88
  end
@@ -0,0 +1,141 @@
1
+ require File.expand_path( File.join( File.dirname(__FILE__),'..','spec_helper') )
2
+
3
+ mods_asset_model = "info:fedora/afmodel:ModsAsset"
4
+
5
+ describe Hydra::SubmissionWorkflow do
6
+ before(:each) do
7
+ @document = SolrDocument.new({:has_model_s => [mods_asset_model]})
8
+ end
9
+ include Hydra::SubmissionWorkflow
10
+
11
+ describe "first step in workflow" do
12
+ it "should return the first step of a given workflow" do
13
+ first_step_in_workflow.should == "contributor"
14
+ end
15
+ end
16
+
17
+ describe "next in workflow" do
18
+ it "should provide the next step based on the provided step" do
19
+ next_step_in_workflow(:contributor).should == "publication"
20
+ end
21
+ it "should return nil if there is no step (denoting the last step)" do
22
+ next_step_in_workflow(:permissions).should be_nil
23
+ end
24
+ it "should return the step after the first if a blank current step is provided (e.g. started from the first step so no wf_step param)" do
25
+ next_step_in_workflow(nil).should == "publication"
26
+ next_step_in_workflow("").should == "publication"
27
+ end
28
+ end
29
+
30
+ describe "partial for step" do
31
+ it "should return the partial for the given step" do
32
+ workflow_partial_for_step(:contributor).should match(/contributor_form/)
33
+ end
34
+ end
35
+
36
+ describe "previous show partials" do
37
+ it "should return all of the previous show partials for display in the HTML-only workflow" do
38
+ prev_partials = previous_show_partials(:permissions)
39
+ prev_partials.is_a?(Array).should be_true
40
+ prev_partials.length.should == 4
41
+ prev_partials.first.should match(/mods.*contributors/)
42
+ prev_partials.last.should match(/mods.*file_assets/)
43
+ end
44
+ it "should return an empty array for the first step in the workflow" do
45
+ previous_show_partials(:contributor).should == []
46
+ previous_show_partials("").should == []
47
+ end
48
+ end
49
+
50
+ describe "model specific configurations" do
51
+ it "should return the appropriate configuration when an @document object is available" do
52
+ config = model_config
53
+ config.is_a?(Array).should be_true
54
+ config.length.should == 5
55
+ partial_is_mods = []
56
+ config.each do |c|
57
+ c.is_a?(Hash).should be_true
58
+ c.has_key?(:name).should be_true
59
+ c.has_key?(:edit_partial).should be_true
60
+ partial_is_mods << c[:edit_partial].include?("mods_assets")
61
+ end
62
+ partial_is_mods.include?(true).should be_true
63
+ end
64
+ it "should return the appropriate config when a model is available in the params hash" do
65
+ @document = nil
66
+ to = SubmissionWorkflowObject.new
67
+ to.stubs(:params).returns({:content_type => "generic_content"})
68
+ config = to.model_config
69
+ config.is_a?(Array).should be_true
70
+ config.length.should == 4
71
+ partial_is_generic = []
72
+ config.each do |c|
73
+ c.is_a?(Hash).should be_true
74
+ c.has_key?(:name).should be_true
75
+ c.has_key?(:edit_partial).should be_true
76
+ partial_is_generic << c[:edit_partial].include?("generic_content")
77
+ end
78
+ partial_is_generic.include?(true).should be_true
79
+ end
80
+ it "should return the appropriate config when the ID of an object is available in the params hash" do
81
+ @document = nil
82
+ to = SubmissionWorkflowObject.new
83
+ to.stubs(:params).returns({:id=>"hydrangea:fixture_mods_article1"})
84
+ config = to.model_config
85
+ config.is_a?(Array).should be_true
86
+ config.length.should == 5
87
+ config.each do |c|
88
+ c.is_a?(Hash).should be_true
89
+ c.has_key?(:name).should be_true
90
+ c.has_key?(:edit_partial).should be_true
91
+ end
92
+ end
93
+ it "should return the configuration for non mods assets (generic_content)" do
94
+ @document = nil
95
+ to = SubmissionWorkflowObject.new
96
+ to.stubs(:params).returns(:id=>"hydra:test_generic_content")
97
+ config = to.model_config
98
+ config.is_a?(Array).should be_true
99
+ config.length.should == 4
100
+ partial_is_generic = []
101
+ config.each do |c|
102
+ c.is_a?(Hash).should be_true
103
+ c.has_key?(:name).should be_true
104
+ c.has_key?(:edit_partial).should be_true
105
+ partial_is_generic << c[:edit_partial].include?("generic_content")
106
+ end
107
+ partial_is_generic.include?(true).should be_true
108
+ end
109
+ it "should return nil if an ID is the only context available and it is not a valid object" do
110
+ @document = nil
111
+ to = SubmissionWorkflowObject.new
112
+ to.stubs(:params).returns(:id=>"hydra:not_an_actual_record")
113
+ to.model_config.should be_nil
114
+ end
115
+ end
116
+ describe "before_filter validation" do
117
+ it "should redirect back when the validation method returns false." do
118
+ @document = nil
119
+ to = SubmissionWorkflowObject.new
120
+ to.stubs(:params).returns({:id=>"hydrangea:fixture_mods_article1",:action=>"create"})
121
+ to.expects(:redirect_to).with(:back)
122
+ to.validate_workflow_step
123
+ end
124
+ it "should not redirect when the validation method returns true." do
125
+ @document = nil
126
+ to = SubmissionWorkflowObject.new
127
+ to.stubs(:params).returns({:id=>"hydrangea:fixture_mods_article1",:action=>"update"})
128
+ to.expects(:redirect_to).never
129
+ to.validate_workflow_step
130
+ end
131
+ end
132
+ end
133
+ class SubmissionWorkflowObject
134
+ include Hydra::SubmissionWorkflow
135
+ def mods_assets_create_validation
136
+ return false
137
+ end
138
+ def mods_assets_update_validation
139
+ return true
140
+ end
141
+ end
@@ -18,6 +18,11 @@ describe GenericImage do
18
18
  @hydra_image.should respond_to(:apply_depositor_metadata)
19
19
  end
20
20
 
21
+ it "should include Hydra Generic Image Methods" do
22
+ @hydra_image.class.included_modules.should include(Hydra::GenericImage)
23
+ @hydra_image.should respond_to(:derivation_options)
24
+ end
25
+
21
26
  it "should have accessors for its default datastreams of content and original" do
22
27
  @hydra_image.should respond_to(:has_content?)
23
28
  @hydra_image.should respond_to(:content)
@@ -45,7 +50,7 @@ describe GenericImage do
45
50
  end
46
51
 
47
52
  describe '#content=' do
48
- it "shoutld create a content datastream when given an image file" do
53
+ it "should create a content datastream when given an image file" do
49
54
  end
50
55
  end
51
56
 
data/uninstall.rb ADDED
@@ -0,0 +1 @@
1
+ # Uninstall hook code here
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file