Difference between revisions of "How to create a separate, searchable 'collection' (for eTheses)"

From EPrints Documentation
Jump to: navigation, search
(Eprints 3.3x Changes to Plugin Module)
(Eprints 3.3x Changes to Plugin Module)
 
(2 intermediate revisions by one other user not shown)
Line 21: Line 21:
 
*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/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
 
*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==
+
==EPrints 3.3x Changes to Searching==
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'''  
+
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''':
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)
+
<source lang="perl">
'''
+
$c->{'plugins'}->{'Search::Internal'}->{'params'}->{'search'} = [qw( simple/* advanced/* thesis/* advthesis/* )];
 +
</source>
 +
 
 +
To match simple, advanced, thesis, and advthesis (or whatever you call them) in '''[archive_root]/cfg/cfg.d/search.pl'''.

Latest revision as of 10:52, 9 December 2011

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.