Tuesday, May 4, 2010

Commecial Grade Repository(Eprints)


INTRODUCTIONS:
So, we 've finally finished exploring EPrints ,and found out that it really fitted to the applications of a Digital Repository.

But we're not through yet or have done it almost if we would refer on a commercialize or high-end web data repository.There are a needs to dig out some configurations files: in its web-url, database format,scripts and etc.One thing more, the best way to customize eprints is not so much on GUI published management "Admin:Config tools" but rather on the files that can be found in its subdirectories.There are more shell commands found in the /usr/local/eprints3/bin that are used to change eprints file systems (GUI,DB,etc)

In this follow up blog-article will show us an interest much on branding ,deploying and configuring the system on our preferred setup and lastly we would be able to appreciate the digital repository sytem and so much so is the legacy of EPrints.


OBJECTIVES:
1) To use e-Prints in building digital repository
2) To fully costumize eprints in the organizational data structure repository design
3) To design library depository scheme/methods other than "Library of Congress Index"
4) To deploy hi-end fully costumized commercial digital repository

METHODOLOGY:
1)Branding
Login to Admin->Home then click edit image , the html source page can be edited.

2)Adding Views


3)Policy/Guidelines

Create your simple policy html files in a notepad , then copy it as "guide.html" in the directory/path below.
root@localhost # /usr/local/eprints3/archives/Archive_ID/cfg/en/guide.html

4) Work Flow(Type:Division:Subjects)

5)Crontab for active maintainance(script scheduler)

The system administrator is usually logged in as "root", but making changes to another user's crontab file or simply looking at another user's crontab file is often necessary. For situations like this, you can append the "-u" flag followed by the desired username.For example, if logged in as root but you want to edit the crontab for the user "admin", you would do the following:
crontab -e -u admin
Note** Now,I expect that you know how to access the crontab,let's take a look at the syntax of the crontab entry itself.
A typical crontab entry might look like this: 30 0,12 * * * /usr/local/eprints3/bin/
OK, so what does that mean? Well, there are 2 parts to the entry you see above. In fact, any crontab entry has 2 parts:
Part 1 - The setting the scheduler
The schedule, which governs when the task will run, consists of a string of numbers, possible commas and asterisks (*).So, in the above example, the schedule is:
30 0,12 * * *
What you are seeing is actually split up into 5 sections. The following chart illustrates what each section of the schedule is for:
1. Minute - Minutes after the hour (0-59).
2. Hour - 24-hour format (0-23).
3. Day - Day of the month (1-31).
4. Month - Month of the year (1-12).
5. Weekday - Day of the week. (0-6, where 0 indicates Sunday).
* = An asterisk in a schedule field indicates "every". It means that the task will occur on "every" instance of the given field. So a "*" on the Month field indicates the the task will run "every" month of the year. A * in the Minutes field would indicate that the task would run "every" minute. , = A comma is used to input multiple values for a field. For example, if you wanted a task to run at hours 12, 15 and 18, you would enter that as "12,15,18".
Let's take a look at how this format fits into the syntax of a crontab entry:
_________________________ 1.Minutes after the hour (0-59)
|
| ______________________ 2. 24-hour format (0-23).
| |
| | ___________________ 3.Day of the month (1-31)
| | |
| | | ________________ 4. Month of the year (1-12)
| | | |
| | | | ______________5. Day of the week. (0-6, where 0 indicates Sunday)
| | | | |
30 0,12 * * * /some/script/or/command

So, when we combine all the schedule elements, we know when and how often this task will run. Going on the above example, this task would run: At 30 minutes past the hours of 0 (midnight) and 12 (noon), EVERY day of the month, EVERY month of the year and EVERY day of the week. In other words, the above task would run every single day at 12:30AM and 12:30PM.
Let's play around with the schedule a little bit and try something different. What if we had something like this:
15,45 0,12,6 20 1,2,3 0 ./ /usr/local/eprints3/bin/generate_views mainlib

