https://wiki.eprints.org/w/api.php?action=feedcontributions&user=Kgoetz&feedformat=atomEPrints Documentation - User contributions [en-gb]2024-03-19T01:02:02ZUser contributionsMediaWiki 1.31.8https://wiki.eprints.org/w/index.php?title=Getting_Started_with_the_EPrints_Bazaar&diff=13099Getting Started with the EPrints Bazaar2018-10-18T05:38:57Z<p>Kgoetz: mention other things which can be done via the web page</p>
<hr />
<div>[[Category:EPrints_Bazaar]]<br />
[[Category:Bazaar Package]]<br />
<br />
EPrints Bazaar uses [[EPrints Package Manager]] to manage EPM packages. EPrints Package Manager has slightly different functionality via web and command line but in both cases they perform the same essential tasks:<br />
* install<br />
* update<br />
* disable<br />
<br />
Package management via web also has several unique functions:<br />
* EPM via web will also download the package; EPM via command line can only install an epm package downloaded by other means.<br />
* EPM files can be created and edited via web<br />
* EPM files can be published via web<br />
<br />
<br />
== Commandline usage ==<br />
<br />
[[EPrints Package Manager | epm]]' lives in ''tools/epm''.<br />
<br />
[https://github.com/eprintsug/gitaar Gitaar] is available from Eprints User Group and eases the process of installing an EPM from git - for example a pre release or work in progress.<br />
<br />
== Non eprints utilities ==<br />
<br />
There are a couple of reasons you might want to know how to search and download without using the eprints supplied tools:<br />
* tools/epm in eprints 3.3 doesn't support searching<br />
* tools/epm in eprints 3.3 doesn't support downloading<br />
* you might want to check for updates via cron and email a warning<br />
<br />
=== Search ===<br />
<br />
Encoded in the [https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/EPM/Source.pm eprints source] are two URIs which can be used for searching, simple and simple2. simple2 accepts an optional parameter '''v'''.<br />
<br />
In all examples, q= is the value to search for.<br />
<br />
==== style 1 ====<br />
<br />
curl --location "http://bazaar.eprints.org/cgi/search?output=EPMI2&q=DOI”<br />
<br />
Use curl ''—location'' to follow redirection to /cgi/search/simple as is done by eprints.<br />
<br />
<br />
==== style 2 ====<br />
<br />
optional parameter ''v'' not included, equivalent to v=_all<br />
curl "http://bazaar.eprints.org/cgi/search/simple2?output=EPMI2&q_merge=ALL&q=DOI"<br />
<br />
v set to 'tbc', this returns an empty list.<br />
<br />
curl "http://bazaar.eprints.org/cgi/search/simple2?output=EPMI2&q_merge=ALL&v=tbc&q=DOI"<br />
<br />
TODO: find out what v= actually does.<br />
<br />
=== Downloading ===<br />
<br />
Command to download a bazaar plugin manually requires setting a custom Accept header. Failing to do so will show the html version of the page.<br />
<br />
curl -H "Accept: application/vnd.eprints.epm+xml" http://bazaar.eprints.org/id/eprint/545<br />
<br />
<br />
== Developing ==<br />
<br />
See available guides in the wiki categories ''Bazaar Package'' and ''EPrints Bazaar''.</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=Installing_EPrints_on_RHEL/Fedora/CentOS&diff=13098Installing EPrints on RHEL/Fedora/CentOS2018-10-11T04:50:09Z<p>Kgoetz: note about bazaar</p>
<hr />
<div>[[Category:Installation]]<br />
<br />
==Requirements==<br />
<br />
* RedHat Enterprise (RHEL) / CentOS 7 or Fedora 25+. These instructions will more than likely work for RHEL / CentOS 6 but have not been as thoroughly tested.<br />
<br />
* Pre-installed MySQL server and client.<br />
** RHEL / Fedora:<br />
yum install mysql-server mysql<br />
** CentOS:<br />
yum install mariadb-server mariadb<br />
<br />
== Installing from EPrints 3.3.x RPM ==<br />
<br />
Add the rpm.eprints.org repository key:<br />
<br />
rpm -ivh http://rpm.eprints.org/rpm-eprints-org-key-1-1.noarch.rpm<br />
<br />
Next, add the rpm.eprints.org EPrints repository:<br />
<br />
rpm -ivh http://rpm.eprints.org/eprints/noarch/rpm-eprints-org-1-1.noarch.rpm<br />
<br />
Install required XML libraries (Use ''yum upgrade'' if these are already installed):<br />
<br />
yum install libxml2 libxslt perl-XML-LibXML perl-XML-LibXSLT<br />
<br />
Finally, install EPrints 3:<br />
<br />
yum install eprints <br />
<br />
=== Other Non-critical Dependencies ===<br />
Some of EPrints non-core functionality may not work out of the box as these dependencies are not included as part of the RPM. Here is a list of known additional packages (and the YUM repositories in which they can be found) or CPAN modules than can be installed. <br />
<br />
Some of these known additional packages are only available through the Extra Packages for Enterprise Linux (EPEL) YUM repository, which can be installed as the root user as follows:<br />
<br />
yum -y install epel-release<br />
yum repolist <br />
<br />
CPAN modules should be installed using the ''cpan'' command as the root user.<br />
<br />
* '''perl-Geo-IP (epel)''' - Allows IRstats2 to determine the location of views/downloads for publications.]<br />
* '''perl-Spreadsheet-WriteExcel (epel)''' - To allow Multiline Excel export.<br />
* '''CPAN module Text::Refer''' - Required for EndNote import.<br />
* '''perl-Image-ExifTool (epel)''' - Sometimes needed to support generation of thumbnails for uploaded documents/images.<br />
* '''perl-LWP-Protocol-https (base)''' - Needed by DataCite plugin to register repository DOIs.<br />
<br />
== Installing EPrints 3.3.x from Source ==<br />
'''N.B. Installing from source is generally discouraged particularly for production repositories. However, if want to develop the EPrints code or a plugin or Bazaar package it may be useful to install from source, ideally from [https://github.com/eprints/eprints EPrints Core Git repository].'''<br />
<br />
First, install the EPEL YUM package repository and run yum repolist to ensure the GPG key is installed:<br />
<br />
yum install epel-release<br />
yum repolist<br />
<br />
Now, install all the dependencies that would be installed through the eprints RPM.<br />
<br />
yum install libxml2 libxslt httpd mod_perl perl-DBI perl-DBD-MySQL perl-IO-Socket-SSL perl-Time-HiRes perl-CGI \<br />
perl-Digest-MD5 perl-Digest-SHA perl-XML-LibXML perl-XML-LibXSLT perl-XML-SAX perl-MIME-Lite tetex-latex wget \<br />
gzip tar ImageMagick unzip elinks poppler-utils chkconfig<br />
<br />
Next, create the eprints user<br />
<br />
adduser eprints<br />
<br />
Next, clone the Git repository from GitHub to /opt/ and set the eprints user as the owner. It is probably best to checkout the latest release rather than using HEAD, which may have known issues:<br />
<br />
yum install git<br />
git clone https://github.com/eprints/eprints.git /opt/eprints3<br />
cd /opt/eprints3/<br />
git checkout tags/v3.3.15<br />
chown -R eprints:eprints . <br />
<br />
Next, as the eprints user copy /opt/eprints3/perl_lib/EPrints/SystemSettings.pm.tmpl to /opt/eprints3/perl_lib/Eprints/SystemSettings.pm<br />
<br />
EPrints is now fully installed at /opt/eprints3. However, you will not yet have a running archive. Follow the [[Getting Started with EPrints 3]] instructions to set this up.<br />
<br />
Now update Apache configuration to set it up to use the eprints user and group, by ensuring the following lines are set thus in /etc/httpd/conf/httpd.conf:<br />
<br />
User eprints<br />
Group eprints<br />
<br />
Now add the file /etc/httpd/conf.d/eprints.conf with the following line:<br />
<br />
Include /opt/eprints3/cfg/apache.conf<br />
<br />
There is a good chance your operating system will have SELinux enabled. If so, follow the instructions under Troubleshooting for how to let EPrints do what it needs to do through SELinux.<br />
<br />
Finally, restart Apache:<br />
<br />
service httpd restart<br />
<br />
You should now be able to access your vanilla repository at the hostname you specified when running '''epadmin create''' from the [[Getting Started with EPrints 3]] instructions.<br />
<br />
== Next steps ==<br />
<br />
Configure eprints per [[Getting_Started_with_EPrints_3]].<br />
<br />
<br />
== Troubleshooting ==<br />
<br />
=== Starting database and webserver at boot ===<br />
As with any database-backed web application, if you have not already done so you should ensure the database and webserver start up automatically after booting. For Redhat and Fedora use the following commands as root:<br />
<br />
chkconfig httpd on<br />
chkconfig mysqld on<br />
<br />
For CentOS it will instead be:<br />
<br />
chkconfig httpd on<br />
chkconfig mariadb on<br />
<br />
<br />
=== Failed to parse XML file ===<br />
When installing EPrints on RHEL6 (may apply to other versions), If you get the error:<br />
Failed to parse XML file:<br />
/usr/share/eprints/lib/lang/en/phrases/system.xml: Entity: line 396: parser error : Entity 'nbsp' not defined age or title page. If there are more...<br />
<br />
Run<br />
sed -i 's/'''&'''nbsp;/ /g' /usr/share/eprints/lib/lang/en/phrases/system.xml<br />
<br />
then navigate to the root of your EPrints install (/opt/eprints or /usr/share/eprints) and run<br />
bin/generate_views *repository_id*<br />
bin/epadmin reload *repository_id*<br />
<br />
<br />
=== Upgrade from previous 3.3 ===<br />
After a upgrading from previous 3.3, your existing repository's database may need updating. <br />
bin/epadmin update [archive_id]<br />
<br />
<br />
=== Apache in eprints group ===<br />
<br />
If you choose not to run apache as the eprints user (for example you have another application on the same server) you will need to change https's groups and update the permissions on some directories<br />
<br />
Add apache to eprints's group.<br />
usermod apache -G eprints<br />
<br />
One way to run httpd as 'apache' but still access eprints files is to add httpd to the eprints group.<br />
chmod 770 /usr/share/eprints/var<br />
chmod 770 /usr/share/eprints/lib/epm/<br />
<br />
Be aware that other directories will need to be writable by eprints user group/apache ; those depend on whether you will be using eprints bazaar.<br />
<br />
=== Using SELinux ===<br />
If you're using SELinux on your server you will need to give Apache read/write access to the documents directory for all repositories you create and the eprints var folder (indexer log, ticker files):<br />
<br />
chcon -R -h -t httpd_sys_script_rw_t [eprintspath]/archives/[repoid]/documents/<br />
chcon -R -h -t httpd_sys_script_rw_t [eprintspath]/var/<br />
chcon -R -h -t httpd_sys_script_rw_t /usr/share/eprints/lib/<br />
<br />
You may also need to tell SELinux to allow Apache to talk on the network, if you intend to run your database on a separate server.<br />
<br />
setsebool -P httpd_can_network_connect=1<br />
<br />
=== Using firewalld ===<br />
Typically RHEL/Fedora/CentOS run a firewall that will block remote connections to you webserver. To overcome this run the following commands as root:<br />
<br />
firewall-cmd --permanent --add-service=http<br />
service firewalld restart<br />
<br />
You will need to same https if you intend to set that up as well. Otherwise, you can just disable the firewall altogether if you have an institutional level firewall:<br />
<br />
service firewalld stop<br />
chkconfig firewalld off</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=Installing_EPrints_on_RHEL/Fedora/CentOS&diff=13097Installing EPrints on RHEL/Fedora/CentOS2018-10-11T04:48:04Z<p>Kgoetz: add section on putting apache in eprints group</p>
<hr />
<div>[[Category:Installation]]<br />
<br />
==Requirements==<br />
<br />
* RedHat Enterprise (RHEL) / CentOS 7 or Fedora 25+. These instructions will more than likely work for RHEL / CentOS 6 but have not been as thoroughly tested.<br />
<br />
* Pre-installed MySQL server and client.<br />
** RHEL / Fedora:<br />
yum install mysql-server mysql<br />
** CentOS:<br />
yum install mariadb-server mariadb<br />
<br />
== Installing from EPrints 3.3.x RPM ==<br />
<br />
Add the rpm.eprints.org repository key:<br />
<br />
rpm -ivh http://rpm.eprints.org/rpm-eprints-org-key-1-1.noarch.rpm<br />
<br />
Next, add the rpm.eprints.org EPrints repository:<br />
<br />
rpm -ivh http://rpm.eprints.org/eprints/noarch/rpm-eprints-org-1-1.noarch.rpm<br />
<br />
Install required XML libraries (Use ''yum upgrade'' if these are already installed):<br />
<br />
yum install libxml2 libxslt perl-XML-LibXML perl-XML-LibXSLT<br />
<br />
Finally, install EPrints 3:<br />
<br />
yum install eprints <br />
<br />
=== Other Non-critical Dependencies ===<br />
Some of EPrints non-core functionality may not work out of the box as these dependencies are not included as part of the RPM. Here is a list of known additional packages (and the YUM repositories in which they can be found) or CPAN modules than can be installed. <br />
<br />
Some of these known additional packages are only available through the Extra Packages for Enterprise Linux (EPEL) YUM repository, which can be installed as the root user as follows:<br />
<br />
yum -y install epel-release<br />
yum repolist <br />
<br />
CPAN modules should be installed using the ''cpan'' command as the root user.<br />
<br />
* '''perl-Geo-IP (epel)''' - Allows IRstats2 to determine the location of views/downloads for publications.]<br />
* '''perl-Spreadsheet-WriteExcel (epel)''' - To allow Multiline Excel export.<br />
* '''CPAN module Text::Refer''' - Required for EndNote import.<br />
* '''perl-Image-ExifTool (epel)''' - Sometimes needed to support generation of thumbnails for uploaded documents/images.<br />
* '''perl-LWP-Protocol-https (base)''' - Needed by DataCite plugin to register repository DOIs.<br />
<br />
== Installing EPrints 3.3.x from Source ==<br />
'''N.B. Installing from source is generally discouraged particularly for production repositories. However, if want to develop the EPrints code or a plugin or Bazaar package it may be useful to install from source, ideally from [https://github.com/eprints/eprints EPrints Core Git repository].'''<br />
<br />
First, install the EPEL YUM package repository and run yum repolist to ensure the GPG key is installed:<br />
<br />
yum install epel-release<br />
yum repolist<br />
<br />
Now, install all the dependencies that would be installed through the eprints RPM.<br />
<br />
yum install libxml2 libxslt httpd mod_perl perl-DBI perl-DBD-MySQL perl-IO-Socket-SSL perl-Time-HiRes perl-CGI \<br />
perl-Digest-MD5 perl-Digest-SHA perl-XML-LibXML perl-XML-LibXSLT perl-XML-SAX perl-MIME-Lite tetex-latex wget \<br />
gzip tar ImageMagick unzip elinks poppler-utils chkconfig<br />
<br />
Next, create the eprints user<br />
<br />
adduser eprints<br />
<br />
Next, clone the Git repository from GitHub to /opt/ and set the eprints user as the owner. It is probably best to checkout the latest release rather than using HEAD, which may have known issues:<br />
<br />
yum install git<br />
git clone https://github.com/eprints/eprints.git /opt/eprints3<br />
cd /opt/eprints3/<br />
git checkout tags/v3.3.15<br />
chown -R eprints:eprints . <br />
<br />
Next, as the eprints user copy /opt/eprints3/perl_lib/EPrints/SystemSettings.pm.tmpl to /opt/eprints3/perl_lib/Eprints/SystemSettings.pm<br />
<br />
EPrints is now fully installed at /opt/eprints3. However, you will not yet have a running archive. Follow the [[Getting Started with EPrints 3]] instructions to set this up.<br />
<br />
Now update Apache configuration to set it up to use the eprints user and group, by ensuring the following lines are set thus in /etc/httpd/conf/httpd.conf:<br />
<br />
User eprints<br />
Group eprints<br />
<br />
Now add the file /etc/httpd/conf.d/eprints.conf with the following line:<br />
<br />
Include /opt/eprints3/cfg/apache.conf<br />
<br />
There is a good chance your operating system will have SELinux enabled. If so, follow the instructions under Troubleshooting for how to let EPrints do what it needs to do through SELinux.<br />
<br />
Finally, restart Apache:<br />
<br />
service httpd restart<br />
<br />
You should now be able to access your vanilla repository at the hostname you specified when running '''epadmin create''' from the [[Getting Started with EPrints 3]] instructions.<br />
<br />
== Next steps ==<br />
<br />
Configure eprints per [[Getting_Started_with_EPrints_3]].<br />
<br />
<br />
== Troubleshooting ==<br />
<br />
=== Starting database and webserver at boot ===<br />
As with any database-backed web application, if you have not already done so you should ensure the database and webserver start up automatically after booting. For Redhat and Fedora use the following commands as root:<br />
<br />
chkconfig httpd on<br />
chkconfig mysqld on<br />
<br />
For CentOS it will instead be:<br />
<br />
chkconfig httpd on<br />
chkconfig mariadb on<br />
<br />
<br />
=== Failed to parse XML file ===<br />
When installing EPrints on RHEL6 (may apply to other versions), If you get the error:<br />
Failed to parse XML file:<br />
/usr/share/eprints/lib/lang/en/phrases/system.xml: Entity: line 396: parser error : Entity 'nbsp' not defined age or title page. If there are more...<br />
<br />
Run<br />
sed -i 's/'''&'''nbsp;/ /g' /usr/share/eprints/lib/lang/en/phrases/system.xml<br />
<br />
then navigate to the root of your EPrints install (/opt/eprints or /usr/share/eprints) and run<br />
bin/generate_views *repository_id*<br />
bin/epadmin reload *repository_id*<br />
<br />
<br />
=== Upgrade from previous 3.3 ===<br />
After a upgrading from previous 3.3, your existing repository's database may need updating. <br />
bin/epadmin update [archive_id]<br />
<br />
<br />
=== Apache in eprints group ===<br />
<br />
If you choose not to run apache as the eprints user (for example you have another application on the same server) you will need to change https's groups and update the permissions on some directories<br />
<br />
Add apache to eprints's group.<br />
usermod apache -G eprints<br />
<br />
One way to run httpd as 'apache' but still access eprints files is to add httpd to the eprints group.<br />
chmod 770 /usr/share/eprints/var<br />
chmod 770 /usr/share/eprints/lib/epm/<br />
<br />
<br />
=== Using SELinux ===<br />
If you're using SELinux on your server you will need to give Apache read/write access to the documents directory for all repositories you create and the eprints var folder (indexer log, ticker files):<br />
<br />
chcon -R -h -t httpd_sys_script_rw_t [eprintspath]/archives/[repoid]/documents/<br />
chcon -R -h -t httpd_sys_script_rw_t [eprintspath]/var/<br />
chcon -R -h -t httpd_sys_script_rw_t /usr/share/eprints/lib/<br />
<br />
You may also need to tell SELinux to allow Apache to talk on the network, if you intend to run your database on a separate server.<br />
<br />
setsebool -P httpd_can_network_connect=1<br />
<br />
=== Using firewalld ===<br />
Typically RHEL/Fedora/CentOS run a firewall that will block remote connections to you webserver. To overcome this run the following commands as root:<br />
<br />
firewall-cmd --permanent --add-service=http<br />
service firewalld restart<br />
<br />
You will need to same https if you intend to set that up as well. Otherwise, you can just disable the firewall altogether if you have an institutional level firewall:<br />
<br />
service firewalld stop<br />
chkconfig firewalld off</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=Installing_EPrints_on_RHEL/Fedora/CentOS&diff=13096Installing EPrints on RHEL/Fedora/CentOS2018-10-11T04:44:09Z<p>Kgoetz: another path apache needs to write (for installing EPMs from bazaar)</p>
<hr />
<div>[[Category:Installation]]<br />
<br />
==Requirements==<br />
<br />
* RedHat Enterprise (RHEL) / CentOS 7 or Fedora 25+. These instructions will more than likely work for RHEL / CentOS 6 but have not been as thoroughly tested.<br />
<br />
* Pre-installed MySQL server and client.<br />
** RHEL / Fedora:<br />
yum install mysql-server mysql<br />
** CentOS:<br />
yum install mariadb-server mariadb<br />
<br />
== Installing from EPrints 3.3.x RPM ==<br />
<br />
Add the rpm.eprints.org repository key:<br />
<br />
rpm -ivh http://rpm.eprints.org/rpm-eprints-org-key-1-1.noarch.rpm<br />
<br />
Next, add the rpm.eprints.org EPrints repository:<br />
<br />
rpm -ivh http://rpm.eprints.org/eprints/noarch/rpm-eprints-org-1-1.noarch.rpm<br />
<br />
Install required XML libraries (Use ''yum upgrade'' if these are already installed):<br />
<br />
yum install libxml2 libxslt perl-XML-LibXML perl-XML-LibXSLT<br />
<br />
Finally, install EPrints 3:<br />
<br />
yum install eprints <br />
<br />
=== Other Non-critical Dependencies ===<br />
Some of EPrints non-core functionality may not work out of the box as these dependencies are not included as part of the RPM. Here is a list of known additional packages (and the YUM repositories in which they can be found) or CPAN modules than can be installed. <br />
<br />
Some of these known additional packages are only available through the Extra Packages for Enterprise Linux (EPEL) YUM repository, which can be installed as the root user as follows:<br />
<br />
yum -y install epel-release<br />
yum repolist <br />
<br />
CPAN modules should be installed using the ''cpan'' command as the root user.<br />
<br />
* '''perl-Geo-IP (epel)''' - Allows IRstats2 to determine the location of views/downloads for publications.]<br />
* '''perl-Spreadsheet-WriteExcel (epel)''' - To allow Multiline Excel export.<br />
* '''CPAN module Text::Refer''' - Required for EndNote import.<br />
* '''perl-Image-ExifTool (epel)''' - Sometimes needed to support generation of thumbnails for uploaded documents/images.<br />
* '''perl-LWP-Protocol-https (base)''' - Needed by DataCite plugin to register repository DOIs.<br />
<br />
== Installing EPrints 3.3.x from Source ==<br />
'''N.B. Installing from source is generally discouraged particularly for production repositories. However, if want to develop the EPrints code or a plugin or Bazaar package it may be useful to install from source, ideally from [https://github.com/eprints/eprints EPrints Core Git repository].'''<br />
<br />
First, install the EPEL YUM package repository and run yum repolist to ensure the GPG key is installed:<br />
<br />
yum install epel-release<br />
yum repolist<br />
<br />
Now, install all the dependencies that would be installed through the eprints RPM.<br />
<br />
yum install libxml2 libxslt httpd mod_perl perl-DBI perl-DBD-MySQL perl-IO-Socket-SSL perl-Time-HiRes perl-CGI \<br />
perl-Digest-MD5 perl-Digest-SHA perl-XML-LibXML perl-XML-LibXSLT perl-XML-SAX perl-MIME-Lite tetex-latex wget \<br />
gzip tar ImageMagick unzip elinks poppler-utils chkconfig<br />
<br />
Next, create the eprints user<br />
<br />
adduser eprints<br />
<br />
Next, clone the Git repository from GitHub to /opt/ and set the eprints user as the owner. It is probably best to checkout the latest release rather than using HEAD, which may have known issues:<br />
<br />
yum install git<br />
git clone https://github.com/eprints/eprints.git /opt/eprints3<br />
cd /opt/eprints3/<br />
git checkout tags/v3.3.15<br />
chown -R eprints:eprints . <br />
<br />
Next, as the eprints user copy /opt/eprints3/perl_lib/EPrints/SystemSettings.pm.tmpl to /opt/eprints3/perl_lib/Eprints/SystemSettings.pm<br />
<br />
EPrints is now fully installed at /opt/eprints3. However, you will not yet have a running archive. Follow the [[Getting Started with EPrints 3]] instructions to set this up.<br />
<br />
Now update Apache configuration to set it up to use the eprints user and group, by ensuring the following lines are set thus in /etc/httpd/conf/httpd.conf:<br />
<br />
User eprints<br />
Group eprints<br />
<br />
Now add the file /etc/httpd/conf.d/eprints.conf with the following line:<br />
<br />
Include /opt/eprints3/cfg/apache.conf<br />
<br />
There is a good chance your operating system will have SELinux enabled. If so, follow the instructions under Troubleshooting for how to let EPrints do what it needs to do through SELinux.<br />
<br />
Finally, restart Apache:<br />
<br />
service httpd restart<br />
<br />
You should now be able to access your vanilla repository at the hostname you specified when running '''epadmin create''' from the [[Getting Started with EPrints 3]] instructions.<br />
<br />
== Next steps ==<br />
<br />
Configure eprints per [[Getting_Started_with_EPrints_3]].<br />
<br />
<br />
== Troubleshooting ==<br />
<br />
=== Starting database and webserver at boot ===<br />
As with any database-backed web application, if you have not already done so you should ensure the database and webserver start up automatically after booting. For Redhat and Fedora use the following commands as root:<br />
<br />
chkconfig httpd on<br />
chkconfig mysqld on<br />
<br />
For CentOS it will instead be:<br />
<br />
chkconfig httpd on<br />
chkconfig mariadb on<br />
<br />
<br />
=== Failed to parse XML file ===<br />
When installing EPrints on RHEL6 (may apply to other versions), If you get the error:<br />
Failed to parse XML file:<br />
/usr/share/eprints/lib/lang/en/phrases/system.xml: Entity: line 396: parser error : Entity 'nbsp' not defined age or title page. If there are more...<br />
<br />
Run<br />
sed -i 's/'''&'''nbsp;/ /g' /usr/share/eprints/lib/lang/en/phrases/system.xml<br />
<br />
then navigate to the root of your EPrints install (/opt/eprints or /usr/share/eprints) and run<br />
bin/generate_views *repository_id*<br />
bin/epadmin reload *repository_id*<br />
<br />
<br />
=== Upgrade from previous 3.3 ===<br />
After a upgrading from previous 3.3, your existing repository's database may need updating. <br />
bin/epadmin update [archive_id]<br />
<br />
<br />
=== Using SELinux ===<br />
If you're using SELinux on your server you will need to give Apache read/write access to the documents directory for all repositories you create and the eprints var folder (indexer log, ticker files):<br />
<br />
chcon -R -h -t httpd_sys_script_rw_t [eprintspath]/archives/[repoid]/documents/<br />
chcon -R -h -t httpd_sys_script_rw_t [eprintspath]/var/<br />
chcon -R -h -t httpd_sys_script_rw_t /usr/share/eprints/lib/<br />
<br />
You may also need to tell SELinux to allow Apache to talk on the network, if you intend to run your database on a separate server.<br />
<br />
setsebool -P httpd_can_network_connect=1<br />
<br />
=== Using firewalld ===<br />
Typically RHEL/Fedora/CentOS run a firewall that will block remote connections to you webserver. To overcome this run the following commands as root:<br />
<br />
firewall-cmd --permanent --add-service=http<br />
service firewalld restart<br />
<br />
You will need to same https if you intend to set that up as well. Otherwise, you can just disable the firewall altogether if you have an institutional level firewall:<br />
<br />
service firewalld stop<br />
chkconfig firewalld off</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=Talk:Branding_with_confidence&diff=13095Talk:Branding with confidence2018-10-11T03:46:17Z<p>Kgoetz: delete spam from talk page</p>
<hr />
<div></div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=Unit_tests&diff=13094Unit tests2018-10-11T01:40:28Z<p>Kgoetz: finally remove old test runs, the steps on this page should result in all but one test passing so the old cruft from Before Instructions is just using space</p>
<hr />
<div>Since Eprints 3.2 [[New_Features_in_EPrints_3.2#Unit_Tests |unit tests have been included in the codebase]] and can be run by developer and non developer alike.<br />
<br />
The tests are not changed very often, but there are quite a few of them covering the existing codebase.<br />
<br />
== Required packages==<br />
<br />
Exact requirements for running the tests aren't documented but at this writing, the used packages are these (available from a distribution package or CPAN).<br />
<br />
$ grep -h '^use.*::' * |cut -d ' ' -f 2 |sort -u<br />
"EPrints::Test"<br />
"EPrints::Test::XML"<br />
Data::Compare;<br />
Data::Dumper;<br />
Digest::MD5;<br />
EPrints::SystemSettings;<br />
EPrints::Test::RepositoryLog;<br />
EPrints::Test;<br />
LWP::UserAgent;<br />
Test::MockObject::Extends;<br />
Test::MockObject;<br />
Test::More<br />
Test::More;<br />
XML::LibXML::XPathContext;<br />
XML::LibXML;<br />
<br />
On RHEL these can be installed by:<br />
<br />
yum install eprints perl-Data-Compare perl-libwww-perl perl-Test-Simple perl-Test-MockObject perl-XML-LibXML<br />
<br />
<br />
== Optional packages ==<br />
<br />
There are also optional dependencies (checked with egrep 'require .*::' *):<br />
* Test::Memory::Cycle<br />
* XML::DOM<br />
* XML::GDOME<br />
<br />
yum install perl-Test-Memory-Cycle perl-XML-DOM<br />
<br />
XML::GDOME is not available on RHEL6 repositories<br />
<br />
Storage::LocalCompress is not available on RHEL6 repositories, but if installing it PerlIO::gzip (perl-PerlIO-gzip) is required.<br />
<br />
<br />
=== EPrint generating script ===<br />
<br />
EPrints ships ''testdata//bin/import_rand_data'' to generate a number of records ( By default creates 1000 prints, 100 publications, 10 publishers and 10 institutions). They don't appear to be required by existing tests but you may find them useful to have during testing anyway and they will be used if available.<br />
<br />
This requires [ https://metacpan.org/pod/Text::Lorem Text::Lorem] which is not packaged but can be trivially vendored in to an eprints install.<br />
<br />
<br />
wget https://st.aticpan.org/source/ADEOLA/Text-Lorem-0.3/lib/Text/Lorem.pm -O perl_lib/Text/Lorem.pm<br />
<br />
<br />
Once installed it can be run with<br />
./testdata/bin/import_rand_data REPOID<br />
<br />
Following this ensure your documents are indexed, either via web or command line<br />
./bin/indexer start --verbose --notdaemon # ^C to stop this after completion<br />
<br />
== Other configuration ==<br />
<br />
* A user named "admin" is required for some tests to run, said user does not have to be an admin<br />
<br />
<br />
== Dummy data ==<br />
<br />
For test instances test data can be installed. Without this data set many dozen tests will fail.<br />
<br />
<br />
Pre supplied data (from testdata/* can be installed with ``import_test_data`` - REPOID is required.<br />
<br />
./testdata/bin/import_test_data REPOID<br />
<br />
Following this ensure your documents are indexed, either via web or command line<br />
./bin/indexer start --verbose --notdaemon # ^C to stop this after completion<br />
<br />
== Expected output ==<br />
<br />
Not everything is an error - these items look like problems but aren't.<br />
<br />
# Undefined phrase: xxx_invalid (en) at line 24 in /usr/share/eprints/tests/55_phrases.pl</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=Unit_tests&diff=13093Unit tests2018-10-11T00:16:14Z<p>Kgoetz: reminder: index after importing; deleted more from historical runs which I attribute to lack of indexing</p>
<hr />
<div>Since Eprints 3.2 [[New_Features_in_EPrints_3.2#Unit_Tests |unit tests have been included in the codebase]] and can be run by developer and non developer alike.<br />
<br />
The tests are not changed very often, but there are quite a few of them covering the existing codebase.<br />
<br />
== Required packages==<br />
<br />
Exact requirements for running the tests aren't documented but at this writing, the used packages are these (available from a distribution package or CPAN).<br />
<br />
$ grep -h '^use.*::' * |cut -d ' ' -f 2 |sort -u<br />
"EPrints::Test"<br />
"EPrints::Test::XML"<br />
Data::Compare;<br />
Data::Dumper;<br />
Digest::MD5;<br />
EPrints::SystemSettings;<br />
EPrints::Test::RepositoryLog;<br />
EPrints::Test;<br />
LWP::UserAgent;<br />
Test::MockObject::Extends;<br />
Test::MockObject;<br />
Test::More<br />
Test::More;<br />
XML::LibXML::XPathContext;<br />
XML::LibXML;<br />
<br />
On RHEL these can be installed by:<br />
<br />
yum install eprints perl-Data-Compare perl-libwww-perl perl-Test-Simple perl-Test-MockObject perl-XML-LibXML<br />
<br />
<br />
== Optional packages ==<br />
<br />
There are also optional dependencies (checked with egrep 'require .*::' *):<br />
* Test::Memory::Cycle<br />
* XML::DOM<br />
* XML::GDOME<br />
<br />
yum install perl-Test-Memory-Cycle perl-XML-DOM<br />
<br />
XML::GDOME is not available on RHEL6 repositories<br />
<br />
Storage::LocalCompress is not available on RHEL6 repositories, but if installing it PerlIO::gzip (perl-PerlIO-gzip) is required.<br />
<br />
<br />
=== EPrint generating script ===<br />
<br />
EPrints ships ''testdata//bin/import_rand_data'' to generate a number of records ( By default creates 1000 prints, 100 publications, 10 publishers and 10 institutions). They don't appear to be required by existing tests but you may find them useful to have during testing anyway and they will be used if available.<br />
<br />
This requires [ https://metacpan.org/pod/Text::Lorem Text::Lorem] which is not packaged but can be trivially vendored in to an eprints install.<br />
<br />
<br />
wget https://st.aticpan.org/source/ADEOLA/Text-Lorem-0.3/lib/Text/Lorem.pm -O perl_lib/Text/Lorem.pm<br />
<br />
<br />
Once installed it can be run with<br />
./testdata/bin/import_rand_data REPOID<br />
<br />
Following this ensure your documents are indexed, either via web or command line<br />
./bin/indexer start --verbose --notdaemon # ^C to stop this after completion<br />
<br />
== Other configuration ==<br />
<br />
* A user named "admin" is required for some tests to run, said user does not have to be an admin<br />
<br />
<br />
== Dummy data ==<br />
<br />
For test instances test data can be installed. Without this data set many dozen tests will fail.<br />
<br />
<br />
Pre supplied data (from testdata/* can be installed with ``import_test_data`` - REPOID is required.<br />
<br />
./testdata/bin/import_test_data REPOID<br />
<br />
Following this ensure your documents are indexed, either via web or command line<br />
./bin/indexer start --verbose --notdaemon # ^C to stop this after completion<br />
<br />
== Expected output ==<br />
<br />
Not everything is an error - these items look like problems but aren't.<br />
<br />
# Undefined phrase: xxx_invalid (en) at line 24 in /usr/share/eprints/tests/55_phrases.pl<br />
<br />
== Old test runs ==<br />
<br />
These are runs people have done, they'll be removed as the page is built out.<br />
Most OK results have been removed to shrink the page<br />
<br />
===STDOUT===<br />
<br />
<pre><br />
/usr/share/eprints3/tests/30_search.pl ............ <br />
Dubious, test returned 1 (wstat 256, 0x100)<br />
Failed 1/35 subtests <br />
(less 2 skipped subtests: 32 okay)<br />
/usr/share/eprints3/tests/31_simple_search.pl ..... ok<br />
Bailout called. Further testing stopped: Failed to parse http://eprints-git.demo/sword-app/servicedocument :1: parser error : Space required after the Public Identifier<br />
</pre><br />
<br />
===STDERR===<br />
<pre><br />
# EPrints Version: 3.3.14<br />
`1d reference at /usr/share/eprints/tests/05_bug_fixes.pl line 36.<br />
# Looks like you planned 15 tests but ran 11.<br />
# Looks like you failed 7 tests of 11 run.<br />
# Looks like your test exited with 255 just after 11.<br />
Can't call method "to_xml" on an undefined value at /usr/share/eprints/bin/../perl_lib/EPrints/Test/XML.pm line 50.<br />
# Looks like you planned 12 tests but ran 9.<br />
# Looks like your test exited with 2 just after 9.<br />
Can't call method "to_xml" on an undefined value at /usr/share/eprints/bin/../perl_lib/EPrints/Test/XML.pm line 50.<br />
# Looks like you planned 12 tests but ran 9.<br />
# Looks like your test exited with 255 just after 9.<br />
<br />
<br />
Warning! No values were found for eprint.view._40_views_pl [date] - configuration may be wrong<br />
# /tmp/jrjiuqUzTc/en/view/_40_views_pl<br />
<br />
# Failed test 'browse_view_menu'<br />
# at /usr/share/eprints/tests/40_views.pl line 67.<br />
# update_view_by_path=-1B<br />
# update_browse_view_list=-1B<br />
# Looks like you failed 1 test of 6.<br />
# LOAD=-1B<br />
<br />
# Plugin Memory Usage<br />
# EPrints::Plugin::Screen::EPrint::Messages=-1B<br />
# EPrints::Plugin::Convert::Thumbnails=-1B<br />
# EPrints::Plugin::Search=-1B<br />
# EPrints::Plugin::Storage::EPM=-1B<br />
# EPrints::Plugin::Screen::Workflow::Destroy=-1B<br />
# EPrints::Plugin::Screen::Workflow::Destroy=-1B<br />
<br />
Use of uninitialized value in subroutine entry at /usr/share/eprints/bin/../perl_lib/EPrints/MetaField/Id.pm line 50.<br />
Can't call method "get_dataset" on an undefined value at /usr/share/eprints/bin/../perl_lib/EPrints/Workflow.pm line 145.<br />
# Looks like you planned 4 tests but ran 3.<br />
# Looks like your test exited with 255 just after 3.<br />
Argument "" isn't numeric in addition (+) at /usr/share/eprints/bin/../perl_lib/EPrints/Database.pm line 1500.<br />
</pre><br />
<br />
Patrick:<br />
<pre><br />
# EPrints Version: 3.3.14<br />
SELECT `document`.`docid` FROM `document`, `document_relation_type` AS `document_relation_type`, `document_relation_uri` AS `document_relation_uri` WHERE `document`.`docid`=`document_relation_type`.`docid` AND `document`.`docid`=`document_relation_uri`.`docid` AND (`document_relation_type`.`relation_type` = 'http://eprints.org/relation/islightboxThumbnailVersionOf') AND (`document_relation_type`.`pos` = `document_relation_uri`.`pos`) AND (`document_relation_uri`.`relation_uri` = '/id/document/1') GROUP BY `document`.`docid`<br />
# Failed test 'compound type field query'<br />
# at /usr/share/eprints3/tests/30_search.pl line 358.<br />
# Looks like you failed 1 test of 35.<br />
<br />
# Plugin Memory Usage<br />
# EPrints::Plugin::Screen::Admin::Config::Edit::Perl=-1B<br />
# EPrints::Plugin::Export::ContextObject=-1B<br />
# EPrints::Plugin::Screen::Admin::Config::Edit::XPage=-1B<br />
# EPrints::Plugin::Export::MultilineCSV=-1B<br />
# EPrints::Plugin::Screen::Admin::UpdateDatabase=-1B<br />
EPScript error: Can't use string ("0") as an ARRAY ref while "strict refs" in use at /home/pm5/eprints-git/bin/../perl_lib/EPrints/Script/Compiled.pm line 633.<br />
<br />
EPScript error: Can't use string ("0") as an ARRAY ref while "strict refs" in use at /home/pm5/eprints-git/bin/../perl_lib/EPrints/Script/Compiled.pm line 633.<br />
<br />
</pre><br />
<br />
[[Category:Testing]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=Unit_tests&diff=13092Unit tests2018-10-10T23:34:24Z<p>Kgoetz: trim more from old runs.</p>
<hr />
<div>Since Eprints 3.2 [[New_Features_in_EPrints_3.2#Unit_Tests |unit tests have been included in the codebase]] and can be run by developer and non developer alike.<br />
<br />
The tests are not changed very often, but there are quite a few of them covering the existing codebase.<br />
<br />
== Required packages==<br />
<br />
Exact requirements for running the tests aren't documented but at this writing, the used packages are these (available from a distribution package or CPAN).<br />
<br />
$ grep -h '^use.*::' * |cut -d ' ' -f 2 |sort -u<br />
"EPrints::Test"<br />
"EPrints::Test::XML"<br />
Data::Compare;<br />
Data::Dumper;<br />
Digest::MD5;<br />
EPrints::SystemSettings;<br />
EPrints::Test::RepositoryLog;<br />
EPrints::Test;<br />
LWP::UserAgent;<br />
Test::MockObject::Extends;<br />
Test::MockObject;<br />
Test::More<br />
Test::More;<br />
XML::LibXML::XPathContext;<br />
XML::LibXML;<br />
<br />
On RHEL these can be installed by:<br />
<br />
yum install eprints perl-Data-Compare perl-libwww-perl perl-Test-Simple perl-Test-MockObject perl-XML-LibXML<br />
<br />
<br />
== Optional packages ==<br />
<br />
There are also optional dependencies (checked with egrep 'require .*::' *):<br />
* Test::Memory::Cycle<br />
* XML::DOM<br />
* XML::GDOME<br />
<br />
yum install perl-Test-Memory-Cycle perl-XML-DOM<br />
<br />
XML::GDOME is not available on RHEL6 repositories<br />
<br />
Storage::LocalCompress is not available on RHEL6 repositories, but if installing it PerlIO::gzip (perl-PerlIO-gzip) is required.<br />
<br />
<br />
=== EPrint generating script ===<br />
<br />
EPrints ships ''testdata//bin/import_rand_data'' to generate a number of records ( By default creates 1000 prints, 100 publications, 10 publishers and 10 institutions). They don't appear to be required by existing tests but you may find them useful to have during testing anyway and they will be used if available.<br />
<br />
This requires [ https://metacpan.org/pod/Text::Lorem Text::Lorem] which is not packaged but can be trivially vendored in to an eprints install.<br />
<br />
<br />
wget https://st.aticpan.org/source/ADEOLA/Text-Lorem-0.3/lib/Text/Lorem.pm -O perl_lib/Text/Lorem.pm<br />
<br />
<br />
Once installed it can be run with<br />
./testdata/bin/import_rand_data REPOID<br />
<br />
== Other configuration ==<br />
<br />
* A user named "admin" is required for some tests to run, said user does not have to be an admin<br />
<br />
<br />
== Dummy data ==<br />
<br />
For test instances test data can be installed. Without this data set many dozen tests will fail.<br />
<br />
<br />
Pre supplied data (from testdata/* can be installed with ``import_test_data`` - REPOID is required.<br />
<br />
./testdata/bin/import_test_data REPOID<br />
<br />
== Expected output ==<br />
<br />
Not everything is an error - these items look like problems but aren't.<br />
<br />
# Undefined phrase: xxx_invalid (en) at line 24 in /usr/share/eprints/tests/55_phrases.pl<br />
<br />
== Old test runs ==<br />
<br />
These are runs people have done, they'll be removed as the page is built out.<br />
Most OK results have been removed to shrink the page<br />
<br />
===STDOUT===<br />
<pre><br />
/usr/share/eprints/tests/30_search.pl ............<br />
Dubious, test returned 255 (wstat 65280, 0xff00)<br />
Failed 33/36 subtests<br />
/usr/share/eprints/tests/40_views.pl .............<br />
Dubious, test returned 1 (wstat 256, 0x100)<br />
Failed 1/6 subtests<br />
</pre><br />
<br />
patrick:<br />
<pre><br />
/usr/share/eprints3/tests/30_search.pl ............ <br />
Dubious, test returned 1 (wstat 256, 0x100)<br />
Failed 1/35 subtests <br />
(less 2 skipped subtests: 32 okay)<br />
/usr/share/eprints3/tests/31_simple_search.pl ..... ok<br />
Bailout called. Further testing stopped: Failed to parse http://eprints-git.demo/sword-app/servicedocument :1: parser error : Space required after the Public Identifier<br />
</pre><br />
<br />
===STDERR===<br />
<pre><br />
# EPrints Version: 3.3.14<br />
`1d reference at /usr/share/eprints/tests/05_bug_fixes.pl line 36.<br />
# Looks like you planned 15 tests but ran 11.<br />
# Looks like you failed 7 tests of 11 run.<br />
# Looks like your test exited with 255 just after 11.<br />
Can't call method "to_xml" on an undefined value at /usr/share/eprints/bin/../perl_lib/EPrints/Test/XML.pm line 50.<br />
# Looks like you planned 12 tests but ran 9.<br />
# Looks like your test exited with 2 just after 9.<br />
Can't call method "to_xml" on an undefined value at /usr/share/eprints/bin/../perl_lib/EPrints/Test/XML.pm line 50.<br />
# Looks like you planned 12 tests but ran 9.<br />
# Looks like your test exited with 255 just after 9.<br />
<br />
# Failed test 'blank found matches'<br />
# at /usr/share/eprints/tests/30_search.pl line 21.<br />
<br />
# Failed test 'search range eprintid'<br />
# at /usr/share/eprints/tests/30_search.pl line 33.<br />
<br />
# Failed test 'title IN + creators_name GREP<br />
# AND(<br />
# AND(<br />
# grep($eprint.creators_name,"%[maury]%-%[w%") ... eprint__index_grep,<br />
# index($eprint.creators_name,"maury") ... eprint__rindex<br />
# ),<br />
# AND(<br />
# grep($eprint.creators_name,"%[parkes]%-%[f%") ... eprint__index_grep,<br />
# index($eprint.creators_name,"parkes") ... eprint__rindex<br />
# ),<br />
# index($eprint.title,"eagle") ... eprint__rindex<br />
# )'<br />
# at /usr/share/eprints/tests/30_search.pl line 43.<br />
<br />
# Failed test 'SET match'<br />
# at /usr/share/eprints/tests/30_search.pl line 58.<br />
<br />
# Failed test 'subjects and divisions: AND(<br />
# in_subject($eprint.divisions,"sch_mat") ... eprint_divisions,<br />
# in_subject($eprint.subjects,"GR") ... eprint_subjects<br />
# )'<br />
# at /usr/share/eprints/tests/30_search.pl line 71.<br />
<br />
# Failed test 'match testdata article full text'<br />
# at /usr/share/eprints/tests/30_search.pl line 82.<br />
Can't call method "get_parent" on an undefined value at /usr/share/eprints/tests/30_search.pl line 86.<br />
# Looks like you planned 36 tests but ran 9.<br />
# Looks like you failed 6 tests of 9 run.<br />
# Looks like your test exited with 255 just after 9.<br />
# memory footprint<br />
Warning! No values were found for eprint.view._40_views_pl [date] - configuration may be wrong<br />
# /tmp/jrjiuqUzTc/en/view/_40_views_pl<br />
<br />
# Failed test 'browse_view_menu'<br />
# at /usr/share/eprints/tests/40_views.pl line 67.<br />
# update_view_by_path=-1B<br />
# update_browse_view_list=-1B<br />
# Looks like you failed 1 test of 6.<br />
# LOAD=-1B<br />
<br />
# Plugin Memory Usage<br />
# EPrints::Plugin::Screen::EPrint::Messages=-1B<br />
# EPrints::Plugin::Convert::Thumbnails=-1B<br />
# EPrints::Plugin::Search=-1B<br />
# EPrints::Plugin::Storage::EPM=-1B<br />
# EPrints::Plugin::Screen::Workflow::Destroy=-1B<br />
# EPrints::Plugin::Screen::Workflow::Destroy=-1B<br />
<br />
Use of uninitialized value in subroutine entry at /usr/share/eprints/bin/../perl_lib/EPrints/MetaField/Id.pm line 50.<br />
Can't call method "get_dataset" on an undefined value at /usr/share/eprints/bin/../perl_lib/EPrints/Workflow.pm line 145.<br />
# Looks like you planned 4 tests but ran 3.<br />
# Looks like your test exited with 255 just after 3.<br />
Argument "" isn't numeric in addition (+) at /usr/share/eprints/bin/../perl_lib/EPrints/Database.pm line 1500.<br />
</pre><br />
<br />
Patrick:<br />
<pre><br />
# EPrints Version: 3.3.14<br />
SELECT `document`.`docid` FROM `document`, `document_relation_type` AS `document_relation_type`, `document_relation_uri` AS `document_relation_uri` WHERE `document`.`docid`=`document_relation_type`.`docid` AND `document`.`docid`=`document_relation_uri`.`docid` AND (`document_relation_type`.`relation_type` = 'http://eprints.org/relation/islightboxThumbnailVersionOf') AND (`document_relation_type`.`pos` = `document_relation_uri`.`pos`) AND (`document_relation_uri`.`relation_uri` = '/id/document/1') GROUP BY `document`.`docid`<br />
# Failed test 'compound type field query'<br />
# at /usr/share/eprints3/tests/30_search.pl line 358.<br />
# Looks like you failed 1 test of 35.<br />
<br />
# Plugin Memory Usage<br />
# EPrints::Plugin::Screen::Admin::Config::Edit::Perl=-1B<br />
# EPrints::Plugin::Export::ContextObject=-1B<br />
# EPrints::Plugin::Screen::Admin::Config::Edit::XPage=-1B<br />
# EPrints::Plugin::Export::MultilineCSV=-1B<br />
# EPrints::Plugin::Screen::Admin::UpdateDatabase=-1B<br />
EPScript error: Can't use string ("0") as an ARRAY ref while "strict refs" in use at /home/pm5/eprints-git/bin/../perl_lib/EPrints/Script/Compiled.pm line 633.<br />
<br />
EPScript error: Can't use string ("0") as an ARRAY ref while "strict refs" in use at /home/pm5/eprints-git/bin/../perl_lib/EPrints/Script/Compiled.pm line 633.<br />
<br />
</pre><br />
<br />
[[Category:Testing]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=Unit_tests&diff=13091Unit tests2018-10-10T23:25:48Z<p>Kgoetz: easy option is so often right - vendor in Text::Lorem and import_rand_data will Just Work</p>
<hr />
<div>Since Eprints 3.2 [[New_Features_in_EPrints_3.2#Unit_Tests |unit tests have been included in the codebase]] and can be run by developer and non developer alike.<br />
<br />
The tests are not changed very often, but there are quite a few of them covering the existing codebase.<br />
<br />
== Required packages==<br />
<br />
Exact requirements for running the tests aren't documented but at this writing, the used packages are these (available from a distribution package or CPAN).<br />
<br />
$ grep -h '^use.*::' * |cut -d ' ' -f 2 |sort -u<br />
"EPrints::Test"<br />
"EPrints::Test::XML"<br />
Data::Compare;<br />
Data::Dumper;<br />
Digest::MD5;<br />
EPrints::SystemSettings;<br />
EPrints::Test::RepositoryLog;<br />
EPrints::Test;<br />
LWP::UserAgent;<br />
Test::MockObject::Extends;<br />
Test::MockObject;<br />
Test::More<br />
Test::More;<br />
XML::LibXML::XPathContext;<br />
XML::LibXML;<br />
<br />
On RHEL these can be installed by:<br />
<br />
yum install eprints perl-Data-Compare perl-libwww-perl perl-Test-Simple perl-Test-MockObject perl-XML-LibXML<br />
<br />
<br />
== Optional packages ==<br />
<br />
There are also optional dependencies (checked with egrep 'require .*::' *):<br />
* Test::Memory::Cycle<br />
* XML::DOM<br />
* XML::GDOME<br />
<br />
yum install perl-Test-Memory-Cycle perl-XML-DOM<br />
<br />
XML::GDOME is not available on RHEL6 repositories<br />
<br />
Storage::LocalCompress is not available on RHEL6 repositories, but if installing it PerlIO::gzip (perl-PerlIO-gzip) is required.<br />
<br />
<br />
=== EPrint generating script ===<br />
<br />
EPrints ships ''testdata//bin/import_rand_data'' to generate a number of records ( By default creates 1000 prints, 100 publications, 10 publishers and 10 institutions). They don't appear to be required by existing tests but you may find them useful to have during testing anyway and they will be used if available.<br />
<br />
This requires [ https://metacpan.org/pod/Text::Lorem Text::Lorem] which is not packaged but can be trivially vendored in to an eprints install.<br />
<br />
<br />
wget https://st.aticpan.org/source/ADEOLA/Text-Lorem-0.3/lib/Text/Lorem.pm -O perl_lib/Text/Lorem.pm<br />
<br />
<br />
Once installed it can be run with<br />
./testdata/bin/import_rand_data REPOID<br />
<br />
== Other configuration ==<br />
<br />
* A user named "admin" is required for some tests to run, said user does not have to be an admin<br />
<br />
<br />
== Dummy data ==<br />
<br />
For test instances test data can be installed. Without this data set many dozen tests will fail.<br />
<br />
<br />
Pre supplied data (from testdata/* can be installed with ``import_test_data`` - REPOID is required.<br />
<br />
./testdata/bin/import_test_data REPOID<br />
<br />
== Expected output ==<br />
<br />
Not everything is an error - these items look like problems but aren't.<br />
<br />
# Undefined phrase: xxx_invalid (en) at line 24 in /usr/share/eprints/tests/55_phrases.pl<br />
<br />
== Old test runs ==<br />
<br />
These are runs people have done, they'll be removed as the page is built out.<br />
Most OK results have been removed to shrink the page<br />
<br />
===STDOUT===<br />
<pre><br />
/usr/share/eprints/tests/30_search.pl ............<br />
Dubious, test returned 255 (wstat 65280, 0xff00)<br />
Failed 33/36 subtests<br />
/usr/share/eprints/tests/40_views.pl .............<br />
Dubious, test returned 1 (wstat 256, 0x100)<br />
Failed 1/6 subtests<br />
</pre><br />
<br />
patrick:<br />
<pre><br />
/usr/share/eprints3/tests/30_search.pl ............ <br />
Dubious, test returned 1 (wstat 256, 0x100)<br />
Failed 1/35 subtests <br />
(less 2 skipped subtests: 32 okay)<br />
/usr/share/eprints3/tests/31_simple_search.pl ..... ok<br />
Bailout called. Further testing stopped: Failed to parse http://eprints-git.demo/sword-app/servicedocument :1: parser error : Space required after the Public Identifier<br />
</pre><br />
<br />
===STDERR===<br />
<pre><br />
# EPrints Version: 3.3.14<br />
`1d reference at /usr/share/eprints/tests/05_bug_fixes.pl line 36.<br />
# Looks like you planned 15 tests but ran 11.<br />
# Looks like you failed 7 tests of 11 run.<br />
# Looks like your test exited with 255 just after 11.<br />
Can't call method "to_xml" on an undefined value at /usr/share/eprints/bin/../perl_lib/EPrints/Test/XML.pm line 50.<br />
# Looks like you planned 12 tests but ran 9.<br />
# Looks like your test exited with 2 just after 9.<br />
Can't call method "to_xml" on an undefined value at /usr/share/eprints/bin/../perl_lib/EPrints/Test/XML.pm line 50.<br />
# Looks like you planned 12 tests but ran 9.<br />
# Looks like your test exited with 255 just after 9.<br />
<br />
# Failed test 'blank found matches'<br />
# at /usr/share/eprints/tests/30_search.pl line 21.<br />
<br />
# Failed test 'search range eprintid'<br />
# at /usr/share/eprints/tests/30_search.pl line 33.<br />
<br />
# Failed test 'title IN + creators_name GREP<br />
# AND(<br />
# AND(<br />
# grep($eprint.creators_name,"%[maury]%-%[w%") ... eprint__index_grep,<br />
# index($eprint.creators_name,"maury") ... eprint__rindex<br />
# ),<br />
# AND(<br />
# grep($eprint.creators_name,"%[parkes]%-%[f%") ... eprint__index_grep,<br />
# index($eprint.creators_name,"parkes") ... eprint__rindex<br />
# ),<br />
# index($eprint.title,"eagle") ... eprint__rindex<br />
# )'<br />
# at /usr/share/eprints/tests/30_search.pl line 43.<br />
<br />
# Failed test 'SET match'<br />
# at /usr/share/eprints/tests/30_search.pl line 58.<br />
<br />
# Failed test 'subjects and divisions: AND(<br />
# in_subject($eprint.divisions,"sch_mat") ... eprint_divisions,<br />
# in_subject($eprint.subjects,"GR") ... eprint_subjects<br />
# )'<br />
# at /usr/share/eprints/tests/30_search.pl line 71.<br />
<br />
# Failed test 'match testdata article full text'<br />
# at /usr/share/eprints/tests/30_search.pl line 82.<br />
Can't call method "get_parent" on an undefined value at /usr/share/eprints/tests/30_search.pl line 86.<br />
# Looks like you planned 36 tests but ran 9.<br />
# Looks like you failed 6 tests of 9 run.<br />
# Looks like your test exited with 255 just after 9.<br />
# memory footprint<br />
Warning! No values were found for eprint.view._40_views_pl [date] - configuration may be wrong<br />
# /tmp/jrjiuqUzTc/en/view/_40_views_pl<br />
<br />
# Failed test 'browse_view_menu'<br />
# at /usr/share/eprints/tests/40_views.pl line 67.<br />
# update_view_by_path=-1B<br />
# update_browse_view_list=-1B<br />
# Looks like you failed 1 test of 6.<br />
# LOAD=-1B<br />
# Repository-Specific Data<br />
# _load_config=-1B<br />
# _load_workflows=-1B<br />
# _load_namedsets=-1B<br />
# _load_datasets=-1B<br />
# _load_languages=-1B<br />
# _load_templates=-1B<br />
# _load_citation_specs=-1B<br />
# _load_storage=-1B<br />
# _load_plugins=-1B<br />
# Session=-1B<br />
#<br />
# Plugin Memory Usage<br />
# EPrints::Plugin::Screen::EPrint::Messages=-1B<br />
# EPrints::Plugin::Convert::Thumbnails=-1B<br />
# EPrints::Plugin::Search=-1B<br />
# EPrints::Plugin::Storage::EPM=-1B<br />
# EPrints::Plugin::Screen::Workflow::Destroy=-1B<br />
# EPrints::Plugin::Screen::Workflow::Destroy=-1B<br />
# Undefined phrase: xxx_invalid (en) at line 24 in /usr/share/eprints/tests/55_phrases.pl<br />
Use of uninitialized value in subroutine entry at /usr/share/eprints/bin/../perl_lib/EPrints/MetaField/Id.pm line 50.<br />
Can't call method "get_dataset" on an undefined value at /usr/share/eprints/bin/../perl_lib/EPrints/Workflow.pm line 145.<br />
# Looks like you planned 4 tests but ran 3.<br />
# Looks like your test exited with 255 just after 3.<br />
Argument "" isn't numeric in addition (+) at /usr/share/eprints/bin/../perl_lib/EPrints/Database.pm line 1500.<br />
FAILED--Further testing stopped: Error retrieving http://jlrs.example.com: 500 Can't connect to jlrs.example.com:80 (Bad hostname) at /usr/share/eprints/tests/84_sword.pl line 54, <DATA> line 8.<br />
</pre><br />
<br />
Patrick:<br />
<pre><br />
# EPrints Version: 3.3.14<br />
SELECT `document`.`docid` FROM `document`, `document_relation_type` AS `document_relation_type`, `document_relation_uri` AS `document_relation_uri` WHERE `document`.`docid`=`document_relation_type`.`docid` AND `document`.`docid`=`document_relation_uri`.`docid` AND (`document_relation_type`.`relation_type` = 'http://eprints.org/relation/islightboxThumbnailVersionOf') AND (`document_relation_type`.`pos` = `document_relation_uri`.`pos`) AND (`document_relation_uri`.`relation_uri` = '/id/document/1') GROUP BY `document`.`docid`<br />
# Failed test 'compound type field query'<br />
# at /usr/share/eprints3/tests/30_search.pl line 358.<br />
# Looks like you failed 1 test of 35.<br />
# memory footprint<br />
# /tmp/nOb_JblCIl/en/view/_40_views_pl<br />
# /tmp/nOb_JblCIl/en/view/_40_views_pl/2003<br />
# /tmp/nOb_JblCIl/en/view/_40_views_pl/2001<br />
# /tmp/nOb_JblCIl/en/view/_40_views_pl/2000<br />
# /tmp/nOb_JblCIl/en/view/_40_views_pl/2005<br />
# /tmp/nOb_JblCIl/en/view/_40_views_pl/2002<br />
# /tmp/nOb_JblCIl/en/view/_40_views_pl/1998<br />
# /tmp/nOb_JblCIl/en/view/_40_views_pl/1999<br />
# /tmp/nOb_JblCIl/en/view/_40_views_pl/2004<br />
# update_view_by_path=-1B<br />
# update_browse_view_list=-1B<br />
# LOAD=-1B<br />
# Repository-Specific Data<br />
# _load_config=-1B<br />
# _load_workflows=-1B<br />
# _load_namedsets=-1B<br />
# _load_datasets=-1B<br />
# _load_languages=-1B<br />
# _load_templates=-1B<br />
# _load_citation_specs=-1B<br />
# _load_storage=-1B<br />
# _load_plugins=-1B<br />
# Session=-1B<br />
# <br />
# Plugin Memory Usage<br />
# EPrints::Plugin::Screen::Admin::Config::Edit::Perl=-1B<br />
# EPrints::Plugin::Export::ContextObject=-1B<br />
# EPrints::Plugin::Screen::Admin::Config::Edit::XPage=-1B<br />
# EPrints::Plugin::Export::MultilineCSV=-1B<br />
# EPrints::Plugin::Screen::Admin::UpdateDatabase=-1B<br />
# Undefined phrase: xxx_invalid (en) at line 24 in /usr/share/eprints3/tests/55_phrases.pl<br />
EPScript error: Can't use string ("0") as an ARRAY ref while "strict refs" in use at /home/pm5/eprints-git/bin/../perl_lib/EPrints/Script/Compiled.pm line 633.<br />
<br />
EPScript error: Can't use string ("0") as an ARRAY ref while "strict refs" in use at /home/pm5/eprints-git/bin/../perl_lib/EPrints/Script/Compiled.pm line 633.<br />
<br />
EPScript error: Can't use string ("0") as an ARRAY ref while "strict refs" in use at /home/pm5/eprints-git/bin/../perl_lib/EPrints/Script/Compiled.pm line 633.<br />
<br />
EPScript error: Can't use string ("0") as an ARRAY ref while "strict refs" in use at /home/pm5/eprints-git/bin/../perl_lib/EPrints/Script/Compiled.pm line 633.<br />
<br />
EPScript error: Can't use string ("0") as an ARRAY ref while "strict refs" in use at /home/pm5/eprints-git/bin/../perl_lib/EPrints/Script/Compiled.pm line 633.<br />
<br />
EPScript error: Can't use string ("0") as an ARRAY ref while "strict refs" in use at /home/pm5/eprints-git/bin/../perl_lib/EPrints/Script/Compiled.pm line 633.<br />
<br />
EPScript error: Can't use string ("0") as an ARRAY ref while "strict refs" in use at /home/pm5/eprints-git/bin/../perl_lib/EPrints/Script/Compiled.pm line 633.<br />
<br />
EPScript error: Can't use string ("0") as an ARRAY ref while "strict refs" in use at /home/pm5/eprints-git/bin/../perl_lib/EPrints/Script/Compiled.pm line 633.<br />
<br />
EPScript error: Can't use string ("0") as an ARRAY ref while "strict refs" in use at /home/pm5/eprints-git/bin/../perl_lib/EPrints/Script/Compiled.pm line 633.<br />
<br />
FAILED--Further testing stopped: Failed to parse http://eprints-git.demo/sword-app/servicedocument :1: parser error : Space required after the Public Identifier<br />
<br />
</pre><br />
<br />
[[Category:Testing]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=My_First_Bazaar_Package&diff=13090My First Bazaar Package2018-10-10T05:17:04Z<p>Kgoetz: mention gitaar</p>
<hr />
<div>=Introduction=<br />
<br />
In this tutorial you will create a "Hello, World" Screen and package it as a Bazaar Package (.epm).<br />
<br />
The page also references using a code versioning tool; [https://git-scm.com Git]. The goal is to have your EPM source files managed through Git and be able to edit them in a live repository.<br />
<br />
Tracking files in Git is more complex but allows easier development. All of your package's files are placed under a directory tree then Sym-linked into the correct locations in EPrints. The [[API:tools/epm]] tool provides a ''link_lib'' option that makes this easier to achieve, as long as you follow the directory layout described below.<br />
As an alternative to using the web for building/customising your package you can try [https://github.com/eprintsug/gitaar Gitaar], a tool for building the epmi metadata file and EPM suitable for sharing.<br />
<br />
'''Warning!''' do not edit files and then enable/disable or install/uninstall an EPM. The EPM will detect the changed files and either create backups or refuse to work. You must edit the EPM and do ''Save and Return'' to re-scan the EPM's files (in Admin &rarr; EPrints Bazaar, Developer Tools).<br />
<br />
=Requirements=<br />
<br />
You will need a working EPrints installation on which you have an administrator account. You will need to have access to the command line to create the files for the package.<br />
<br />
If using Git, you need to have it installed on your server.<br />
<br />
<br />
= Create a blank package=<br />
<br />
In ''Admin'' &rarr; ''System Tools'' &rarr; ''EPrints Bazaar'', select the ''Developer Tools'' tab.<br />
<br />
At the bottom of this screen is a form to create a new EPM. Enter the name (without quotes) "hello_world" and click ''Create''.<br />
<br />
You can fill out the metadata if you wish but at this stage you are only required to have a ''version'', which defaults to "1.0.0".<br />
<br />
Click ''Save and Return'' to return to the EPrints Bazaar screen.<br />
<br />
If you make a mistake you can click ''Edit'' on the ''Developer Tools'' tab to re-edit the package.<br />
<br />
The GUI will create the lib/epm/hello_world directory tree for you.<br />
<br />
<br />
= Add blank EPM to Git =<br />
<br />
This step is performed on your Eprints server.<br />
<br />
Initialise and configure your git repository<br />
cd lib/epm/hello_world<br />
git init<br />
git add .<br />
git commit -a -m 'Blank EPM started via web'<br />
<br />
<br />
= Develop your package contents=<br />
<br />
You will need to be in the root directory of your EPrints installation (typically /opt/eprints3).<br />
<br />
''gedit'' is the Gnome Text editor but you can use any editor that is capable of creating text files.<br />
<br />
<br />
== Add an Icon ==<br />
<br />
Create an Icon, using the icon builder at http://bazaar.eprints.org<br />
<br />
OR<br />
<br />
Download the hello_world icon from http://bazaar.eprints.org/images/hello_world.png<br />
<br />
Once you have this icon, name it hello_world.png and move it into lib/epm/hello_world/lib/static/images/epm/ directory.<br />
<br />
<br />
==Hello.pm==<br />
<br />
Create the directory to contain the ''Screen'' plugin you're going to package:<br />
<br />
$ mkdir -p lib/plugins/EPrints/Plugin/Screen/<br />
<br />
Create the screen plugin using your preferred text editor and add the sample content below:<br />
<br />
$ gedit lib/plugins/EPrints/Plugin/Screen/Hello.pm<br />
<br />
<source lang="perl"><br />
package EPrints::Plugin::Screen::Hello;<br />
<br />
@ISA = ( 'EPrints::Plugin::Screen' );<br />
<br />
use strict;<br />
# Make the plug-in<br />
sub new<br />
{<br />
my( $class, %params ) = @_;<br />
<br />
my $self = $class->SUPER::new(%params);<br />
<br />
# Where the button to access the screen appears if anywhere, and what priority<br />
$self->{appears} = [<br />
{<br />
place => "admin_actions",<br />
position => 1247,<br />
},<br />
];<br />
<br />
return $self;<br />
}<br />
<br />
# Anyone can see this screen<br />
sub can_be_viewed { 1 }<br />
<br />
# What to display<br />
sub render<br />
{<br />
my( $self ) = @_;<br />
<br />
# Get the current repository object (so we can access the users, eprints information about things in this repository)<br />
<br />
my $repository = $self->{repository};<br />
<br />
# Create an XML element to return to our screen<br />
<br />
my $frag = $repository->xml->create_document_fragment();<br />
<br />
# Fill the fragment with stuff<br />
<br />
$frag->appendChild($repository->xml->create_text_node( "Hello, World!" ));<br />
<br />
return $frag;<br />
}<br />
<br />
1;<br />
</source><br />
<br />
==hello_world.pl==<br />
<br />
Create the package directory that will contain the package's configuration file:<br />
<br />
$ mkdir -p lib/epm/hello_world/cfg/cfg.d<br />
<br />
Create a configuration file that enables the plugin - this file is copied into the repository when the package is enabled:<br />
<br />
$ gedit lib/epm/hello_world/cfg/cfg.d/hello_world.pl<br />
<br />
$c->{plugins}{"Screen::Hello"}{params}{disable} = 0;<br />
<br />
'''NOTE All plugins in lib/plugins are disabled by default (see EPrints::PluginFactory::new) UNLESS you explicitly set the disable property in the plugin (and it doesn't make sense to set disable = 0 in the plugin because that would make it visible to all of your repositories even if they hadn't explicitly enabled your bazaar package).<br />
<br />
Tip: Any files you add below '''cfg/''' and are tracked by the EPM will be added to the repository when the EPM is enabled.<br />
<br />
<br />
== Commit changes ==<br />
<br />
After adding new files its important to record the changes<br />
<br />
Add all new files<br />
git add . <br />
<br />
Commit them with a message<br />
<br />
git commit -a -m "Added new Screen and its configuration. Also included new image"<br />
<br />
<br />
= Build the Package=<br />
<br />
Re-Edit your EPM in the "Developer Tools" section of the Bazaar Store. <br />
<br />
At the bottom of the screen (the ''Files'' selector) you need to add the files you created above:<br />
<br />
* epm/hello_world/cfg/cfg.d/hello_world.pl<br />
* plugins/EPrints/Plugin/Screen/Hello.pm<br />
* static/images/epm/hello_world.png<br />
<br />
<br />
= Testing in place =<br />
<br />
Use the ''link_lib'' argument in [[API:tools/epm]] to sym-link the plugin into your live repository:<br />
<br />
./tools/epm link_lib hello_world<br />
<br />
If needed, also include configuration<br />
./tools/epm link_cfg REPOID hello_world<br />
<br />
Followed by <br />
tools/epm enable REPOID hello_world<br />
<br />
= Enable and test the package=<br />
<br />
On the EPrints Bazaar ''Installed'' tab click ''Enable'' for the '''hello_world''' package. After a short time you should see a repository configuration reloaded message.<br />
<br />
In ''Admin'' &rarr; ''System Tools'' &rarr; ''Misc. Tools'' you should now a button-link to your plugin (although with a missing phrase).<br />
<br />
You can now use ''Uninstall'' to completely remove the package and the source files created. A copy of the package will be saved in '''var/cache/epm/hello_world-1.0.0.epm'''.<br />
<br />
<br />
= Adding the missing phrases=<br />
<br />
As EPrints is designed to be multi-language, phrases should be used instead of embedded text.<br />
<br />
In this section we add the phrase file to define a title and a description for our screen.<br />
<br />
Create the English language directory that will contain the package's English language phrase file:<br />
<br />
$ mkdir -p lib/lang/en/phrases/<br />
<br />
Create a phrase file:<br />
<br />
$ gedit lib/lang/en/phrases/hello_world.xml<br />
<br />
<source lang="xml"><br />
<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?><br />
<!DOCTYPE phrases SYSTEM "entities.dtd"><br />
<br />
<epp:phrases xmlns="http://www.w3.org/1999/xhtml" xmlns:epp="http://eprints.org/ep3/phrase" xmlns:epc="http://eprints.org/ep3/control"><br />
<br />
<epp:phrase id="Plugin/Screen/Hello:title">Hello</epp:phrase><br />
<epp:phrase id="Plugin/Screen/Hello:description">My First Bazaar Package</epp:phrase><br />
<br />
<epp:phrase id="Plugin/Screen/Hello:text">Hello World - This is the my first bazaar package calling.</epp:phrase><br />
<br />
</epp:phrases><br />
</source><br />
<br />
Don't worry too much about the wrapping here, the important thing is the phrases of which we have created 3. <br />
<br />
Note that 2 of these (the top 2) will get used instantly by our package however the 3rd needs to be added to the render method of our screen. <br />
<br />
In order to do this edit the Hello.pm screen created in Step 1 and add the following in the appropriate place in the render method.<br />
<br />
$frag->appendChild($repository->xml->create_element("br"));<br />
$frag->appendChild($self->html_phrase("text"));<br />
<br />
For some hints on loading and manipulating EPrints see [[Manipulating eprints in 3.2]].<br />
<br />
'''Don't Forget''' to add the phrase file to your bazaar package using the developer tools tab and commit them to git!<br />
<br />
'''WARNING: if your package overrides any existing EPrints phrases then your overrides will be applied to ALL repositories even if they have not enabled your package. In this case you would add your override phrases to a separate file - eg. lib/epm/hello_world/cfg/lang/en/phrases/hello_world_overrides.xml - this file will then only be considered when a repository enables your package.<br />
<br />
<br />
<br />
[[Category:EPrints_Bazaar]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=Getting_Started_with_the_EPrints_Bazaar&diff=13089Getting Started with the EPrints Bazaar2018-10-10T05:01:02Z<p>Kgoetz: add another category</p>
<hr />
<div>[[Category:EPrints_Bazaar]]<br />
[[Category:Bazaar Package]]<br />
<br />
EPrints Bazaar uses [[EPrints Package Manager]] to manage EPM packages. EPrints Package Manager has slightly different functionality via web and command line but in both cases they perform the same essential tasks:<br />
* install<br />
* update<br />
* disable<br />
<br />
EPM via web will also download the package; EPM via command line can only install an epm package downloaded by other means.<br />
<br />
<br />
== Commandline usage ==<br />
<br />
[[EPrints Package Manager | epm]]' lives in ''tools/epm''.<br />
<br />
[https://github.com/eprintsug/gitaar Gitaar] is available from Eprints User Group and eases the process of installing an EPM from git - for example a pre release or work in progress.<br />
<br />
== Non eprints utilities ==<br />
<br />
There are a couple of reasons you might want to know how to search and download without using the eprints supplied tools:<br />
* tools/epm in eprints 3.3 doesn't support searching<br />
* tools/epm in eprints 3.3 doesn't support downloading<br />
* you might want to check for updates via cron and email a warning<br />
<br />
=== Search ===<br />
<br />
Encoded in the [https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/EPM/Source.pm eprints source] are two URIs which can be used for searching, simple and simple2. simple2 accepts an optional parameter '''v'''.<br />
<br />
In all examples, q= is the value to search for.<br />
<br />
==== style 1 ====<br />
<br />
curl --location "http://bazaar.eprints.org/cgi/search?output=EPMI2&q=DOI”<br />
<br />
Use curl ''—location'' to follow redirection to /cgi/search/simple as is done by eprints.<br />
<br />
<br />
==== style 2 ====<br />
<br />
optional parameter ''v'' not included, equivalent to v=_all<br />
curl "http://bazaar.eprints.org/cgi/search/simple2?output=EPMI2&q_merge=ALL&q=DOI"<br />
<br />
v set to 'tbc', this returns an empty list.<br />
<br />
curl "http://bazaar.eprints.org/cgi/search/simple2?output=EPMI2&q_merge=ALL&v=tbc&q=DOI"<br />
<br />
TODO: find out what v= actually does.<br />
<br />
=== Downloading ===<br />
<br />
Command to download a bazaar plugin manually requires setting a custom Accept header. Failing to do so will show the html version of the page.<br />
<br />
curl -H "Accept: application/vnd.eprints.epm+xml" http://bazaar.eprints.org/id/eprint/545<br />
<br />
<br />
== Developing ==<br />
<br />
See available guides in the wiki categories ''Bazaar Package'' and ''EPrints Bazaar''.</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=User_roles.pl&diff=13088User roles.pl2018-10-03T01:27:11Z<p>Kgoetz: link 'buffer' to standard names which describes the four buffers available.</p>
<hr />
<div>User roles control various aspects of what a user can do in eprints. By default there are 4 categories of user: Administrator, Editor, User, and minimal User. user_roles.pl controls what each class of user can do. You can also make your own classes of user in this file.<br />
<br />
A role in EPrints is made up of 1 or more privileges. Giving a user a role gives them all the privileges associated with that role. You can also give users additional privileges without giving them the full role. <br />
<br />
==Creating a role==<br />
<br />
To create the role <code>approve-hat</code> you would do the following:<br />
<pre><br />
$c->{roles}->{"approve-hat"} = [<br />
"eprint/buffer/view:editor",<br />
"eprint/buffer/summary:editor",<br />
"eprint/buffer/details:editor",<br />
"eprint/buffer/move_archive:editor",<br />
];<br />
</pre><br />
The privileges listed above means the users given the <code>approve-hat</code> role can see the View, Summary, Details and Move to archive screen as an editor. Note because they cannot edit items [[Standard names |in the buffer]] they can't correct any mistakes they find. However they do have the power to move items to the archive. This means the <code>approve-hat</code> allows a user to see the metadata of an item and if they think it is correct move it to the archive. They cannot return it to the user or edit the metadata themselves.<br />
<br />
The quoting around the role name approve-hat is required, eprints will generate an error if the text is simply {approve-hat}.<br />
<br />
<br />
Tip: Ensure the role is in {roles} not {user_roles}!<br />
<br />
== Creating a privilege ==<br />
<br />
There is no special step to creating a privilege, simply define it where you would like it tested for. Equally, there is no specified format for privileges tying them to (for example) screens.<br />
<br />
As a result the following are all valid:<br />
<br />
* "eprint/coindoi"<br />
* "eprint/coindoiffff"<br />
* "eprint/coindoi:editor"<br />
<br />
==Assigning a role==<br />
Now that you have created a role you want to give that to class of users. To give every regular user of the repository the <code>approve-hat</code> you add it to the list of roles for the user.<br />
<br />
<pre><br />
$c->{user_roles}->{user} = [<br />
'general',<br />
'edit-own-record',<br />
'saved-searches',<br />
'set-password',<br />
'deposit',<br />
'change-email',<br />
'approve-hat',<br />
],<br />
</pre><br />
<br />
Rather than giving every user the role you can give it to individual users. Administer a users profile and add the name of the role to their list of additional roles.<br />
<br />
[[File:Approve-hat.jpg]]<br />
<br />
==Assigning a user privilege==<br />
You do not have to give a user a full role you can give them a privilege. The syntax is slightly different. Add the name of the privilege prefixed with a '+' to the list of roles. You can remove a privilege by prefixing it with a '-'.<br />
<br />
<pre><br />
$c->{user_roles}->{user} = [<br />
'general',<br />
'edit-own-record',<br />
'saved-searches',<br />
'set-password',<br />
'deposit',<br />
'change-email',<br />
'approve-hat',<br />
'+eprint/archive/edit:owner',<br />
],<br />
</pre><br />
<br />
You can also assign privileges to individual users through the web interface in the same way you can assign a role, remembering they will be listed as "roles". (remember the '+' or '-')<br />
<br />
There is no need for users to log in again following a privilege change, eprints will pick it up automatically.<br />
<br />
==List of Roles and privileges==<br />
This is a full list of privileges defined in EPrints 3.3.15. They are just strings so you create your own when you create a role in user roles.pl<br />
<br />
<pre><br />
{<br />
<br />
general => <br />
[<br />
"user/view:owner",<br />
"user/details:owner",<br />
"user/history:owner",<br />
],<br />
<br />
"edit-own-record" => <br />
[<br />
"user/edit:owner",<br />
],<br />
<br />
"set-password" => <br />
[<br />
"set-password",<br />
],<br />
<br />
"change-email" => <br />
[<br />
# not done<br />
],<br />
<br />
"change-user" => <br />
[<br />
# not done<br />
],<br />
<br />
"staff-view" => <br />
[<br />
# still needs search tools<br />
<br />
"eprint/inbox/view",<br />
"eprint/inbox/summary",<br />
"eprint/inbox/export",<br />
"eprint/inbox/details",<br />
"eprint/inbox/history",<br />
<br />
"eprint/buffer/view",<br />
"eprint/buffer/summary",<br />
"eprint/buffer/export",<br />
"eprint/buffer/details",<br />
"eprint/buffer/history",<br />
<br />
"eprint/archive/view",<br />
"eprint/archive/export",<br />
"eprint/archive/details",<br />
"eprint/archive/history",<br />
<br />
"eprint/deletion/view",<br />
"eprint/deletion/summary",<br />
"eprint/deletion/export",<br />
"eprint/deletion/details",<br />
"eprint/deletion/history",<br />
<br />
"eprint/search/staff",<br />
],<br />
<br />
"view-status" => <br />
[<br />
"status"<br />
],<br />
<br />
"admin" =><br />
[<br />
"indexer/stop",<br />
"indexer/start",<br />
"indexer/force_start",<br />
"create_user",<br />
"subject/edit",<br />
"staff/user_search",<br />
"staff/history_search",<br />
"staff/issue_search",<br />
"config/view",<br />
"config/view/xml",<br />
"config/view/workflow",<br />
"config/view/citation",<br />
"config/view/phrase",<br />
"config/view/namedset",<br />
"config/view/template",<br />
"config/view/static",<br />
"config/view/autocomplete",<br />
"config/view/apache",<br />
"config/view/perl",<br />
"config/test_email",<br />
"config/imports",<br />
"config/add_field",<br />
"config/remove_field",<br />
"config/regen_abstracts",<br />
"config/regen_views",<br />
"config/edit/perl",<br />
<br />
"storage/manager",<br />
"repository/epm", #EPrints Package Manager<br />
<br />
"event_queue/destroy",<br />
"event_queue/details",<br />
"event_queue/edit",<br />
"event_queue/export",<br />
"event_queue/view",<br />
"eprint/destroy",<br />
"eprint/details",<br />
"eprint/edit",<br />
"eprint/export",<br />
"eprint/upsert",<br />
"eprint/view",<br />
"eprint/archive/remove",<br />
"eprint/archive/edit", # BatchEdit<br />
"file/destroy",<br />
"file/export",<br />
"file/view",<br />
"import/view",<br />
"import/edit",<br />
"saved_search/destroy",<br />
"saved_search/details",<br />
"saved_search/edit",<br />
"saved_search/export",<br />
"saved_search/view",<br />
"user/remove",<br />
"user/edit",<br />
"user/view",<br />
"user/details",<br />
"user/destroy",<br />
"user/history",<br />
"user/staff/edit",<br />
"repository/epm-submit", #EPrints Package Manager - Bazaar Package Submission<br />
],<br />
<br />
"toolbox" => <br />
[<br />
"toolbox",<br />
],<br />
<br />
"edit-config" => <br />
[<br />
"config/edit",<br />
"config/edit/xml",<br />
"config/edit/workflow",<br />
"config/edit/citation",<br />
"config/edit/phrase",<br />
"config/edit/namedset",<br />
"config/edit/template",<br />
"config/edit/static",<br />
"config/edit/autocomplete",<br />
# not editing perl files or apache files!<br />
"config/reload",<br />
],<br />
<br />
"saved-searches" => <br />
[<br />
"saved_search",<br />
"create_saved_search",<br />
"saved_search/view:owner",<br />
"saved_search/edit:owner",<br />
"saved_search/destroy:owner",<br />
],<br />
<br />
deposit => <br />
[<br />
"items",<br />
"create_eprint",<br />
"user/history:owner",<br />
<br />
"eprint/inbox/view:owner",<br />
"eprint/inbox/export:owner",<br />
"eprint/inbox/summary:owner",<br />
"eprint/inbox/destroy:owner",<br />
"eprint/inbox/deposit:owner",<br />
"eprint/inbox/edit:owner",<br />
"eprint/inbox/remove:owner",<br />
"eprint/inbox/details:owner",<br />
"eprint/inbox/history:owner",<br />
"eprint/inbox/messages:owner",<br />
"eprint/inbox/issues:owner",<br />
<br />
"eprint/inbox/deposit:owner",<br />
"eprint/inbox/use_as_template:owner",<br />
"eprint/inbox/derive_version:owner",<br />
<br />
<br />
"eprint/buffer/view:owner",<br />
"eprint/buffer/export:owner",<br />
"eprint/buffer/summary:owner",<br />
"eprint/buffer/move_inbox:owner",<br />
"eprint/buffer/details:owner",<br />
"eprint/buffer/history:owner",<br />
"eprint/buffer/messages:owner",<br />
<br />
"eprint/buffer/request_removal:owner",<br />
"eprint/buffer/use_as_template:owner",<br />
"eprint/buffer/derive_version:owner",<br />
<br />
<br />
"eprint/archive/view:owner",<br />
"eprint/archive/export:owner",<br />
"eprint/archive/summary:owner",<br />
"eprint/archive/details:owner",<br />
"eprint/archive/history:owner",<br />
"eprint/archive/messages:owner",<br />
<br />
"eprint/archive/request_removal:owner",<br />
"eprint/archive/use_as_template:owner",<br />
"eprint/archive/derive_version:owner",<br />
<br />
<br />
"eprint/deletion/view:owner",<br />
"eprint/deletion/export:owner",<br />
"eprint/deletion/summary:owner",<br />
"eprint/deletion/details:owner",<br />
"eprint/deletion/history:owner",<br />
"eprint/deletion/messages:owner",<br />
<br />
"eprint/deletion/use_as_template:owner",<br />
"eprint/deletion/derive_version:owner",<br />
],<br />
<br />
editor => <br />
[<br />
"datasets",<br />
<br />
"editorial_review",<br />
<br />
"eprint/inbox/view:editor",<br />
"eprint/inbox/export:editor",<br />
"eprint/inbox/summary:editor",<br />
"eprint/inbox/export:editor",<br />
"eprint/inbox/details:editor",<br />
"eprint/inbox/history:editor",<br />
"eprint/inbox/messages:editor",<br />
<br />
"eprint/inbox/remove_with_email:editor",<br />
"eprint/inbox/move_archive:editor",<br />
"eprint/inbox/move_buffer:editor",<br />
"eprint/inbox/use_as_template:editor",<br />
"eprint/inbox/derive_version:editor",<br />
"eprint/inbox/edit:editor",<br />
"eprint/inbox/takelock:editor",<br />
<br />
<br />
"eprint/buffer/view:editor",<br />
"eprint/buffer/export:editor",<br />
"eprint/buffer/summary:editor",<br />
"eprint/buffer/export:editor",<br />
"eprint/buffer/details:editor",<br />
"eprint/buffer/history:editor",<br />
"eprint/buffer/messages:editor",<br />
"eprint/buffer/issues:editor",<br />
<br />
"eprint/buffer/remove_with_email:editor",<br />
"eprint/buffer/reject_with_email:editor",<br />
"eprint/buffer/move_inbox:editor",<br />
"eprint/buffer/move_archive:editor",<br />
"eprint/buffer/use_as_template:editor",<br />
"eprint/buffer/derive_version:editor",<br />
"eprint/buffer/edit:editor",<br />
"eprint/buffer/takelock:editor",<br />
<br />
<br />
"eprint/archive/view:editor",<br />
"eprint/archive/export:editor",<br />
"eprint/archive/details:editor",<br />
"eprint/archive/history:editor",<br />
"eprint/archive/messages:editor",<br />
"eprint/archive/issues:editor",<br />
<br />
"eprint/archive/move_buffer:editor",<br />
"eprint/archive/move_deletion:editor",<br />
"eprint/archive/use_as_template:editor",<br />
"eprint/archive/derive_version:editor",<br />
"eprint/archive/edit:editor",<br />
"eprint/archive/takelock:editor",<br />
<br />
<br />
"eprint/deletion/view:editor",<br />
"eprint/deletion/export:editor",<br />
"eprint/deletion/summary:editor",<br />
"eprint/deletion/export:editor",<br />
"eprint/deletion/details:editor",<br />
"eprint/deletion/history:editor",<br />
"eprint/deletion/messages:editor",<br />
<br />
"eprint/deletion/move_archive:editor",<br />
"eprint/deletion/use_as_template:editor",<br />
"eprint/deletion/derive_version:editor",<br />
"eprint/deletion/takelock:editor",<br />
],<br />
<br />
rest => [<br />
"eprint/archive/rest/get:editor",<br />
"eprint/archive/rest/put:editor",<br />
"eprint/buffer/rest/get:editor",<br />
"eprint/buffer/rest/put:editor",<br />
"eprint/inbox/rest/get:editor",<br />
"eprint/inbox/rest/put:editor",<br />
"eprint/deletion/rest/get:editor",<br />
"eprint/deletion/rest/put:editor",<br />
<br />
"eprint/inbox/rest/get:owner",<br />
"eprint/inbox/rest/put:owner",<br />
"eprint/buffer/rest/get:owner",<br />
"eprint/archive/rest/get:owner",<br />
"eprint/deletion/rest/get:owner",<br />
<br />
"user/rest/get:owner",<br />
<br />
"subject/rest/get",<br />
],<br />
<br />
};<br />
<br />
</pre></div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=Perl_lib/EPrints/Plugin/Screen/User/&diff=13087Perl lib/EPrints/Plugin/Screen/User/2018-10-03T00:53:08Z<p>Kgoetz: add categories</p>
<hr />
<div><br />
These all '''may''' take userid as a parameter of the user object to act on. If no userid is set then the current user is used instead.<br />
<br />
*'''[[EPrints_Directory_Structure/eprints3|eprints3]]/[[EPrints_Directory_Structure/eprints3/perl_lib|perl_lib]]/[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints|EPrints]]/[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin|Plugin]]/[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen|Screen]]/User'''<br />
** '''Edit.pm''' -<br />
** '''History.pm''' -<br />
** '''SaveSearch.pm''' -<br />
** '''[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen/User/SavedSearch|SavedSearch/]]''' -<br />
** '''SavedSearch.pm''' -<br />
** '''SavedSearches.pm''' -<br />
** '''[[Perl lib/EPrints/Plugin/Screen/Staff/|Staff/]]''' -<br />
** '''View.pm''' -<br />
<br />
<br />
[[Category: Out of Date]]<br />
[[Category: Eprints3.2]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=Perl_lib/EPrints/Plugin/Screen/User/&diff=13086Perl lib/EPrints/Plugin/Screen/User/2018-10-03T00:52:43Z<p>Kgoetz: update link</p>
<hr />
<div><br />
These all '''may''' take userid as a parameter of the user object to act on. If no userid is set then the current user is used instead.<br />
<br />
*'''[[EPrints_Directory_Structure/eprints3|eprints3]]/[[EPrints_Directory_Structure/eprints3/perl_lib|perl_lib]]/[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints|EPrints]]/[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin|Plugin]]/[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen|Screen]]/User'''<br />
** '''Edit.pm''' -<br />
** '''History.pm''' -<br />
** '''SaveSearch.pm''' -<br />
** '''[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen/User/SavedSearch|SavedSearch/]]''' -<br />
** '''SavedSearch.pm''' -<br />
** '''SavedSearches.pm''' -<br />
** '''[[Perl lib/EPrints/Plugin/Screen/Staff/|Staff/]]''' -<br />
** '''View.pm''' -</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=Eprints3/perl_lib/EPrints/Plugin/Screen/User/Staff&diff=13085Eprints3/perl lib/EPrints/Plugin/Screen/User/Staff2018-10-03T00:51:31Z<p>Kgoetz: update redirect</p>
<hr />
<div>#redirect [[Perl lib/EPrints/Plugin/Screen/Staff/]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=Perl_lib/EPrints/Plugin/Screen/Staff/&diff=13084Perl lib/EPrints/Plugin/Screen/Staff/2018-10-03T00:50:58Z<p>Kgoetz: add categories</p>
<hr />
<div>*'''[[EPrints_Directory_Structure/eprints3|eprints3]]/[[EPrints_Directory_Structure/eprints3/perl_lib|perl_lib]]/[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints|EPrints]]/[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin|Plugin]]/[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen|Screen]]/Staff'''<br />
** '''EPrintSearch.pm''' -<br />
** '''HistorySearch.pm''' -<br />
** '''UserSearch.pm''' -<br />
<br />
[[Category: Eprints3.2]]<br />
[[Category: Out of Date]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen/EPrint&diff=13082EPrints Directory Structure/eprints3/perl lib/EPrints/Plugin/Screen/EPrint2018-10-03T00:47:33Z<p>Kgoetz: add categories</p>
<hr />
<div>[[Category: OpenAccess]]<br />
[[Category: Eprints3.2]]<br />
[[Category: Out of Date]]<br />
<br />
These all must take eprintid as a parameter. This is the eprintid of the eprint object to act on.<br />
<br />
Many of the EPrint:: screen plugins are used as tabs in the view, rather than accessed directly (although they can be). <br />
<br />
*'''[[EPrints_Directory_Structure/eprints3|eprints3]]/[[EPrints_Directory_Structure/eprints3/perl_lib|perl_lib]]/[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints|EPrints]]/[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin|Plugin]]/[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen|Screen]]/EPrint'''<br />
** '''Actions.pm''' -<br />
** '''Deposit.pm''' -<br />
** '''Details.pm''' -<br />
** '''Edit.pm''' -<br />
** '''EditLink.pm''' -<br />
** '''Error.pm''' -<br />
** '''Export.pm''' -<br />
** '''History.pm''' -<br />
** '''Messages.pm''' -<br />
** '''Move.pm''' -<br />
** '''NewVersion.pm''' -<br />
** '''RejectWithEmail.pm''' -<br />
** '''Remove.pm''' -<br />
** '''RemoveWithEmail.pm''' -<br />
** '''RequestRemoval.pm''' -<br />
** '''[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen/EPrint/Staff|Staff/]]''' -<br />
** '''Summary.pm''' -<br />
** '''UseAsTemplate.pm''' -<br />
** '''[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen/EPrint/View|View/]]''' -<br />
** '''View.pm''' -</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen&diff=13081EPrints Directory Structure/eprints3/perl lib/EPrints/Plugin/Screen2018-10-03T00:47:11Z<p>Kgoetz: adding categories</p>
<hr />
<div>[[Category: OpenAccess]]<br />
[[Category: Eprints3.2]]<br />
[[Category: Out of Date]]<br />
<br />
*'''[[EPrints_Directory_Structure/eprints3|eprints3]]/[[EPrints_Directory_Structure/eprints3/perl_lib|perl_lib]]/[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints|EPrints]]/[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin|Plugin]]/Screen'''<br />
** '''AbstractSearch.pm''' -<br />
** '''[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen/Admin|Admin/]]''' -<br />
** '''Admin.pm''' -<br />
** '''[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen/EPrint|EPrint/]]''' -<br />
** '''EPrint.pm''' -<br />
** '''Error.pm''' -<br />
** '''Example.pm''' -<br />
** '''FirstTool.pm''' -<br />
** '''Import.pm''' -<br />
** '''Items.pm''' -<br />
** '''NewEPrint.pm''' -<br />
** '''NewUser.pm''' -<br />
** '''[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen/Public|Public/]]''' -<br />
** '''[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen/Request|Request/]]''' -<br />
** '''Review.pm''' -<br />
** '''[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen/Staff|Staff/]]''' -<br />
** '''Status.pm''' -<br />
** '''[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen/Subject|Subject/]]''' -<br />
** '''Subject.pm''' -<br />
** '''[[EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Screen/User|User/]]''' -<br />
** '''User.pm''' -</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Export/EAP.pm&diff=13080EPrints Directory Structure/eprints3/perl lib/EPrints/Plugin/Export/EAP.pm2018-10-03T00:47:03Z<p>Kgoetz: add categories</p>
<hr />
<div>[[Category: OpenAccess]]<br />
[[Category: Eprints3.2]]<br />
[[Category: Out of Date]]<br />
<br />
= Scholarly Works Application Profile =<br />
<br />
This page describes how the EAP/SWAP export plugin complies with the SWAP.<br />
<br />
[http://www.ukoln.ac.uk/repositories/digirep/index/Eprints_Application_Profile Eprints Application Profile]<br />
<br />
== Model ==<br />
<br />
Mapping the SWAP model onto EPrints.<br />
<br />
=== ScholarlyWork ===<br />
<br />
An abstract concept not implemented in Eprints.<br />
<br />
* title - eprint.title<br />
* subject - eprint.subjects<br />
* abstract - eprint.abstract<br />
* grant number - eprint.projects/funders<br />
* has adaptation - N/A<br />
* identifier (URI) - eprint.eprintid<br />
<br />
=== Expression ===<br />
<br />
The EPrint object.<br />
<br />
* title - eprint.title<br />
* description - N/A<br />
* date available - eprint.datestamp<br />
* status - eprint.status<br />
* version number or string - N/A (further work)<br />
* language - eprint.lang (maybe document.lang? unclear)<br />
* genre / type - eprint.type<br />
* copyright holder - N/A or repository-level?<br />
* has version - N/A (further work)<br />
* has translation - N/A<br />
* bibliographic citation - eprint.render_citation()<br />
* references - N/A<br />
* identifier (URI) - eprint.eprintid<br />
<br />
=== Manifestation ===<br />
<br />
The Document object.<br />
<br />
* format - document.format (MIME-type)<br />
* date modified - eprint.lastmod<br />
* identifier (URI) - eprint.eprintid + document.documentid<br />
<br />
=== Copy ===<br />
<br />
Part of the Document object?<br />
<br />
* date available - eprint.datestamp?<br />
* access rights - N/A<br />
* licence - document.license<br />
* is part of - eprint?<br />
* identifier/locator (URI) - file URL<br />
<br />
=== Agent ===<br />
<br />
Eprint user record (but unused).<br />
<br />
* name - user.username<br />
* family name - user.name.family<br />
* given name - user.name.given<br />
* type of agent - user.usertype<br />
* workplace homepage - N/A<br />
* mailbox - user.email<br />
* homepage - N/A<br />
* identifier (URI) - user.userid</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=EPrints_Directory_Structure/eprints3/perl_lib/EPrints/Plugin/Export/EAP.pm&diff=13079EPrints Directory Structure/eprints3/perl lib/EPrints/Plugin/Export/EAP.pm2018-10-03T00:46:22Z<p>Kgoetz: add categories</p>
<hr />
<div>[[Category: OpenAccess]]<br />
[[Category: Eprints3.2]]<br />
<br />
= Scholarly Works Application Profile =<br />
<br />
This page describes how the EAP/SWAP export plugin complies with the SWAP.<br />
<br />
[http://www.ukoln.ac.uk/repositories/digirep/index/Eprints_Application_Profile Eprints Application Profile]<br />
<br />
== Model ==<br />
<br />
Mapping the SWAP model onto EPrints.<br />
<br />
=== ScholarlyWork ===<br />
<br />
An abstract concept not implemented in Eprints.<br />
<br />
* title - eprint.title<br />
* subject - eprint.subjects<br />
* abstract - eprint.abstract<br />
* grant number - eprint.projects/funders<br />
* has adaptation - N/A<br />
* identifier (URI) - eprint.eprintid<br />
<br />
=== Expression ===<br />
<br />
The EPrint object.<br />
<br />
* title - eprint.title<br />
* description - N/A<br />
* date available - eprint.datestamp<br />
* status - eprint.status<br />
* version number or string - N/A (further work)<br />
* language - eprint.lang (maybe document.lang? unclear)<br />
* genre / type - eprint.type<br />
* copyright holder - N/A or repository-level?<br />
* has version - N/A (further work)<br />
* has translation - N/A<br />
* bibliographic citation - eprint.render_citation()<br />
* references - N/A<br />
* identifier (URI) - eprint.eprintid<br />
<br />
=== Manifestation ===<br />
<br />
The Document object.<br />
<br />
* format - document.format (MIME-type)<br />
* date modified - eprint.lastmod<br />
* identifier (URI) - eprint.eprintid + document.documentid<br />
<br />
=== Copy ===<br />
<br />
Part of the Document object?<br />
<br />
* date available - eprint.datestamp?<br />
* access rights - N/A<br />
* licence - document.license<br />
* is part of - eprint?<br />
* identifier/locator (URI) - file URL<br />
<br />
=== Agent ===<br />
<br />
Eprint user record (but unused).<br />
<br />
* name - user.username<br />
* family name - user.name.family<br />
* given name - user.name.given<br />
* type of agent - user.usertype<br />
* workplace homepage - N/A<br />
* mailbox - user.email<br />
* homepage - N/A<br />
* identifier (URI) - user.userid</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=EPrints_OAI_Stylesheet&diff=13078EPrints OAI Stylesheet2018-10-03T00:44:07Z<p>Kgoetz: fix syntax</p>
<hr />
<div>To use the EPrints OAI stylesheet on another server:<br />
<br />
# Download the XSL source from https://svn.eprints.org/eprints/trunk/system/lib/static/oai2.xsl<br />
# Make oai2.xsl accessible from somewhere on your OAI 2 server - browsers' same-origin policy require the xsl file to be hosted on the same server<br />
# Add the stylesheet to your OAI 2 response:<br />
<br />
<source lang="xml"><br />
<?xml version='1.0' encoding='UTF-8'?><br />
<?xml-stylesheet type='text/xsl' href='/oai2.xsl' ?><br />
<OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd"><br />
<responseDate>2011-12-15T18:11:46Z</responseDate><br />
<request>http://eprints.soton.ac.uk/cgi/oai2</request><br />
<error code="badVerb">Requires verb argument</error><br />
</OAI-PMH><br />
</source><br />
<br />
<br />
[[Category: Out of Date]]<br />
[[Category: OpenAccess]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=EPrints_OAI_Stylesheet&diff=13077EPrints OAI Stylesheet2018-10-03T00:43:41Z<p>Kgoetz: adding categories</p>
<hr />
<div>To use the EPrints OAI stylesheet on another server:<br />
<br />
# Download the XSL source from https://svn.eprints.org/eprints/trunk/system/lib/static/oai2.xsl<br />
# Make oai2.xsl accessible from somewhere on your OAI 2 server - browsers' same-origin policy require the xsl file to be hosted on the same server<br />
# Add the stylesheet to your OAI 2 response:<br />
<br />
<source lang="xml"><br />
<?xml version='1.0' encoding='UTF-8'?><br />
<?xml-stylesheet type='text/xsl' href='/oai2.xsl' ?><br />
<OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd"><br />
<responseDate>2011-12-15T18:11:46Z</responseDate><br />
<request>http://eprints.soton.ac.uk/cgi/oai2</request><br />
<error code="badVerb">Requires verb argument</error><br />
</OAI-PMH><br />
</source><br />
<br />
<br />
[[Category: Out of Date]]<br />
[[Category: OpenAccess</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Itemref&diff=13075API:EPrints/MetaField/Itemref2018-10-03T00:40:41Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Subject&diff=13074API:EPrints/MetaField/Subject2018-10-03T00:40:29Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Id&diff=13073API:EPrints/MetaField/Id2018-10-03T00:39:25Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Langid&diff=13072API:EPrints/MetaField/Langid2018-10-03T00:38:04Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Longtext&diff=13071API:EPrints/MetaField/Longtext2018-10-03T00:37:52Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Name&diff=13070API:EPrints/MetaField/Name2018-10-03T00:37:39Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Namedset&diff=13069API:EPrints/MetaField/Namedset2018-10-03T00:37:16Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Set&diff=13068API:EPrints/MetaField/Set2018-10-03T00:37:00Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Secret&diff=13067API:EPrints/MetaField/Secret2018-10-03T00:36:47Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Search&diff=13066API:EPrints/MetaField/Search2018-10-03T00:36:35Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Pagerange&diff=13065API:EPrints/MetaField/Pagerange2018-10-03T00:36:22Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Subobject&diff=13064API:EPrints/MetaField/Subobject2018-10-03T00:32:34Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Text&diff=13063API:EPrints/MetaField/Text2018-10-03T00:32:25Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Url&diff=13062API:EPrints/MetaField/Url2018-10-03T00:32:14Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Year&diff=13061API:EPrints/MetaField/Year2018-10-03T00:32:05Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/Extras&diff=13060API:EPrints/Extras2018-10-03T00:31:21Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/Index&diff=13057API:EPrints/Index2018-10-03T00:30:12Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/Latex&diff=13055API:EPrints/Latex2018-10-03T00:29:51Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Arclanguage&diff=13054API:EPrints/MetaField/Arclanguage2018-10-03T00:29:43Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Boolean&diff=13053API:EPrints/MetaField/Boolean2018-10-03T00:29:33Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Compound&diff=13052API:EPrints/MetaField/Compound2018-10-03T00:29:18Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Email&diff=13051API:EPrints/MetaField/Email2018-10-03T00:29:06Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Fields&diff=13050API:EPrints/MetaField/Fields2018-10-03T00:28:51Z<p>Kgoetz: addi</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/File&diff=13049API:EPrints/MetaField/File2018-10-03T00:28:43Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Float&diff=13048API:EPrints/MetaField/Float2018-10-03T00:28:29Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/MetaField/Fulltext&diff=13047API:EPrints/MetaField/Fulltext2018-10-03T00:28:12Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/DataObj/Request&diff=13045API:EPrints/DataObj/Request2018-10-03T00:27:26Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetzhttps://wiki.eprints.org/w/index.php?title=API:EPrints/DataObj/MetaField&diff=13044API:EPrints/DataObj/MetaField2018-10-03T00:27:10Z<p>Kgoetz: adding Category:Rubbish, page was emptied 9 years ago and has been untouched since</p>
<hr />
<div>[[Category: Rubbish]]</div>Kgoetz