Page MenuHomec4science

guide.html.wml
No OneTemporary

File Metadata

Created
Tue, May 7, 01:42

guide.html.wml

## -*- mode: html; coding: utf-8; -*-
## $Id$
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN.
##
## CDS 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.
##
## CDS 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 CDS Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#include "cdspage.wml" \
title="BibEdit Admin Guide" \
navtrail_previous_links="<a class=navtrail href=<WEBURL>/admin/<lang:star: index.*.html>>_(Admin Area)_</a> &gt; <a class=navtrail href=<WEBURL>/admin/bibedit/>BibEdit Admin</a>" \
navbar_name="admin" \
navbar_select="bibedit-admin-guide"
<p>Version <: print generate_pretty_revision_date_string('$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>
<strong>3. <a href="#3">Edit records via command line</a></strong><br>
<strong>4. <a href="#4">Delete records via command line</a></strong><br>
<strong>5. <a href="#5">Delete all records</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.
<a name="2"></a><h2>2. Edit records via Web interface</h2>
<p>Bibliographic Metadata Editor on Web is not implemented yet.
Please use the command-line technique describe below.
<a name="3"></a><h2>3. 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>You therefore continue as follows:
<ol>
<li> Download the record in XML MARC. For example, download record ID 1234:
<pre>
$ wget -O z.xml 'http://your.site/search.py?recid=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.py?p=Qllis%2C+J&f=author&of=xm&rg=5000'
</pre>
<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>
After which the record(s) should be fully modified and formatted and
all indexes and collections updated, as necessary.
<a name="4"></a><h2>4. 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>Thus said, the canonical way to delete the record #1234 in CDS Invenio
v0.1.x development branch is to download its XML MARC:
<pre>
$ wget -O z.xml 'http://your.site/search.py?recid=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>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 (search.py?recid=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.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/search.py?recid=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.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
CDS Invenio yet; moreover in the future we plan to abolish all the
bibXXx tables, so that this won't be necessary anymore.
<a name="5"></a><h2>5. 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/cds-invenio/bin/dbexec &lt; /opt/cds-invenio/src/cds-invenio-0.90/modules/miscutil/sql/tabbibclean.sql
$ /opt/cds-invenio/bin/webcoll
</pre>
Note that you may also want to truncate some idxWORD11* tables,
in case you have created additional indexes. Look into
<code>tabbibclean.sql</code> to see exactly what it does.
Note that you may also want to delete the fulltext files and the
submission counters in <code>/opt/cds-invenio/var/data</code>
subdirectories, if you use WebSubmit.

Event Timeline