curate 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. data/LICENSE +14 -0
  2. data/app/controllers/application_controller.rb +69 -0
  3. data/app/controllers/catalog_controller.rb +336 -0
  4. data/app/controllers/classify_concerns_controller.rb +29 -0
  5. data/app/controllers/common_objects_controller.rb +27 -0
  6. data/app/controllers/curation_concern/base_controller.rb +26 -0
  7. data/app/controllers/curation_concern/generic_files_controller.rb +82 -0
  8. data/app/controllers/dashboard_controller.rb +85 -0
  9. data/app/controllers/downloads_controller.rb +22 -0
  10. data/app/controllers/errors_controller.rb +19 -0
  11. data/app/controllers/help_requests_controller.rb +38 -0
  12. data/app/controllers/terms_of_service_agreements_controller.rb +44 -0
  13. data/app/controllers/welcome_controller.rb +14 -0
  14. data/app/helpers/application_helper.rb +89 -0
  15. data/app/helpers/blacklight_helper.rb +19 -0
  16. data/app/helpers/common_objects_helper.rb +5 -0
  17. data/app/inputs/multi_value_input.rb +71 -0
  18. data/app/models/access_right.rb +53 -0
  19. data/app/models/classify_concern.rb +30 -0
  20. data/app/models/contributor_agreement.rb +58 -0
  21. data/app/models/digital_object_identifier.rb +83 -0
  22. data/app/models/doi_config.rb +26 -0
  23. data/app/models/help_request.rb +34 -0
  24. data/app/models/mint_doi.rb +51 -0
  25. data/app/models/mint_purl.rb +40 -0
  26. data/app/models/object_access.rb +17 -0
  27. data/app/models/purl.rb +18 -0
  28. data/app/models/purl_config.rb +10 -0
  29. data/app/models/repo_object.rb +24 -0
  30. data/app/models/solr_document.rb +35 -0
  31. data/app/repository_datastreams/file_content_datastream.rb +36 -0
  32. data/app/repository_models/curation_concern/embargoable.rb +43 -0
  33. data/app/repository_models/curation_concern/with_access_right.rb +31 -0
  34. data/app/repository_models/generic_file.rb +36 -0
  35. data/app/services/anti_virus_scanner.rb +28 -0
  36. data/app/services/curation_concern.rb +22 -0
  37. data/app/services/curation_concern/base_actor.rb +48 -0
  38. data/app/services/curation_concern/generic_file_actor.rb +38 -0
  39. data/app/validators/future_date_validator.rb +19 -0
  40. data/app/views/_footer.html.erb +19 -0
  41. data/app/views/_ga.html.erb +6 -0
  42. data/app/views/_logo.html.erb +34 -0
  43. data/app/views/_masthead.html.erb +34 -0
  44. data/app/views/catalog/_bookmark_control.html.erb +25 -0
  45. data/app/views/catalog/_bookmark_form.html.erb +8 -0
  46. data/app/views/catalog/_citation.html.erb +11 -0
  47. data/app/views/catalog/_constraints.html.erb +6 -0
  48. data/app/views/catalog/_constraints_element.html.erb +20 -0
  49. data/app/views/catalog/_delete_partials/_default.html.erb +29 -0
  50. data/app/views/catalog/_did_you_mean.html.erb +10 -0
  51. data/app/views/catalog/_document.html.erb +19 -0
  52. data/app/views/catalog/_document_list.html.erb +2 -0
  53. data/app/views/catalog/_edit_partials/_default.html.erb +58 -0
  54. data/app/views/catalog/_edit_partials/_default_details.html.erb +13 -0
  55. data/app/views/catalog/_email_form.html.erb +11 -0
  56. data/app/views/catalog/_facet_layout.html.erb +12 -0
  57. data/app/views/catalog/_facet_limit.html.erb +19 -0
  58. data/app/views/catalog/_facet_selected.html.erb +12 -0
  59. data/app/views/catalog/_facets.html.erb +5 -0
  60. data/app/views/catalog/_folder_control.html.erb +12 -0
  61. data/app/views/catalog/_home.html.erb +2 -0
  62. data/app/views/catalog/_home_text.html.erb +10 -0
  63. data/app/views/catalog/_index_default.html.erb +11 -0
  64. data/app/views/catalog/_index_partials/_default_group.html.erb +37 -0
  65. data/app/views/catalog/_marc_view.html.erb +33 -0
  66. data/app/views/catalog/_opensearch_response_metadata.html.erb +2 -0
  67. data/app/views/catalog/_previous_next_doc.html.erb +6 -0
  68. data/app/views/catalog/_refworks_form.html.erb +7 -0
  69. data/app/views/catalog/_results_pagination.html.erb +6 -0
  70. data/app/views/catalog/_search_form.html.erb +20 -0
  71. data/app/views/catalog/_show_default.html.erb +9 -0
  72. data/app/views/catalog/_show_partials/_default.html.erb +22 -0
  73. data/app/views/catalog/_show_partials/_default_details.html.erb +15 -0
  74. data/app/views/catalog/_show_partials/_facets.html.erb +52 -0
  75. data/app/views/catalog/_show_sidebar.html.erb +1 -0
  76. data/app/views/catalog/_show_tools.html.erb +46 -0
  77. data/app/views/catalog/_sms_form.html.erb +21 -0
  78. data/app/views/catalog/_sort_and_per_page.html.erb +38 -0
  79. data/app/views/catalog/_uva_tabs.html.erb +10 -0
  80. data/app/views/catalog/about.html.erb +0 -0
  81. data/app/views/catalog/citation.html.erb +1 -0
  82. data/app/views/catalog/email.erb +1 -0
  83. data/app/views/catalog/endnote.endnote.erb +1 -0
  84. data/app/views/catalog/index.atom.builder +109 -0
  85. data/app/views/catalog/index.html.erb +55 -0
  86. data/app/views/catalog/index.rss.builder +19 -0
  87. data/app/views/catalog/librarian_view.html.erb +3 -0
  88. data/app/views/catalog/opensearch.json.erb +0 -0
  89. data/app/views/catalog/opensearch.xml.builder +10 -0
  90. data/app/views/catalog/send_email_record.erb +0 -0
  91. data/app/views/catalog/show.endnote.erb +1 -0
  92. data/app/views/catalog/show.html.erb +40 -0
  93. data/app/views/catalog/show.refworks.erb +1 -0
  94. data/app/views/catalog/sms.erb +1 -0
  95. data/app/views/classify_concerns/new.html.erb +24 -0
  96. data/app/views/common_objects/_generic_file.html.erb +0 -0
  97. data/app/views/common_objects/_senior_thesis.html.erb +2 -0
  98. data/app/views/common_objects/show.html.erb +11 -0
  99. data/app/views/common_objects/show_stub_information.html.erb +13 -0
  100. data/app/views/curation_concern/_content_license.html.erb +16 -0
  101. data/app/views/curation_concern/_contributor_agreement.html.erb +27 -0
  102. data/app/views/curation_concern/_doi.html.erb +43 -0
  103. data/app/views/curation_concern/_media_display.html.erb +1 -0
  104. data/app/views/curation_concern/_permission.html.erb +39 -0
  105. data/app/views/curation_concern/_related_files.html.erb +46 -0
  106. data/app/views/curation_concern/generic_files/_attributes.html.erb +63 -0
  107. data/app/views/curation_concern/generic_files/_form.html.erb +57 -0
  108. data/app/views/curation_concern/generic_files/edit.html.erb +5 -0
  109. data/app/views/curation_concern/generic_files/new.html.erb +5 -0
  110. data/app/views/curation_concern/generic_files/show.html.erb +12 -0
  111. data/app/views/curation_concern/senior_theses/_attributes.html.erb +13 -0
  112. data/app/views/curation_concern/senior_theses/_form.html.erb +88 -0
  113. data/app/views/curation_concern/senior_theses/edit.html.erb +15 -0
  114. data/app/views/curation_concern/senior_theses/new.html.erb +14 -0
  115. data/app/views/curation_concern/senior_theses/show.html.erb +18 -0
  116. data/app/views/dashboard/_constraints.html.erb +22 -0
  117. data/app/views/dashboard/_did_you_mean.html.erb +26 -0
  118. data/app/views/dashboard/_document_list.html.erb +20 -0
  119. data/app/views/dashboard/_facet_layout.html.erb +27 -0
  120. data/app/views/dashboard/_facet_limit.html.erb +35 -0
  121. data/app/views/dashboard/_facet_pagination.html.erb +25 -0
  122. data/app/views/dashboard/_facet_selected.html.erb +28 -0
  123. data/app/views/dashboard/_facets.html.erb +22 -0
  124. data/app/views/dashboard/_index_partials/_default_group.html.erb +37 -0
  125. data/app/views/dashboard/_index_partials/_list_files.html.erb +66 -0
  126. data/app/views/dashboard/_index_partials/_thumbnail_display.html.erb +0 -0
  127. data/app/views/dashboard/_results_pagination.html.erb +22 -0
  128. data/app/views/dashboard/_search_form.html.erb +36 -0
  129. data/app/views/dashboard/_show_partials/_default.html.erb +38 -0
  130. data/app/views/dashboard/_show_partials/_default_details.html.erb +31 -0
  131. data/app/views/dashboard/_show_partials/_facets.html.erb +103 -0
  132. data/app/views/dashboard/_sort_and_per_page.html.erb +18 -0
  133. data/app/views/dashboard/facet.html.erb +38 -0
  134. data/app/views/dashboard/get_related_file.html.erb +4 -0
  135. data/app/views/dashboard/index.html.erb +60 -0
  136. data/app/views/errors/401.html.erb +5 -0
  137. data/app/views/errors/404.html.erb +16 -0
  138. data/app/views/errors/500.html.erb +10 -0
  139. data/app/views/help_requests/new.html.erb +60 -0
  140. data/app/views/layouts/application.html.erb +14 -0
  141. data/app/views/layouts/boilerplate.html.erb +28 -0
  142. data/app/views/layouts/common_objects.html.erb +45 -0
  143. data/app/views/layouts/curate_nd.html.erb +55 -0
  144. data/app/views/layouts/curate_nd/1_column.html.erb +22 -0
  145. data/app/views/layouts/curate_nd/2_column.html.erb +26 -0
  146. data/app/views/layouts/curate_nd/catalog.html.erb +22 -0
  147. data/app/views/layouts/curate_nd/dashboard.html.erb +22 -0
  148. data/app/views/layouts/hydra-head.html.erb +95 -0
  149. data/app/views/shared/_action_bar.html.erb +30 -0
  150. data/app/views/shared/_flash_message.html.erb +9 -0
  151. data/app/views/shared/_site_search.html.erb +18 -0
  152. data/app/views/terms_of_service_agreements/new.html.erb +136 -0
  153. data/app/views/welcome/index.html.erb +21 -0
  154. data/app/workers/characterize_job.rb +4 -0
  155. data/app/workers/doi_worker.rb +16 -0
  156. data/config/routes.rb +35 -0
  157. data/lib/curate.rb +6 -0
  158. data/lib/curate/engine.rb +46 -0
  159. data/lib/curate/version.rb +1 -1
  160. data/spec/abilities/generic_file_abilities_spec.rb +55 -0
  161. data/spec/controllers/application_controller_spec.rb +38 -0
  162. data/spec/controllers/classify_concerns_controller_spec.rb +36 -0
  163. data/spec/controllers/common_objects_controller_spec.rb +112 -0
  164. data/spec/controllers/curation_concern/base_controller_spec.rb +14 -0
  165. data/spec/controllers/curation_concern/generic_files_controller_spec.rb +156 -0
  166. data/spec/controllers/dashboard_controller_spec.rb +85 -0
  167. data/spec/controllers/downloads_controller_spec.rb +42 -0
  168. data/spec/controllers/help_requests_controller_spec.rb +42 -0
  169. data/spec/controllers/terms_of_service_agreements_controller_spec.rb +30 -0
  170. data/spec/controllers/welcome_controller_spec.rb +10 -0
  171. data/spec/dummy/app/models/solr_document.rb +4 -0
  172. data/spec/dummy/app/models/user.rb +13 -0
  173. data/spec/dummy/config/application.rb +8 -1
  174. data/spec/dummy/config/database.yml +21 -22
  175. data/spec/dummy/config/doi.yml +11 -0
  176. data/spec/dummy/config/fedora.yml +20 -0
  177. data/spec/dummy/config/initializers/devise.rb +232 -0
  178. data/spec/dummy/config/initializers/hydra_config.rb +41 -0
  179. data/spec/dummy/config/initializers/mailboxer.rb +17 -0
  180. data/spec/dummy/config/initializers/redis_config.rb +45 -0
  181. data/spec/dummy/config/initializers/sufia.rb +66 -0
  182. data/spec/dummy/config/purl.yml +15 -0
  183. data/spec/dummy/config/redis.yml +6 -0
  184. data/spec/dummy/config/role_map_ci.yml +15 -0
  185. data/spec/dummy/config/role_map_cucumber.yml +10 -0
  186. data/spec/dummy/config/role_map_development.yml +12 -0
  187. data/spec/dummy/config/role_map_pre_production.yml +2 -0
  188. data/spec/dummy/config/role_map_production.yml +2 -0
  189. data/spec/dummy/config/role_map_test.yml +15 -0
  190. data/spec/dummy/config/routes.rb +4 -55
  191. data/spec/dummy/config/solr.yml +17 -0
  192. data/spec/dummy/db/migrate/20130130142162_create_purl.rb +55 -0
  193. data/spec/dummy/db/migrate/20130312135359_create_help_requests.rb +22 -0
  194. data/spec/dummy/db/migrate/20130408165008_create_users.rb +11 -0
  195. data/spec/dummy/db/migrate/20130408165009_acts_as_follower_migration.rb +31 -0
  196. data/spec/dummy/db/migrate/20130408165010_add_social_to_users.rb +27 -0
  197. data/spec/dummy/db/migrate/20130408165011_create_single_use_links.rb +12 -0
  198. data/spec/dummy/db/migrate/20130408165012_add_ldap_attrs_to_user.rb +41 -0
  199. data/spec/dummy/db/migrate/20130408165013_add_avatars_to_users.rb +23 -0
  200. data/spec/dummy/db/migrate/20130408165014_create_checksum_audit_logs.rb +34 -0
  201. data/spec/dummy/db/migrate/20130408165015_create_version_committers.rb +29 -0
  202. data/spec/dummy/db/migrate/20130408165016_add_groups_to_users.rb +25 -0
  203. data/spec/dummy/db/migrate/20130408165017_create_local_authorities.rb +64 -0
  204. data/spec/dummy/db/migrate/20130408165018_create_trophies.rb +10 -0
  205. data/spec/dummy/db/migrate/20130408165022_create_mailboxer.mailboxer_engine.rb +62 -0
  206. data/spec/dummy/db/migrate/20130408165023_add_notified_object.mailboxer_engine.rb +18 -0
  207. data/spec/dummy/db/migrate/20130408165024_add_notification_code.mailboxer_engine.rb +14 -0
  208. data/spec/dummy/db/migrate/20130408165025_add_attachments.mailboxer_engine.rb +10 -0
  209. data/spec/dummy/db/migrate/20130408165026_rename_receipts_read.mailboxer_engine.rb +10 -0
  210. data/spec/dummy/db/schema.rb +197 -0
  211. data/spec/dummy/db/test.sqlite3 +0 -0
  212. data/spec/dummy/fedora_conf/conf/development/fedora.fcfg +953 -0
  213. data/spec/dummy/fedora_conf/conf/test/fedora.fcfg +953 -0
  214. data/spec/dummy/log/development.log +1791 -0
  215. data/spec/dummy/log/test.log +176333 -0
  216. data/spec/dummy/solr_conf/conf/schema.xml +692 -0
  217. data/spec/dummy/solr_conf/conf/solrconfig.xml +299 -0
  218. data/spec/dummy/solr_conf/solr.xml +35 -0
  219. data/spec/factories/create_curation_concern.rb +11 -0
  220. data/spec/factories/create_generic_file.rb +36 -0
  221. data/spec/factories/help_requests.rb +10 -0
  222. data/spec/factories/mock_curation_concerns.rb +4 -0
  223. data/spec/factories/users.rb +8 -0
  224. data/spec/helpers/application_helper_spec.rb +139 -0
  225. data/spec/helpers/common_objects_helper_spec.rb +9 -0
  226. data/spec/models/access_right_spec.rb +47 -0
  227. data/spec/models/classify_concern_spec.rb +30 -0
  228. data/spec/models/contributor_agreement_spec.rb +45 -0
  229. data/spec/models/digital_object_identifier_spec.rb +50 -0
  230. data/spec/models/help_request_spec.rb +5 -0
  231. data/spec/models/mint_doi_spec.rb +79 -0
  232. data/spec/models/mint_purl_spec.rb +38 -0
  233. data/spec/models/object_access_spec.rb +24 -0
  234. data/spec/models/purl_spec.rb +22 -0
  235. data/spec/models/repo_object_spec.rb +39 -0
  236. data/spec/repository_models/curation_concern/embargoable_spec.rb +69 -0
  237. data/spec/repository_models/generic_file_spec.rb +38 -0
  238. data/spec/services/anti_virus_scanner_spec.rb +26 -0
  239. data/spec/services/curation_concern/base_actor_spec.rb +28 -0
  240. data/spec/services/curation_concern/generic_file_actor_spec.rb +75 -0
  241. data/spec/services/curation_concern_spec.rb +34 -0
  242. data/spec/spec_helper.rb +54 -1
  243. data/spec/support/environment_override.rb +17 -0
  244. data/spec/support/matchers/raise_rescue_response_type_matcher.rb +42 -0
  245. data/spec/support/mock_curation_concern.rb +61 -0
  246. data/spec/support/shared/shared_examples_is_embargoable.rb +9 -0
  247. data/spec/support/shared/shared_examples_with_access_rights.rb +33 -0
  248. data/spec/workers/characterize_job_spec.rb +26 -0
  249. metadata +686 -10
  250. data/MIT-LICENSE +0 -20
