Difference between revisions of "EdShareCollectionsInstallation"

From EPrints Documentation
Jump to: navigation, search
(Extract Package)
(Install CGI Scripts)
Line 22: Line 22:
Link the collections CGI scripts to the EPrints CGI directory:
Link the collections CGI scripts to the EPrints CGI directory:
  ln -s /opt/eprints3/archives/ARCHIVEID/cgi/collectionselect/ /opt/eprints3/cgi/
  ln -s /opt/eprints3/archives/ARCHIVEID/cgi/users/collectionselect/ /opt/eprints3/cgi/users
  ln -s /opt/eprints3/archives/ARCHIVEID/cgi/bookmarks/ /opt/eprints3/cgi/
  ln -s /opt/eprints3/archives/ARCHIVEID/cgi/users/bookmarks/ /opt/eprints3/cgi/users
===Patch Default Workflow===
===Patch Default Workflow===

Revision as of 09:45, 26 January 2010


The collections plugin is part of EdShare suite. It is based on code developed in EdShare and LanguageBox. The goal of this project is to produce a package that allows the easy installation of the collections functionality on a vanilla EPrints installation.

For more details about this plugin see EdShareCollections.


The EdShare Collections plugin has been tested and confirmed to run on EPrints 3.1.3.


As with all package installations it is important to remember to backup your installation of EPrints before continuing.

Extract Package

The package should be extracted in the appropriate archive directory of your EPrints installation. Run the following commands replacing ARCHIVEID with the name of the archive you want the collections on, and replace VERSION with the appropriate version number based on the package you have downloaded;

cd /opt/eprints3/archives/ARCHIVEID
tar xzf collections-VERSION.tar.gz

These commands assume that you installed EPrints to /opt/eprints3 substitute this for something else if you installed it elsewhere. Users of the Ubuntu version of EPrints will find that it is installed by default at /usr/share/eprints3.

Install CGI Scripts

Link the collections CGI scripts to the EPrints CGI directory:

ln -s /opt/eprints3/archives/ARCHIVEID/cgi/users/collectionselect/ /opt/eprints3/cgi/users
ln -s /opt/eprints3/archives/ARCHIVEID/cgi/users/bookmarks/ /opt/eprints3/cgi/users

Patch Default Workflow

Assuming that you have patch installed on you system then you need to run;

patch -p0 < default_collection_workflow.patch

This patch will only work if you have not yet modified your default workflow. If you have then you will need to add the following to your code inside the <flow> tags, this modification is what an unmodified default workflow should look like once changed;

  <stage ref="type"/>
    <epc:when test="type = 'collection'">
      <stage ref="collection"/>
      <stage ref="files"/>
      <stage ref="core"/>
      <stage ref="subjects"/>

Then at the work flow file still inside the <workflow> tags you need to add the following;

<stage name="collection">
  <component type="Field::Multi">
    <title><epc:phrase ref="Plugin/Collection:details_title"/></title>
    <field ref="title" required="yes" input_lookup_url="{$config{perl_url}}/users/lookup/title_duplicates" input_lookup_params="eprintid={eprintid}"/>
    <field ref="abstract"/>
  <component type="Field::CollectionSelect">
    <field ref="relation"/>

Edit Configuration Files


Add collection to the types for eprint list. The position it is in this list will be the position it will appear when choosing a type in the new item workflow.


In the validate_eprint function look for the line my @problems = (); and after it add;

return( @problems ) if( $eprint->get_type eq 'collection' ); 


You will need to add an exception here to stop warnings appearing for users when they deposit a collection. A warning will appear because no files have been loaded for the collection but this is fine. If you have not edited this file before look for the following line;

if( @docs == 0 )

Replace it with the following;

if( $eprint->get_type ne 'collection' && @docs == 0 )

This should stop the warning from appearing.


Assuming you haven't modified the default citation you want to look for the first <choose> block at the top of the citation. And add the following;

  <!-- Code ommitted for brevity -->   
  <when test="type = 'collection'">
    <print expr="userid"/>
  <!-- Code ommitted for brevity -->

This will put the user citation for the user that created this collection at the front of the default EPrint citation.



The collections extension provides you with two control boxes that appear on your abstract pages, a bookmark controls box and collection membership box. The collection membership box will not render on the collections page. It is possible to disable these boxes or change where they appear on the page.

To disable either of the boxes look in this file for either of the following lines;

$c->{plugins}->{"Screen::EPrint::Box::BookmarkTools"}->{params}->{disable} = 0;
$c->{plugins}->{"Screen::EPrint::Box::CollectionMembership"}->{params}->{disable} = 0;

If you want to disable either of the boxes then you just need to set the value of this setting to 1 and then regenerate your abstract pages and now the boxes will appear or not according to your preferences.

You can also choose where on the page the boxes appear. Replace the 1000 with undef and the undef with 1000 for the position you want the box to appear. To hide the box use the method above to do so rather then declare all of the positions as undef.

$c->{plugins}->{"Screen::EPrint::Box::BookmarkTools"}->{appears}->{summary_top} = undef;
$c->{plugins}->{"Screen::EPrint::Box::BookmarkTools"}->{appears}->{summary_right} = 1000;
$c->{plugins}->{"Screen::EPrint::Box::BookmarkTools"}->{appears}->{summary_bottom} = undef;
$c->{plugins}->{"Screen::EPrint::Box::BookmarkTools"}->{appears}->{summary_left} = undef;

Again any changes will need to be followed by a regeneration of your abstract pages for them to be visible.



This step is not actually required as part of the installation but it is important that you take note of it since there may be some undesired results when using the plugin.

The bookmarks plugin defines $c->{get_users_owned_eprints} in the z_bookmarks.pl file. If you are installing the plugin on a vanilla install of EPrints then there should not be a problem. But if you have installed other plugins, or implemented this function yourself then you will need to modify the function and comment this function out in z_bookmarks.pl.



It is possible to customize the layout of the collection pages by modifying the collection_render function located in archives/ARCHIVEID/cfg/cfg.d/collection_render.pl. This function is very similar to the eprint_render function except that certain fields in the EPrint object will not be set. Refer to the default function for more details.

Restart Web Server

Once you have completed all of these previous steps, you will need to restart your web server in the usual fashion.


Please report all bugs to the OneShare Bugtracker. There is a project setup for OneShare collections called OneShare Packages >> Collections.