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

From EPrints Documentation
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 Searching

From EPrints 3.3 onwards the internal search only works for the simple and advanced search types. When adding new search types you must also enable them for the internal search engine by adding to [archive_root]/cfg/cfg.d/plugins:

 $c->{'plugins'}->{'Search::Internal'}->{'params'}->{'search'} = [qw( simple/* advanced/* thesis/* advthesis/* )];

To match simple, advanced, thesis, and advthesis (or whatever you call them) in [archive_root]/cfg/cfg.d/search.pl.