Let's decipher it...
15,45 - This means that the task will run at 15 and 45 minutes past the hour. But what hours and what days? Well, that's coming up.
0.12.6 - The task will run during the hours of 0 (midnight), 12 (noon) and 6AM.
20 - The task will run on the 20th day of the month. But during what months?
1,2,3 - The task will run only during the months of January, February and March.
0 - The task will only run on a Sunday.

So, when we put all of this information together,the task is going to run at 0:15, 0:45, 6:15, 6:45, 12:15 and 12:45 on the 20th of January, February and March IF that day falls on a Sunday.
Part 2: The task needs to be executed
In the above example, the "task" to run would be: ./ /usr/local/eprints3/bin/generate_views mainlib .
actually, we have a lot of scripts to run , and that can be found in the directory of /usr/local/eprints3/bin/
6)Back Up

New Server:
Let may give you some clear procedures to back up your eprints.In your old server to your new eprints server. Here is the link of my previous post with regards eprints installations.
http://cobecoballes-linux.blogspot.com/2010/04/e-prints-complete-metadata-repository.html


Given:
user name 'mainlib'
data base name 'mainlib_DB'
data base password 'xxxxyyy'

Old Server:
1)Please back up the following files: /usr/local/eprints3 ; /var/lib/mysql/mainlib_DB
root@localhost# tar zxf eprints_backup.tar /usr/local/eprints3/
root@localhost# mysqladmin -u root password "XXXYYY"
root@localhost# mysqladmin -u root -p create mainlib_DB
root@localhost# mysqldump --opt mainlib_DB > eprints_db.sql -u mainlib -p
root@localhost# scp eprints_backup.tar root@IP_NEW_SERVER:/usr/local/eprints3/
root@localhost# scp eprints_db.sql root@IP_NEW_SERVER:/var/lib/mysql/

New server:

1)Install the same version of eprints.ver.3.x in the new server ,see to it that you can point the name to the local browser after the installations: http://name.eprints (example only)


2)Copy those : eprints_db.sql eprints_backup.tar

root@localhost# tar zxvf eprints_backup.tar
root@localhost# mysqladmin -u root password "XXXYYY"
root@localhost# mysqladmin -u root -p create mainlib_DB
root@localhost# mysql-u root -p mainlib_DB < style="font-style: italic;">root@localhost# "mysql mainlib_DB "
root@localhost# mysql> grant all privileges on mainlib_DB.* to mainlib@localhost identified by 'eprints1234';

EPRINTS COSTUMIZATIONS(Webpage Layout)


1)Changing captions
Log in to Admin -> Admin ->config tools-> Edit page phrases

2) Adding Eprint Type (Browse by Type)
root@localhost# /usr/local/eprints3/archives/Archive_ID/cfg/cdg.d/views.pl

3)Adding editing Eprint Material type
root@localhost# /usr/local/eprints3/archives/Archive_ID/cfg/namedsets/
root@localhost# vim eprint

ex: reports
root@localhost# vim /usr/local/eprints3/lib/lang/en/phrases/system.xml
root@localhost# vim /usr/local/eprints3/lib/lang/en/phrases/zz_wconfig.xml

4) Adding subject (Browse by Subject)
root@localhost# /usr/local/eprints3/archives/Archive_ID/
root@localhost# vim subject

5) Adding details (Publisher details) in a customized material type
root@localhost# vim /usr/local/eprints3/archives/mainlib/cfg/workflows/eprint/default.xml
Copy an old field of existing material type and change its type name by a new material type name; ie, "other" to "added_name". other'">


6) Upgrading repositories from an old to a new eprints version
root@localhost # cd /usr/local/eprints3/bin
root@localhost# sudo -u eprints ./ epadmin upgrade repository_id
7) Update eprints database structure to its latest meta-fields
root@localhost # cd /usr/local/eprints3/bin
root@localhost# sudo -u eprints ./epadmin update_database_structure repository_id
Importing and Exporting MARC protocolInstall the followiing perl modules for MARC
cpan > instal XML::SAX
cpan> install MARC::Record
cpan > install MARC::Charset
cpan > install MARC::XML
cpan > install MARC::File::XML

