Getting Started Eprints Training: Repository Configuration Exercises
Total Page:16
File Type:pdf, Size:1020Kb
EPrints Training: Repository Configuration Exercises Exercise 1: Getting Started The PCs provided for this session have been pre-installed with an EPrints demo repository. 1.1 Logging In To log into the machine enter the username eprints, Press return, and when asked enter the password you have been given. You will the be logged into the desktop. If you©re not familiar with Linux, don©t panic! Things work more or less the same as in Windows. 1.2 Entering Commands A terminal allows you to type commands directly. This is how you will issue commands to EPrints. Click the right mouse button on the desktop and select Open Terminal from the popup menu. Enter the following command: eprints> cd /opt/eprints2 (eprints> means ªtype this as user eprintsº) 1.3 Starting a Text Editor Each of the exercises in this session require you to edit one or more EPrints configuration files. To start a text editor application, click on the Applications button on the top left hand corner of the screen, select Accessories, then Text Editor. To edit the file: /opt/eprints2/archives/myid/cfg/template-en.xml click the Open button on the toolbar, then double-click on Filesystem in the left hand pane of the Open File.. dialog box. In the right hand pane, double-click opt, then eprints2 etc. until you reach template- en.xml. Double-click template-en.xml to open it for editing. 1.4 Starting a Web Browser After editing the EPrints configuration files, you will use a Web browser to check the results.To start a Web browser application, click on the Applications button, select Internet, then Firefox Web Browser. In the address bar, enter the hostname of the PC you are using (look on the front of the PC case for the machine name) to load the front page of the demo repository: http://machinename.ecs.soton.ac.uk/ 1/15 http://www.eprints.org/services/training/ EPrints Training: Repository Configuration Exercises Exercise 2: Branding Almost all institutions modify the default ªlookº of their EPrints repository. Some simply add their logo and colour scheme, others make far more radical changes. For examples, visit: http://www.eprints.org/software/examples/#branding In this exercise, you will modify the look of the demo repository. Every page displayed by EPrints is wrapped in an XHTML template. This can be found at: /opt/eprints2/archives/myid/cfg/template-en.xml 2.1 Change the Web Site Template Edit: /opt/eprints2/archives/myid/cfg/template-en.xml Find the line <div class="archivetitle">&archivename;</div> This is the name of the archive as it appears in the top left of every page. Replace this with your institution©s logo: <div class="archivetitle"><img src=ºhttp://.../logo.pngº /></div> (Or use the EPrints logo: http://www.eprints.org/style/eprintslogo.gif) Note that this file is XHTML so make sure that the img tag is closed correctly! Save your changes. 2.2 Reload the configuration Whenever you make changes to the configuration, you need to tell EPrints to reload it: eprints> bin/force_config_reload myid Tell EPrints to re-generate its static pages (home page, help page...): eprints> bin/generate_static myid 2.3 Check it worked • Reload the home page of the demo repository in your browser. • Check your logo is displayed. 2.4 Change the Stylesheet Edit: /opt/eprints2/archives/myid/cfg/static/general/eprints.css 2/15 http://www.eprints.org/services/training/ EPrints Training: Repository Configuration Exercises Change the background value for .header and .footer to suit your institution's colour scheme (or use ªEPrints Blueº: #ccccff). Save your changes. Update the static pages: eprints> bin/generate_static myid 2.5 Check it worked • Reload the home page of the demo repository in your browser. • Check your new colour scheme is displayed. 2.6 Notes • Find the <ep:pin> elements in the template-en.xml file. These tell EPrints where to insert page content. • To apply your changes to the views and abstract pages, you would need to run generate_views and generate_abstracts. • Explore how generate_static works in more detail: http://www.eprints.org/documentation/tech/php/generate_static.php • force_config_reload is a quick way of reloading the eprints configuration, and is useful when tweaking the configuration files. However, for performance reasons you should always restart apache after tweaking a live archive. Read more: http://www.eprints.org/documentation/tech/php/force_config_reload.p hp 3/15 http://www.eprints.org/services/training/ EPrints Training: Repository Configuration Exercises Exercise 3: Configuring Submission Workflow When depositing documents in EPrints, users work through several simple forms. However, some institutions prefer to provide users with one large submission form. In this exercise you will learn how EPrints splits up the submission process, and configure the demo repository to provide one large submission form. 3.1 Change the workflow configuration Edit: /opt/eprints2/archives/myid/cfg/metadata-types.xml Find the definition of the article type. It starts with <type name=ºarticleº> Notice that the list of metadata fields is broken up by <page> tags - these tell EPrints how to split the submission process into forms. Remove all the <page> tags from the article type. Save your changes. 3.2 Reload the configuration eprints> bin/force_config_reload myid 3.3 Create a User Account To view the submission page, you first need to create yourself a user account: eprints> bin/create_user myid USERNAME EMAIL admin PASSWORD Choose your own values for USERNAME, EMAIL and PASSWORD. 3.4 Check it worked • Load the home page of the demo repository in your browser. • Go to the User Area. • Log in using the account you just created. • You will be asked to enter your name. This is because by default a user record is not valid unless it has a name. Click Update Record. • Select Begin new Item. • Select Article and click Next. • Check that all the metadata fields are shown on a single form. 4/15 http://www.eprints.org/services/training/ EPrints Training: Repository Configuration Exercises Exercise 4: Customising the Subject Hierarchy By default, EPrints is configured with a subject hierarchy based on the Library of Congress subject tree. Institutions often modify this hierarchy (e.g. by adding more detail to areas that they specialise in) or even change it for a completely different classification scheme. In this exercise you will replace the EPrints subject tree with an alternative classification scheme. 4.1 Change the default subject tree Edit: /opt/eprints2/archives/myid/cfg/subjects Examine the format of this file: subjects:Library of Congress Subject Areas:ROOT:0 ... Q:Q Science:subjects:0 Q1:Q Science (General):Q:1 QA:QA Mathematics:Q:1 QA75:QA75 Electronic computers. Computer science:QA:1 QA76:QA76 Computer software:QA:1 QB:QB Astronomy:Q:1 QC:QC Physics:Q:1 You can see that each line of the file is in the form: subjectid:name:parents:depositable • subjectid is a unique identifier for the subject. • name is the name of the subject, in the default language of the archive. • the parents field defines how the subject fits into the hierarchy. In this case, EPrints is able to determine that "Computer Software" (QA76) comes under "Mathematics" (QA) which itself comes under "Science" (Q) and so on. Therefore a search for eprints matching the "Mathematics" subject would also return items associated with the "Computer Science" (QA75) and "Computer Software" (QA76) subjects. The special keyword ROOT indicates the top level of the hierarchy. • depositable specifies whether or not users can associate their deposits with the subject. It wouldn©t be very helpful to let users associate their eprints with the top level subject "Library of Congress Subject Areas", so in this case depositable is set to 0. 5/15 http://www.eprints.org/services/training/ EPrints Training: Repository Configuration Exercises Remove the eprints subject tree altogether and replace it with you own favourite classification scheme. Here©s the first line of an ACM Computing Classification scheme (http://www.acm.org/class/1998/) to get you started: subjects:ACM Computing Classification System (1998):ROOT:0 4.2 Import the new subject tree eprints> bin/import_subjects myid 4.3 Check it worked • Load the home page of the demo repository in your browser. • Go to the User Area. • Select Begin new Item. • Select Book and click Next. • Continue through the deposit process until you reach the Subjects page. • Check your new subject tree is shown. 4.4 Notes • The ability to specify multiple parents for a subject means that you can create a rich ªlatticeº rather than force items into a tree structure. • Note that you did not need to run force_config_reload after making changes to the subjects file. This is because the subjects file is only used by import_subjects script and is not part of the main archive configuration. • Editing the subjects file is a good way to define an inital classification scheme. To make small tweaks later, you can use the subject editing tool. Point your browser at: http://flag.ecs.soton.ac.uk:8080/perl/users/staff/edit_subject • This exercise dealt with creating subject trees in a single language. In order to specify subject trees in multiple languages, you need to use a special XML format. See: http://www.eprints.org/documentation/tech/php/import_subjects.php 6/15 http://www.eprints.org/services/training/ EPrints Training: Repository Configuration Exercises Exercise 5: Bespoke Deposits 1 EPrints comes configured with a default set of metadata fields (title, creators, date, publication, keywords, abstract...). Institutions often add extra metadata fields to suit the individual requirements of their repositories. In this exercise you will add a new metadata field to the demo repository.