valkyrie_active_fedora 0.0.1

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 (58) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +77 -0
  3. data/.rubocop.yml +276 -0
  4. data/.rubocop_todo.yml +20 -0
  5. data/.solr_wrapper +6 -0
  6. data/.travis.yml +19 -0
  7. data/CHANGELOG.md +3 -0
  8. data/Gemfile +17 -0
  9. data/LICENSE +201 -0
  10. data/README.md +46 -0
  11. data/Rakefile +17 -0
  12. data/config/fedora.yml +14 -0
  13. data/config/service_mappings.yml +9 -0
  14. data/config/solr.yml +15 -0
  15. data/lib/generators/valkyrie_active_fedora/config/USAGE +9 -0
  16. data/lib/generators/valkyrie_active_fedora/config/config_generator.rb +10 -0
  17. data/lib/generators/valkyrie_active_fedora/config/fedora/fedora_generator.rb +16 -0
  18. data/lib/generators/valkyrie_active_fedora/config/fedora/templates/.fcrepo_wrapper.yml +4 -0
  19. data/lib/generators/valkyrie_active_fedora/config/fedora/templates/fcrepo_wrapper_test.yml +4 -0
  20. data/lib/generators/valkyrie_active_fedora/config/fedora/templates/fedora.yml +15 -0
  21. data/lib/generators/valkyrie_active_fedora/config/solr/solr_generator.rb +19 -0
  22. data/lib/generators/valkyrie_active_fedora/config/solr/templates/.solr_wrapper.yml +8 -0
  23. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr.yml +7 -0
  24. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/_rest_managed.json +3 -0
  25. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/admin-extra.html +31 -0
  26. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/elevate.xml +36 -0
  27. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/mapping-ISOLatin1Accent.txt +246 -0
  28. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/protwords.txt +21 -0
  29. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/schema.xml +379 -0
  30. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/scripts.conf +24 -0
  31. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/solrconfig.xml +325 -0
  32. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/spellings.txt +2 -0
  33. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/stopwords.txt +58 -0
  34. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/stopwords_en.txt +58 -0
  35. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/synonyms.txt +31 -0
  36. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/xslt/example.xsl +132 -0
  37. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/xslt/example_atom.xsl +67 -0
  38. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/xslt/example_rss.xsl +66 -0
  39. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr/config/xslt/luke.xsl +337 -0
  40. data/lib/generators/valkyrie_active_fedora/config/solr/templates/solr_wrapper_test.yml +8 -0
  41. data/lib/generators/valkyrie_active_fedora/model/USAGE +11 -0
  42. data/lib/generators/valkyrie_active_fedora/model/model_generator.rb +31 -0
  43. data/lib/generators/valkyrie_active_fedora/model/templates/datastream.rb.erb +32 -0
  44. data/lib/generators/valkyrie_active_fedora/model/templates/datastream_spec.rb.erb +13 -0
  45. data/lib/generators/valkyrie_active_fedora/model/templates/model.rb.erb +46 -0
  46. data/lib/generators/valkyrie_active_fedora/model/templates/model_spec.rb.erb +38 -0
  47. data/lib/tasks/valkyrie_active_fedora_dev.rake +67 -0
  48. data/lib/valkyrie_active_fedora.rb +11 -0
  49. data/lib/valkyrie_active_fedora/base.rb +39 -0
  50. data/lib/valkyrie_active_fedora/engine.rb +12 -0
  51. data/lib/valkyrie_active_fedora/version.rb +4 -0
  52. data/spec/.gitignore +1 -0
  53. data/spec/rails_helper.rb +3 -0
  54. data/spec/spec_helper.rb +108 -0
  55. data/spec/unit/base_spec.rb +36 -0
  56. data/tasks/valkyrie_active_fedora_dev.rake +17 -0
  57. data/valkyrie_active_fedora.gemspec +47 -0
  58. metadata +314 -0
