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
data/.gitignore
CHANGED
data/HISTORY.textile
CHANGED
@@ -1,8 +1,23 @@
|
|
1
1
|
h3. 4.1.0
|
2
|
-
*
|
2
|
+
* Add AccessControlsEnforcement to AssetsController
|
3
|
+
* Upgrade to active fedora ~>4.1
|
3
4
|
* Upgrade to solrizer-fedora 2.1.0
|
4
|
-
* Upgrade to blacklight 3.4
|
5
|
+
* Upgrade to blacklight ~> 3.4
|
5
6
|
* Improved access controls api
|
7
|
+
* HYDRA-817 allow overriding of where we redirect_to, so that nested routes will work
|
8
|
+
* Extracted hydra-mods and hydra-access-controls
|
9
|
+
* Deprecation fest in preparation for 5.0
|
10
|
+
* HYDRA-822 Move GlobalConfig into Hydra. It was removed from Blacklight.
|
11
|
+
* HYDRA-831 apply_depositor_metadata should not overwrite existing user permissions
|
12
|
+
* HYDRA-832 depositor should apply depositor metadata if the properties datastream exists
|
13
|
+
* Fix up layout to better match blacklight.
|
14
|
+
|
15
|
+
Note about deprecations: We encourage the implementer to create their own controllers
|
16
|
+
for CRUD operations and use standard Rails forms rather than using the AssetsController
|
17
|
+
and the AssetsControllerHelpers. In the 5.0 series these capabilites will be removed from
|
18
|
+
HydraHead. If you want to continue using these modules, you should copy the appropriate
|
19
|
+
files from this release into your local Hydra application. Further simplified examples
|
20
|
+
of this approach will be forthcoming. Until then, scholarsphere is a great exemplar.
|
6
21
|
|
7
22
|
h3. 4.0.0
|
8
23
|
* Upgrade to active fedora 4.0.0
|
@@ -1,30 +1,11 @@
|
|
1
|
-
/* This is the CSS that Jessie is creating to put some CSS tweaks necessary to get the app looking like Blacklight again
|
2
|
-
I fully expect this CSS to either be moved to a more appropriate name or removed all together */
|
3
1
|
|
4
|
-
#documents table {
|
5
|
-
width:100%;
|
6
|
-
}
|
7
|
-
|
8
|
-
|
9
|
-
/* The hydra provided search button was miss-aligned w/ the form field */
|
10
|
-
#search .submit {
|
11
|
-
margin-bottom:-12px;
|
12
|
-
}
|
13
|
-
|
14
|
-
/* Record view next/previous links */
|
15
|
-
#previousNextDocument {
|
16
|
-
text-align:center;
|
17
|
-
}
|
18
|
-
#previousNextDocument .previous {
|
19
|
-
float:left;
|
20
|
-
}
|
21
|
-
|
22
|
-
/* JFG: to be sorted */
|
23
2
|
|
24
3
|
/* =HEADER
|
25
4
|
-------------------------------------------------------------- */
|
26
5
|
|
27
|
-
#
|
6
|
+
#hd { overflow: visible; margin-bottom: 2em; }
|
7
|
+
|
8
|
+
#hd #user_util_links { width: 75%; }
|
28
9
|
|
29
10
|
#select-item-box {background: url('/assets/hydra/search-button.png') no-repeat scroll 95% 5px #f5f5f5; border: 1px solid #BBB; float: left; line-height: 20px; margin-top: -3px; padding: 2px 6px; position: relative; text-align: left; width: 170px; z-index: 300; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
|
30
11
|
#select-item-box > a {border-bottom: none; vertical-align: text-bottom;}
|
@@ -38,14 +19,6 @@
|
|
38
19
|
/* =SEARCH
|
39
20
|
-------------------------------------------------------------- */
|
40
21
|
|
41
|
-
#doc4 #bd { font-size: 13px;}
|
42
|
-
#bd #search {background-color: #EEE; padding: 12px 20px; background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #DDD), color-stop(1, #EEE));
|
43
|
-
background-image: -moz-linear-gradient(center bottom, #DDD 0%, #EEE 100%); }
|
44
|
-
#bd .home-text #search { -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px;}
|
45
|
-
#bd #search #q {margin: 0 15px 0 0; padding: 0.2em; width: 420px;}
|
46
|
-
#bd #search .submit {background: #f3f3f3; border: 1px solid #AAA; font-size: 16px; margin: 0; padding: 4px 6px; width: 75px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
|
47
|
-
#bd #search .submit:hover {background: #f7f7f7; cursor: pointer;}
|
48
|
-
|
49
22
|
/* =RESULTS
|
50
23
|
-------------------------------------------------------------- */
|
51
24
|
|
@@ -1,42 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
}
|
5
|
-
|
6
|
-
html, body {
|
7
|
-
height: 100%;
|
8
|
-
width: 100%;
|
9
|
-
margin: 0;
|
10
|
-
padding: 0;
|
11
|
-
}
|
12
|
-
|
13
|
-
body {
|
14
|
-
background: #fff;
|
15
|
-
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
|
16
|
-
font-size: 13px;
|
17
|
-
color: #121212;
|
18
|
-
}
|
19
|
-
|
20
|
-
#document h1 {
|
21
|
-
display: none;
|
22
|
-
}
|
23
|
-
|
24
|
-
body td, body ul, body p, body ol {
|
25
|
-
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
|
26
|
-
}
|
27
|
-
|
28
|
-
|
29
|
-
#hd ul {
|
30
|
-
margin: 5px;
|
31
|
-
padding: 5px;
|
32
|
-
}
|
1
|
+
/*
|
2
|
+
*= require 'hydra/html_refactor'
|
3
|
+
*/
|
33
4
|
|
34
|
-
#
|
35
|
-
|
36
|
-
display: inline;
|
37
|
-
color: blue;
|
38
|
-
cursor: pointer;
|
39
|
-
margin-left: 10px;
|
5
|
+
#page {
|
6
|
+
width: 1020px;
|
40
7
|
}
|
41
8
|
|
42
9
|
button.ui-button-icon-only {
|
@@ -99,17 +66,11 @@ button.ui-button-icon-only {
|
|
99
66
|
font-style: normal;
|
100
67
|
}
|
101
68
|
|
102
|
-
a:link, a:visited, a:active, #uvalicense_read_all {
|
103
|
-
color: blue;
|
104
|
-
text-decoration: underline;
|
105
|
-
border: none;
|
106
|
-
}
|
107
|
-
|
108
69
|
.editable-text:hover, .textile-text .text:hover {
|
109
70
|
color: #E7C584 !important;
|
110
71
|
}
|
111
72
|
|
112
|
-
a:hover
|
73
|
+
a:hover.addval, #uvalicense_read_all:hover {
|
113
74
|
color: blue
|
114
75
|
}
|
115
76
|
|
@@ -127,20 +88,10 @@ a.destructive:hover {
|
|
127
88
|
width: 40px;
|
128
89
|
}
|
129
90
|
|
130
|
-
h2 {
|
131
|
-
font-weight: bold;
|
132
|
-
text-transform: uppercase;
|
133
|
-
margin-top: 30px;
|
134
|
-
}
|
135
|
-
|
136
91
|
th {
|
137
92
|
font-weight: bold;
|
138
93
|
}
|
139
94
|
|
140
|
-
h3 {
|
141
|
-
margin-left: 20px;
|
142
|
-
}
|
143
|
-
|
144
95
|
dl dd {
|
145
96
|
margin-left: 0;
|
146
97
|
}
|
@@ -211,11 +162,6 @@ table#file_assets {
|
|
211
162
|
color: #E7C584;
|
212
163
|
}
|
213
164
|
|
214
|
-
#hd {
|
215
|
-
overflow: visible; /* override blacklight */
|
216
|
-
}
|
217
|
-
|
218
|
-
|
219
165
|
#submitForRelease {
|
220
166
|
background: #DFEFFC;
|
221
167
|
color: #336;
|
@@ -407,10 +353,6 @@ tr.document {
|
|
407
353
|
margin: 0;
|
408
354
|
}
|
409
355
|
|
410
|
-
#results {
|
411
|
-
border: 1px solid #C8C8C8;
|
412
|
-
}
|
413
|
-
|
414
356
|
.document_show #cover_container h1 {
|
415
357
|
margin-bottom: 0;
|
416
358
|
padding-bottom: 0;
|
@@ -1,3 +1,12 @@
|
|
1
|
+
require 'deprecation'
|
1
2
|
class Hydra::AssetsController < ApplicationController
|
2
|
-
|
3
|
+
extend Deprecation
|
4
|
+
|
5
|
+
self.deprecation_horizon = 'hydra-head 5.x'
|
6
|
+
include Hydra::Controller::AssetsControllerBehavior
|
7
|
+
|
8
|
+
def initialize *args
|
9
|
+
Deprecation.warn(Hydra::AssetsController, "Hydra::AssetsController is deprecated and will be removed from #{self.class.deprecation_horizon}")
|
10
|
+
super
|
11
|
+
end
|
3
12
|
end
|
@@ -1,9 +1,18 @@
|
|
1
|
+
require 'deprecation'
|
1
2
|
class Hydra::ContributorsController < ApplicationController
|
2
|
-
|
3
|
+
extend Deprecation
|
4
|
+
|
5
|
+
self.deprecation_horizon = 'hydra-head 5.x'
|
6
|
+
include Hydra::Controller::RepositoryControllerBehavior
|
3
7
|
include Hydra::AssetsControllerHelper
|
4
8
|
include Hydra::SubmissionWorkflow
|
5
9
|
|
6
10
|
before_filter :load_document, :only => :update
|
11
|
+
|
12
|
+
def initialize *args
|
13
|
+
Deprecation.warn(Hydra::ContributorsController, "Hydra::ContributorsController is deprecated and will be removed from #{self.class.deprecation_horizon}")
|
14
|
+
super
|
15
|
+
end
|
7
16
|
|
8
17
|
# Display form for adding a new Contributor
|
9
18
|
# If contributor_type is provided, renders the appropriate "new" form
|
@@ -22,6 +31,7 @@ class Hydra::ContributorsController < ApplicationController
|
|
22
31
|
format.inline { render :partial=>"contributors/new", :layout=>false }
|
23
32
|
end
|
24
33
|
end
|
34
|
+
deprecation_deprecate :new
|
25
35
|
|
26
36
|
def create
|
27
37
|
@document_fedora = load_document_from_id(params[:asset_id])
|
@@ -38,6 +48,7 @@ class Hydra::ContributorsController < ApplicationController
|
|
38
48
|
end
|
39
49
|
|
40
50
|
end
|
51
|
+
deprecation_deprecate :create
|
41
52
|
|
42
53
|
# Not sure how the #create method was intended to work, but this seems like it works and takes a hybrid approach to how the contributors were handled between this and the AssetsController work.
|
43
54
|
def update
|
@@ -55,6 +66,7 @@ class Hydra::ContributorsController < ApplicationController
|
|
55
66
|
redirect_to next_step(params[:asset_id])
|
56
67
|
end
|
57
68
|
end
|
69
|
+
deprecation_deprecate :update
|
58
70
|
|
59
71
|
def destroy
|
60
72
|
af_model = retrieve_af_model(params[:content_type], :default=>ModsAsset)
|
@@ -67,6 +79,7 @@ class Hydra::ContributorsController < ApplicationController
|
|
67
79
|
redirect_to edit_catalog_path(params[:asset_id], :wf_step => :contributor)
|
68
80
|
end
|
69
81
|
end
|
82
|
+
deprecation_deprecate :destroy
|
70
83
|
|
71
84
|
protected
|
72
85
|
|
@@ -87,6 +100,7 @@ class Hydra::ContributorsController < ApplicationController
|
|
87
100
|
end
|
88
101
|
return true
|
89
102
|
end
|
103
|
+
deprecation_deprecate :mods_assets_update_validation
|
90
104
|
|
91
105
|
private
|
92
106
|
|
@@ -1,4 +1,13 @@
|
|
1
|
+
require 'deprecation'
|
1
2
|
class Hydra::PermissionsController < ApplicationController
|
3
|
+
extend Deprecation
|
4
|
+
self.deprecation_horizon = 'hydra-head 5.x'
|
5
|
+
|
6
|
+
def initialize *args
|
7
|
+
Deprecation.warn(Hydra::PermissionsController, "Hydra::PermissionsController is deprecated and will be removed from #{self.class.deprecation_horizon}")
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
2
11
|
include Hydra::AssetsControllerHelper
|
3
12
|
include Hydra::SubmissionWorkflow
|
4
13
|
|
@@ -10,6 +19,7 @@ class Hydra::PermissionsController < ApplicationController
|
|
10
19
|
format.inline { render :partial=>"hydra/permissions/index", :format=>"html" }
|
11
20
|
end
|
12
21
|
end
|
22
|
+
deprecation_deprecate :index
|
13
23
|
|
14
24
|
def new
|
15
25
|
respond_to do |format|
|
@@ -17,6 +27,7 @@ class Hydra::PermissionsController < ApplicationController
|
|
17
27
|
format.inline { render :partial=>"hydra/permissions/new" }
|
18
28
|
end
|
19
29
|
end
|
30
|
+
deprecation_deprecate :new
|
20
31
|
|
21
32
|
def edit
|
22
33
|
@document_fedora=ActiveFedora::Base.find(params[:asset_id], :cast=>true)
|
@@ -26,6 +37,7 @@ class Hydra::PermissionsController < ApplicationController
|
|
26
37
|
format.inline {render :action=>"edit", :layout=>false}
|
27
38
|
end
|
28
39
|
end
|
40
|
+
deprecation_deprecate :edit
|
29
41
|
|
30
42
|
# Create a new permissions entry
|
31
43
|
# expects permission["actor_id"], permission["actor_type"] and permission["access_level"] as params. ie. :permission=>{"actor_id"=>"_person_id_","actor_type"=>"person","access_level"=>"read"}
|
@@ -55,6 +67,7 @@ class Hydra::PermissionsController < ApplicationController
|
|
55
67
|
end
|
56
68
|
|
57
69
|
end
|
70
|
+
deprecation_deprecate :create
|
58
71
|
|
59
72
|
# Updates the permissions for all actors in a hash. Can specify as many groups and persons as you want
|
60
73
|
# ie. :permission => {"group"=>{"group1"=>"discover","group2"=>"edit"}, {"person"=>{"person1"=>"read"}}}
|
@@ -96,5 +109,6 @@ class Hydra::PermissionsController < ApplicationController
|
|
96
109
|
end
|
97
110
|
|
98
111
|
end
|
112
|
+
deprecation_deprecate :update
|
99
113
|
|
100
114
|
end
|
@@ -1,15 +1,20 @@
|
|
1
1
|
# This was CatalogHelper in the rails2 version of hydra-head
|
2
|
+
require 'deprecation'
|
2
3
|
module Hydra
|
3
4
|
module ArticleMetadataHelperBehavior
|
5
|
+
extend Deprecation
|
6
|
+
self.deprecation_horizon = 'hydra-head 5.x'
|
4
7
|
|
5
8
|
def format_date date
|
6
9
|
date.strftime("%b. %e, %Y")
|
7
10
|
end
|
8
|
-
|
11
|
+
deprecation_deprecate :format_date
|
9
12
|
|
10
13
|
def depositor_string depositor=nil
|
11
14
|
"#{depositor}" unless depositor.nil?
|
12
15
|
end
|
16
|
+
deprecation_deprecate :depositor_string
|
17
|
+
|
13
18
|
def get_children pid
|
14
19
|
par = solr_facet_params(:is_part_of_s)
|
15
20
|
query="_query_:\"{!dismax qf=$qf_dismax pf=$pf_dismax}is_part_of_s:info\\:fedora/#{pid.gsub(":",'\:')}\""
|
@@ -18,14 +23,17 @@ module Hydra
|
|
18
23
|
(response, document_list) = get_search_results( :q=>query )
|
19
24
|
par.inspect
|
20
25
|
end
|
26
|
+
deprecation_deprecate :get_children
|
21
27
|
|
22
28
|
def author_list(doc)
|
23
29
|
get_persons_from_roles(doc,['author','collaborator','creator','contributor']).map {|person| format_person_string(person[:first],person[:last],person[:institution])}
|
24
30
|
end
|
31
|
+
deprecation_deprecate :author_list
|
25
32
|
|
26
33
|
def researcher_list(doc)
|
27
34
|
get_persons_from_roles(doc,['research team head']).map {|person| format_person_string(person[:first],person[:last],person[:institution])}
|
28
35
|
end
|
36
|
+
deprecation_deprecate :researcher_list
|
29
37
|
|
30
38
|
def get_persons_from_roles(doc,roles,opts={})
|
31
39
|
i = 0
|
@@ -40,12 +48,14 @@ module Hydra
|
|
40
48
|
end
|
41
49
|
return persons
|
42
50
|
end
|
51
|
+
deprecation_deprecate :get_persons_from_roles
|
43
52
|
|
44
53
|
def format_person_string first_name, last_name, affiliation, opt={}
|
45
54
|
full_name = [first_name, last_name].join(" ").strip
|
46
55
|
affiliation = affiliation.nil? ? "" : "(#{affiliation})"
|
47
56
|
[full_name, affiliation].join(" ").concat(";")
|
48
57
|
end
|
58
|
+
deprecation_deprecate :format_person_string
|
49
59
|
|
50
60
|
def journal_info(doc)
|
51
61
|
title = doc.get(:journal_title_info_main_title_t)
|
@@ -58,6 +68,7 @@ module Hydra
|
|
58
68
|
journal_info = "" if journal_info.match(/^\.\s+;\s+\(\s+\)\:\s+-\s*$/)
|
59
69
|
journal_info
|
60
70
|
end
|
71
|
+
deprecation_deprecate :journal_info
|
61
72
|
|
62
73
|
def short_abstract(doc,max=250)
|
63
74
|
abstract = doc.get(:abstract_t)
|
@@ -69,6 +80,7 @@ module Hydra
|
|
69
80
|
return abstract[0..max].strip.concat("...")
|
70
81
|
end
|
71
82
|
end
|
83
|
+
deprecation_deprecate :short_abstract
|
72
84
|
|
73
85
|
def admin_info(doc)
|
74
86
|
info =<<-EOS
|
@@ -77,6 +89,7 @@ module Hydra
|
|
77
89
|
| Status: Created
|
78
90
|
EOS
|
79
91
|
end
|
92
|
+
deprecation_deprecate :admin_info
|
80
93
|
|
81
94
|
end
|
82
95
|
end
|
@@ -1,5 +1,10 @@
|
|
1
|
+
require 'deprecation'
|
2
|
+
|
1
3
|
module Hydra
|
2
4
|
module DownloadsHelperBehavior
|
5
|
+
extend Deprecation
|
6
|
+
|
7
|
+
self.deprecation_horizon = 'hydra-head 5.x'
|
3
8
|
|
4
9
|
def list_downloadables( datastreams, mime_types=["application/pdf"])
|
5
10
|
result = "<ul>"
|
@@ -13,6 +18,7 @@ module Hydra
|
|
13
18
|
result << "</ul>"
|
14
19
|
return result
|
15
20
|
end
|
21
|
+
deprecation_deprecate :list_downloadables
|
16
22
|
|
17
23
|
end
|
18
24
|
end
|
@@ -1,14 +1,21 @@
|
|
1
|
+
# WILL BE REMOVED IN HYDRA-HEAD 5.x
|
2
|
+
require 'deprecation'
|
1
3
|
module Hydra
|
2
4
|
module FacetsHelperBehavior
|
3
5
|
include Blacklight::FacetsHelperBehavior
|
6
|
+
extend Deprecation
|
7
|
+
self.deprecation_horizon = 'hydra-head 5.x'
|
8
|
+
|
4
9
|
|
5
10
|
# Removing the [remove] link and label class from the default selected facet display
|
11
|
+
# NOT DEPRECATED BECAUSE THIS IS AN OVERRIDE OF A BLACKLIGHT METHOD
|
6
12
|
def render_selected_facet_value(facet_solr_field, item)
|
7
13
|
content_tag(:span, render_facet_value(facet_solr_field, item, :suppress_link => true), :class => "selected")
|
8
14
|
end
|
9
15
|
|
10
16
|
# Override to remove the label class (easier integration with bootstrap)
|
11
17
|
# and handles arrays
|
18
|
+
# NOT DEPRECATED BECAUSE THIS IS AN OVERRIDE OF A BLACKLIGHT METHOD
|
12
19
|
def render_facet_value(facet_solr_field, item, options ={})
|
13
20
|
if item.is_a? Array
|
14
21
|
render_array_facet_value(facet_solr_field, item, options)
|