cul_hydra 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concept.rb +10 -2
- data/app/models/cul/hydra/datastreams/encoded_text_datastream.rb +38 -0
- data/fixtures/spec/BLOB/description-utf8.txt +1 -0
- data/lib/cul_hydra/version.rb +1 -1
- metadata +5 -7
- data/config/fedora.yml +0 -26
- data/config/solr.yml +0 -17
- data/config/subs.yml +0 -10
- data/fixtures/spec/CUL_MODS/mods-archival-context-2.xml +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7c942afbb5baf9638461f80723af40b30633892a7774d426ad4edabe6dbdab4
|
4
|
+
data.tar.gz: 549c735df93fed430ebb33708a59829f7f7228e664309d1f19f323f6de7ef4a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d5eba1acff06eb1789b529d0f4871a4d40ce48f76d6e1cbd5acff3162495b156fce85ed2910c581fc7f71548f0c42de3551343b5e85aeddbfbe63f6ea8062d1
|
7
|
+
data.tar.gz: 57d089ae06742089dd3e140307cf3cf787615196e69e8fbbc9a271fab3ff38f0ab4bf97554cab459d9cf1fa7ea66dedb2a17dbb49cb2480706e5712b5e61749b
|
data/app/models/concept.rb
CHANGED
@@ -9,7 +9,7 @@ class Concept < GenericAggregator
|
|
9
9
|
rdf_types(RDF::CUL.Aggregator)
|
10
10
|
rdf_types(RDF::PCDM.Object)
|
11
11
|
|
12
|
-
has_file_datastream :name => "descriptionText", :type
|
12
|
+
has_file_datastream :name => "descriptionText", :type=>Cul::Hydra::Datastreams::EncodedTextDatastream,
|
13
13
|
:versionable => false, :label => 'Textual Description of Concept',
|
14
14
|
:mimeType => 'text/markdown'
|
15
15
|
|
@@ -107,7 +107,15 @@ class Concept < GenericAggregator
|
|
107
107
|
|
108
108
|
def to_solr(solr_doc = Hash.new, opts={})
|
109
109
|
solr_doc = super(solr_doc, opts)
|
110
|
-
|
110
|
+
description.tap do |description_value|
|
111
|
+
if description_value
|
112
|
+
unless description_ds.is_a? Cul::Hydra::Datastreams::EncodedTextDatastream
|
113
|
+
description_value = Cul::Hydra::Datastreams::EncodedTextDatastream.utf8able!(description_value).encode(Encoding::UTF_8)
|
114
|
+
end
|
115
|
+
description_field_name = ::ActiveFedora::SolrService.solr_name(:description_text, :displayable)
|
116
|
+
solr_doc[description_field_name] = description_value
|
117
|
+
end
|
118
|
+
end
|
111
119
|
solr_doc
|
112
120
|
end
|
113
121
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Cul
|
2
|
+
module Hydra
|
3
|
+
module Datastreams
|
4
|
+
class EncodedTextDatastream < ::ActiveFedora::Datastream
|
5
|
+
DEFAULT_PRIORITIES = [ Encoding::UTF_8, Encoding::ISO_8859_1, Encoding::WINDOWS_1252 ]
|
6
|
+
def initialize(digital_object=nil, dsid=nil, options={})
|
7
|
+
@encoding_priorities = options.delete(:encodings) || DEFAULT_PRIORITIES
|
8
|
+
super
|
9
|
+
end
|
10
|
+
def content=(value)
|
11
|
+
super(utf8able!(value).encode!(Encoding::UTF_8))
|
12
|
+
end
|
13
|
+
|
14
|
+
def content
|
15
|
+
utf8able!(super.to_s).encode!(Encoding::UTF_8)
|
16
|
+
end
|
17
|
+
|
18
|
+
def utf8able!(data)
|
19
|
+
EncodedTextDatastream.utf8able!(data, @encoding_priorities)
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.utf8able!(data, encoding_priorities = DEFAULT_PRIORITIES)
|
23
|
+
return unless data
|
24
|
+
content_encoding = encoding_priorities.detect do |enc|
|
25
|
+
begin
|
26
|
+
data.force_encoding(enc).valid_encoding?
|
27
|
+
rescue Encoding::UndefinedConversionError, Encoding::InvalidByteSequenceError
|
28
|
+
false
|
29
|
+
end
|
30
|
+
end
|
31
|
+
raise "could not encode text datastream content" unless content_encoding
|
32
|
+
puts "using encoding #{content_encoding}"
|
33
|
+
data.force_encoding(content_encoding)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
In 1917, Harrison founded the first organization (The Liberty League) and the first newspaper (The Voice) of the “New Negro Movement” and he published his first book, The Negro and the Nation. He opposed positions taken by Joel E. Spingarn and W.E.B. Du Bois of the NAACP during the First World War and, along with William Monroe Trotter and others he organized the 1918 Liberty Congress. The Congress, the major Black protest effort during the war, demanded enforcement of the Thirteenth, Fourteenth, and Fifteenth Amendments and federal anti-lynching legislation. Beginning in 1920, he became the principal editor of Marcus Garvey's Negro World, which he reshaped into a leading political and literary publication of the era. In its pages, he discussed history, politics, theater, international affairs, religion, and science. He also created a "Poetry for the People" feature, a “West Indian News Notes” column, and what he described as the first regular book review section by a Black author in “Negro newspaperdom.” In 1920 he also published his second book, When Africa Awakes: The “Inside Story” of the Stirrings and Strivings of the New Negro in the Western World. Later, he would criticize Garvey's methods and actions.
|
data/lib/cul_hydra/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cul_hydra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Armintor
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-03-
|
12
|
+
date: 2020-03-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -394,6 +394,7 @@ files:
|
|
394
394
|
- app/models/content_aggregator.rb
|
395
395
|
- app/models/cul/hydra/datastreams/access_control_metadata.rb
|
396
396
|
- app/models/cul/hydra/datastreams/dc_metadata.rb
|
397
|
+
- app/models/cul/hydra/datastreams/encoded_text_datastream.rb
|
397
398
|
- app/models/cul/hydra/datastreams/mods_document.rb
|
398
399
|
- app/models/cul/hydra/datastreams/rels_int.rb
|
399
400
|
- app/models/cul/hydra/datastreams/struct_metadata.rb
|
@@ -402,14 +403,11 @@ files:
|
|
402
403
|
- app/models/generic_object.rb
|
403
404
|
- app/models/generic_resource.rb
|
404
405
|
- bin/rails
|
405
|
-
- config/fedora.yml
|
406
406
|
- config/jetty.yml
|
407
407
|
- config/locales/ldpd_hydra.en.yml
|
408
408
|
- config/predicate_mappings.yml
|
409
|
-
- config/solr.yml
|
410
409
|
- config/solr_mappings.yml
|
411
410
|
- config/solr_value_maps.yml
|
412
|
-
- config/subs.yml
|
413
411
|
- fixtures/cmodels/ldpd_ADLMetadata.xml
|
414
412
|
- fixtures/cmodels/ldpd_AESMetadata.xml
|
415
413
|
- fixtures/cmodels/ldpd_BagAggregator.xml
|
@@ -453,6 +451,7 @@ files:
|
|
453
451
|
- fixtures/cmodels/ldpd_sdep.StaticImageCore.xml
|
454
452
|
- fixtures/cmodels/ore_Proxy.xml
|
455
453
|
- fixtures/cmodels/pcdm_Collection.xml
|
454
|
+
- fixtures/spec/BLOB/description-utf8.txt
|
456
455
|
- fixtures/spec/BLOB/dlc.md
|
457
456
|
- fixtures/spec/BLOB/test001.jpg
|
458
457
|
- fixtures/spec/CUL_ACCESS/access-closed.xml
|
@@ -462,7 +461,6 @@ files:
|
|
462
461
|
- fixtures/spec/CUL_MODS/mods-001.xml
|
463
462
|
- fixtures/spec/CUL_MODS/mods-access-condition.xml
|
464
463
|
- fixtures/spec/CUL_MODS/mods-all.xml
|
465
|
-
- fixtures/spec/CUL_MODS/mods-archival-context-2.xml
|
466
464
|
- fixtures/spec/CUL_MODS/mods-archival-context.xml
|
467
465
|
- fixtures/spec/CUL_MODS/mods-bad-repo.xml
|
468
466
|
- fixtures/spec/CUL_MODS/mods-date-created-range.xml
|
@@ -566,7 +564,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
566
564
|
- !ruby/object:Gem::Version
|
567
565
|
version: '0'
|
568
566
|
requirements: []
|
569
|
-
rubygems_version: 3.
|
567
|
+
rubygems_version: 3.1.2
|
570
568
|
signing_key:
|
571
569
|
specification_version: 4
|
572
570
|
summary: ActiveFedora, OM, and Solrizer implementations for CUL repository apps
|
data/config/fedora.yml
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
development:
|
2
|
-
user: fedoraAdmin
|
3
|
-
password: f+BULUS*^
|
4
|
-
url: http://repository.cul.columbia.edu:8080/fedora
|
5
|
-
datastreams_root: /ifs/cul/repo/archive/repo-datastreams
|
6
|
-
time_zone: "America/New_York"
|
7
|
-
test: &TEST
|
8
|
-
user: fedoraAdmin
|
9
|
-
password: fedoraAdmin
|
10
|
-
url: <%= "http://127.0.0.1:#{ENV['TEST_JETTY_PORT'] || 8983}/fedora-test" %>
|
11
|
-
datastreams_root: /ifs/cul/repo/archive/repo-datastreams
|
12
|
-
time_zone: "America/New_York"
|
13
|
-
production:
|
14
|
-
user: fedoraAdmin
|
15
|
-
password: f+BULUS*^
|
16
|
-
url: http://repository.cul.columbia.edu:8080/fedora
|
17
|
-
datastreams_root: /ifs/cul/repo/archive/repo-datastreams
|
18
|
-
time_zone: "America/New_York"
|
19
|
-
dcv_test:
|
20
|
-
user: fedoraAdmin
|
21
|
-
password: f+BULUS*^
|
22
|
-
url: http://repository.cul.columbia.edu:8080/fedora
|
23
|
-
datastreams_root: /ifs/cul/repo/archive/repo-datastreams
|
24
|
-
time_zone: "America/New_York"
|
25
|
-
cucumber:
|
26
|
-
<<: *TEST
|
data/config/solr.yml
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# This is a sample config file that does not have multiple solr instances. You will also need to be sure to
|
2
|
-
# edit the fedora.yml file to match the solr URL for active-fedora.
|
3
|
-
# url: http://katana.cul.columbia.edu:8080/solr-4.7/dcv_private_dev
|
4
|
-
test: &TEST
|
5
|
-
url: <%= "http://127.0.0.1:#{ENV['TEST_JETTY_PORT'] || 8983}/solr/test" %>
|
6
|
-
dcv_dev: &DEV
|
7
|
-
url: http://spatha.cul.columbia.edu:8080/solr-4.7/dcv_private_test
|
8
|
-
dcv_core: 'dcv_private_dev'
|
9
|
-
dcv_test: &IFP
|
10
|
-
url: http://spatha.cul.columbia.edu:8080/solr-4.7/dcv_private_test
|
11
|
-
dcv_core: 'dcv_private_test'
|
12
|
-
cucumber:
|
13
|
-
<<: *TEST
|
14
|
-
production: &PROD
|
15
|
-
url: http://spatha.cul.columbia.edu:8080/solr-4.7/dcv_prod
|
16
|
-
development:
|
17
|
-
<<: *PROD
|
data/config/subs.yml
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
old:
|
2
|
-
fedora_server: http://sayers.cul.columbia.edu:8080
|
3
|
-
php_server: http://bach.cul.columbia.edu/dev
|
4
|
-
djatoka_server: http://iris.cul.columbia.edu:8080
|
5
|
-
development:
|
6
|
-
fedora_server: http://repository.cul.columbia.edu:8080
|
7
|
-
php_server: http://fedora-svc.cul.columbia.edu/dev
|
8
|
-
test:
|
9
|
-
fedora_server: http://repository.cul.columbia.edu:8080
|
10
|
-
php_server: http://fedora-svc.cul.columbia.edu/dev
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<?xml version="1.0"?>
|
2
|
-
<mods:mods xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mods="http://www.loc.gov/mods/v3" version="3.6" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-6.xsd">
|
3
|
-
<mods:titleInfo>
|
4
|
-
<mods:title>Agreement between Gunnar Myrdal and Harper & Brothers for the publication of "An American Dilemma," January 8, 1943</mods:title>
|
5
|
-
</mods:titleInfo>
|
6
|
-
<mods:relatedItem type="host" displayLabel="Project">
|
7
|
-
<mods:titleInfo>
|
8
|
-
<mods:title>Carnegie Digital Past and Future</mods:title>
|
9
|
-
</mods:titleInfo>
|
10
|
-
</mods:relatedItem>
|
11
|
-
<mods:relatedItem type="host" displayLabel="Collection">
|
12
|
-
<mods:titleInfo valueURI="http://id.library.columbia.edu/term/72fcfd07-f7db-4a18-bdb2-beb0abce071c">
|
13
|
-
<mods:title>Carnegie Corporation of New York Records</mods:title>
|
14
|
-
</mods:titleInfo>
|
15
|
-
<mods:identifier type="CLIO">4079753</mods:identifier>
|
16
|
-
<mods:part>
|
17
|
-
<mods:detail type="Series" level="1">
|
18
|
-
<mods:title>Series II. Files on Microfilm</mods:title>
|
19
|
-
</mods:detail>
|
20
|
-
</mods:part>
|
21
|
-
</mods:relatedItem>
|
22
|
-
</mods:mods>
|