Repository Customisation Configuring EPrints Training Course Southampton May

  • Slides: 78
Download presentation
Repository Customisation: Configuring EPrints Training Course Southampton, May 3 -4 th 2007

Repository Customisation: Configuring EPrints Training Course Southampton, May 3 -4 th 2007

EPrints Installation x EPrints successfully runs on x Linux x Solaris x Mac OS-X

EPrints Installation x EPrints successfully runs on x Linux x Solaris x Mac OS-X x Installation process is standardised x Grant from Microsoft for Windows version x evaluation release available on files. eprints. org x One site installation can run many separate repositories x mixing and matching EPrints and other Web-based services on the same host is possible

Installation: Run epadmin Tool x Walks you through creating an EPrints 3 repository x

Installation: Run epadmin Tool x Walks you through creating an EPrints 3 repository x core configuration xhostname, repository name x database configuration x creates database x creates tables in database x creates an initial user account xusername, user type, password x creates repository Web pages x Open repository homepage in browser & log in

EPrints - the Administrator's View x x SQL database Web server Scripts to configure

EPrints - the Administrator's View x x SQL database Web server Scripts to configure repository activities Configuration files

Orientation x Where are the configuration files?

Orientation x Where are the configuration files?

EPrints Home Directory

EPrints Home Directory

EPrints Home Directory: Configuration Global configuration for all repositories Repository-specific configuration for each repository

EPrints Home Directory: Configuration Global configuration for all repositories Repository-specific configuration for each repository

Global vs. Local Configuration x Single EPrints installation can run multiple repositories x each

Global vs. Local Configuration x Single EPrints installation can run multiple repositories x each may be very different in style in functionality x EPrints configuration files divided into x global configuration xleast likely to be changed xshared by all repositories xconsidered read only but can be overridden at the local level x repository-specific (local) configuration xoften changed xeach repository has its own set

EPrints Home Directory: Programs Directories for storing programs

EPrints Home Directory: Programs Directories for storing programs

EPrints Home Directory: Perl Modules Holds all the modules required by Perl scripting language

EPrints Home Directory: Perl Modules Holds all the modules required by Perl scripting language

EPrints Home Directory: Test Data Test data for populating a repository

EPrints Home Directory: Test Data Test data for populating a repository

EPrints Home Directory: Apache configuration

EPrints Home Directory: Apache configuration

EPrints Home Directory: Temp Files Temporary files

EPrints Home Directory: Temp Files Temporary files

EPrints Home Directory: Where Next?

EPrints Home Directory: Where Next?

Contents of archives Directory A subdirectory for every active repository

Contents of archives Directory A subdirectory for every active repository

Contents of archives Directory: Where Next?

Contents of archives Directory: Where Next?

Contents of individual archive directory The configuration files for this repository

Contents of individual archive directory The configuration files for this repository

Contents of individual archive directory PDFs etc.

Contents of individual archive directory PDFs etc.

Contents of individual archive directory Processed static webpages This is where static content gets

Contents of individual archive directory Processed static webpages This is where static content gets served from

Contents of individual archive directory Temporary files

Contents of individual archive directory Temporary files

Contents of individual archive directory

Contents of individual archive directory

Contents of individual cfg directory Configuration files. . .

Contents of individual cfg directory Configuration files. . .

Contents of individual cfg directory . . . citation definitions. . .

Contents of individual cfg directory . . . citation definitions. . .

Contents of individual cfg directory . . . languagespecific content. . .

Contents of individual cfg directory . . . languagespecific content. . .

Contents of individual cfg directory (2) x. . . there are LOTS of configuration

Contents of individual cfg directory (2) x. . . there are LOTS of configuration files! x Rather than examine each individually, consider two common configuration tasks 1. Branding 2. Adding a new metadata field x One step at a time x examining cause and effect x not how you would normally do things!

Aside: EPrints 3 for EPrints 2 administrators x. EPrints 2 had many large config

Aside: EPrints 3 for EPrints 2 administrators x. EPrints 2 had many large config files xnow split into several smaller files xwith filenames that make finding specific configuration options much easier! xcfg directory reshuffled to organise files more logically x http: //wiki. eprints. org/w/EPrints_3_Configurati on_orientation_for_EPrints_2_administrators

Task 1: Branding x The first thing most institutions do is brand their repository

Task 1: Branding x The first thing most institutions do is brand their repository and fit it in with their existing look and feel

