README.rdoc in fcrepo_admin-0.3.5 vs README.rdoc in fcrepo_admin-0.4.0

- old
+ new

@@ -31,18 +31,31 @@ * Mount the engine In config/routes.rb add this line: - mount FcrepoAdmin::Engine => '/admin', :as=> 'fcrepo_admin' + mount FcrepoAdmin::Engine => '/', :as=> 'fcrepo_admin' - You may replace <code>'/admin'</code> with any mount point (except perhaps <code>'/catalog'</code>), - including <code>'/'</code>. All routes include <code>objects</code> as a subpath. + You may use any mount point (except perhaps <code>'/catalog'</code>). + All routes include <code>objects</code> as a subpath. -* Add Javascript +* Add CanCan action aliases (version >= 0.4.0) + + In your Ability class (app/models/ability.rb) include the FcrepoAdmin::Ability module, for example: + + class Ability + include Hydra::Ability + include Hydra::PolicyAwareAbility + include FcrepoAdmin::Ability + end + + FcrepoAdmin::Ability defines action aliases for permissions which are enforced on (ActiveFedora::Base) objects. + If your application defines action aliases, please check FcrepoAdmin::Ability for conflicts as aliases are global. + +* Add Javascript (not required for version >= 0.4.0) - In app/assets/javascripts/application.js add this line: + In app/assets/javascripts/application.js add: //= require bootstrap-tab * Customize catalog search results (optional) @@ -50,68 +63,77 @@ 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 + # additional customizations here, if any end * Add audit trail support (optional) - To enable access to the Fedora audit trail data through the fcrepo_admin UI, add your ActiveFedora models: + To enable access to the Fedora audit trail data through the fcrepo_admin UI, include the + ActiveFedora::Auditable mixin in your ActiveFedora models: include ActiveFedora::Auditable === Overriding fcrepo_admin behaviors -* Object views +The following are examples of possible customizations. This list is not necessarily exhaustive. - Create app/helpers/fcrepo_admin/objects_helper.rb with this content: +* Helpers + Override objects helpers by creating 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: + The contents of the object context navigation menu can be customized by overriding #object_context_nav_items, + or by copying and modifying the partial fcrepo_admin/objects/context_nav_items. - <%= link_to_unless_current label, path %> + Override datastreams helpers by creating app/helpers/fcrepo_admin/datastreams_helper.rb with this content: -* 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: + The contents of the datastream context navigation menu can be customized by overriding #datastream_context_nav_items, + or by copying and modifying the partial fcrepo_admin/datastreams/context_nav_items. - <%= 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 + class ObjectsController < CatalogController include FcrepoAdmin::Controller::ObjectsControllerBehavior # add your customizations end end + NOTE: This controller subclasses CatalogController, not ApplicationController. + 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 + +=== Contributing + +* Consider first posting to hydra-tech@googlegroups.com with a question or bug report, or submit an issue + to the Github issue tracker at https://github.com/projecthydra/fcrepo-admin/issues. +* Fork the git repository, create a feature branch, make your changes, and submit a pull request. + It is preferable for all changes to be made in one commit, if possible. + +Thanks! === License See the LICENSE file in the root directory of the project for copyright and license information.