Difference between revisions of "Authority Lists"

From EPrints Documentation
Jump to: navigation, search
Line 22: Line 22:
 
All that is left now is to restart the webserver.
 
All that is left now is to restart the webserver.
  
 +
== Creating Your Own Authority File ==
  
 +
Before creating an authority file, it's important to understand the strict structure that needs to be adhered to.
  
== Creating Your Own Authority File ==
+
* An authority file is a set of lines.
 +
* Each single line represents one entry in the authority file.
  
 +
An entry consists of:
  
To use your own file, change 'romeo_journals.autocomplete' to the name of your file.
+
* A lookup string (case insensitive)
 +
* A tab
 +
* A <li>...</li> chunk of XHTML
  
 +
The 'file' cgi script will take the fragment that a user has entered and match it to the lookup string.  It will return the <li>.
  
 +
An <li> contains:
  
The format of the file is a set of lines.  Each single line represents one entry in the authority file.
+
* A piece of XHTML to display
 +
* A magic list items to insert into the form, inside the XHTML to display.
  
An entry consists of:
+
Here is an example from the EPrints Romeo authority file.
 +
<pre>
 +
African Journal of Agricultural Research        <li style='border-right: solid 50px #30FF30' >&quot;African Journal of Agricultural Research&quot; published by &quot;Academic Publishers&quot;<br /><small>(a Green publisher)</small>ISSN: 1991-637X<ul><li id="for:value:component:_publication">African Journal of Agricultural Research</li><li id="for:value:component:_publisher">Academic Publishers</li><li id="for:value:component:_issn">1991-637X</li></ul></li>
 +
</pre>
 +
 
 +
The first two parts of this
  
* A lookup string
+
<pre>
* A tab
+
* String to Match = African Journal of Agricultural Research
* A chunk of XML
+
* <li> to display = <li style='border-right: solid 50px #30FF30' >&quot;African Journal of Agricultural Research&quot; published by &quot;Academic Publishers&quot;<br /><small>(a Green publisher)</small>ISSN: 1991-637X</li>
 +
</pre>

Revision as of 18:57, 5 February 2007

EPrints can autocomplete on an authority file. The file needs to be placed in eprints3/archives/ARCHIVEID/cfg/autocomplete/.

Using the EPrints Romeo Authority File

EPrints Romeo is a service which provides a list of journals and their open access status. A EPrints 3 authority file is available from their website.

%cd /opt/eprints3/archives/ARCHIVEID/cfg/autocomplete
%wget romeo.eprints.org/romeo_journals.autocomplete

Now the file needs to be linked into the workflow. Edit the file

/opt/eprints3/archives/ARCHIVEID/cfg/workflows/eprint/default.xml

Find the input for Publication Title

<field ref="publication" required="yes" input_lookup_url="{$config{perl_url}}/users/lookup/journal_by_name" />

By default, this is set to use the 'journal_by_name' script, which searches records already in the repository. However, now that we have a long list of journals that we've downloaded from Romeo, we'd like to use that instead. Modify the line:

 <field ref="publication" required="yes" input_lookup_url="{$config{perl_url}}/users/lookup/file" input_lookup_params="file=romeo_journals.autocomplete"/>

All that is left now is to restart the webserver.

Creating Your Own Authority File

Before creating an authority file, it's important to understand the strict structure that needs to be adhered to.

  • An authority file is a set of lines.
  • Each single line represents one entry in the authority file.

An entry consists of:

  • A lookup string (case insensitive)
  • A tab
  • A
  • ...
  • chunk of XHTML

The 'file' cgi script will take the fragment that a user has entered and match it to the lookup string. It will return the

  • . An
  • contains:
    • A piece of XHTML to display
    • A magic list items to insert into the form, inside the XHTML to display.
    Here is an example from the EPrints Romeo authority file.
     African Journal of Agricultural Research        <li style='border-right: solid 50px #30FF30' >"African Journal of Agricultural Research" published by "Academic Publishers"<br /><small>(a Green publisher)</small>ISSN: 1991-637X<ul><li id="for:value:component:_publication">African Journal of Agricultural Research</li><li id="for:value:component:_publisher">Academic Publishers</li><li id="for:value:component:_issn">1991-637X</li></ul></li>
    

    The first two parts of this

     * String to Match = African Journal of Agricultural Research
     * <li> to display = <li style='border-right: solid 50px #30FF30' >"African Journal of Agricultural Research" published by "Academic Publishers"<br /><small>(a Green publisher)</small>ISSN: 1991-637X</li>