Branding: Which Configuration Files? cfg. d/branding. pl Branding shortcuts

Branding: Which Configuration Files? cfg. d/branding. pl Branding shortcuts

Branding: Which Configuration Files? lang/en/templates/default. xml Site-wide HTML template

Branding: Which Configuration Files? lang/en/templates/default. xml Site-wide HTML template

Branding: Which Configuration Files? lang/en/static/*. xpage fixed content pages e. g. homepage, about page,

Branding: Which Configuration Files? lang/en/static/*. xpage fixed content pages e. g. homepage, about page, help page

Branding: Which Configuration Files? static images and stylesheets

Branding: Which Configuration Files? static images and stylesheets

Branding: cfg. d/branding. pl x. Perl syntax, but very easy to change x Provides

Branding: cfg. d/branding. pl x. Perl syntax, but very easy to change x Provides a couple of handy branding shortcuts xchange the site logo xapply a theme to the site x Very quickly change the appearance of your repository xuseful for building a demo

Branding: Change the Logo x Add the University of Southampton logo xfirst copy dolphin_logo.

Branding: Change the Logo x Add the University of Southampton logo xfirst copy dolphin_logo. gif into the static/images directory xthen change branding. pl to point to the file $c->{site_logo} = “/images/dolphin_logo. gif”;

Branding: Check the Homepage x Check the homepage. . . logo hasn’t changed!

Branding: Check the Homepage x Check the homepage. . . logo hasn’t changed!

Branding: epadmin reload Command x For best performance, EPrints loads all configuration files at

Branding: epadmin reload Command x For best performance, EPrints loads all configuration files at startup x Whenever we change a configuration file we need to tell EPrints to reload its configuration xrun epadmin reload or restart the Web server

Branding: Check the Homepage x After running epadmin reload xlogo image not being found

Branding: Check the Homepage x After running epadmin reload xlogo image not being found

Branding: generate_static command x. We need to run the generate_static command x. This takes

Branding: generate_static command x. We need to run the generate_static command x. This takes the fixed content files in the static configuration directory and moves them into the live content area xthe repository’s html directory xsoton/cfg/static/images/dolphin_logo. gif xgets copied to xsoton/html/en/images/dolphin_logo. gif

Branding: Check the Homepage x After running generate_static

Branding: Check the Homepage x After running generate_static

Branding Fast Track: Summary 1. Copy new logo to static content directory 2. Change

Branding Fast Track: Summary 1. Copy new logo to static content directory 2. Change branding. pl to point to new logo 3. Run epadmin reload to load the updated branding configuration 4. Run generate_static to copy the logo to the live content area

Branding: lang/en/templates/default. xml x The branding configuration file provides some shortcuts x handy for

Branding: lang/en/templates/default. xml x The branding configuration file provides some shortcuts x handy for demos x not so handy for seamlessly integrating your repository into your institutional Web presence! xneed complete control of page layout x EPrints lets you define an HTML template (outline) which is used to build every Web page x Customise the look and feel of the whole site x page layout x header xtitle, logo, navigation menu x footer

Template: Things to Look Out For x phrases x e. g. <epc: phrase ref=“archive_name”>

Template: Things to Look Out For x phrases x e. g. <epc: phrase ref=“archive_name”> x include some text in the page that is defined elsewhere x archive_name is defined in lang/en/phrases/archive_name. xml x if the archive name changes, you don’t have to update every page! x the archive name can be defined in multiple languages. x pins x e. g. <epc: pin ref=“page”> x page, title, login_status x tell EPrints how to combine the template with content to build each page on the repository x incorporate the pins into your new layout x configuration strings x e. g. <a href=“{$config{frontpage}}”>. . . </a> x frontpage, base_url, perl_url x include configuration values x e. g. if the repository URL changes, you don’t have to update every link!

Aside: What is XML? x Quick answer: it's a bit like HTML x. HTML

Aside: What is XML? x Quick answer: it's a bit like HTML x. HTML is for making pages for people to read x. XML is for making data for computers to use x. The syntax is very similar, just stricter x. All tags must have a matching closing tag x. All attributes must be quoted x. It doesn't know anything about Web pages xor anything else, come to that!

Branding: Change Page Layout x Add some links to key pages on the University

Branding: Change Page Layout x Add some links to key pages on the University of Southampton website x We’ve changed a configuration file so have to reload

Check the Homepage x After running epadmin reload

Check the Homepage x After running epadmin reload

Changing the Layout: Summary 1. Define new layout in lang/en/templates/default. xml x copy any

Changing the Layout: Summary 1. Define new layout in lang/en/templates/default. xml x copy any required images or stylesheets to static content directory x use pins to tell EPrints where to insert content in the layout 2. Run epadmin reload x if you have used any additional images/stylesheets, move them to the live area of the site by running generate_static

Aside: Dynamic Pages in EPrints 3 x EPrints 2 administrators will be used to

Aside: Dynamic Pages in EPrints 3 x EPrints 2 administrators will be used to re- generating static pages, browse view pages and abstract pages when the template is changed x EPrints 3 builds pages on demand x generate_static puts static content into html directory xhtml/en/index. body, html/en/index. title x same for generate_views, generate_abstracts x when page is requested, EPrints combines template with these pieces of static content to build the page

Aside: Dynamic Pages in EPrints 3 (2) x Why? x can introduce dynamic elements

Aside: Dynamic Pages in EPrints 3 (2) x Why? x can introduce dynamic elements into the page xuser login status is good example of this x trade off between server performance and functionality x. Google will crawl repository at least once a day x static parts of static, views and abstract pages pre- generated

Branding: lang/en/static directory x You can also define fixed content for: xhomepage, “about” page,

Branding: lang/en/static directory x You can also define fixed content for: xhomepage, “about” page, help pages, “error” page. . . xthe static content that appears on the front page of the repository is in xlang/en/static/index. xpage x These configuration files are stored in the lang/en/static directory xone subdirectory per language xe. g. english files go in lang/en/static

Branding: Remove Warning from Homepage

Branding: Remove Warning from Homepage

Branding: Remove Warning from Homepage

Branding: Remove Warning from Homepage

Branding: Remove Warning from Homepage x Remove the warning and replace with a paragraph

Branding: Remove Warning from Homepage x Remove the warning and replace with a paragraph describing the repository x We’ve changed some static content, so need to run generate_static to move it into the live content area

Branding: Remove Warning from Homepage x After running generate_static

Branding: Remove Warning from Homepage x After running generate_static

Aside: Creating New Static Pages x You may want to additional static pages xfrequently

Aside: Creating New Static Pages x You may want to additional static pages xfrequently asked questions xrepository policies x Just create a new. xpage file in lang/en/static directory xcopy an existing one and use it as a template xrun generate_static xlink to the new page from your site template xe. g. if you created faq. xpage, create a link to faq. html

Task 2: Add a New Metadata Field x Imagine an archive of photographs where

Task 2: Add a New Metadata Field x Imagine an archive of photographs where the location at which the image was taken is important.

New Metadata Field: Which Config Files? eprint_fields. pl Contains all fields an eprint could

New Metadata Field: Which Config Files? eprint_fields. pl Contains all fields an eprint could have

New Metadata Field: Which Config Files? eprint_fields. xml Phrases for names and helptext of

New Metadata Field: Which Config Files? eprint_fields. xml Phrases for names and helptext of eprint fields.

New Metadata Field: Which Config Files? default. xml workflow, defines the input fields for

New Metadata Field: Which Config Files? default. xml workflow, defines the input fields for each eprint type.

Task 3: Add a New Metadata Field x Add the new field to the

Task 3: Add a New Metadata Field x Add the new field to the workflow default. xml file. x Workflows are a little different in EPrints 3

New Metadata Field x Restart the web server. x Everything looks fine. x But

New Metadata Field x Restart the web server. x Everything looks fine. x But try to create a new image and:

New Metadata Field x EPrints knows that a picture needs coordinates but…. x EPrints

New Metadata Field x EPrints knows that a picture needs coordinates but…. x EPrints doesn’t know what coordinates are yet.

New Metadata Field: eprint_fields. pl x Contains all possible metadata fields for an eprint.

New Metadata Field: eprint_fields. pl x Contains all possible metadata fields for an eprint. x A Perl file (but don’t worry too much)

New Metadata Field: Add Definition x Add a definition for the coordinates field to

New Metadata Field: Add Definition x Add a definition for the coordinates field to eprint_fields. pm

New Metadata Field x Restart the web server. x Everything looks fine. x But

New Metadata Field x Restart the web server. x Everything looks fine. x But try to create a new image and:

New Metadata Field: Why it Failed x EPrints uses the metadata configuration in eprint_fields.

New Metadata Field: Why it Failed x EPrints uses the metadata configuration in eprint_fields. pm to: xconstruct its database tables xgenerate queries for selecting data from the database x EPrints expects to find a coordinates column in the database

New Metadata Field: Update Database x We need to either xrebuild the EPrints database

New Metadata Field: Update Database x We need to either xrebuild the EPrints database tables for the new metadata configuration xwill lose all data and uploaded files xuse epadmin erase_eprints xdon't do this on a live repository! xuseful development technique xadd the field to the database by hand xwon't lose any data xinstructions for doing this on the EPrints wiki xhttp: //wiki. eprints. org/w/Adding_a_Field_to_a_Live_Repository

New Metadata Field: Check Workflow x Field now appears in deposit workflow x Now

New Metadata Field: Check Workflow x Field now appears in deposit workflow x Now just need to add some phrases! xfield title and help text

New Metadata: Phrases x Phrases contain text that is displayed on pages generated by

New Metadata: Phrases x Phrases contain text that is displayed on pages generated by EPrints x In a multi-language repository, there would be a set of phrases for each language x Defined in XML x Eprints loads all phrases in all files in the cfg/lang/en/phrases directory.

New Metadata: Add a Phrase x Add phrases to eprint_field. xml x Reload the

New Metadata: Add a Phrase x Add phrases to eprint_field. xml x Reload the archive

New Metadata Field: Summary 1. Define type and properties of new field in eprint_fields.

New Metadata Field: Summary 1. Define type and properties of new field in eprint_fields. pl 2. Add field to deposit workflow in workflows/eprint/default. xml 3. Add display name and help text to eprint_field. xml 4. epadmin erase_eprints x or manually add new field 5. epadmin reload

Briefly: Autocompletion x Drop a simple text file or a more complex xml file

Briefly: Autocompletion x Drop a simple text file or a more complex xml file into the autocomplete directory. x Edit the workflow:

Briefly: Plugins x Add functionality to your repository x Most Common – Import, Export,

Briefly: Plugins x Add functionality to your repository x Most Common – Import, Export, Screen x Just drop the plugin into the right plugin directory x Perl intensive (plugins are little programs), but very powerful. x Download plugins from files. eprints. org

Other Config Files: subjects x Plain text file that defines the subject tree for

Other Config Files: subjects x Plain text file that defines the subject tree for the classification system x By default contains the top 2 levels of the US Library of Congress classification x Also include a ‘place-holder’ organisational structure that you should remove/replace x ‘subjects’ is a misnomer. It can contain any number of trees/hierarchies.

Other Config Files: oai. pl x Tells EPrints which export plugins to use to

Other Config Files: oai. pl x Tells EPrints which export plugins to use to map your metadata to any format a plugin exists for. x Edit to make your data, metadata and submission policies available.

Other Config Files: eprint_render. pl x Methods for generating the abstract pages for each

Other Config Files: eprint_render. pl x Methods for generating the abstract pages for each eprint x Perl intensive, but we can do almost anything! xe. g. embed an music player applet on each Composition page

Other Config Files: *_validate. pm x Methods for checking the metadata fields that a

Other Config Files: *_validate. pm x Methods for checking the metadata fields that a depositor is submitting xindividual fields xa whole page (i. e. combination of fields) xa document (e. g. has the user submitted a format safe for preservation purposes? ) xa complete eprint record xa user x Perl intensive

Other Config Files: indexing. pm x Methods for supporting free text indexing xdefinitions of

Other Config Files: indexing. pm x Methods for supporting free text indexing xdefinitions of lexical token separators xlist of stop words xfilter that translates a text into a bag of words x Unlikely to be changed

Web Server Config Files x auto-apache. conf is the main workhorse x defines where

Web Server Config Files x auto-apache. conf is the main workhorse x defines where the archive files are, how to handle script requests and errors etc. x Not User editable x. Add directives to apache. conf xsome tweaks may be necessary if you are hosting other Web-based services on the same server

Reflection: What do you need to do? x Look back at the issues you

Reflection: What do you need to do? x Look back at the issues you raised for configuring EPrints xcan you see where you would need to start working in the EPrints setup? xcan you find some repositories which do things in the same way? xi. e. can you find someone to give you advice?