curate 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +14 -0
- data/app/controllers/application_controller.rb +69 -0
- data/app/controllers/catalog_controller.rb +336 -0
- data/app/controllers/classify_concerns_controller.rb +29 -0
- data/app/controllers/common_objects_controller.rb +27 -0
- data/app/controllers/curation_concern/base_controller.rb +26 -0
- data/app/controllers/curation_concern/generic_files_controller.rb +82 -0
- data/app/controllers/dashboard_controller.rb +85 -0
- data/app/controllers/downloads_controller.rb +22 -0
- data/app/controllers/errors_controller.rb +19 -0
- data/app/controllers/help_requests_controller.rb +38 -0
- data/app/controllers/terms_of_service_agreements_controller.rb +44 -0
- data/app/controllers/welcome_controller.rb +14 -0
- data/app/helpers/application_helper.rb +89 -0
- data/app/helpers/blacklight_helper.rb +19 -0
- data/app/helpers/common_objects_helper.rb +5 -0
- data/app/inputs/multi_value_input.rb +71 -0
- data/app/models/access_right.rb +53 -0
- data/app/models/classify_concern.rb +30 -0
- data/app/models/contributor_agreement.rb +58 -0
- data/app/models/digital_object_identifier.rb +83 -0
- data/app/models/doi_config.rb +26 -0
- data/app/models/help_request.rb +34 -0
- data/app/models/mint_doi.rb +51 -0
- data/app/models/mint_purl.rb +40 -0
- data/app/models/object_access.rb +17 -0
- data/app/models/purl.rb +18 -0
- data/app/models/purl_config.rb +10 -0
- data/app/models/repo_object.rb +24 -0
- data/app/models/solr_document.rb +35 -0
- data/app/repository_datastreams/file_content_datastream.rb +36 -0
- data/app/repository_models/curation_concern/embargoable.rb +43 -0
- data/app/repository_models/curation_concern/with_access_right.rb +31 -0
- data/app/repository_models/generic_file.rb +36 -0
- data/app/services/anti_virus_scanner.rb +28 -0
- data/app/services/curation_concern.rb +22 -0
- data/app/services/curation_concern/base_actor.rb +48 -0
- data/app/services/curation_concern/generic_file_actor.rb +38 -0
- data/app/validators/future_date_validator.rb +19 -0
- data/app/views/_footer.html.erb +19 -0
- data/app/views/_ga.html.erb +6 -0
- data/app/views/_logo.html.erb +34 -0
- data/app/views/_masthead.html.erb +34 -0
- data/app/views/catalog/_bookmark_control.html.erb +25 -0
- data/app/views/catalog/_bookmark_form.html.erb +8 -0
- data/app/views/catalog/_citation.html.erb +11 -0
- data/app/views/catalog/_constraints.html.erb +6 -0
- data/app/views/catalog/_constraints_element.html.erb +20 -0
- data/app/views/catalog/_delete_partials/_default.html.erb +29 -0
- data/app/views/catalog/_did_you_mean.html.erb +10 -0
- data/app/views/catalog/_document.html.erb +19 -0
- data/app/views/catalog/_document_list.html.erb +2 -0
- data/app/views/catalog/_edit_partials/_default.html.erb +58 -0
- data/app/views/catalog/_edit_partials/_default_details.html.erb +13 -0
- data/app/views/catalog/_email_form.html.erb +11 -0
- data/app/views/catalog/_facet_layout.html.erb +12 -0
- data/app/views/catalog/_facet_limit.html.erb +19 -0
- data/app/views/catalog/_facet_selected.html.erb +12 -0
- data/app/views/catalog/_facets.html.erb +5 -0
- data/app/views/catalog/_folder_control.html.erb +12 -0
- data/app/views/catalog/_home.html.erb +2 -0
- data/app/views/catalog/_home_text.html.erb +10 -0
- data/app/views/catalog/_index_default.html.erb +11 -0
- data/app/views/catalog/_index_partials/_default_group.html.erb +37 -0
- data/app/views/catalog/_marc_view.html.erb +33 -0
- data/app/views/catalog/_opensearch_response_metadata.html.erb +2 -0
- data/app/views/catalog/_previous_next_doc.html.erb +6 -0
- data/app/views/catalog/_refworks_form.html.erb +7 -0
- data/app/views/catalog/_results_pagination.html.erb +6 -0
- data/app/views/catalog/_search_form.html.erb +20 -0
- data/app/views/catalog/_show_default.html.erb +9 -0
- data/app/views/catalog/_show_partials/_default.html.erb +22 -0
- data/app/views/catalog/_show_partials/_default_details.html.erb +15 -0
- data/app/views/catalog/_show_partials/_facets.html.erb +52 -0
- data/app/views/catalog/_show_sidebar.html.erb +1 -0
- data/app/views/catalog/_show_tools.html.erb +46 -0
- data/app/views/catalog/_sms_form.html.erb +21 -0
- data/app/views/catalog/_sort_and_per_page.html.erb +38 -0
- data/app/views/catalog/_uva_tabs.html.erb +10 -0
- data/app/views/catalog/about.html.erb +0 -0
- data/app/views/catalog/citation.html.erb +1 -0
- data/app/views/catalog/email.erb +1 -0
- data/app/views/catalog/endnote.endnote.erb +1 -0
- data/app/views/catalog/index.atom.builder +109 -0
- data/app/views/catalog/index.html.erb +55 -0
- data/app/views/catalog/index.rss.builder +19 -0
- data/app/views/catalog/librarian_view.html.erb +3 -0
- data/app/views/catalog/opensearch.json.erb +0 -0
- data/app/views/catalog/opensearch.xml.builder +10 -0
- data/app/views/catalog/send_email_record.erb +0 -0
- data/app/views/catalog/show.endnote.erb +1 -0
- data/app/views/catalog/show.html.erb +40 -0
- data/app/views/catalog/show.refworks.erb +1 -0
- data/app/views/catalog/sms.erb +1 -0
- data/app/views/classify_concerns/new.html.erb +24 -0
- data/app/views/common_objects/_generic_file.html.erb +0 -0
- data/app/views/common_objects/_senior_thesis.html.erb +2 -0
- data/app/views/common_objects/show.html.erb +11 -0
- data/app/views/common_objects/show_stub_information.html.erb +13 -0
- data/app/views/curation_concern/_content_license.html.erb +16 -0
- data/app/views/curation_concern/_contributor_agreement.html.erb +27 -0
- data/app/views/curation_concern/_doi.html.erb +43 -0
- data/app/views/curation_concern/_media_display.html.erb +1 -0
- data/app/views/curation_concern/_permission.html.erb +39 -0
- data/app/views/curation_concern/_related_files.html.erb +46 -0
- data/app/views/curation_concern/generic_files/_attributes.html.erb +63 -0
- data/app/views/curation_concern/generic_files/_form.html.erb +57 -0
- data/app/views/curation_concern/generic_files/edit.html.erb +5 -0
- data/app/views/curation_concern/generic_files/new.html.erb +5 -0
- data/app/views/curation_concern/generic_files/show.html.erb +12 -0
- data/app/views/curation_concern/senior_theses/_attributes.html.erb +13 -0
- data/app/views/curation_concern/senior_theses/_form.html.erb +88 -0
- data/app/views/curation_concern/senior_theses/edit.html.erb +15 -0
- data/app/views/curation_concern/senior_theses/new.html.erb +14 -0
- data/app/views/curation_concern/senior_theses/show.html.erb +18 -0
- data/app/views/dashboard/_constraints.html.erb +22 -0
- data/app/views/dashboard/_did_you_mean.html.erb +26 -0
- data/app/views/dashboard/_document_list.html.erb +20 -0
- data/app/views/dashboard/_facet_layout.html.erb +27 -0
- data/app/views/dashboard/_facet_limit.html.erb +35 -0
- data/app/views/dashboard/_facet_pagination.html.erb +25 -0
- data/app/views/dashboard/_facet_selected.html.erb +28 -0
- data/app/views/dashboard/_facets.html.erb +22 -0
- data/app/views/dashboard/_index_partials/_default_group.html.erb +37 -0
- data/app/views/dashboard/_index_partials/_list_files.html.erb +66 -0
- data/app/views/dashboard/_index_partials/_thumbnail_display.html.erb +0 -0
- data/app/views/dashboard/_results_pagination.html.erb +22 -0
- data/app/views/dashboard/_search_form.html.erb +36 -0
- data/app/views/dashboard/_show_partials/_default.html.erb +38 -0
- data/app/views/dashboard/_show_partials/_default_details.html.erb +31 -0
- data/app/views/dashboard/_show_partials/_facets.html.erb +103 -0
- data/app/views/dashboard/_sort_and_per_page.html.erb +18 -0
- data/app/views/dashboard/facet.html.erb +38 -0
- data/app/views/dashboard/get_related_file.html.erb +4 -0
- data/app/views/dashboard/index.html.erb +60 -0
- data/app/views/errors/401.html.erb +5 -0
- data/app/views/errors/404.html.erb +16 -0
- data/app/views/errors/500.html.erb +10 -0
- data/app/views/help_requests/new.html.erb +60 -0
- data/app/views/layouts/application.html.erb +14 -0
- data/app/views/layouts/boilerplate.html.erb +28 -0
- data/app/views/layouts/common_objects.html.erb +45 -0
- data/app/views/layouts/curate_nd.html.erb +55 -0
- data/app/views/layouts/curate_nd/1_column.html.erb +22 -0
- data/app/views/layouts/curate_nd/2_column.html.erb +26 -0
- data/app/views/layouts/curate_nd/catalog.html.erb +22 -0
- data/app/views/layouts/curate_nd/dashboard.html.erb +22 -0
- data/app/views/layouts/hydra-head.html.erb +95 -0
- data/app/views/shared/_action_bar.html.erb +30 -0
- data/app/views/shared/_flash_message.html.erb +9 -0
- data/app/views/shared/_site_search.html.erb +18 -0
- data/app/views/terms_of_service_agreements/new.html.erb +136 -0
- data/app/views/welcome/index.html.erb +21 -0
- data/app/workers/characterize_job.rb +4 -0
- data/app/workers/doi_worker.rb +16 -0
- data/config/routes.rb +35 -0
- data/lib/curate.rb +6 -0
- data/lib/curate/engine.rb +46 -0
- data/lib/curate/version.rb +1 -1
- data/spec/abilities/generic_file_abilities_spec.rb +55 -0
- data/spec/controllers/application_controller_spec.rb +38 -0
- data/spec/controllers/classify_concerns_controller_spec.rb +36 -0
- data/spec/controllers/common_objects_controller_spec.rb +112 -0
- data/spec/controllers/curation_concern/base_controller_spec.rb +14 -0
- data/spec/controllers/curation_concern/generic_files_controller_spec.rb +156 -0
- data/spec/controllers/dashboard_controller_spec.rb +85 -0
- data/spec/controllers/downloads_controller_spec.rb +42 -0
- data/spec/controllers/help_requests_controller_spec.rb +42 -0
- data/spec/controllers/terms_of_service_agreements_controller_spec.rb +30 -0
- data/spec/controllers/welcome_controller_spec.rb +10 -0
- data/spec/dummy/app/models/solr_document.rb +4 -0
- data/spec/dummy/app/models/user.rb +13 -0
- data/spec/dummy/config/application.rb +8 -1
- data/spec/dummy/config/database.yml +21 -22
- data/spec/dummy/config/doi.yml +11 -0
- data/spec/dummy/config/fedora.yml +20 -0
- data/spec/dummy/config/initializers/devise.rb +232 -0
- data/spec/dummy/config/initializers/hydra_config.rb +41 -0
- data/spec/dummy/config/initializers/mailboxer.rb +17 -0
- data/spec/dummy/config/initializers/redis_config.rb +45 -0
- data/spec/dummy/config/initializers/sufia.rb +66 -0
- data/spec/dummy/config/purl.yml +15 -0
- data/spec/dummy/config/redis.yml +6 -0
- data/spec/dummy/config/role_map_ci.yml +15 -0
- data/spec/dummy/config/role_map_cucumber.yml +10 -0
- data/spec/dummy/config/role_map_development.yml +12 -0
- data/spec/dummy/config/role_map_pre_production.yml +2 -0
- data/spec/dummy/config/role_map_production.yml +2 -0
- data/spec/dummy/config/role_map_test.yml +15 -0
- data/spec/dummy/config/routes.rb +4 -55
- data/spec/dummy/config/solr.yml +17 -0
- data/spec/dummy/db/migrate/20130130142162_create_purl.rb +55 -0
- data/spec/dummy/db/migrate/20130312135359_create_help_requests.rb +22 -0
- data/spec/dummy/db/migrate/20130408165008_create_users.rb +11 -0
- data/spec/dummy/db/migrate/20130408165009_acts_as_follower_migration.rb +31 -0
- data/spec/dummy/db/migrate/20130408165010_add_social_to_users.rb +27 -0
- data/spec/dummy/db/migrate/20130408165011_create_single_use_links.rb +12 -0
- data/spec/dummy/db/migrate/20130408165012_add_ldap_attrs_to_user.rb +41 -0
- data/spec/dummy/db/migrate/20130408165013_add_avatars_to_users.rb +23 -0
- data/spec/dummy/db/migrate/20130408165014_create_checksum_audit_logs.rb +34 -0
- data/spec/dummy/db/migrate/20130408165015_create_version_committers.rb +29 -0
- data/spec/dummy/db/migrate/20130408165016_add_groups_to_users.rb +25 -0
- data/spec/dummy/db/migrate/20130408165017_create_local_authorities.rb +64 -0
- data/spec/dummy/db/migrate/20130408165018_create_trophies.rb +10 -0
- data/spec/dummy/db/migrate/20130408165022_create_mailboxer.mailboxer_engine.rb +62 -0
- data/spec/dummy/db/migrate/20130408165023_add_notified_object.mailboxer_engine.rb +18 -0
- data/spec/dummy/db/migrate/20130408165024_add_notification_code.mailboxer_engine.rb +14 -0
- data/spec/dummy/db/migrate/20130408165025_add_attachments.mailboxer_engine.rb +10 -0
- data/spec/dummy/db/migrate/20130408165026_rename_receipts_read.mailboxer_engine.rb +10 -0
- data/spec/dummy/db/schema.rb +197 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/fedora_conf/conf/development/fedora.fcfg +953 -0
- data/spec/dummy/fedora_conf/conf/test/fedora.fcfg +953 -0
- data/spec/dummy/log/development.log +1791 -0
- data/spec/dummy/log/test.log +176333 -0
- data/spec/dummy/solr_conf/conf/schema.xml +692 -0
- data/spec/dummy/solr_conf/conf/solrconfig.xml +299 -0
- data/spec/dummy/solr_conf/solr.xml +35 -0
- data/spec/factories/create_curation_concern.rb +11 -0
- data/spec/factories/create_generic_file.rb +36 -0
- data/spec/factories/help_requests.rb +10 -0
- data/spec/factories/mock_curation_concerns.rb +4 -0
- data/spec/factories/users.rb +8 -0
- data/spec/helpers/application_helper_spec.rb +139 -0
- data/spec/helpers/common_objects_helper_spec.rb +9 -0
- data/spec/models/access_right_spec.rb +47 -0
- data/spec/models/classify_concern_spec.rb +30 -0
- data/spec/models/contributor_agreement_spec.rb +45 -0
- data/spec/models/digital_object_identifier_spec.rb +50 -0
- data/spec/models/help_request_spec.rb +5 -0
- data/spec/models/mint_doi_spec.rb +79 -0
- data/spec/models/mint_purl_spec.rb +38 -0
- data/spec/models/object_access_spec.rb +24 -0
- data/spec/models/purl_spec.rb +22 -0
- data/spec/models/repo_object_spec.rb +39 -0
- data/spec/repository_models/curation_concern/embargoable_spec.rb +69 -0
- data/spec/repository_models/generic_file_spec.rb +38 -0
- data/spec/services/anti_virus_scanner_spec.rb +26 -0
- data/spec/services/curation_concern/base_actor_spec.rb +28 -0
- data/spec/services/curation_concern/generic_file_actor_spec.rb +75 -0
- data/spec/services/curation_concern_spec.rb +34 -0
- data/spec/spec_helper.rb +54 -1
- data/spec/support/environment_override.rb +17 -0
- data/spec/support/matchers/raise_rescue_response_type_matcher.rb +42 -0
- data/spec/support/mock_curation_concern.rb +61 -0
- data/spec/support/shared/shared_examples_is_embargoable.rb +9 -0
- data/spec/support/shared/shared_examples_with_access_rights.rb +33 -0
- data/spec/workers/characterize_job_spec.rb +26 -0
- metadata +686 -10
- 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<-1 5<-2 6<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,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\"><h2></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
|