How to create a separate, searchable 'collection' (for eTheses)

From EPrints Documentation
Revision as of 13:43, 15 November 2011 by Dkane (Talk | contribs)

Jump to: navigation, search

creation fo a new directory for theses

The approach was to create new views and searches that filtered out the theses currently listed in our eprints repository and created a subfolder in the website that accessed this rather than creating a new repository just for etheses.

Here is a basic explanation:

To add new views, we modified the browse_views configuration in /cfg/cfg.d/views.pl to add the following lines:

{id=>"theses/type", allow_null=>0, fields=>"thesistype", order=>"title/authors", noindex=>0, nolink=>1 }, 
{id=>"theses/year", allow_null=>0, fields=>"year", subheadings=>"thesistype", order=>"title/authors", noindex=>0, nolink=>1, heading_level=>2, hideempty=>1 }, 
{id=>"theses/subject", allow_null=>0, fields=>"subjects", subheadings=>"thesistype", order=>"title/authors", nolink=>1, heading_level=>2, hideempty=>1}, 
{id=>"theses/department", allow_null=>0, fields=>"department", subheadings=>"thesistype", order=>"title/authors", noindex=>0, nolink=>1, heading_level=>2, hideempty=>1 } 

Note: We added the nolink option to each view so that these new views wouldn't be linked from the standard view page of the repository.

Then to add the new searches, we duplicated the configuration for the simple and advanced searches in /usr/share/eprints3/archives/witeprints/cfg/cfg.d/search.pl, renaming them thesis and advthesis and added the following option to their configuration.

filters => [ { meta_fields => [ "type" ], value => "thesis" }] 

We then added a new subfolder etheses in static/en/ and in it created an index page for our etheses section that linked to our new views and searches.

For a consistent look we also created an static/en/etheses/view/ folder and added an index that mimicked the look of the autogenerated view index of the eprints repository, except linking to our etheses views.

  • Had to modify /usr/share/eprints3/archives/witeprints/cfg/lang/en/static/index.xpage , which is the main home page of the repository
  • Had to modify /usr/share/eprints3/archives/witeprints/cfg/lang/en/static/etheses/index.xpage , which is the main home page of the etheses directory
  • Had to modify /usr/share/eprints3/archives/witeprints/cfg/lang/en/templates/default.xml, which is the main template to include links to the etheses directory on the side menu

Eprints 3.3x Changes to Plugin Module

The plugins module has changed things a little bit. So you have to now make an addition into the module itself.

in [eprints_root]/perl_lib/EPrints/Plugin/Search/Internal.pm change

$self->{search} = [qw( simple/* advanced/*)];

to

$self->{search} = [qw( simple/* advanced/* thesis/* advthesis/* )];

You already should have simple, advanced, thesis, and advthesis (or whatever you call them) in [archive_root]/cfg/cfg.d/search.pl (simple, advanced, thesis, advthesis)