hydra-head 4.0.3 → 4.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.
- data/.gitignore +1 -0
- data/HISTORY.textile +17 -2
- data/app/assets/stylesheets/hydra/html_refactor.css +3 -30
- data/app/assets/stylesheets/hydra/styles.css +6 -64
- data/app/controllers/downloads_controller.rb +1 -1
- data/app/controllers/hydra/assets_controller.rb +10 -1
- data/app/controllers/hydra/contributors_controller.rb +15 -1
- data/app/controllers/hydra/file_assets_controller.rb +1 -1
- data/app/controllers/hydra/permissions_controller.rb +14 -0
- data/app/helpers/hydra/article_metadata_helper_behavior.rb +14 -1
- data/app/helpers/hydra/downloads_helper_behavior.rb +6 -0
- data/app/helpers/hydra/facets_helper_behavior.rb +7 -0
- data/app/helpers/hydra/generic_content_objects_helper_behavior.rb +6 -0
- data/app/helpers/hydra/hydra_assets_helper_behavior.rb +10 -0
- data/app/helpers/hydra/hydra_fedora_metadata_helper_behavior.rb +31 -0
- data/app/helpers/hydra/hydra_helper_behavior.rb +18 -7
- data/app/helpers/hydra/hydra_uploader_helper_behavior.rb +5 -0
- data/app/helpers/hydra/inline_editable_metadata_helper_behavior.rb +6 -0
- data/app/helpers/hydra/javascript_includes_helper_behavior.rb +7 -0
- data/app/helpers/hydra/personalization_helper_behavior.rb +5 -0
- data/app/helpers/hydra/release_process_helper_behavior.rb +5 -0
- data/app/models/generic_content.rb +3 -0
- data/app/models/generic_image.rb +3 -0
- data/app/models/superuser.rb +4 -2
- data/app/models/user_attribute.rb +7 -2
- data/app/views/_add_assets_links.html.erb +4 -4
- data/app/views/catalog/_index_partials/_default.html.erb +2 -2
- data/app/views/catalog/show.html.erb +1 -1
- data/app/views/generic_contents/_index.html.erb +2 -2
- data/app/views/generic_images/_edit.html.erb +1 -1
- data/app/views/generic_images/_index.html.erb +2 -2
- data/app/views/hydra/file_assets/_file_assets_form.html.erb +1 -1
- data/app/views/hydra/file_assets/_index.html.erb +2 -2
- data/app/views/hydra/file_assets/_result.html.erb +1 -1
- data/app/views/layouts/hydra-head.html.erb +4 -1
- data/app/views/mods_assets/_index_list.html.erb +1 -1
- data/app/views/mods_assets/_index_table.html.erb +2 -2
- data/app/views/mods_assets/_show.html.erb +1 -1
- data/app/views/mods_assets/_show_file_assets.html.erb +1 -1
- data/config/jetty.yml +1 -1
- data/config/locales/hydra.en.yml +7 -0
- data/config/solr.yml +1 -1
- data/config/solr_mappings.yml +2 -2
- data/hydra-head.gemspec +5 -4
- data/lib/generators/hydra/head_generator.rb +6 -5
- data/lib/generators/hydra/templates/config/fedora.yml +1 -1
- data/lib/generators/hydra/templates/config/solr.yml +1 -1
- data/lib/hydra-head/version.rb +1 -1
- data/lib/hydra.rb +13 -11
- data/lib/hydra/assets.rb +5 -135
- data/lib/hydra/catalog.rb +6 -44
- data/lib/hydra/controller.rb +10 -27
- data/lib/hydra/controller/assets_controller_behavior.rb +142 -0
- data/lib/hydra/controller/catalog_controller_behavior.rb +56 -0
- data/lib/hydra/controller/controller_behavior.rb +59 -0
- data/lib/hydra/controller/file_assets_behavior.rb +142 -0
- data/lib/hydra/controller/repository_controller_behavior.rb +119 -0
- data/lib/hydra/controller/upload_behavior.rb +139 -0
- data/lib/hydra/file_assets.rb +3 -138
- data/lib/hydra/file_assets_helper.rb +6 -133
- data/lib/hydra/generic_content.rb +15 -0
- data/lib/hydra/generic_image.rb +10 -0
- data/lib/hydra/global_configurable.rb +46 -0
- data/lib/hydra/model_methods.rb +3 -3
- data/lib/hydra/model_mixins.rb +1 -1
- data/lib/hydra/model_mixins/solr_document_extension.rb +24 -0
- data/lib/hydra/repository_controller.rb +4 -95
- data/lib/hydra/ui/controller.rb +1 -2
- data/lib/hydra/user.rb +13 -1
- data/lib/railties/hydra-fixtures.rake +1 -1
- data/tasks/hydra-head.rake +2 -0
- data/{app/models → test_support/etc}/common_metadata_asset.rb +1 -2
- data/test_support/features/mods_asset_show.feature +1 -1
- data/test_support/features/support/env.rb +2 -0
- data/test_support/features/support/paths.rb +2 -0
- data/test_support/spec/controllers/catalog_controller_spec.rb +8 -0
- data/test_support/spec/controllers/catalog_controller_viewing_context_spec.rb +10 -1
- data/test_support/spec/controllers/catalog_valid_html_spec.rb +8 -0
- data/test_support/spec/controllers/contributors_controller_spec.rb +10 -0
- data/test_support/spec/controllers/file_assets_controller_spec.rb +15 -3
- data/test_support/spec/controllers/hydra-assets_controller_spec.rb +11 -1
- data/test_support/spec/controllers/hydra_controller_spec.rb +15 -4
- data/test_support/spec/controllers/permissions_controller_spec.rb +8 -0
- data/test_support/spec/helpers/access_controls_enforcement_spec.rb +1 -2
- data/test_support/spec/helpers/file_assets_helper_spec.rb +1 -1
- data/test_support/spec/helpers/generic_content_objects_helper_spec.rb +10 -1
- data/test_support/spec/helpers/hydra-repository_controller_spec.rb +1 -1
- data/test_support/spec/helpers/hydra_assets_helper_spec.rb +8 -0
- data/test_support/spec/helpers/hydra_fedora_metadata_helper_spec.rb +11 -0
- data/test_support/spec/helpers/hydra_helper_spec.rb +18 -0
- data/test_support/spec/helpers/hydra_model_methods_spec.rb +0 -12
- data/test_support/spec/helpers/hydra_uploader_helper_spec.rb +8 -0
- data/test_support/spec/helpers/javascript_includes_helper_spec.rb +9 -1
- data/test_support/spec/lib/catalog_spec.rb +10 -3
- data/test_support/spec/lib/global_configurable_spec.rb +98 -0
- data/test_support/spec/lib/model_methods_spec.rb +29 -0
- data/test_support/spec/models/generic_content_spec.rb +11 -0
- data/test_support/spec/models/generic_image_spec.rb +15 -0
- data/test_support/spec/models/user_spec.rb +25 -0
- metadata +39 -37
- data/app/models/ability.rb +0 -5
- data/app/models/hydra/ability.rb +0 -137
- data/app/models/hydra/datastream/common_mods_index_methods.rb +0 -47
- data/app/models/hydra/datastream/mods_article.rb +0 -530
- data/app/models/hydra/datastream/mods_dataset.rb +0 -173
- data/app/models/hydra/datastream/mods_generic_content.rb +0 -498
- data/app/models/hydra/datastream/mods_image.rb +0 -497
- data/app/models/hydra/datastream/rights_metadata.rb +0 -191
- data/app/models/hydra/role_mapper_behavior.rb +0 -33
- data/app/models/role_mapper.rb +0 -6
- data/lib/hydra/access_controls_enforcement.rb +0 -237
- data/lib/hydra/access_controls_evaluation.rb +0 -38
- data/lib/hydra/common_mods_index_methods.rb +0 -46
- data/lib/hydra/model_mixins/mods_object.rb +0 -17
- data/lib/hydra/model_mixins/rights_metadata.rb +0 -357
- data/lib/hydra/mods_article.rb +0 -535
- data/lib/hydra/mods_dataset.rb +0 -177
- data/lib/hydra/mods_generic_content.rb +0 -500
- data/lib/hydra/mods_image.rb +0 -500
- data/lib/uva/mods_index_methods.rb +0 -30
- data/test_support/spec/lib/common_mods_index_methods_spec.rb +0 -26
- data/test_support/spec/models/ability_spec.rb +0 -40
- data/test_support/spec/models/hydra_rights_metadata_spec.rb +0 -175
- data/test_support/spec/models/role_mapper_spec.rb +0 -22
- data/test_support/spec/unit/rights_metadata_spec.rb +0 -80
@@ -1,173 +0,0 @@
|
|
1
|
-
# @deprecated Leftover from Hydrangea work; this should be moved to documentation as an EXAMPLE, and will be removed no later than release 6.x
|
2
|
-
module Hydra
|
3
|
-
module Datastream
|
4
|
-
class ModsDataset < ActiveFedora::NokogiriDatastream
|
5
|
-
include Hydra::Datastream::CommonModsIndexMethods
|
6
|
-
|
7
|
-
def initialize
|
8
|
-
ActiveSupport::Deprecation.warn("Hydra:Datastream:ModsDataset is deprecated and will be removed in release 5 or 6. It has been moved into wiki documentation here: https://github.com/projecthydra/hydra-head/wiki/Models---Some-Examples")
|
9
|
-
super
|
10
|
-
end
|
11
|
-
|
12
|
-
set_terminology do |t|
|
13
|
-
t.root(:path=>"mods", :xmlns=>"http://www.loc.gov/mods/v3", :schema=>"http://www.loc.gov/standards/mods/v3/mods-3-2.xsd")
|
14
|
-
|
15
|
-
# Common MODS info -- might eventually be put into its own shared terminology.
|
16
|
-
|
17
|
-
t.title_info(:path=>"titleInfo") {
|
18
|
-
t.main_title(:path=>"title", :label=>"title")
|
19
|
-
t.language(:path=>{:attribute=>"lang"})
|
20
|
-
}
|
21
|
-
t.title(:proxy=>[:title_info, :main_title])
|
22
|
-
t.abstract
|
23
|
-
t.subject {
|
24
|
-
t.topic(:index_as=>[:facetable])
|
25
|
-
}
|
26
|
-
t.topic_tag(:path=>"subject", :default_content_path=>"topic")
|
27
|
-
t.identifier {
|
28
|
-
t.type_(:path=>{:attribute=>"type"})
|
29
|
-
}
|
30
|
-
# This is a mods:name. The underscore is purely to avoid namespace conflicts.
|
31
|
-
t.name_ {
|
32
|
-
t.namePart(:index_as=>[:searchable, :displayable, :facetable, :sortable], :required=>:true, :type=>:string, :label=>"generic name")
|
33
|
-
t.affiliation
|
34
|
-
t.institution(:path=>"affiliation")
|
35
|
-
t.displayForm
|
36
|
-
t.role(:ref=>[:role])
|
37
|
-
t.description
|
38
|
-
t.date(:path=>"namePart", :attributes=>{:type=>"date"})
|
39
|
-
t.last_name(:path=>"namePart", :attributes=>{:type=>"family"})
|
40
|
-
t.first_name(:path=>"namePart", :attributes=>{:type=>"given"}, :label=>"first name")
|
41
|
-
t.terms_of_address(:path=>"namePart", :attributes=>{:type=>"termsOfAddress"})
|
42
|
-
}
|
43
|
-
# lookup :person, :first_name
|
44
|
-
t.person(:ref=>:name, :attributes=>{:type=>"personal"})
|
45
|
-
t.organization(:ref=>:name, :attributes=>{:type=>"institutional"})
|
46
|
-
t.conference(:ref=>:name, :attributes=>{:type=>"conference"})
|
47
|
-
|
48
|
-
t.role {
|
49
|
-
t.text(:path=>"roleTerm",:attributes=>{:type=>"text"})
|
50
|
-
t.code(:path=>"roleTerm",:attributes=>{:type=>"code"})
|
51
|
-
}
|
52
|
-
|
53
|
-
# Dataset-specific Terms
|
54
|
-
|
55
|
-
# In datasets, we're calling the abstract "methodology"
|
56
|
-
t.methodology(:path=>"abstract")
|
57
|
-
|
58
|
-
# Most of these are forcing non-bibliographic information into mods by using the note field pretty freely
|
59
|
-
t.note
|
60
|
-
t.gps(:index_as=>[:facetable],:path=>"note",:attributes=>{:type=>"location"})
|
61
|
-
t.timespan_start(:path=>"note",:attributes=>{:type=>"timespan-start"})
|
62
|
-
t.timespan_end(:path=>"note",:attributes=>{:type=>"timespan-end"})
|
63
|
-
t.region(:index_as=>[:facetable],:path=>"note",:attributes=>{:type=>"region"})
|
64
|
-
t.site(:index_as=>[:facetable],:path=>"note",:attributes=>{:type=>"site"})
|
65
|
-
t.ecosystem(:index_as=>[:facetable],:path=>"note",:attributes=>{:type=>"ecosystem"})
|
66
|
-
end
|
67
|
-
|
68
|
-
# It would be nice if we could declare properties with refined info like this
|
69
|
-
# accessor :grant_agency, :relative_xpath=>'oxns:mods/oxns:name[contains(oxns:role/oxns:roleTerm, "Funder")]'
|
70
|
-
|
71
|
-
# Generates an empty Mods Article (used when you call ModsArticle.new without passing in existing xml)
|
72
|
-
def self.xml_template
|
73
|
-
builder = Nokogiri::XML::Builder.new do |xml|
|
74
|
-
xml.mods(:version=>"3.3", "xmlns:xlink"=>"http://www.w3.org/1999/xlink",
|
75
|
-
"xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance",
|
76
|
-
"xmlns"=>"http://www.loc.gov/mods/v3",
|
77
|
-
"xsi:schemaLocation"=>"http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd") {
|
78
|
-
xml.titleInfo(:lang=>"") {
|
79
|
-
xml.title
|
80
|
-
}
|
81
|
-
xml.name(:type=>"personal") {
|
82
|
-
xml.namePart(:type=>"given")
|
83
|
-
xml.namePart(:type=>"family")
|
84
|
-
xml.affiliation
|
85
|
-
xml.role {
|
86
|
-
xml.roleTerm(:authority=>"marcrelator", :type=>"text")
|
87
|
-
}
|
88
|
-
}
|
89
|
-
xml.name(:type=>"corporate") {
|
90
|
-
xml.namePart
|
91
|
-
xml.affiliation
|
92
|
-
xml.role {
|
93
|
-
xml.roleTerm("Funder", :authority=>"marcrelator", :type=>"text")
|
94
|
-
}
|
95
|
-
}
|
96
|
-
xml.typeOfResource "software, multimedia"
|
97
|
-
xml.genre("dataset", :authority=>"dct")
|
98
|
-
xml.language {
|
99
|
-
xml.languageTerm("eng", :authority=>"iso639-2b", :type=>"code")
|
100
|
-
}
|
101
|
-
xml.abstract
|
102
|
-
xml.subject {
|
103
|
-
xml.topic
|
104
|
-
}
|
105
|
-
xml.note(:type=>"completeness")
|
106
|
-
xml.note(:type=>"interval")
|
107
|
-
xml.note(:type=>"datatype")
|
108
|
-
xml.note(:type=>"timespan-start")
|
109
|
-
xml.note(:type=>"timespan-end")
|
110
|
-
xml.note(:type=>"location")
|
111
|
-
xml.note(:type=>"grant")
|
112
|
-
xml.note(:type=>"data quality")
|
113
|
-
xml.note(:type=>"contact-name")
|
114
|
-
xml.note(:type=>"contact-email")
|
115
|
-
}
|
116
|
-
end
|
117
|
-
return builder.doc
|
118
|
-
end
|
119
|
-
|
120
|
-
def self.person_relator_terms
|
121
|
-
{"anl" => "Analyst",
|
122
|
-
"aut" => "Author",
|
123
|
-
"clb" => "Collaborator",
|
124
|
-
"com" => "Compiler",
|
125
|
-
"cre" => "Creator",
|
126
|
-
"ctb" => "Contributor",
|
127
|
-
"dpt" => "Depositor",
|
128
|
-
"dtc" => "Data contributor ",
|
129
|
-
"dtm" => "Data manager ",
|
130
|
-
"edt" => "Editor",
|
131
|
-
"lbr" => "Laboratory ",
|
132
|
-
"ldr" => "Laboratory director ",
|
133
|
-
"pdr" => "Project director",
|
134
|
-
"prg" => "Programmer",
|
135
|
-
"res" => "Researcher",
|
136
|
-
"rth" => "Research team head",
|
137
|
-
"rtm" => "Research team member"
|
138
|
-
}
|
139
|
-
end
|
140
|
-
|
141
|
-
def self.completed_choices
|
142
|
-
["Time Series",
|
143
|
-
"Snapshot / Sample"
|
144
|
-
]
|
145
|
-
end
|
146
|
-
|
147
|
-
|
148
|
-
def self.interval_choices
|
149
|
-
["Monthly",
|
150
|
-
"Quarterly",
|
151
|
-
"Semi-annually",
|
152
|
-
"Annually",
|
153
|
-
"Irregular"
|
154
|
-
]
|
155
|
-
end
|
156
|
-
|
157
|
-
def self.data_type_choices
|
158
|
-
["transect","observation","data logging","remote sensing"]
|
159
|
-
end
|
160
|
-
|
161
|
-
def self.valid_child_types
|
162
|
-
["data", "supporting file", "profile", "lorem ipsum", "dolor"]
|
163
|
-
end
|
164
|
-
def to_solr(solr_doc=Hash.new)
|
165
|
-
super(solr_doc)
|
166
|
-
solr_doc.merge!(extract_person_full_names)
|
167
|
-
solr_doc.merge!(extract_person_organizations)
|
168
|
-
solr_doc.merge!(:object_type_facet => "Dataset")
|
169
|
-
solr_doc
|
170
|
-
end
|
171
|
-
end
|
172
|
-
end
|
173
|
-
end
|
@@ -1,498 +0,0 @@
|
|
1
|
-
# Datastream that uses a Generic MODS Terminology; essentially an exemplar.
|
2
|
-
# this class will be renamed to Hydra::Datastream::ModsBasic in Hydra 5.0
|
3
|
-
module Hydra
|
4
|
-
module Datastream
|
5
|
-
class ModsGenericContent < ActiveFedora::NokogiriDatastream
|
6
|
-
include Hydra::Datastream::CommonModsIndexMethods
|
7
|
-
|
8
|
-
set_terminology do |t|
|
9
|
-
t.root(:path=>"mods", :xmlns=>"http://www.loc.gov/mods/v3", :schema=>"http://www.loc.gov/standards/mods/v3/mods-3-2.xsd")
|
10
|
-
|
11
|
-
t.title_info(:path=>"titleInfo") {
|
12
|
-
t.main_title(:path=>"title", :label=>"title")
|
13
|
-
t.language(:index_as=>[:facetable],:path=>{:attribute=>"lang"})
|
14
|
-
}
|
15
|
-
|
16
|
-
t.language{
|
17
|
-
t.lang_code(:index_as=>[:facetable], :path=>"languageTerm", :attributes=>{:type=>"code"})
|
18
|
-
}
|
19
|
-
t.abstract
|
20
|
-
t.subject {
|
21
|
-
t.topic
|
22
|
-
}
|
23
|
-
t.topic_tag(:index_as=>[:facetable],:path=>"subject", :default_content_path=>"topic")
|
24
|
-
|
25
|
-
# mods:physicaldescription/mods:extent - used for storing file size in human-readable form.
|
26
|
-
t.physical_description(:path => "physicalDescription") {
|
27
|
-
t.extent( :path => "extent")
|
28
|
-
}
|
29
|
-
|
30
|
-
# This is a mods:name. The underscore is purely to avoid namespace conflicts.
|
31
|
-
t.name_ {
|
32
|
-
# this is a namepart
|
33
|
-
t.namePart(:type=>:string, :label=>"generic name")
|
34
|
-
# affiliations are great
|
35
|
-
t.affiliation
|
36
|
-
t.institution(:path=>"affiliation", :index_as=>[:facetable], :label=>"organization")
|
37
|
-
t.displayForm
|
38
|
-
t.role(:ref=>[:role])
|
39
|
-
t.description
|
40
|
-
t.date(:path=>"namePart", :attributes=>{:type=>"date"})
|
41
|
-
t.last_name(:path=>"namePart", :attributes=>{:type=>"family"})
|
42
|
-
t.first_name(:path=>"namePart", :attributes=>{:type=>"given"}, :label=>"first name")
|
43
|
-
t.terms_of_address(:path=>"namePart", :attributes=>{:type=>"termsOfAddress"})
|
44
|
-
}
|
45
|
-
# lookup :person, :first_name
|
46
|
-
t.person(:ref=>:name, :attributes=>{:type=>"personal"}, :index_as=>[:facetable])
|
47
|
-
t.organization(:ref=>:name, :attributes=>{:type=>"corporate"}, :index_as=>[:facetable])
|
48
|
-
t.conference(:ref=>:name, :attributes=>{:type=>"conference"}, :index_as=>[:facetable])
|
49
|
-
t.role {
|
50
|
-
t.text(:path=>"roleTerm",:attributes=>{:type=>"text"})
|
51
|
-
t.code(:path=>"roleTerm",:attributes=>{:type=>"code"})
|
52
|
-
}
|
53
|
-
t.journal(:path=>'relatedItem', :attributes=>{:type=>"host"}) {
|
54
|
-
t.title_info(:index_as=>[:facetable],:ref=>[:title_info])
|
55
|
-
t.origin_info(:path=>"originInfo") {
|
56
|
-
t.publisher
|
57
|
-
t.date_issued(:path=>"dateIssued")
|
58
|
-
}
|
59
|
-
t.issn(:path=>"identifier", :attributes=>{:type=>"issn"})
|
60
|
-
t.issue(:path=>"part") {
|
61
|
-
t.volume(:path=>"detail", :attributes=>{:type=>"volume"}, :default_content_path=>"number")
|
62
|
-
t.level(:path=>"detail", :attributes=>{:type=>"number"}, :default_content_path=>"number")
|
63
|
-
t.extent
|
64
|
-
t.pages(:path=>"extent", :attributes=>{:unit=>"pages"}) {
|
65
|
-
t.start
|
66
|
-
t.end
|
67
|
-
}
|
68
|
-
t.start_page(:proxy=>[:pages, :start])
|
69
|
-
t.end_page(:proxy=>[:pages, :end])
|
70
|
-
t.publication_date(:path=>"date")
|
71
|
-
}
|
72
|
-
}
|
73
|
-
end
|
74
|
-
|
75
|
-
# accessor :title, :term=>[:mods, :title_info, :main_title]
|
76
|
-
|
77
|
-
# Generates an empty Mods Generic Content (used when you call ModsGenericContent.new without passing in existing xml)
|
78
|
-
def self.xml_template
|
79
|
-
builder = Nokogiri::XML::Builder.new do |xml|
|
80
|
-
xml.mods(:version=>"3.3", "xmlns:xlink"=>"http://www.w3.org/1999/xlink",
|
81
|
-
"xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance",
|
82
|
-
"xmlns"=>"http://www.loc.gov/mods/v3",
|
83
|
-
"xsi:schemaLocation"=>"http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd") {
|
84
|
-
xml.titleInfo(:lang=>"") {
|
85
|
-
xml.title
|
86
|
-
}
|
87
|
-
xml.name(:type=>"personal") {
|
88
|
-
xml.namePart(:type=>"given")
|
89
|
-
xml.namePart(:type=>"family")
|
90
|
-
xml.affiliation
|
91
|
-
xml.role {
|
92
|
-
xml.roleTerm(:authority=>"marcrelator", :type=>"text")
|
93
|
-
}
|
94
|
-
}
|
95
|
-
xml.typeOfResource
|
96
|
-
xml.genre(:authority=>"marcgt")
|
97
|
-
xml.language {
|
98
|
-
xml.languageTerm(:authority=>"iso639-2b", :type=>"code")
|
99
|
-
}
|
100
|
-
# mods:physicaldescription/mods:extent - used for storing file size in human-readable form.
|
101
|
-
xml.physicalDescription {
|
102
|
-
xml.extent
|
103
|
-
}
|
104
|
-
xml.abstract
|
105
|
-
xml.subject {
|
106
|
-
xml.topic
|
107
|
-
}
|
108
|
-
xml.relatedItem(:type=>"host") {
|
109
|
-
xml.titleInfo {
|
110
|
-
xml.title
|
111
|
-
}
|
112
|
-
xml.identifier(:type=>"issn")
|
113
|
-
xml.originInfo {
|
114
|
-
xml.publisher
|
115
|
-
xml.dateIssued
|
116
|
-
}
|
117
|
-
xml.part {
|
118
|
-
xml.detail(:type=>"volume") {
|
119
|
-
xml.number
|
120
|
-
}
|
121
|
-
xml.detail(:type=>"number") {
|
122
|
-
xml.number
|
123
|
-
}
|
124
|
-
xml.extent(:unit=>"pages") {
|
125
|
-
xml.start
|
126
|
-
xml.end
|
127
|
-
}
|
128
|
-
xml.date
|
129
|
-
}
|
130
|
-
}
|
131
|
-
xml.location {
|
132
|
-
xml.url
|
133
|
-
}
|
134
|
-
}
|
135
|
-
end
|
136
|
-
return builder.doc
|
137
|
-
end
|
138
|
-
|
139
|
-
# Generates a new Person node
|
140
|
-
def self.person_template
|
141
|
-
builder = Nokogiri::XML::Builder.new do |xml|
|
142
|
-
xml.name(:type=>"personal") {
|
143
|
-
xml.namePart(:type=>"family")
|
144
|
-
xml.namePart(:type=>"given")
|
145
|
-
xml.affiliation
|
146
|
-
xml.role {
|
147
|
-
xml.roleTerm(:type=>"text")
|
148
|
-
}
|
149
|
-
}
|
150
|
-
end
|
151
|
-
return builder.doc.root
|
152
|
-
end
|
153
|
-
|
154
|
-
def self.full_name_template
|
155
|
-
builder = Nokogiri::XML::Builder.new do |xml|
|
156
|
-
xml.full_name(:type => "personal")
|
157
|
-
end
|
158
|
-
return builder.doc.root
|
159
|
-
end
|
160
|
-
|
161
|
-
# Generates a new Organization node
|
162
|
-
# Uses mods:name[@type="corporate"]
|
163
|
-
def self.organization_template
|
164
|
-
builder = Nokogiri::XML::Builder.new do |xml|
|
165
|
-
xml.name(:type=>"corporate") {
|
166
|
-
xml.namePart
|
167
|
-
xml.role {
|
168
|
-
xml.roleTerm(:authority=>"marcrelator", :type=>"text")
|
169
|
-
}
|
170
|
-
}
|
171
|
-
end
|
172
|
-
return builder.doc.root
|
173
|
-
end
|
174
|
-
|
175
|
-
# Generates a new Conference node
|
176
|
-
def self.conference_template
|
177
|
-
builder = Nokogiri::XML::Builder.new do |xml|
|
178
|
-
xml.name(:type=>"conference") {
|
179
|
-
xml.namePart
|
180
|
-
xml.role {
|
181
|
-
xml.roleTerm(:authority=>"marcrelator", :type=>"text")
|
182
|
-
}
|
183
|
-
}
|
184
|
-
end
|
185
|
-
return builder.doc.root
|
186
|
-
end
|
187
|
-
|
188
|
-
# Inserts a new contributor (mods:name) into the mods document
|
189
|
-
# creates contributors of type :person, :organization, or :conference
|
190
|
-
def insert_contributor(type, opts={})
|
191
|
-
case type.to_sym
|
192
|
-
when :person
|
193
|
-
node = Hydra::Datastream::ModsGenericContent.person_template
|
194
|
-
nodeset = self.find_by_terms(:person)
|
195
|
-
when :organization
|
196
|
-
node = Hydra::Datastream::ModsGenericContent.organization_template
|
197
|
-
nodeset = self.find_by_terms(:organization)
|
198
|
-
when :conference
|
199
|
-
node = Hydra::Datastream::ModsGenericContent.conference_template
|
200
|
-
nodeset = self.find_by_terms(:conference)
|
201
|
-
else
|
202
|
-
ActiveFedora.logger.warn("#{type} is not a valid argument for Hydra::Datastream::ModsGenericContent.insert_contributor")
|
203
|
-
node = nil
|
204
|
-
index = nil
|
205
|
-
end
|
206
|
-
|
207
|
-
unless nodeset.nil?
|
208
|
-
if nodeset.empty?
|
209
|
-
self.ng_xml.root.add_child(node)
|
210
|
-
index = 0
|
211
|
-
else
|
212
|
-
nodeset.after(node)
|
213
|
-
index = nodeset.length
|
214
|
-
end
|
215
|
-
self.dirty = true
|
216
|
-
end
|
217
|
-
|
218
|
-
return node, index
|
219
|
-
end
|
220
|
-
|
221
|
-
# Remove the contributor entry identified by @contributor_type and @index
|
222
|
-
def remove_contributor(contributor_type, index)
|
223
|
-
self.find_by_terms( {contributor_type.to_sym => index.to_i} ).first.remove
|
224
|
-
self.dirty = true
|
225
|
-
end
|
226
|
-
|
227
|
-
def self.common_relator_terms
|
228
|
-
{"aut" => "Author",
|
229
|
-
"clb" => "Collaborator",
|
230
|
-
"com" => "Compiler",
|
231
|
-
"ctb" => "Contributor",
|
232
|
-
"cre" => "Creator",
|
233
|
-
"edt" => "Editor",
|
234
|
-
"ill" => "Illustrator",
|
235
|
-
"oth" => "Other",
|
236
|
-
"trl" => "Translator",
|
237
|
-
}
|
238
|
-
end
|
239
|
-
|
240
|
-
def self.person_relator_terms
|
241
|
-
{"aut" => "Author",
|
242
|
-
"clb" => "Collaborator",
|
243
|
-
"com" => "Compiler",
|
244
|
-
"cre" => "Creator",
|
245
|
-
"ctb" => "Contributor",
|
246
|
-
"edt" => "Editor",
|
247
|
-
"ill" => "Illustrator",
|
248
|
-
"res" => "Researcher",
|
249
|
-
"rth" => "Research team head",
|
250
|
-
"rtm" => "Research team member",
|
251
|
-
"trl" => "Translator"
|
252
|
-
}
|
253
|
-
end
|
254
|
-
|
255
|
-
def self.conference_relator_terms
|
256
|
-
{
|
257
|
-
"hst" => "Host"
|
258
|
-
}
|
259
|
-
end
|
260
|
-
|
261
|
-
def self.organization_relator_terms
|
262
|
-
{
|
263
|
-
"fnd" => "Funder",
|
264
|
-
"hst" => "Host"
|
265
|
-
}
|
266
|
-
end
|
267
|
-
|
268
|
-
def self.dc_relator_terms
|
269
|
-
{"acp" => "Art copyist",
|
270
|
-
"act" => "Actor",
|
271
|
-
"adp" => "Adapter",
|
272
|
-
"aft" => "Author of afterword, colophon, etc.",
|
273
|
-
"anl" => "Analyst",
|
274
|
-
"anm" => "Animator",
|
275
|
-
"ann" => "Annotator",
|
276
|
-
"ant" => "Bibliographic antecedent",
|
277
|
-
"app" => "Applicant",
|
278
|
-
"aqt" => "Author in quotations or text abstracts",
|
279
|
-
"arc" => "Architect",
|
280
|
-
"ard" => "Artistic director ",
|
281
|
-
"arr" => "Arranger",
|
282
|
-
"art" => "Artist",
|
283
|
-
"asg" => "Assignee",
|
284
|
-
"asn" => "Associated name",
|
285
|
-
"att" => "Attributed name",
|
286
|
-
"auc" => "Auctioneer",
|
287
|
-
"aud" => "Author of dialog",
|
288
|
-
"aui" => "Author of introduction",
|
289
|
-
"aus" => "Author of screenplay",
|
290
|
-
"aut" => "Author",
|
291
|
-
"bdd" => "Binding designer",
|
292
|
-
"bjd" => "Bookjacket designer",
|
293
|
-
"bkd" => "Book designer",
|
294
|
-
"bkp" => "Book producer",
|
295
|
-
"bnd" => "Binder",
|
296
|
-
"bpd" => "Bookplate designer",
|
297
|
-
"bsl" => "Bookseller",
|
298
|
-
"ccp" => "Conceptor",
|
299
|
-
"chr" => "Choreographer",
|
300
|
-
"clb" => "Collaborator",
|
301
|
-
"cli" => "Client",
|
302
|
-
"cll" => "Calligrapher",
|
303
|
-
"clt" => "Collotyper",
|
304
|
-
"cmm" => "Commentator",
|
305
|
-
"cmp" => "Composer",
|
306
|
-
"cmt" => "Compositor",
|
307
|
-
"cng" => "Cinematographer",
|
308
|
-
"cnd" => "Conductor",
|
309
|
-
"cns" => "Censor",
|
310
|
-
"coe" => "Contestant -appellee",
|
311
|
-
"col" => "Collector",
|
312
|
-
"com" => "Compiler",
|
313
|
-
"cos" => "Contestant",
|
314
|
-
"cot" => "Contestant -appellant",
|
315
|
-
"cov" => "Cover designer",
|
316
|
-
"cpc" => "Copyright claimant",
|
317
|
-
"cpe" => "Complainant-appellee",
|
318
|
-
"cph" => "Copyright holder",
|
319
|
-
"cpl" => "Complainant",
|
320
|
-
"cpt" => "Complainant-appellant",
|
321
|
-
"cre" => "Creator",
|
322
|
-
"crp" => "Correspondent",
|
323
|
-
"crr" => "Corrector",
|
324
|
-
"csl" => "Consultant",
|
325
|
-
"csp" => "Consultant to a project",
|
326
|
-
"cst" => "Costume designer",
|
327
|
-
"ctb" => "Contributor",
|
328
|
-
"cte" => "Contestee-appellee",
|
329
|
-
"ctg" => "Cartographer",
|
330
|
-
"ctr" => "Contractor",
|
331
|
-
"cts" => "Contestee",
|
332
|
-
"ctt" => "Contestee-appellant",
|
333
|
-
"cur" => "Curator",
|
334
|
-
"cwt" => "Commentator for written text",
|
335
|
-
"dfd" => "Defendant",
|
336
|
-
"dfe" => "Defendant-appellee",
|
337
|
-
"dft" => "Defendant-appellant",
|
338
|
-
"dgg" => "Degree grantor",
|
339
|
-
"dis" => "Dissertant",
|
340
|
-
"dln" => "Delineator",
|
341
|
-
"dnc" => "Dancer",
|
342
|
-
"dnr" => "Donor",
|
343
|
-
"dpc" => "Depicted",
|
344
|
-
"dpt" => "Depositor",
|
345
|
-
"drm" => "Draftsman",
|
346
|
-
"drt" => "Director",
|
347
|
-
"dsr" => "Designer",
|
348
|
-
"dst" => "Distributor",
|
349
|
-
"dtc" => "Data contributor ",
|
350
|
-
"dte" => "Dedicatee",
|
351
|
-
"dtm" => "Data manager ",
|
352
|
-
"dto" => "Dedicator",
|
353
|
-
"dub" => "Dubious author",
|
354
|
-
"edt" => "Editor",
|
355
|
-
"egr" => "Engraver",
|
356
|
-
"elg" => "Electrician ",
|
357
|
-
"elt" => "Electrotyper",
|
358
|
-
"eng" => "Engineer",
|
359
|
-
"etr" => "Etcher",
|
360
|
-
"exp" => "Expert",
|
361
|
-
"fac" => "Facsimilist",
|
362
|
-
"fld" => "Field director ",
|
363
|
-
"flm" => "Film editor",
|
364
|
-
"fmo" => "Former owner",
|
365
|
-
"fpy" => "First party",
|
366
|
-
"fnd" => "Funder",
|
367
|
-
"frg" => "Forger",
|
368
|
-
"gis" => "Geographic information specialist ",
|
369
|
-
"grt" => "Graphic technician",
|
370
|
-
"hnr" => "Honoree",
|
371
|
-
"hst" => "Host",
|
372
|
-
"ill" => "Illustrator",
|
373
|
-
"ilu" => "Illuminator",
|
374
|
-
"ins" => "Inscriber",
|
375
|
-
"inv" => "Inventor",
|
376
|
-
"itr" => "Instrumentalist",
|
377
|
-
"ive" => "Interviewee",
|
378
|
-
"ivr" => "Interviewer",
|
379
|
-
"lbr" => "Laboratory ",
|
380
|
-
"lbt" => "Librettist",
|
381
|
-
"ldr" => "Laboratory director ",
|
382
|
-
"led" => "Lead",
|
383
|
-
"lee" => "Libelee-appellee",
|
384
|
-
"lel" => "Libelee",
|
385
|
-
"len" => "Lender",
|
386
|
-
"let" => "Libelee-appellant",
|
387
|
-
"lgd" => "Lighting designer",
|
388
|
-
"lie" => "Libelant-appellee",
|
389
|
-
"lil" => "Libelant",
|
390
|
-
"lit" => "Libelant-appellant",
|
391
|
-
"lsa" => "Landscape architect",
|
392
|
-
"lse" => "Licensee",
|
393
|
-
"lso" => "Licensor",
|
394
|
-
"ltg" => "Lithographer",
|
395
|
-
"lyr" => "Lyricist",
|
396
|
-
"mcp" => "Music copyist",
|
397
|
-
"mfr" => "Manufacturer",
|
398
|
-
"mdc" => "Metadata contact",
|
399
|
-
"mod" => "Moderator",
|
400
|
-
"mon" => "Monitor",
|
401
|
-
"mrk" => "Markup editor",
|
402
|
-
"msd" => "Musical director",
|
403
|
-
"mte" => "Metal-engraver",
|
404
|
-
"mus" => "Musician",
|
405
|
-
"nrt" => "Narrator",
|
406
|
-
"opn" => "Opponent",
|
407
|
-
"org" => "Originator",
|
408
|
-
"orm" => "Organizer of meeting",
|
409
|
-
"oth" => "Other",
|
410
|
-
"own" => "Owner",
|
411
|
-
"pat" => "Patron",
|
412
|
-
"pbd" => "Publishing director",
|
413
|
-
"pbl" => "Publisher",
|
414
|
-
"pdr" => "Project director",
|
415
|
-
"pfr" => "Proofreader",
|
416
|
-
"pht" => "Photographer",
|
417
|
-
"plt" => "Platemaker",
|
418
|
-
"pma" => "Permitting agency",
|
419
|
-
"pmn" => "Production manager",
|
420
|
-
"pop" => "Printer of plates",
|
421
|
-
"ppm" => "Papermaker",
|
422
|
-
"ppt" => "Puppeteer",
|
423
|
-
"prc" => "Process contact",
|
424
|
-
"prd" => "Production personnel",
|
425
|
-
"prf" => "Performer",
|
426
|
-
"prg" => "Programmer",
|
427
|
-
"prm" => "Printmaker",
|
428
|
-
"pro" => "Producer",
|
429
|
-
"prt" => "Printer",
|
430
|
-
"pta" => "Patent applicant",
|
431
|
-
"pte" => "Plaintiff -appellee",
|
432
|
-
"ptf" => "Plaintiff",
|
433
|
-
"pth" => "Patent holder",
|
434
|
-
"ptt" => "Plaintiff-appellant",
|
435
|
-
"rbr" => "Rubricator",
|
436
|
-
"rce" => "Recording engineer",
|
437
|
-
"rcp" => "Recipient",
|
438
|
-
"red" => "Redactor",
|
439
|
-
"ren" => "Renderer",
|
440
|
-
"res" => "Researcher",
|
441
|
-
"rev" => "Reviewer",
|
442
|
-
"rps" => "Repository",
|
443
|
-
"rpt" => "Reporter",
|
444
|
-
"rpy" => "Responsible party",
|
445
|
-
"rse" => "Respondent-appellee",
|
446
|
-
"rsg" => "Restager",
|
447
|
-
"rsp" => "Respondent",
|
448
|
-
"rst" => "Respondent-appellant",
|
449
|
-
"rth" => "Research team head",
|
450
|
-
"rtm" => "Research team member",
|
451
|
-
"sad" => "Scientific advisor",
|
452
|
-
"sce" => "Scenarist",
|
453
|
-
"scl" => "Sculptor",
|
454
|
-
"scr" => "Scribe",
|
455
|
-
"sds" => "Sound designer",
|
456
|
-
"sec" => "Secretary",
|
457
|
-
"sgn" => "Signer",
|
458
|
-
"sht" => "Supporting host",
|
459
|
-
"sng" => "Singer",
|
460
|
-
"spk" => "Speaker",
|
461
|
-
"spn" => "Sponsor",
|
462
|
-
"spy" => "Second party",
|
463
|
-
"srv" => "Surveyor",
|
464
|
-
"std" => "Set designer",
|
465
|
-
"stl" => "Storyteller",
|
466
|
-
"stm" => "Stage manager",
|
467
|
-
"stn" => "Standards body",
|
468
|
-
"str" => "Stereotyper",
|
469
|
-
"tcd" => "Technical director",
|
470
|
-
"tch" => "Teacher",
|
471
|
-
"ths" => "Thesis advisor",
|
472
|
-
"trc" => "Transcriber",
|
473
|
-
"trl" => "Translator",
|
474
|
-
"tyd" => "Type designer",
|
475
|
-
"tyg" => "Typographer",
|
476
|
-
"vdg" => "Videographer",
|
477
|
-
"voc" => "Vocalist",
|
478
|
-
"wam" => "Writer of accompanying material",
|
479
|
-
"wdc" => "Woodcutter",
|
480
|
-
"wde" => "Wood -engraver",
|
481
|
-
"wit" => "Witness"}
|
482
|
-
end
|
483
|
-
|
484
|
-
def self.valid_child_types
|
485
|
-
["data", "supporting file", "profile", "lorem ipsum", "dolor"]
|
486
|
-
end
|
487
|
-
|
488
|
-
def to_solr(solr_doc=Hash.new)
|
489
|
-
super(solr_doc)
|
490
|
-
solr_doc.merge!(extract_person_full_names)
|
491
|
-
solr_doc.merge!(extract_person_organizations)
|
492
|
-
solr_doc.merge!(:object_type_facet => "Generic content")
|
493
|
-
solr_doc
|
494
|
-
end
|
495
|
-
|
496
|
-
end
|
497
|
-
end
|
498
|
-
end
|