data/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # ValkyrieActiveFedora
2
+
3
+ Extends ActiveFedora gem to place nicely with Valkyrie data mapper gem.
4
+
5
+ ## Setup
6
+
7
+ ### Compatibility
8
+
9
+ Tested with...
10
+
11
+ * Ruby 2.5
12
+ * Rails 5.1.6
13
+
14
+ ### Installation Instructions
15
+
16
+ #### Adding the engine dependency
17
+
18
+ Add this line to your application's Gemfile:
19
+
20
+ ```ruby
21
+ gem 'valkyrie_active_fedora'
22
+ ```
23
+
24
+ And then execute:
25
+ ```bash
26
+ $ bundle
27
+ ```
28
+
29
+ Or install it yourself as:
30
+ ```bash
31
+ $ gem install valkyrie_active_fedora
32
+ ```
33
+
34
+ Follow remaining installation instructions in the ActiveFedora gem.
35
+
36
+ ## Contributing
37
+
38
+ *Have a suggestion for code improvements or new linked data authorities?* Submit an issue with your request. For new authorities, include links to the authority's linked data API and other access documentation.
39
+
40
+ *Have code improvements you've written or a configuration for a new authority you'd like to submit?* Submit a PR and your changes will be reviewed for possible inclussion. If you want to make a substantial change, you may want to express your ideas in an issue first for discussion.
41
+
42
+
43
+ ## License
44
+ The gem is available as open source under the terms of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0).
45
+
46
+
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ require 'rake/clean'
2
+ require 'bundler'
3
+
4
+ Bundler::GemHelper.install_tasks
5
+
6
+ # load rake tasks defined in lib/tasks that are not loaded in lib/valkyrie_active_fedora.rb
7
+ load "lib/tasks/valkyrie_active_fedora_dev.rake"
8
+
9
+ CLEAN.include %w(**/.DS_Store tmp *.log *.orig *.tmp **/*~)
10
+
11
+ desc 'setup jetty and run tests'
12
+ task ci: ['valkyrie_active_fedora:ci']
13
+ desc 'run tests'
14
+ task spec: ['valkyrie_active_fedora:rubocop', 'valkyrie_active_fedora:rspec']
15
+ task rcov: ['valkyrie_active_fedora:rcov']
16
+
17
+ task default: [:ci]
data/config/fedora.yml ADDED
@@ -0,0 +1,14 @@
1
+ development:
2
+ user: fedoraAdmin
3
+ password: fedoraAdmin
4
+ url: http://127.0.0.1:<%= ENV['FCREPO_DEVELOPMENT_PORT'] || 8984 %>/rest
5
+ base_path: /dev
6
+ test:
7
+ user: fedoraAdmin
8
+ password: fedoraAdmin
9
+ url: http://localhost:<%= ENV['FCREPO_TEST_PORT'] || 8986 %>/rest
10
+ base_path: /test
11
+ production:
12
+ user: fedoraAdmin
13
+ password: fedoraAdmin
14
+ url: http://127.0.0.1:8983/fedora/rest
@@ -0,0 +1,9 @@
1
+ :service_mapping:
2
+ "fedora-system:3":
3
+ :object_profile: viewObjectProfile
4
+ :method_index: viewMethodIndex
5
+ :item_index: viewItemIndex
6
+ :dc_view: viewDublinCore
7
+ "test:12":
8
+ :document_style_1: getDocumentStyle1
9
+ :document_style_2: getDocumentStyle2
data/config/solr.yml ADDED
@@ -0,0 +1,15 @@
1
+ development:
2
+ default:
3
+ url: http://127.0.0.1:<%= ENV['SOLR_TEST_PORT'] || 8983 %>/solr/hydra-development
4
+ full_text:
5
+ url: http://localhost:8983/solr/development
6
+ test:
7
+ default:
8
+ url: http://localhost:<%= ENV['SOLR_TEST_PORT'] || 8985 %>/solr/hydra-test
9
+ full_text:
10
+ url: http://localhost:<%= ENV['SOLR_TEST_PORT'] || 8985 %>/solr/test
11
+ production:
12
+ default:
13
+ url: http://localhost:8080/solr/production
14
+ full_text:
15
+ url: http://localhost:8080/solr/production
@@ -0,0 +1,9 @@
1
+ Description:
2
+ Generate ActiveFedora config files
3
+
4
+ Example:
5
+ rails generate active_fedora:config
6
+
7
+ This will create:
8
+ config/fedora.yml
9
+ config/solr.yml
@@ -0,0 +1,10 @@
1
+ require 'rails/generators'
2
+
3
+ module ActiveFedora
4
+ class ConfigGenerator < Rails::Generators::Base
5
+ def generate_configs
6
+ generate('active_fedora:config:fedora')
7
+ generate('active_fedora:config:solr')
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,16 @@
1
+ require 'rails/generators'
2
+
3
+ module ActiveFedora
4
+ class Config::FedoraGenerator < Rails::Generators::Base
5
+ source_root ::File.expand_path('../templates', __FILE__)
6
+
7
+ def generate
8
+ copy_file('fedora.yml', 'config/fedora.yml')
9
+ end
10
+
11
+ def fcrepo_wrapper_config
12
+ copy_file '.fcrepo_wrapper.yml'
13
+ copy_file 'fcrepo_wrapper_test.yml', 'config/fcrepo_wrapper_test.yml'
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,4 @@
1
+ # Place any default configuration for fcrepo_wrapper here
2
+ port: 8984
3
+ enable_jms: false
4
+ fcrepo_home_dir: tmp/fcrepo4-development-data
@@ -0,0 +1,4 @@
1
+ #config/fcrepo_wrapper_test.yml.sample
2
+ port: 8986
3
+ enable_jms: false
4
+ fcrepo_home_dir: tmp/fcrepo4-test-data
@@ -0,0 +1,15 @@
1
+ development:
2
+ user: fedoraAdmin
3
+ password: fedoraAdmin
4
+ url: http://127.0.0.1:<%= ENV['FCREPO_DEVELOPMENT_PORT'] || 8984 %>/rest
5
+ base_path: /dev
6
+ test:
7
+ user: fedoraAdmin
8
+ password: fedoraAdmin
9
+ url: http://127.0.0.1:<%= ENV['FCREPO_TEST_PORT'] || 8986 %>/rest
10
+ base_path: /test
11
+ production:
12
+ user: fedoraAdmin
13
+ password: fedoraAdmin
14
+ url: http://127.0.0.1:8983/fedora/rest
15
+ base_path: /prod
@@ -0,0 +1,19 @@
1
+ require 'rails/generators'
2
+
3
+ module ActiveFedora
4
+ class Config::SolrGenerator < Rails::Generators::Base
5
+ source_root ::File.expand_path('../templates', __FILE__)
6
+
7
+ def generate
8
+ # Overwrite the configuration files that Blacklight has installed
9
+ copy_file 'solr.yml', 'config/solr.yml', force: true
10
+ directory 'solr', 'solr'
11
+ end
12
+
13
+ def solr_wrapper_config
14
+ # Overwrite the configuration files that Blacklight has installed
15
+ copy_file '.solr_wrapper.yml', force: true
16
+ copy_file 'solr_wrapper_test.yml', 'config/solr_wrapper_test.yml'
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,8 @@
1
+ # Place any default configuration for solr_wrapper here
2
+ # version: 6.0.0
3
+ # port: 8983
4
+ instance_dir: tmp/solr-development
5
+ collection:
6
+ persist: true
7
+ dir: solr/config/
8
+ name: hydra-development
@@ -0,0 +1,7 @@
1
+ # This is a sample config file that points to a solr server for each environment
2
+ development:
3
+ url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_DEVELOPMENT_PORT', 8983)}/solr/hydra-development" %>
4
+ test:
5
+ url: <%= ENV['SOLR_URL'] || "http://127.0.0.1:#{ENV.fetch('SOLR_TEST_PORT', 8985)}/solr/hydra-test" %>
6
+ production:
7
+ url: <%= ENV['SOLR_URL'] || "http://your.production.server:8080/bl_solr/core0" %>
@@ -0,0 +1,31 @@
1
+ <!--
2
+ Licensed to the Apache Software Foundation (ASF) under one or more
3
+ contributor license agreements. See the NOTICE file distributed with
4
+ this work for additional information regarding copyright ownership.
5
+ The ASF licenses this file to You under the Apache License, Version 2.0
6
+ (the "License"); you may not use this file except in compliance with
7
+ the License. You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ -->
17
+
18
+ <!-- The content of this page will be statically included into the top
19
+ of the admin page. Uncomment this as an example to see there the content
20
+ will show up.
21
+
22
+ <hr>
23
+ <i>This line will appear before the first table</i>
24
+ <tr>
25
+ <td colspan="2">
26
+ This row will be appended to the end of the first table
27
+ </td>
28
+ </tr>
29
+ <hr>
30
+
31
+ -->
@@ -0,0 +1,36 @@
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
+ <!-- If this file is found in the config directory, it will only be
20
+ loaded once at startup. If it is found in Solr's data
21
+ directory, it will be re-loaded every commit.
22
+ -->
23
+
24
+ <elevate>
25
+ <query text="foo bar">
26
+ <doc id="1" />
27
+ <doc id="2" />
28
+ <doc id="3" />
29
+ </query>
30
+
31
+ <query text="ipod">
32
+ <doc id="MA147LL/A" /> <!-- put the actual ipod at the top -->
33
+ <doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
34
+ </query>
35
+
36
+ </elevate>
@@ -0,0 +1,246 @@
1
+ # The ASF licenses this file to You under the Apache License, Version 2.0
2
+ # (the "License"); you may not use this file except in compliance with
3
+ # the License. You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ # Syntax:
14
+ # "source" => "target"
15
+ # "source".length() > 0 (source cannot be empty.)
16
+ # "target".length() >= 0 (target can be empty.)
17
+
18
+ # example:
19
+ # "??" => "A"
20
+ # "\u00C0" => "A"
21
+ # "\u00C0" => "\u0041"
22
+ # "??" => "ss"
23
+ # "\t" => " "
24
+ # "\n" => ""
25
+
26
+ # ?? => A
27
+ "\u00C0" => "A"
28
+
29
+ # ?? => A
30
+ "\u00C1" => "A"
31
+
32
+ # ?? => A
33
+ "\u00C2" => "A"
34
+
35
+ # ?? => A
36
+ "\u00C3" => "A"
37
+
38
+ # ?? => A
39
+ "\u00C4" => "A"
40
+
41
+ # ?? => A
42
+ "\u00C5" => "A"
43
+
44
+ # ?? => AE
45
+ "\u00C6" => "AE"
46
+
47
+ # ?? => C
48
+ "\u00C7" => "C"
49
+
50
+ # ?? => E
51
+ "\u00C8" => "E"
52
+
53
+ # ?? => E
54
+ "\u00C9" => "E"
55
+
56
+ # ?? => E
57
+ "\u00CA" => "E"
58
+
59
+ # ?? => E
60
+ "\u00CB" => "E"
61
+
62
+ # ?? => I
63
+ "\u00CC" => "I"
64
+
65
+ # ?? => I
66
+ "\u00CD" => "I"
67
+
68
+ # ?? => I
69
+ "\u00CE" => "I"
70
+
71
+ # ?? => I
72
+ "\u00CF" => "I"
73
+
74
+ # ?? => IJ
75
+ "\u0132" => "IJ"
76
+
77
+ # ?? => D
78
+ "\u00D0" => "D"
79
+
80
+ # ?? => N
81
+ "\u00D1" => "N"
82
+
83
+ # ?? => O
84
+ "\u00D2" => "O"
85
+
86
+ # ?? => O
87
+ "\u00D3" => "O"
88
+
89
+ # ?? => O
90
+ "\u00D4" => "O"
91
+
92
+ # ?? => O
93
+ "\u00D5" => "O"
94
+
95
+ # ?? => O
96
+ "\u00D6" => "O"
97
+
98
+ # ?? => O
99
+ "\u00D8" => "O"
100
+
101
+ # ?? => OE
102
+ "\u0152" => "OE"
103
+
104
+ # ??
105
+ "\u00DE" => "TH"
106
+
107
+ # ?? => U
108
+ "\u00D9" => "U"
109
+
110
+ # ?? => U
111
+ "\u00DA" => "U"
112
+
113
+ # ?? => U
114
+ "\u00DB" => "U"
115
+
116
+ # ?? => U
117
+ "\u00DC" => "U"
118
+
119
+ # ?? => Y
120
+ "\u00DD" => "Y"
121
+
122
+ # ?? => Y
123
+ "\u0178" => "Y"
124
+
125
+ # ?? => a
126
+ "\u00E0" => "a"
127
+
128
+ # ?? => a
129
+ "\u00E1" => "a"
130
+
131
+ # ?? => a
132
+ "\u00E2" => "a"
133
+
134
+ # ?? => a
135
+ "\u00E3" => "a"
136
+
137
+ # ?? => a
138
+ "\u00E4" => "a"
139
+
140
+ # ?? => a
141
+ "\u00E5" => "a"
142
+
143
+ # ?? => ae
144
+ "\u00E6" => "ae"
145
+
146
+ # ?? => c
147
+ "\u00E7" => "c"
148
+
149
+ # ?? => e
150
+ "\u00E8" => "e"
151
+
152
+ # ?? => e
153
+ "\u00E9" => "e"
154
+
155
+ # ?? => e
156
+ "\u00EA" => "e"
157
+
158
+ # ?? => e
159
+ "\u00EB" => "e"
160
+
161
+ # ?? => i
162
+ "\u00EC" => "i"
163
+
164
+ # ?? => i
165
+ "\u00ED" => "i"
166
+
167
+ # ?? => i
168
+ "\u00EE" => "i"
169
+
170
+ # ?? => i
171
+ "\u00EF" => "i"
172
+
173
+ # ?? => ij
174
+ "\u0133" => "ij"
175
+
176
+ # ?? => d
177
+ "\u00F0" => "d"
178
+
179
+ # ?? => n
180
+ "\u00F1" => "n"
181
+
182
+ # ?? => o
183
+ "\u00F2" => "o"
184
+
185
+ # ?? => o
186
+ "\u00F3" => "o"
187
+
188
+ # ?? => o
189
+ "\u00F4" => "o"
190
+
191
+ # ?? => o
192
+ "\u00F5" => "o"
193
+
194
+ # ?? => o
195
+ "\u00F6" => "o"
196
+
197
+ # ?? => o
198
+ "\u00F8" => "o"
199
+
200
+ # ?? => oe
201
+ "\u0153" => "oe"
202
+
203
+ # ?? => ss
204
+ "\u00DF" => "ss"
205
+
206
+ # ?? => th
207
+ "\u00FE" => "th"
208
+
209
+ # ?? => u
210
+ "\u00F9" => "u"
211
+
212
+ # ?? => u
213
+ "\u00FA" => "u"
214
+
215
+ # ?? => u
216
+ "\u00FB" => "u"
217
+
218
+ # ?? => u
219
+ "\u00FC" => "u"
220
+
221
+ # ?? => y
222
+ "\u00FD" => "y"
223
+
224
+ # ?? => y
225
+ "\u00FF" => "y"
226
+
227
+ # ??? => ff
228
+ "\uFB00" => "ff"
229
+
230
+ # ??? => fi
231
+ "\uFB01" => "fi"
232
+
233
+ # ??? => fl
234
+ "\uFB02" => "fl"
235
+
236
+ # ??? => ffi
237
+ "\uFB03" => "ffi"
238
+
239
+ # ??? => ffl
240
+ "\uFB04" => "ffl"
241
+
242
+ # ??? => ft
243
+ "\uFB05" => "ft"
244
+
245
+ # ??? => st
246
+ "\uFB06" => "st"