Note**
We can also you "yum" instead of "cpan" installation
ex:
root@localhost # yum install perl-MARC-XML
Then download the following files "EPrints-MARC_0.1.tar.gz" and extract it in the
root@localhost# cd /usr/local/eprints3/
copy the "marc.pl" file in the
root@locahost# cd /usr/local/eprints3/archives/Archived_ID/cfg/cfg.d/
Then goto eprints browser " manage depository" , [Import] and choose
"marc" then Bingoooo!


MULTIPLE EPRINTS REPOSITORIES(Virtual Directories)
o)Please follow the steps "CREATING AN ARCHIVE"
1) Create more than one archive
2) Give a DNS name for each archive

a) roots.localhost # /usr/local/eprints3/bin/ create epadmin engineering
a.1) hostname? engineering.mainlib.xxd.edu.ph

b) roots.localhost# /usr/local/eprints3/bin/ create epadmin mainlib
b.1) hostname? eprints.mainlib.xxd.edu.ph


REMARKS:

Hint!
If you had lost your "mysql" database root password elsewhere and your memories can't retrieve it any-more best thing is to these.

root@localhost # service mysqld stop
root@localhost@ mysqld_safe
open another tab for cli command,then...
root@localhost# mysql -u root mysql
Enter Password:

mysql>
update user set Password=PASSWORD('new-password-here!') WHERE User='root';
Query OK, 2 rows affected (0.04 sec)

Rows matched: 2 Changed: 2 Warnings: 0


mysql> flush privileges;

Query OK, 0 rows affected (0.02 sec)
mysql> exit
Bye

and you wouldn't be worrying any more.....alligator!

If Eprints is running yet some features are not available you may try to add some module or addons to supplement your requirements, and it is important to know if some software were installed already such as:

root@localhost# vim /usr/local/eprints3/perl_lib/EPrints/SystemSettings.pm
-------------------------------------------------------------------------------
'executables' => {
'convert' => '/usr/bin/convert',
'tar' => '/bin/tar',
'rm' => '/bin/rm',
'dvips' => '/usr/bin/dvips',
'gunzip' => '/bin/gunzip',
'sendmail' => '/usr/sbin/sendmail',
'unzip' => '/usr/bin/unzip',
'elinks' => '/usr/bin/elinks',
'cp' => '/bin/cp',
'latex' => '/usr/bin/latex',
'perl' => '/usr/bin/perl',
'pdftotext' => '/usr/bin/pdftotext',
'wget' => '/usr/bin/wget',
'antiword' => '/usr/bin/antiword'
},
-------------------------------------------------------------------------------
for example:Antiword for viewing pdf; to know if antiword is installed , pls type
root@localhost # which antiword
then must appear where the exectables is loaded
root@localhost# /usr/bin/antiword
After eprints migrations not all previous service are active ;therefore there is a need to familiarise the script in just to make it working again:root@localhost # /usr/local/eprints3/bin
To change to a new apache configurations
0) root@localhost # ./generate_apacheconf archive_ID

To change new browsing
1)root@localhost # ./generate_views archive_ID

To change new text record
2) root@localhost # ./generate_abstract archive_ID

To restore a archives
3)root@localhost # ./generate_static archive_ID

For restoring thumbnail preview
4)root@localhost # ./epadmin redothumbnails archive_ID
To generate video preview
5)root@localhost # ./generate_video_preview


For some advance tricks about eprints....check this out!http://imageweb.zoo.ox.ac.uk/wiki/index.php?title=DefiningImageAccess/Tool/Eprints&printable=yes#Customizing_the_browsing_interface

CONCLUSIONS:

1 comment:

  1. I am almost reverse engineering it , but that is cool.

    ReplyDelete