Page MenuHomec4science

bibedit-admin-guide.webdoc
No OneTemporary

File Metadata

Created
Sun, Dec 8, 15:04

bibedit-admin-guide.webdoc

## -*- mode: html; coding: utf-8; -*-
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
<!-- WebDoc-Page-Title: BibEdit Admin Guide -->
<!-- WebDoc-Page-Navtrail: <a class="navtrail" href="<CFG_SITE_URL>/help/admin<lang:link/>">_(Admin Area)_</a> -->
<!-- WebDoc-Page-Revision: $Id$ -->
<h2>Contents</h2>
<strong>1. <a href="#1">Overview</a></strong><br />
<strong>2. <a href="#2">Edit records via Web interface</a></strong><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.1. <a href="#2.1">Keyboard shortcuts</a><br />
<strong>3. <a href="#3">Edit multiple records via Web interface</a></strong><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.1. <a href="#3.1">Multi-Record Editor user guide</a><br />
<strong>4. <a href="#4">Edit records via command line</a></strong><br />
<strong>5. <a href="#5">Delete records via command line</a></strong><br />
<strong>6. <a href="#6">Delete all records</a></strong><br />
<strong>7. <a href="#7">Access record history</a></strong><br />
<a name="1"></a><h2>1. Overview</h2>
<p>BibEdit enables you to directly manipulate bibliographic data, edit a
single record, do global replacements, and other cataloguing tasks.</p>
<a name="2"></a><h2>2. Edit records via Web interface</h2>
<p>To edit records via the web interface, please go to <a
href="<CFG_SITE_URL>/<CFG_SITE_RECORD>/edit/">BibEdit Editor</a>. This interface will let you add, change or delete fields in a record.</p>
<p>If you want to change several records at once, you can use the batch
command-line techniques described below or the <a
href="#3.1">Multi-Record Editor</a>.</p>
<p>Please note that 8564 tags pointing to fulltext files managed by Invenio
can't be manipulated via BibEdit. In order to modify them please use the
<a href="bibupload-admin-guide#3.5">FFT tags through BibUpload</a> or the
bibdocfile command line tool.</p>
<a name="2.1"></a><h3>2.1 Keyboard shortcuts on BibEdit</h3>
<h4>Basic record actions</h4>
<table border="1" width="600px">
<thead>
<tr> <th>Shortcut</th> <th>Definition</th> <th>Action</th> </tr>
</thead>
<tbody>
<tr> <td>g</td> <td>Select</td> <td>Go to the record selection
field</td> </tr>
<tr> <td>Ctrl+Right</td> <td>Next</td> <td>Go to next record
(in search results).</td> </tr>
<tr> <td>Ctrl+Left</td> <td>Previous</td> <td>Go to previous record
(in search results).</td> </tr>
<tr> <td>Shift+n</td> <td>New record</td> <td>Opens the new record dialog.
</td> </tr>
<tr> <td>Shift+s</td> <td>Submit</td> <td>Submit the record.</td> </tr>
<tr> <td>Shift+c</td> <td>Cancel</td> <td>Cancel editing of the
record.</td> </tr>
<tr> <td>Shift+l</td> <td>Clone</td> <td>Clone the record.</td> </tr>
<tr> <td>Shift+t</td> <td>Tags</td> <td>Toggle MARC/human tags.</td> </tr>
<tr> <td>a</td> <td>Add field</td> <td>Add a new, empty field.</td> </tr>
<tr> <td>s</td> <td>Open first field</td> <td>Opens first field for editing.</td> </tr>
<tr> <td>Del</td> <td>Delete selected</td> <td>Deletes all selected
fields.</td> </tr>
</tbody>
</table>
<h4>Focused (clicked) subfield or field</h4>
<table border="1" width="600px">
<thead>
<tr> <th>Shortcut</th> <th>Definition</th> <th>Action</th> </tr>
</thead>
<tbody>
<tr> <td>Ctrl+Up</td> <td>Move up</td> <td>Move focused subfield up.</td> </tr>
<tr> <td>Ctrl+Down</td> <td>Move down</td> <td>Move focused subfield
down.</td> </tr>
</tbody>
</table>
<h4>Input field/form</h4>
<table border="1" width="600px">
<thead>
<tr> <th>Shortcut</th> <th>Definition</th> <th>Action</th> </tr>
</thead>
<tbody>
<tr> <td>Esc</td> <td>Cancel</td> <td>Cancel edition of subfield</td> </tr>
<tr> <td>Ctrl+*</td> <td>Jump next</td> <td>Jump to next marc field</td> </tr>
<tr> <td>Ctrl+/</td> <td>Jump previous</td> <td>Jump to previous marc field</td> </tr>
</tbody>
</table>
<h4>Display modes</h4>
<table border="1" width="600px">
<thead>
<tr> <th>Shortcut</th> <th>Definition</th> <th>Action</th> </tr>
</thead>
<tbody>
<tr> <td>Ctrl+Shift+r</td> <td>References</td> <td>Display only references</td> </tr>
<tr> <td>Ctrl+Shift+a</td> <td>Authors</td> <td>Display only authors</td> </tr>
<tr> <td>Ctrl+Shift+o</td> <td>Others</td> <td>Display only other fields</td> </tr>
<tr> <td>Ctrl+Shift+d</td> <td>All</td> <td>Display all fields</td> </tr>
</tbody>
</table>
<h4>Other functionality</h4>
<table border="1" width="600px">
<thead>
<tr> <th>Shortcut</th> <th>Definition</th> <th>Action</th> </tr>
</thead>
<tbody>
<tr> <td>Ctrl+Shift+z</td> <td>Undo</td> <td>Undo last action.</td> </tr>
<tr> <td>Ctrl+Shift+y</td> <td>Redo</td> <td>Redo last action.</td> </tr>
<tr> <td>Shift+p</td> <td>Open PDF</td> <td>Open attached PDF</td> </tr>
</tbody>
</table>
<br />
<a name="3"></a><h2>3. Edit multiple records via web interface</h2>
<p>The purpose of the <a href="<CFG_SITE_URL>/<CFG_SITE_RECORD>/multiedit/">Multi-Record Editor Web interface</a> is to allow cataloguers to easily edit more than one record in one go.</p>
<p>The Multi-Record Editor allows cataloguers to easily look up various records in
the system in order to find record sets upon which to operate, and then to allow
some easy replacement procedures on these records in one go, e.g. a substring
substitution of some field value in some field tags.
</p>
<a name="3.1"></a><h3>3.1 Multi-Record Editor user guide</h3>
<p>While working with the Multi-Record Editor, the first step is to filter the set
of records that are going to be modified.<p>
<p>In order to do that, three options are available in the interface:<p>
<blockquote>
<pre>
Search criteria: [ ]
Filter collection: [ ]
Output tags: [ ]
[Search]
</pre>
</blockquote>
<p>
<ul>
<li>Search criteria allows to search records using the
same syntax offered by Invenio's web search.
<li>These records can be filtered by the desired collection, thus narrowing the
search results.
<li>Finally, for convenience, the tags displayed for each record can be specified.
The tags have to be separated by commas.
</ul>
</p>
<p>After clicking the <code>Search</code> button, the set of records that will
be affected by the changes will be visible at the bottom of the interface. It is
possible to specify whether to visualize them in <code>MARC</code> format or in
<code>HTML Brief</code> format.</p>
<p>The next step is to specify the desired changes to be made on the records.
When defining a new field action, the field tag and its indicators (if necessary)
have to be specified and one of the three actions (Add field, Delete field,
Update field) selected.</p>
<blockquote>
<pre>
Field
[ tag ][ind1][ind2] [Select action[V]]
</pre>
</blockquote>
<p>After that, as many actions on subfields as needed can be defined. The subfield
tag has to be specified and one action (<code>Add subfield, Delete subfield, Replace
full content, Replace substring</code>) selected. Depending on the field action
selected some actions for subfields will not be available.</p>
<p>The difference between <code>Replace full content</code> and <code>Replace
substring</code> resides in that the former deletes all the content present in
a subfield and writes the specified value on it whereas the latter looks for a string
and substitutes it by a new string.</p>
<p>All subfield actions have the <code>Apply only to specific field instances</code>
option. This is useful, for example, in cases where there are multiple authors
(<code>700__</code> tags) and we do not want to act in all of them.</p>
<p>In that case one could add the condition that only fields where the tag
<code>$a</code> is equal to <code>Ellis A.</code> should be modified.</p>
<blockquote>
<pre>
700__ Update Field
[u] [Replace full content]
[Ellis J.]
when other subfield [u] is equal to [Ellis A.]
</pre>
</blockquote>
<p>Every subfield action defined has to be saved using the correspondent button
before applying the changes.</p>
<p>Once all the actions for fields and subfields have been specified the modifications
can be previewed using the corresponding button.</p>
<p>Finally, when clicking on the <code>Apply changes</code> button all modifications
will be sent to the server and will be visible after some time.</p>
<a name="4"></a><h2>4. Edit records via command line</h2>
<p>The idea is to download record in XML MARC format, edit it by using
any editor, and upload the changes back. Note that you can edit any
number of records at the same time: for example, you can download all
records written by <code>Qllis, J</code>, open the file in your
favourite text editor, and change globally the author name to the
proper form <code>Ellis, J</code>.</p>
<p>You therefore continue as follows:</p>
<ol>
<li> Download the record in XML MARC. For example, download record ID 1234:
<pre>
$ wget -O z.xml 'http://your.site/<CFG_SITE_RECORD>/1234?of=xm'
</pre>
or download latest 5,000 public documents written by <code>Qllis, J</code>:
<pre>
$ wget -O z.xml 'http://your.site/search?p=Qllis%2C+J&f=author&of=xm&rg=5000'
</pre>
Note also that you can access history of records as covered in
a <a href="#6">access record history</a> section below.<p/>
<li> Edit the metadata as necessary:
<pre>
$ emacs z.xml
</pre>
<li> Upload changes back:
<pre>
$ bibupload -r z.xml
</pre>
<li> See the progress of the treatment of the file via BibSched:
<pre>
$ bibsched
</pre>
If you do not want to wait for the next wake-up time of indexing
and formatting daemons, launch them manually now:
<pre>
$ bibindex
$ bibreformat
$ webcoll
</pre>
and watch the progress via <code>bibsched</code>.
</ol>
<p>After which the record(s) should be fully modified and formatted and
all indexes and collections updated, as necessary.</p>
<a name="5"></a><h2>5. Delete records via command line</h2>
<p>Once a record has been uploaded, we prefer not to *destroy* it fully
anymore (i.e. to wipe it out and to reuse its record ID for another
record) for a variety of reasons. For example, some users may have
put this record already into their baskets in the meantime, or the
record might have already been announced by alert emails to the
external world, or the OAI harvestors might have harvested it already,
etc. We usually prefer only to *mark* records as deleted, so that our
record IDs are ensured to stay permanent.</p>
<p>Thus said, the canonical way to delete the record #1234 in Invenio
v0.1.x development branch is to download its XML MARC:
<pre>
$ wget -O z.xml 'http://your.site/<CFG_SITE_RECORD>/1234?of=xm'
</pre>
and to mark it as deleted by adding the indicator ``DELETED'' into the
MARC 980 $$c tag:
<pre>
$ emacs z.xml
[...]
&lt;datafield tag="980" ind1=" " ind2=" "&gt;
&lt;subfield code="a"&gt;PREPRINT&lt;/subfield&gt;
&lt;subfield code="c"&gt;DELETED&lt;/subfield&gt;
&lt;/datafield&gt;
[...]
</pre>
and upload thusly modified record in the `replace' mode:
<pre>
$ bibupload -r z.xml
</pre>
and watch the progress via <code>bibsched</code>, as mentioned in the
<a href="#3">section 3</a>.
</p>
<p>This procedure will remove the record from the collection cache so
that the record won't be findable anymore. In addition, if the users
try to access this record via direct URL such as distributed by the
alert engine (<CFG_SITE_RECORD>/1234) or via their baskets, they will
see a message ``This record has been deleted''. Please note though
that the original MARCXML of the record stays kept in the database,
for example you can access it by:
<pre>
$ python -c "from zlib import decompress; \\
from invenio.legacy.dbquery import run_sql; \\
print decompress(run_sql('SELECT value FROM bibfmt \\
WHERE id_bibrec=1234 AND format=\'xm\'')[0][0])"
</pre>
<p>In some cases you may want to hide the record from the searches,
but to leave it accessible via direct URLs or via baskets. In this
case the best it to alter its collection tag (980) to some
non-existent collection, for example:
<pre>
$ wget -O z.xml 'http:://localhost/<CFG_SITE_RECORD>/1234?of=xm'
$ perl -pi -e 's,<subfield code="a">ARTICLE</subfield>,<subfield code="a">HIDDENARTICLE</subfield>,g' z.xml
$ bibupload -r z.xml
</pre>
This will make the record non-existent as far as the search engine is
concerned, because it won't belong to any existing collection, but the
record will exist ``on its own'' and the users knowing its recID will
be able to access it.
</p>
<p>P.S. Note that the ``bibXXx'' tables will keep having entries for the
deleted records. These entries are to be cleaned from time to
time by the BibEdit garbage collector. This GC isn't part of
Invenio yet; moreover in the future we plan to abolish all the
bibXXx tables, so that this won't be necessary anymore.</p>
<a name="6"></a><h2>6. Delete all records</h2>
<p>If you want to wipe out all the existing bibliographic content of
your site, for example to start uploading the documents from
scratch again, you can launch:
<pre>
$ /opt/invenio/bin/dbexec &lt; /opt/invenio/src/invenio-0.90/modules/miscutil/sql/tabbibclean.sql
$ rm -rf /opt/invenio/var/data/files/*
$ /opt/invenio/bin/webcoll
$ /opt/invenio/bin/bibindex --reindex
</pre>
Note that you may also want to delete the fulltext files and the
submission counters in <code>/opt/invenio/var/data</code>
subdirectories, if you use WebSubmit.
</p>
<a name="7"></a><h2>7. Access record history</h2>
<p>Every revision of the metadata of a record is stored in the
"history" table containing all previous MARCXML master formats of the
record. You can access them via the <code>bibedit</code> command line
utility.
<p>To list previous revisions of record ID 1:
<pre>
$ /opt/invenio/bin/bibedit --list-revisions 1
1.20080319193118
1.20080318172536
1.20080311020315
</pre>
<p>To get MARCXML of the revision 1.20080318172536 (record ID 1,
revision date 2008-03-18 17:25:36):
<pre>
$/opt/invenio/bin/bibedit --get-revision 1.20080318172536 | head -5
&lt;record>
&lt;controlfield tag="001">1&lt;/controlfield>
&lt;datafield tag="037" ind1=" " ind2=" ">
&lt;subfield code="a">CERN-EX-0106015&lt;/subfield>
&lt;/datafield>
[...]
</pre>
<p>To compare the differences between the two last revisions:
<pre>
$ /opt/invenio/bin/bibedit --diff-revisions 1.20080318172536 1.20080319193118
--- 1.20080318172536
+++ 1.20080319193118
@@ -4,7 +4,7 @@
&lt;subfield code="a">CERN-EX-0106015&lt;/subfield>
&lt;/datafield>
&lt;datafield tag="100" ind1=" " ind2=" ">
- &lt;subfield code="a">Photolab&lt;/subfield>
+ &lt;subfield code="a">Photolab SOME TEST EDIT HERE&lt;/subfield>
&lt;/datafield>
&lt;datafield tag="245" ind1=" " ind2=" ">
&lt;subfield code="a">ALEPH experiment: Candidate of Higgs boson production&lt;/subfield>
@@ -26,7 +26,7 @@
&lt;/datafield>
&lt;datafield tag="650" ind1="1" ind2="7">
&lt;subfield code="2">SzGeCERN&lt;/subfield>
- &lt;subfield code="a">Experiments and Tracks&lt;/subfield>
+ &lt;subfield code="a">Experiments and Tracks SOME TEST EDIT THERE&lt;/subfield>
&lt;/datafield>
&lt;datafield tag="653" ind1="1" ind2=" ">
&lt;subfield code="a">LEP&lt;/subfield>
</pre>

Event Timeline