fcrepo_admin 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{HISTORY.rdoc → HISTORY.md} +17 -13
- data/README.md +208 -0
- data/app/controllers/fcrepo_admin/associations_controller.rb +3 -0
- data/fcrepo_admin.gemspec +1 -1
- data/lib/fcrepo_admin/configurable.rb +5 -1
- data/lib/fcrepo_admin/version.rb +1 -1
- metadata +6 -6
- data/README.rdoc +0 -190
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e26f1848c179673df8ef4efefa687c718365bcb
|
4
|
+
data.tar.gz: ba0010feb90c17d3853f647f0f9a0cd1b2ea8e30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a47b722727bc7eb6f4518a425fc050752585b9ec1493901ef7ee84db04a9c7fc9f30d715841180a53aa4163dc7c20d7864f95b9748b337ef8db5e2a881b88f1
|
7
|
+
data.tar.gz: 3c5218ad09ed98edae213f2fa179b7b92f1c09c9c25e106d4f83b2a83b137923318ab35886929dc0c53a42c9834da8703bf010c32ac6bc0cdc3eab3f9e6428f4
|
data/{HISTORY.rdoc → HISTORY.md}
RENAMED
@@ -1,38 +1,42 @@
|
|
1
|
-
|
1
|
+
#### 0.5.3 (2013-05-23)
|
2
|
+
|
3
|
+
* Added configuration setting `associated_object_sort_param` to specify Solr query sort clause for retrieving associated objects. Default is `nil`, meaning that no sort clause is used.
|
4
|
+
|
5
|
+
#### 0.5.2 (2013-05-22)
|
2
6
|
|
3
7
|
* Fixed association show view pagination by working around Kaminari.
|
4
8
|
* Object XML (FOXML) accessible from object context nav.
|
5
9
|
* Catalog show fields and show document actions displayed in object show view (summary).
|
6
10
|
|
7
|
-
|
11
|
+
#### 0.5.1 (2013-05-21)
|
8
12
|
|
9
13
|
* Association show view paginated (Fixes #18).
|
10
14
|
* Association show view uses blacklight document list rendering.
|
11
15
|
* Object show view loads Solr document for object and incorporates Blacklight document show fields.
|
12
16
|
|
13
|
-
|
17
|
+
### 0.5.0 (2013-05-17)
|
14
18
|
|
15
19
|
* Feature: Configurable settings.
|
16
20
|
* Context navigation menus refactored: customizations now done through helpers and configuration settings, not by overriding partials.
|
17
21
|
* ActiveFedora::Base and ActiveFedora::Datastream classes extended by decorators.
|
18
22
|
* Tests added.
|
19
23
|
|
20
|
-
|
24
|
+
#### 0.4.1 (2013-05-14)
|
21
25
|
|
22
26
|
* Feature: Datastream history view.
|
23
27
|
* Feature: Support for asOfDateTime parameter added to datastream read views to display content and profile information for datastream versions.
|
24
28
|
|
25
|
-
|
29
|
+
### 0.4.0 (2013-05-03)
|
26
30
|
|
27
31
|
* Feature: Display object's associations.
|
28
32
|
* Require inclusion of CanCan action aliases in application's Ability class.
|
29
33
|
* Tabbed object show view ("summary") replaced with separate views.
|
30
34
|
|
31
|
-
|
35
|
+
#### 0.3.5 (2013-04-30)
|
32
36
|
|
33
37
|
* Requires active-fedora 6.1.
|
34
38
|
|
35
|
-
|
39
|
+
#### 0.3.4 (2013-04-29)
|
36
40
|
|
37
41
|
* Moved FcrepoAdmin::BlacklightHelperBehavior to FcrepoAdmin::Helpers::BlacklightHelperBehavior.
|
38
42
|
* FcrepoAdmin::ObjectsHelper methods can now be easily overridden.
|
@@ -41,29 +45,29 @@
|
|
41
45
|
* Objects and datastreams controller behaviors are now easily overrideable.
|
42
46
|
* Refactored object and datastream context navs for greater reusability.
|
43
47
|
|
44
|
-
|
48
|
+
#### 0.3.3 (2013-04-25)
|
45
49
|
|
46
50
|
* Audit trail functionality fails gracefully (i.e., if object does not implement ActiveFedora::Auditable)
|
47
51
|
|
48
|
-
|
52
|
+
#### 0.3.2 (2013-04-19)
|
49
53
|
|
50
54
|
* Separated datastream and object context navigation menus.
|
51
55
|
* Added object helpers.
|
52
56
|
|
53
|
-
|
57
|
+
#### 0.3.1 (2013-04-18)
|
54
58
|
|
55
59
|
* Object and datastream context nav menus added.
|
56
60
|
* Audit trail moved into objects controller.
|
57
61
|
|
58
|
-
|
62
|
+
### 0.3.0 (2013-04-16)
|
59
63
|
|
60
64
|
* Feature: Permissions and inherited permissions added to object show view.
|
61
65
|
|
62
|
-
|
66
|
+
### 0.2.0 (2013-04-12)
|
63
67
|
|
64
68
|
* Feature: Datastream content editing.
|
65
69
|
|
66
|
-
|
70
|
+
### 0.1.0 (2013-04-11)
|
67
71
|
|
68
72
|
Initial release to RubyGems.
|
69
73
|
|
data/README.md
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
## Hydra Administrative Tool for a Fedora Repository
|
2
|
+
|
3
|
+
A Rails engine providing an administrative interface to a Fedora Commons repository built on the Hydra project framework.
|
4
|
+
|
5
|
+
### Status
|
6
|
+
|
7
|
+
This project should be considered *experimental*. Versions earlier than 1.0 may change API and/or UI without notice
|
8
|
+
or regard for backward compatibility.
|
9
|
+
|
10
|
+
### Requirements
|
11
|
+
|
12
|
+
fcrepo_admin is designed for installation on hydra-head 6.0 or higher (requires active-fedora 6.1 or higher).
|
13
|
+
See https://github.com/projecthydra/hydra-head/wiki/Installation-Prerequisites.
|
14
|
+
|
15
|
+
### Installation
|
16
|
+
|
17
|
+
**Add to Gemfile**
|
18
|
+
|
19
|
+
```
|
20
|
+
gem 'fcrepo_admin'
|
21
|
+
```
|
22
|
+
|
23
|
+
Then `bundle install`
|
24
|
+
|
25
|
+
**Run the Blacklight and Hydra generators** (if this is a new Rails app, not an existing Hydra head)
|
26
|
+
|
27
|
+
```
|
28
|
+
rails g blacklight --devise
|
29
|
+
rails g hydra:head -f
|
30
|
+
rake db:migrate
|
31
|
+
rails g hydra:jetty # if you need a development copy of jetty with solr and fedora
|
32
|
+
```
|
33
|
+
|
34
|
+
**Mount the engine**
|
35
|
+
|
36
|
+
In `config/routes.rb` add this line:
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
mount FcrepoAdmin::Engine => '/', :as=> 'fcrepo_admin'
|
40
|
+
```
|
41
|
+
|
42
|
+
You may use any mount point. All routes include `objects` as a subpath.
|
43
|
+
|
44
|
+
**Add CanCan action aliases** (fcrepo_admin >= 0.4.0)
|
45
|
+
|
46
|
+
In your Ability class (`app/models/ability.rb`) include the `FcrepoAdmin::Ability` module, for example:
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
class Ability
|
50
|
+
include Hydra::Ability
|
51
|
+
include Hydra::PolicyAwareAbility
|
52
|
+
include FcrepoAdmin::Ability
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
56
|
+
`FcrepoAdmin::Ability` defines action aliases for permissions which are enforced on `ActiveFedora::Base` objects.
|
57
|
+
If your application defines action aliases, please check `FcrepoAdmin::Ability` for conflicts as aliases are global.
|
58
|
+
|
59
|
+
**Customize catalog search results** (optional)
|
60
|
+
|
61
|
+
If you would like catalog search results items to link to the fcrepo_admin object show view
|
62
|
+
instead of the catalog show view, create `app/helpers/blacklight_helper.rb` with this content:
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
module BlacklightHelper
|
66
|
+
include Blacklight::BlacklightHelperBehavior # Default Blacklight behaviors
|
67
|
+
include FcrepoAdmin::Helpers::BlacklightHelperBehavior # fcrepo_admin overrides
|
68
|
+
# additional customizations here, if any
|
69
|
+
end
|
70
|
+
```
|
71
|
+
|
72
|
+
**Add audit trail support** (optional)
|
73
|
+
|
74
|
+
To enable access to the Fedora audit trail data through the fcrepo_admin UI, include the
|
75
|
+
`ActiveFedora::Auditable` mixin in your ActiveFedora models:
|
76
|
+
|
77
|
+
```ruby
|
78
|
+
include ActiveFedora::Auditable
|
79
|
+
```
|
80
|
+
|
81
|
+
### Overriding fcrepo_admin behaviors
|
82
|
+
|
83
|
+
#### Configurable settings (fcrepo_admin >= 0.5.0)
|
84
|
+
|
85
|
+
To override default configurable settings for fcrepo_admin, create an initializer at `config/initializers/fcrepo_admin.rb`.
|
86
|
+
You should start with this content:
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
module YourApp
|
90
|
+
class Application < Rails::Application
|
91
|
+
config.before_initialize do
|
92
|
+
# Customized settings will go here
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
```
|
97
|
+
|
98
|
+
Refer to the default configuration settings at https://github.com/projecthydra/fcrepo-admin/blob/master/lib/fcrepo_admin/configurable.rb.
|
99
|
+
|
100
|
+
All configuration options are set by module methods prefixed by `FcrepoAdmin`, for example:
|
101
|
+
|
102
|
+
```ruby
|
103
|
+
FcrepoAdmin.read_only = true
|
104
|
+
```
|
105
|
+
|
106
|
+
#### Helpers
|
107
|
+
|
108
|
+
Override objects helpers by creating `app/helpers/fcrepo_admin/objects_helper.rb` with this content:
|
109
|
+
|
110
|
+
```ruby
|
111
|
+
module FcrepoAdmin::ObjectsHelper
|
112
|
+
include FcrepoAdmin::Helpers::ObjectsHelperBehavior
|
113
|
+
# override methods here
|
114
|
+
end
|
115
|
+
```
|
116
|
+
|
117
|
+
In particular you may want to override `object_title`.
|
118
|
+
|
119
|
+
Override datastreams helpers by creating `app/helpers/fcrepo_admin/datastreams_helper.rb` with this content:
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
module FcrepoAdmin::DatastreamsHelper
|
123
|
+
include FcrepoAdmin::Helpers::DatastreamsHelperBehavior
|
124
|
+
# override methods here
|
125
|
+
end
|
126
|
+
```
|
127
|
+
|
128
|
+
#### Context Navigation Menus
|
129
|
+
|
130
|
+
##### fcrepo_admin >= 0.5.0
|
131
|
+
|
132
|
+
The configuration settings that control the items on the context menus are:
|
133
|
+
|
134
|
+
```ruby
|
135
|
+
FcrepoAdmin.object_nav_items = [:pid, :summary, :datastreams, :permissions, :associations, :audit_trail, :object_xml]
|
136
|
+
FcrepoAdmin.datastream_nav_items = [:dsid, :version, :current_version, :summary, :content, :download,
|
137
|
+
:edit, :upload, :history]
|
138
|
+
```
|
139
|
+
|
140
|
+
Each setting takes an array of symbols representing the items. You can start by copying the default values shown above.
|
141
|
+
If you simply want to rearrange or remove items, then just modify the default arrays.
|
142
|
+
|
143
|
+
To add a custom navigation item, start by adding your own symbol to the approriate array setting. Then override the
|
144
|
+
appropriate helper method (see section above on overriding fcrepo_admin helpers) -- for object context nav, override
|
145
|
+
`custom_object_nav_item` in `ObjectsHelper`; for datastream context nav, override `custom_datastream_nav_item`
|
146
|
+
in `DatastreamsHelper`.
|
147
|
+
|
148
|
+
Each method takes a single symbol argument and should return either nil (meaning no menu item is to be added) or the
|
149
|
+
*content* of a menu item. Do not include the `<li></li>` wrapper. You may want to use `link_to_unless_current`
|
150
|
+
and/or put a condition on the menu item (i.e., so that `nil` is returned if the condition is not met).
|
151
|
+
|
152
|
+
##### fcrepo_admin < 0.5.0
|
153
|
+
|
154
|
+
The contents of the object context navigation menu can be customized by overriding the `object_context_nav_items`
|
155
|
+
helper method, or by copying and modifying the partial `fcrepo_admin/objects/context_nav_items`.
|
156
|
+
|
157
|
+
The contents of the datastream context navigation menu can be customized by overriding the
|
158
|
+
`datastream_context_nav_items` helper method, or by copying and modifying the partial
|
159
|
+
`fcrepo_admin/datastreams/context_nav_items`.
|
160
|
+
|
161
|
+
#### Controllers
|
162
|
+
|
163
|
+
To override or extend controller behaviors, please consult Rails engine documentation and guides, such as
|
164
|
+
http://edgeguides.rubyonrails.org/engines.html.
|
165
|
+
|
166
|
+
IMPORTANT: If you add a non-RESTful action to a controller, you will probably have to add a CanCan action alias
|
167
|
+
to your Ability class. For this, you can use Hydra's `custom_permissions` callback:
|
168
|
+
|
169
|
+
```ruby
|
170
|
+
class Ability
|
171
|
+
include Hydra::Ability
|
172
|
+
include Hydra::PolicyAwareAbility
|
173
|
+
include FcrepoAdmin::Ability
|
174
|
+
|
175
|
+
def custom_permissions
|
176
|
+
alias_action :my_method, :to => :read
|
177
|
+
end
|
178
|
+
end
|
179
|
+
```
|
180
|
+
|
181
|
+
#### Read-only mode
|
182
|
+
|
183
|
+
To suppress mutating behaviors (i.e, routes, nav items, etc.) regardless of user permissions,
|
184
|
+
add this configuration setting:
|
185
|
+
|
186
|
+
```ruby
|
187
|
+
FcrepoAdmin.read_only = true
|
188
|
+
```
|
189
|
+
|
190
|
+
### Internationalization (i18n)
|
191
|
+
|
192
|
+
An effort has been made to support i18n on headings, menus, etc. See https://github.com/projecthydra/fcrepo-admin/blob/master/config/locales/fcrepo_admin.en.yml
|
193
|
+
for the keys and consult the Rails documentation on how to provide your own translations or alternate text values.
|
194
|
+
|
195
|
+
### Contributing
|
196
|
+
|
197
|
+
* Consider first posting to hydra-tech@googlegroups.com with a question or bug report, or submit an issue
|
198
|
+
to the Github issue tracker at https://github.com/projecthydra/fcrepo-admin/issues.
|
199
|
+
* Fork the git repository, create a feature branch, make your changes, and submit a pull request.
|
200
|
+
It is preferable for all changes to be made in one commit, if possible.
|
201
|
+
|
202
|
+
Thanks!
|
203
|
+
|
204
|
+
### License
|
205
|
+
|
206
|
+
See the LICENSE file in the root directory of the project for copyright and license information.
|
207
|
+
|
208
|
+
Licenses for code copied from other projects will be included in source files as required.
|
@@ -44,6 +44,9 @@ module FcrepoAdmin
|
|
44
44
|
rows = FcrepoAdmin.associated_objects_per_page
|
45
45
|
start = (page - 1) * rows
|
46
46
|
args = {raw: true, start: start, rows: rows}
|
47
|
+
if FcrepoAdmin.associated_objects_sort_param
|
48
|
+
args[:sort] = FcrepoAdmin.associated_objects_sort_param
|
49
|
+
end
|
47
50
|
apply_gated_discovery(args, nil) # add args to enforce Hydra access controls
|
48
51
|
args
|
49
52
|
end
|
data/fcrepo_admin.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.files = `git ls-files`.split("\n")
|
21
21
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
22
22
|
|
23
|
-
s.extra_rdoc_files = ["LICENSE", "README.
|
23
|
+
s.extra_rdoc_files = ["LICENSE", "README.md", "HISTORY.md"]
|
24
24
|
|
25
25
|
s.require_paths = ["lib"]
|
26
26
|
|
@@ -47,9 +47,13 @@ module FcrepoAdmin::Configurable
|
|
47
47
|
mattr_accessor :object_properties
|
48
48
|
self.object_properties = [:label, :state, :create_date, :modified_date, :owner_id]
|
49
49
|
|
50
|
-
# Number of objects to display per page on
|
50
|
+
# Number of objects to display per page on associations show view
|
51
51
|
mattr_accessor :associated_objects_per_page
|
52
52
|
self.associated_objects_per_page = 10
|
53
|
+
|
54
|
+
# Solr sort param added to association collection query
|
55
|
+
mattr_accessor :associated_objects_sort_param
|
56
|
+
self.associated_objects_sort_param = nil
|
53
57
|
end
|
54
58
|
|
55
59
|
end
|
data/lib/fcrepo_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fcrepo_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chandek-Stark
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-05-
|
14
|
+
date: 2013-05-23 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: hydra-head
|
@@ -231,15 +231,15 @@ executables: []
|
|
231
231
|
extensions: []
|
232
232
|
extra_rdoc_files:
|
233
233
|
- LICENSE
|
234
|
-
- README.
|
235
|
-
- HISTORY.
|
234
|
+
- README.md
|
235
|
+
- HISTORY.md
|
236
236
|
files:
|
237
237
|
- .gitignore
|
238
238
|
- .rspec
|
239
239
|
- Gemfile
|
240
|
-
- HISTORY.
|
240
|
+
- HISTORY.md
|
241
241
|
- LICENSE
|
242
|
-
- README.
|
242
|
+
- README.md
|
243
243
|
- Rakefile
|
244
244
|
- app/controllers/fcrepo_admin/associations_controller.rb
|
245
245
|
- app/controllers/fcrepo_admin/datastreams_controller.rb
|
data/README.rdoc
DELETED
@@ -1,190 +0,0 @@
|
|
1
|
-
== Hydra Administrative Tool for a Fedora Repository
|
2
|
-
|
3
|
-
A Rails engine providing an administrative interface to a Fedora Commons repository built on the Hydra project framework.
|
4
|
-
|
5
|
-
=== Status
|
6
|
-
|
7
|
-
This project should be considered *experimental*. Versions earlier than 1.0 may change API and/or UI without notice
|
8
|
-
or regard for backward compatibility.
|
9
|
-
|
10
|
-
=== Requirements
|
11
|
-
|
12
|
-
fcrepo_admin is designed for installation on hydra-head 6.0 or higher (requires active-fedora 6.1 or higher).
|
13
|
-
See https://github.com/projecthydra/hydra-head/wiki/Installation-Prerequisites.
|
14
|
-
|
15
|
-
=== Installation
|
16
|
-
|
17
|
-
(In the future, we hope to automate some of these tasks with a generator.)
|
18
|
-
|
19
|
-
* Add to gemfile
|
20
|
-
|
21
|
-
gem 'fcrepo_admin'
|
22
|
-
|
23
|
-
Then <code>bundle install</code>
|
24
|
-
|
25
|
-
* Run the Blacklight and Hydra generators (if this is a new Rails app, not an existing Hydra head)
|
26
|
-
|
27
|
-
rails g blacklight --devise
|
28
|
-
rails g hydra:head -f
|
29
|
-
rake db:migrate
|
30
|
-
rails g hydra:jetty # if you need a development copy of jetty with solr and fedora
|
31
|
-
|
32
|
-
* Mount the engine
|
33
|
-
|
34
|
-
In config/routes.rb add this line:
|
35
|
-
|
36
|
-
mount FcrepoAdmin::Engine => '/', :as=> 'fcrepo_admin'
|
37
|
-
|
38
|
-
You may use any mount point (except perhaps <code>'/catalog'</code>).
|
39
|
-
All routes include <code>objects</code> as a subpath.
|
40
|
-
|
41
|
-
* Add CanCan action aliases (fcrepo_admin >= 0.4.0)
|
42
|
-
|
43
|
-
In your Ability class (app/models/ability.rb) include the FcrepoAdmin::Ability module, for example:
|
44
|
-
|
45
|
-
class Ability
|
46
|
-
include Hydra::Ability
|
47
|
-
include Hydra::PolicyAwareAbility
|
48
|
-
include FcrepoAdmin::Ability
|
49
|
-
end
|
50
|
-
|
51
|
-
FcrepoAdmin::Ability defines action aliases for permissions which are enforced on (ActiveFedora::Base) objects.
|
52
|
-
If your application defines action aliases, please check FcrepoAdmin::Ability for conflicts as aliases are global.
|
53
|
-
|
54
|
-
* Add Javascript (fcrepo_admin < 0.4.0)
|
55
|
-
|
56
|
-
In app/assets/javascripts/application.js add:
|
57
|
-
|
58
|
-
//= require bootstrap-tab
|
59
|
-
|
60
|
-
* Customize catalog search results (optional)
|
61
|
-
|
62
|
-
If you would like catalog search results items to link to the fcrepo_admin object show view
|
63
|
-
instead of the catalog show view, create app/helpers/blacklight_helper.rb with this content:
|
64
|
-
|
65
|
-
module BlacklightHelper
|
66
|
-
include Blacklight::BlacklightHelperBehavior # Default Blacklight behaviors
|
67
|
-
include FcrepoAdmin::Helpers::BlacklightHelperBehavior # fcrepo_admin overrides
|
68
|
-
# additional customizations here, if any
|
69
|
-
end
|
70
|
-
|
71
|
-
* Add audit trail support (optional)
|
72
|
-
|
73
|
-
To enable access to the Fedora audit trail data through the fcrepo_admin UI, include the
|
74
|
-
ActiveFedora::Auditable mixin in your ActiveFedora models:
|
75
|
-
|
76
|
-
include ActiveFedora::Auditable
|
77
|
-
|
78
|
-
=== Overriding fcrepo_admin behaviors
|
79
|
-
|
80
|
-
==== Configurable settings (fcrepo_admin >= 0.5.0)
|
81
|
-
|
82
|
-
To override default configurable settings for fcrepo_admin, create an initializer at config/initializers/fcrepo_admin.rb.
|
83
|
-
You should start with this content:
|
84
|
-
|
85
|
-
module YourApp
|
86
|
-
class Application < Rails::Application
|
87
|
-
config.before_initialize do
|
88
|
-
# Customized settings will go here
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
Refer to the default configuration settings at https://github.com/projecthydra/fcrepo-admin/blob/master/lib/fcrepo_admin/configurable.rb.
|
94
|
-
|
95
|
-
All configuration options are set by module methods prefixed by FcrepoAdmin, for example:
|
96
|
-
|
97
|
-
FcrepoAdmin.read_only = true
|
98
|
-
|
99
|
-
==== Helpers
|
100
|
-
|
101
|
-
Override objects helpers by creating app/helpers/fcrepo_admin/objects_helper.rb with this content:
|
102
|
-
|
103
|
-
module FcrepoAdmin::ObjectsHelper
|
104
|
-
include FcrepoAdmin::Helpers::ObjectsHelperBehavior
|
105
|
-
# override methods here
|
106
|
-
end
|
107
|
-
|
108
|
-
In particular you may want to override #object_title.
|
109
|
-
|
110
|
-
Override datastreams helpers by creating app/helpers/fcrepo_admin/datastreams_helper.rb with this content:
|
111
|
-
|
112
|
-
module FcrepoAdmin::DatastreamsHelper
|
113
|
-
include FcrepoAdmin::Helpers::DatastreamsHelperBehavior
|
114
|
-
# override methods here
|
115
|
-
end
|
116
|
-
|
117
|
-
==== Context Navigation Menus
|
118
|
-
|
119
|
-
===== fcrepo_admin >= 0.5.0
|
120
|
-
|
121
|
-
The configuration settings that control the items on the context menus are:
|
122
|
-
|
123
|
-
FcrepoAdmin.object_nav_items = [:pid, :summary, :datastreams, :permissions, :associations, :audit_trail, :object_xml]
|
124
|
-
FcrepoAdmin.datastream_nav_items = [:dsid, :version, :current_version, :summary, :content, :download, :edit, :upload, :history]
|
125
|
-
|
126
|
-
Each setting takes an array of symbols representing the items. You can start by copying the default values shown above.
|
127
|
-
If you simply want to rearrange or remove items, then just modify the default arrays.
|
128
|
-
|
129
|
-
To add a custom navigation item, start by adding your own symbol to the approriate array setting. Then override the
|
130
|
-
appropriate helper method (see section above on overriding fcrepo_admin helpers) -- for object context nav, override
|
131
|
-
#custom_object_nav_item in ObjectsHelper; for datastream context nav, override #custom_datastream_nav_item
|
132
|
-
in DatastreamsHelper.
|
133
|
-
|
134
|
-
Each method takes a single symbol argument and should return either nil (meaning no menu item is to be added) or the *content*
|
135
|
-
of a menu item. Do not include the <li></li> wrapper. You may want to use link_to_unless_current and/or put a condition on
|
136
|
-
the menu item (i.e., so that nil is returned if the condition is not met).
|
137
|
-
|
138
|
-
===== fcrepo_admin < 0.5.0
|
139
|
-
|
140
|
-
The contents of the object context navigation menu can be customized by overriding the #object_context_nav_items
|
141
|
-
helper method, or by copying and modifying the partial fcrepo_admin/objects/context_nav_items.
|
142
|
-
|
143
|
-
The contents of the datastream context navigation menu can be customized by overriding the
|
144
|
-
#datastream_context_nav_items helper method, or by copying and modifying the partial fcrepo_admin/datastreams/context_nav_items.
|
145
|
-
|
146
|
-
==== Controllers
|
147
|
-
|
148
|
-
To override or extend controller behaviors, please consult Rails engine documentation and guides, such as
|
149
|
-
http://edgeguides.rubyonrails.org/engines.html.
|
150
|
-
|
151
|
-
IMPORTANT: If you add a non-RESTful action to a controller, you will probably have to add a CanCan action alias
|
152
|
-
to your Ability class. For this, you can use Hydra's #custom_permissions callback:
|
153
|
-
|
154
|
-
class Ability
|
155
|
-
include Hydra::Ability
|
156
|
-
include Hydra::PolicyAwareAbility
|
157
|
-
include FcrepoAdmin::Ability
|
158
|
-
|
159
|
-
def custom_permissions
|
160
|
-
alias_action :my_method, :to => :read
|
161
|
-
end
|
162
|
-
|
163
|
-
end
|
164
|
-
|
165
|
-
==== Read-only mode
|
166
|
-
|
167
|
-
To suppress mutating behaviors (i.e, routes, nav items, etc.) regardless of user permissions,
|
168
|
-
add this configuration setting:
|
169
|
-
|
170
|
-
FcrepoAdmin.read_only = true
|
171
|
-
|
172
|
-
=== Internationalization (i18n)
|
173
|
-
|
174
|
-
An effort has been made to support i18n on headings, menus, etc. See https://github.com/projecthydra/fcrepo-admin/blob/master/config/locales/fcrepo_admin.en.yml
|
175
|
-
for the keys and consult the Rails documentation on how to provide your own translations or alternate text values.
|
176
|
-
|
177
|
-
=== Contributing
|
178
|
-
|
179
|
-
* Consider first posting to hydra-tech@googlegroups.com with a question or bug report, or submit an issue
|
180
|
-
to the Github issue tracker at https://github.com/projecthydra/fcrepo-admin/issues.
|
181
|
-
* Fork the git repository, create a feature branch, make your changes, and submit a pull request.
|
182
|
-
It is preferable for all changes to be made in one commit, if possible.
|
183
|
-
|
184
|
-
Thanks!
|
185
|
-
|
186
|
-
=== License
|
187
|
-
|
188
|
-
See the LICENSE file in the root directory of the project for copyright and license information.
|
189
|
-
|
190
|
-
Licenses for code copied from other projects will be included in source files as required.
|