@@ -0,0 +1,299 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <!--
3
+ Licensed to the Apache Software Foundation (ASF) under one or more
4
+ contributor license agreements. See the NOTICE file distributed with
5
+ this work for additional information regarding copyright ownership.
6
+ The ASF licenses this file to You under the Apache License, Version 2.0
7
+ (the "License"); you may not use this file except in compliance with
8
+ the License. You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ -->
18
+
19
+ <!--
20
+ For more details about configurations options that may appear in
21
+ this file, see http://wiki.apache.org/solr/SolrConfigXml.
22
+ -->
23
+ <config>
24
+ <!-- In all configuration below, a prefix of "solr." for class names
25
+ is an alias that causes solr to search appropriate packages,
26
+ including org.apache.solr.(search|update|request|core|analysis)
27
+
28
+ You may also specify a fully qualified Java classname if you
29
+ have your own custom plugins.
30
+ -->
31
+
32
+ <!-- Set this to 'false' if you want solr to continue working after
33
+ it has encountered an severe configuration error. In a
34
+ production environment, you may want solr to keep working even
35
+ if one handler is mis-configured.
36
+
37
+ You may also set this to false using by setting the system
38
+ property:
39
+
40
+ -Dsolr.abortOnConfigurationError=false
41
+ -->
42
+ <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
43
+
44
+ <!-- Controls what version of Lucene various components of Solr
45
+ adhere to. Generally, you want to use the latest version to
46
+ get all bug fixes and improvements. It is highly recommended
47
+ that you fully re-index after changing this setting as it can
48
+ affect both how text is indexed and queried.
49
+ -->
50
+ <luceneMatchVersion>LUCENE_41</luceneMatchVersion>
51
+
52
+ <!-- The DirectoryFactory to use for indexes.
53
+ solr.StandardDirectoryFactory, the default, is filesystem based.
54
+ solr.RAMDirectoryFactory is memory based, not persistent, and doesn't work with replication. -->
55
+ <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
56
+
57
+ <!-- solr lib dirs -->
58
+ <lib dir="../lib/contrib/analysis-extras/lib" />
59
+ <lib dir="../lib/contrib/analysis-extras/lucene-libs" />
60
+
61
+ <dataDir>${solr.data.dir:}</dataDir>
62
+
63
+ <requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
64
+
65
+ <requestDispatcher handleSelect="true" >
66
+ <requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048" />
67
+ </requestDispatcher>
68
+
69
+ <requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
70
+ <requestHandler name="/update" class="solr.UpdateRequestHandler" />
71
+ <requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
72
+
73
+ <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
74
+ <lst name="invariants">
75
+ <str name="q">solrpingquery</str>
76
+ </lst>
77
+ <lst name="defaults">
78
+ <str name="echoParams">all</str>
79
+ </lst>
80
+ </requestHandler>
81
+
82
+ <!-- config for the admin interface -->
83
+ <admin>
84
+ <defaultQuery>search</defaultQuery>
85
+ </admin>
86
+
87
+
88
+ <requestHandler name="search" class="solr.SearchHandler" default="true">
89
+ <!-- default values for query parameters can be specified, these
90
+ will be overridden by parameters in the request
91
+ -->
92
+ <lst name="defaults">
93
+ <str name="defType">dismax</str>
94
+ <str name="echoParams">explicit</str>
95
+ <str name="q.alt">*:*</str>
96
+ <str name="mm">2&lt;-1 5&lt;-2 6&lt;90%</str>
97
+ <!-- this qf and pf are used by default, if not otherwise specified by
98
+ client. The default blacklight_config will use these for the
99
+ "keywords" search. See the author_qf/author_pf, title_qf, etc
100
+ below, which the default blacklight_config will specify for
101
+ those searches. You may also be interested in:
102
+ http://wiki.apache.org/solr/LocalParams
103
+ -->
104
+ <str name="qf">
105
+ id
106
+ title_t^25000
107
+ text
108
+ active_fedora_model_s
109
+ object_type_facet
110
+ </str>
111
+ <str name="pf">
112
+ id
113
+ title_t^250000
114
+ text^10
115
+ active_fedora_model_s
116
+ object_type_facet
117
+ </str>
118
+
119
+ <str name="author_qf">
120
+ author_unstem_search^200
121
+ author_addl_unstem_search^50
122
+ author_t^20
123
+ author_addl_t
124
+ </str>
125
+ <str name="author_pf">
126
+ author_unstem_search^2000
127
+ author_addl_unstem_search^500
128
+ author_t^200
129
+ author_addl_t^10
130
+ </str>
131
+ <str name="title_qf">
132
+ title_unstem_search^50000
133
+ subtitle_unstem_search^25000
134
+ title_addl_unstem_search^10000
135
+ title_t^5000
136
+ subtitle_t^2500
137
+ title_addl_t^100
138
+ title_added_entry_unstem_search^50
139
+ title_added_entry_t^10
140
+ title_series_unstem_search^5
141
+ title_series_t
142
+ </str>
143
+ <str name="title_pf">
144
+ title_unstem_search^500000
145
+ subtitle_unstem_search^250000
146
+ title_addl_unstem_search^100000
147
+ title_t^50000
148
+ subtitle_t^25000
149
+ title_addl_t^1000
150
+ title_added_entry_unstem_search^500
151
+ title_added_entry_t^100
152
+ title_series_t^50
153
+ title_series_unstem_search^10
154
+ </str>
155
+ <str name="subject_qf">
156
+ subject_topic_unstem_search^200
157
+ subject_unstem_search^125
158
+ subject_topic_facet^100
159
+ subject_t^50
160
+ subject_addl_unstem_search^10
161
+ subject_addl_t
162
+ </str>
163
+ <str name="subject_pf">
164
+ subject_topic_unstem_search^2000
165
+ subject_unstem_search^1250
166
+ subject_t^1000
167
+ subject_topic_facet^500
168
+ subject_addl_unstem_search^100
169
+ subject_addl_t^10
170
+ </str>
171
+
172
+ <int name="ps">3</int>
173
+ <float name="tie">0.01</float>
174
+
175
+ <!-- NOT using marc_display because it is large and will slow things down for search results -->
176
+ <str name="fl">
177
+ *,
178
+ score,
179
+ </str>
180
+
181
+ <str name="facet">true</str>
182
+ <str name="facet.mincount">1</str>
183
+ <str name="facet.limit">10</str>
184
+ <str name="facet.field">format</str>
185
+ <str name="facet.field">lc_1letter_facet</str>
186
+ <str name="facet.field">lc_alpha_facet</str>
187
+ <str name="facet.field">lc_b4cutter_facet</str>
188
+ <str name="facet.field">language_facet</str>
189
+ <str name="facet.field">pub_date</str>
190
+ <str name="facet.field">subject_era_facet</str>
191
+ <str name="facet.field">subject_geo_facet</str>
192
+ <str name="facet.field">subject_topic_facet</str>
193
+
194
+ <str name="spellcheck">true</str>
195
+ <str name="spellcheck.dictionary">default</str>
196
+ <str name="spellcheck.onlyMorePopular">true</str>
197
+ <str name="spellcheck.extendedResults">true</str>
198
+ <str name="spellcheck.collate">false</str>
199
+ <str name="spellcheck.count">5</str>
200
+
201
+ </lst>
202
+ <arr name="last-components">
203
+ <str>spellcheck</str>
204
+ </arr>
205
+
206
+ </requestHandler>
207
+
208
+
209
+ <!-- Hydra Additions Start -->
210
+
211
+ <requestHandler name="standard" class="solr.SearchHandler">
212
+ <lst name="defaults">
213
+ <str name="echoParams">explicit</str>
214
+ </lst>
215
+ </requestHandler>
216
+
217
+ <requestHandler name="permissions" class="solr.SearchHandler" >
218
+ <lst name="defaults">
219
+ <str name="facet">off</str>
220
+ <str name="echoParams">all</str>
221
+ <str name="rows">1</str>
222
+ <str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
223
+ <str name="fl">
224
+ id,access_t,
225
+ discover_access_group_t,discover_access_person_t,
226
+ read_access_group_t,read_access_person_t,
227
+ edit_access_group_t,edit_access_person_t,
228
+ depositor_t,
229
+ embargo_release_date_dt,
230
+ inheritable_access_t,
231
+ inheritable_discover_access_group_t,inheritable_discover_access_person_t,
232
+ inheritable_read_access_group_t,inheritable_read_access_person_t,
233
+ inheritable_edit_access_group_t,inheritable_edit_access_person_t,
234
+ inheritable_embargo_release_date_dt
235
+ </str>
236
+ </lst>
237
+ </requestHandler>
238
+
239
+ <!-- Hydra Additions End -->
240
+
241
+ <!-- for requests to get a single document; use id=666 instead of q=id:666 -->
242
+ <requestHandler name="document" class="solr.SearchHandler" >
243
+ <lst name="defaults">
244
+ <str name="echoParams">all</str>
245
+ <str name="fl">*</str>
246
+ <str name="rows">1</str>
247
+ <str name="q">{!raw f=id v=$id}</str> <!-- use id=666 instead of q=id:666 -->
248
+ </lst>
249
+ </requestHandler>
250
+
251
+
252
+
253
+ <!-- Spell Check
254
+
255
+ The spell check component can return a list of alternative spelling
256
+ suggestions.
257
+
258
+ http://wiki.apache.org/solr/SpellCheckComponent
259
+ -->
260
+ <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
261
+
262
+ <str name="queryAnalyzerFieldType">textSpell</str>
263
+
264
+ <!-- Multiple "Spell Checkers" can be declared and used by this
265
+ component
266
+ -->
267
+
268
+ <!-- a spellchecker built from a field of the main index, and
269
+ written to disk
270
+ -->
271
+ <lst name="spellchecker">
272
+ <str name="name">default</str>
273
+ <str name="field">spell</str>
274
+ <str name="spellcheckIndexDir">./spell</str>
275
+ <str name="buildOnOptimize">true</str>
276
+ </lst>
277
+ <lst name="spellchecker">
278
+ <str name="name">author</str>
279
+ <str name="field">author_spell</str>
280
+ <str name="spellcheckIndexDir">./spell_author</str>
281
+ <str name="accuracy">0.7</str>
282
+ <str name="buildOnOptimize">true</str>
283
+ </lst>
284
+ <lst name="spellchecker">
285
+ <str name="name">subject</str>
286
+ <str name="field">subject_spell</str>
287
+ <str name="spellcheckIndexDir">./spell_subject</str>
288
+ <str name="accuracy">0.7</str>
289
+ <str name="buildOnOptimize">true</str>
290
+ </lst>
291
+ <lst name="spellchecker">
292
+ <str name="name">title</str>
293
+ <str name="field">title_spell</str>
294
+ <str name="spellcheckIndexDir">./spell_title</str>
295
+ <str name="accuracy">0.7</str>
296
+ <str name="buildOnOptimize">true</str>
297
+ </lst>
298
+ </searchComponent>
299
+ </config>
@@ -0,0 +1,35 @@
1
+ <?xml version="1.0" encoding="UTF-8" ?>
2
+ <!--
3
+ Licensed to the Apache Software Foundation (ASF) under one or more
4
+ contributor license agreements. See the NOTICE file distributed with
5
+ this work for additional information regarding copyright ownership.
6
+ The ASF licenses this file to You under the Apache License, Version 2.0
7
+ (the "License"); you may not use this file except in compliance with
8
+ the License. You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+ -->
18
+
19
+ <!--
20
+ All (relative) paths are relative to the installation path
21
+
22
+ persistent: Save changes made via the API to this file
23
+ sharedLib: path to a lib directory that will be shared across all cores
24
+ -->
25
+ <solr persistent="false" sharedLib="lib">
26
+
27
+ <!--
28
+ adminPath: RequestHandler path to manage cores.
29
+ If 'null' (or absent), cores will not be manageable via REST
30
+ -->
31
+ <cores adminPath="/admin/cores" defaultCoreName="development">
32
+ <core name="development" instanceDir="development-core" />
33
+ <core name="test" instanceDir="test-core" />
34
+ </cores>
35
+ </solr>
@@ -0,0 +1,11 @@
1
+ def FactoryGirl.create_curation_concern(factory_name, user, override_attributes = {})
2
+ object = FactoryGirl.build(factory_name, override_attributes)
3
+
4
+ object.apply_depositor_metadata(user.user_key)
5
+ object.creator = user.to_s
6
+ object.date_uploaded = Date.today
7
+ object.date_modified = Date.today
8
+ object.set_visibility(override_attributes[:visibility] || AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED)
9
+ object.save!
10
+ object
11
+ end
@@ -0,0 +1,36 @@
1
+ def FactoryGirl.create_generic_file(container_factory_name_or_object, user, file = nil, &block)
2
+ curation_concern =
3
+ if container_factory_name_or_object.is_a?(Symbol)
4
+ FactoryGirl.create_curation_concern(container_factory_name_or_object, user)
5
+ else
6
+ container_factory_name_or_object
7
+ end
8
+
9
+ generic_file = GenericFile.new
10
+
11
+ yield(generic_file) if block_given?
12
+
13
+ generic_file.visibility ||= AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED
14
+
15
+ file ||= Rack::Test::UploadedFile.new(__FILE__, 'text/plain', false)
16
+ generic_file.file ||= file
17
+
18
+ generic_file.apply_depositor_metadata(user.user_key)
19
+ generic_file.creator = user.name
20
+ generic_file.date_uploaded = Date.today
21
+ generic_file.date_modified = Date.today
22
+ generic_file.batch = curation_concern
23
+ generic_file.set_visibility(generic_file.visibility)
24
+ generic_file.save!
25
+
26
+
27
+ Sufia::GenericFile::Actions.create_content(
28
+ generic_file,
29
+ file,
30
+ file.original_filename,
31
+ 'content',
32
+ user
33
+ )
34
+
35
+ return generic_file
36
+ end
@@ -0,0 +1,10 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :help_request do
5
+ how_can_we_help_you "It's on fire"
6
+ end
7
+ factory :help_request_invalid, parent: :help_request do
8
+ how_can_we_help_you ""
9
+ end
10
+ end
@@ -0,0 +1,4 @@
1
+ FactoryGirl.define do
2
+ factory :mock_curation_concern do
3
+ end
4
+ end
@@ -0,0 +1,8 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :user do
5
+ sequence(:email) {|n| "email-#{n}@test.com" }
6
+ agreed_to_terms_of_service true
7
+ end
8
+ end
@@ -0,0 +1,139 @@
1
+ require 'spec_helper'
2
+
3
+ describe ApplicationHelper do
4
+ it 'has #sufia as a "monkey-patch" for sufia gem' do
5
+ expect(helper.sufia).to eq(helper)
6
+ end
7
+
8
+ it 'has #default_page_title' do
9
+ expect(helper.default_page_title).to(
10
+ eq("#{controller_name.titleize} // CurateND")
11
+ )
12
+ end
13
+
14
+ it 'has #curation_concern_page_title' do
15
+ expect(helper.curation_concern_page_title(MockCurationConcern.new)).to(
16
+ eq("New Mock Curation Concern // CurateND")
17
+ )
18
+ end
19
+
20
+ describe '#curation_concern_attribute_to_html' do
21
+ it 'handles an array by rendering one <dd> per element' do
22
+ collection = ["<h2>", "Johnny Tables"]
23
+ object = double('curation_concern', things: collection)
24
+
25
+ expect(helper.curation_concern_attribute_to_html(object, :things, "Weird")).to(
26
+ eq("<dt>Weird</dt>\n<dd class=\"attribute things\">&lt;h2&gt;</dd>\n<dd class=\"attribute things\">Johnny Tables</dd>\n")
27
+ )
28
+ end
29
+ it 'handles a string by rendering one <dd>' do
30
+ collection = "Tim"
31
+ object = double('curation_concern', things: collection)
32
+
33
+ expect(helper.curation_concern_attribute_to_html(object, :things, "Weird")).to(
34
+ eq("<dt>Weird</dt>\n<dd class=\"attribute things\">Tim</dd>\n")
35
+ )
36
+ end
37
+ it 'returns a '' for a nil value' do
38
+ collection = nil
39
+ object = double('curation_concern', things: collection)
40
+
41
+ expect(helper.curation_concern_attribute_to_html(object, :things, "Weird")).to(
42
+ eq("")
43
+ )
44
+ end
45
+ it 'returns a '' for an empty array' do
46
+ collection = []
47
+ object = double('curation_concern', things: collection)
48
+
49
+ expect(helper.curation_concern_attribute_to_html(object, :things, "Weird")).to(
50
+ eq("")
51
+ )
52
+ end
53
+ end
54
+
55
+ it 'has #classify_for_display' do
56
+ expect(helper.classify_for_display(MockCurationConcern.new)).to eq('mock curation concern')
57
+ end
58
+
59
+ describe '#bootstrap_navigation_element' do
60
+ let(:path) { '/hello/world' }
61
+ let(:name) { "Link Name"}
62
+ it 'disables the navigation link to the active page' do
63
+ helper.should_receive(:current_page?).with(path).and_return(true)
64
+ expect(helper.bootstrap_navigation_element(name, path)).
65
+ to have_tag('li.disabled a')
66
+ end
67
+ it 'does not disable a navigation link that is not the active page' do
68
+ helper.should_receive(:current_page?).with(path).and_return(false)
69
+ expect(helper.bootstrap_navigation_element(name, path)).
70
+ to_not have_tag('li.disabled a')
71
+ end
72
+ end
73
+
74
+ describe '#link_to_edit_permissions' do
75
+ let(:solr_document) { {read_access_group_t: access_policy } }
76
+ let(:user) { FactoryGirl.create(:user) }
77
+ let(:curation_concern) {
78
+ FactoryGirl.create_curation_concern(
79
+ :mock_curation_concern, user, visibility: visibility
80
+ )
81
+ }
82
+ let(:visibility) { nil }
83
+ let(:access_policy) { nil }
84
+ describe 'with a "registered" access group' do
85
+ let(:expected_label) { t('sufia.institution_name') }
86
+ let(:visibility) { AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED } # Can we change this?
87
+ let(:access_policy) { 'registered' }
88
+ it 'renders a Notre Dame only label' do
89
+ rendered = helper.link_to_edit_permissions(curation_concern, solr_document)
90
+ expect(rendered).to(
91
+ have_tag("a#permission_#{curation_concern.to_param}") {
92
+ with_tag("span.label.label-info", with: {title: expected_label }, text: expected_label)
93
+ }
94
+ )
95
+ end
96
+ end
97
+ describe 'with a "public" access group' do
98
+ let(:expected_label) { "Open Access" }
99
+ let(:access_policy) { 'public' }
100
+ let(:visibility) { AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC}
101
+ it 'renders an "Open Access" label' do
102
+ rendered = helper.link_to_edit_permissions(curation_concern, solr_document)
103
+ expect(rendered).to(
104
+ have_tag("a#permission_#{curation_concern.to_param}") {
105
+ with_tag("span.label.label-success", with: {title: expected_label }, text: expected_label)
106
+ }
107
+ )
108
+ end
109
+ end
110
+ describe 'with a mixed "public registered" access group' do
111
+ # This test is purely speculative to the appropriate labeling behavior and
112
+ # does not account for whether the document is truly accessable; I suppose
113
+ # I'm persisting hash drive development via a Solr document
114
+ let(:expected_label) { "Open Access" }
115
+ let(:access_policy) { 'public registered' }
116
+ it 'renders an "Open Access" label' do
117
+ rendered = helper.link_to_edit_permissions(curation_concern, solr_document)
118
+ expect(rendered).to(
119
+ have_tag("a#permission_#{curation_concern.to_param}") {
120
+ with_tag("span.label.label-success", with: {title: expected_label }, text: expected_label)
121
+ }
122
+ )
123
+ end
124
+ end
125
+ describe 'without an access group' do
126
+ let(:expected_label) { "Private" }
127
+ let(:access_policy) { nil }
128
+ let(:visibility) { AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE }
129
+ it 'renders an "Private" label' do
130
+ rendered = helper.link_to_edit_permissions(curation_concern, solr_document)
131
+ expect(rendered).to(
132
+ have_tag("a#permission_#{curation_concern.to_param}") {
133
+ with_tag("span.label.label-important", with: {title: expected_label }, text: expected_label)
134
+ }
135
+ )
136
+ end
137
+ end
138
+ end
139
+ end