== Hydra Administrative Tool for a Fedora Repository
A Rails engine providing an administrative interface to a Fedora Commons repository built on the Hydra project framework.
=== Status
This project should be considered *experimental* and not ready for production deployment.
Versions earlier than 1.0 may change API and/or UI without notice or regard for backward compatibility.
=== Requirements
fcrepo_admin is designed for installation on hydra-head 6.0 or higher (requires active-fedora 6.1 or higher).
See https://github.com/projecthydra/hydra-head/wiki/Installation-Prerequisites.
=== Installation
(In the future, we hope to automate some of these tasks with a generator.)
* Add to gemfile
gem 'fcrepo_admin'
Then bundle install
* Run the Blacklight and Hydra generators (if this is a new Rails app, not an existing Hydra head)
rails g blacklight --devise
rails g hydra:head -f
rake db:migrate
rails g hydra:jetty # if you need a development copy of jetty with solr and fedora
* Mount the engine
In config/routes.rb add this line:
mount FcrepoAdmin::Engine => '/admin', :as=> 'fcrepo_admin'
You may replace '/admin'
with any mount point (except perhaps '/catalog'
),
including '/'
. All routes include objects
as a subpath.
* Add Javascript
In app/assets/javascripts/application.js add this line:
//= require bootstrap-tab
* Customize catalog search results (optional)
If you would like catalog search results items to link to the fcrepo_admin object show view
instead of the catalog show view, create app/helpers/blacklight_helper.rb with this content:
module BlacklightHelper
include Blacklight::BlacklightHelperBehavior # Default Blacklight behaviors
include FcrepoAdmin::Helpers::BlacklightHelperBehavior # fcrepo_admin overrides
end
* Add audit trail support (optional)
To enable access to the Fedora audit trail data through the fcrepo_admin UI, add your ActiveFedora models:
include ActiveFedora::Auditable
=== Overriding fcrepo_admin behaviors
* Object views
Create app/helpers/fcrepo_admin/objects_helper.rb with this content:
module FcrepoAdmin::ObjectsHelper
include FcrepoAdmin::Helpers::ObjectsHelperBehavior
# override and/or add methods here
end
In particular you may want to override #object_title.
The contents of the object context navigation menu can be customized by overriding #object_context_nav_items.
It should return an array of [label, path] items suitable for use by link_to_unless_current:
<%= link_to_unless_current label, path %>
* Datastream views
The contents of the datastream context navigation menu can be customized by overriding #datastream_context_nav_items.
Create app/helpers/fcrepo_admin/datastreams_helper.rb with this content:
module FcrepoAdmin::DatastreamsHelper
include FcrepoAdmin::Helpers::DatastreamsHelperBehavior
# override and/or add methods here
end
datastream_context_nav_items should return an array of [label, path] items suitable for use by link_to_unless_current:
<%= link_to_unless_current label, path %>
* Controllers
To override/extend the objects controller, create app/controllers/fcrepo_admin/objects_controller.rb:
module FcrepoAdmin
class ObjectsController < ApplicationController
include FcrepoAdmin::Controller::ObjectsControllerBehavior
# add your customizations
end
end
To override/extend the datastreams controller, create app/controllers/fcrepo_admin/datastreams_controller.rb:
module FcrepoAdmin
class DatastreamsController < ApplicationController
include FcrepoAdmin::Controller::DatastreamsControllerBehavior
# add your customizations
end
end
=== License
See the LICENSE file in the root directory of the project for copyright and license information.
Licenses for code copied from other projects will be included in source files as required.