refdb-cvs Mailing List for RefDB (Page 75)
Status: Beta
Brought to you by:
mhoenicka
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(88) |
Feb
(50) |
Mar
(36) |
Apr
(9) |
May
(30) |
Jun
(30) |
Jul
(22) |
Aug
(16) |
Sep
(42) |
Oct
(18) |
Nov
(29) |
Dec
(23) |
2005 |
Jan
(18) |
Feb
(28) |
Mar
(21) |
Apr
(35) |
May
(62) |
Jun
(22) |
Jul
(5) |
Aug
(40) |
Sep
(98) |
Oct
(81) |
Nov
(51) |
Dec
(62) |
2006 |
Jan
(46) |
Feb
(36) |
Mar
(8) |
Apr
(16) |
May
(14) |
Jun
(16) |
Jul
(47) |
Aug
(60) |
Sep
(34) |
Oct
(16) |
Nov
(46) |
Dec
(11) |
2007 |
Jan
(16) |
Feb
(13) |
Mar
(58) |
Apr
(32) |
May
(4) |
Jun
(8) |
Jul
(31) |
Aug
(46) |
Sep
(22) |
Oct
(30) |
Nov
(58) |
Dec
(15) |
2008 |
Jan
(8) |
Feb
(8) |
Mar
(2) |
Apr
(6) |
May
(3) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(6) |
Nov
(3) |
Dec
(5) |
2009 |
Jan
(1) |
Feb
(20) |
Mar
(8) |
Apr
(5) |
May
(8) |
Jun
(3) |
Jul
(6) |
Aug
(4) |
Sep
(7) |
Oct
(8) |
Nov
(2) |
Dec
(1) |
2010 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
(5) |
Feb
(5) |
Mar
(13) |
Apr
(3) |
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(5) |
Nov
|
Dec
(3) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(13) |
2014 |
Jan
(2) |
Feb
(2) |
Mar
(2) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
|
Aug
(6) |
Sep
(3) |
Oct
|
Nov
(2) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
(9) |
Feb
(16) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Markus H. <mho...@us...> - 2003-12-31 00:28:12
|
Update of /cvsroot/refdb/refdb In directory sc8-pr-cvs1:/tmp/cvs-serv32646 Modified Files: UPGRADING Log Message: added version strings Index: UPGRADING =================================================================== RCS file: /cvsroot/refdb/refdb/UPGRADING,v retrieving revision 1.5 retrieving revision 1.6 diff -u -U2 -r1.5 -r1.6 --- UPGRADING 30 Dec 2003 23:51:36 -0000 1.5 +++ UPGRADING 31 Dec 2003 00:28:07 -0000 1.6 @@ -2,4 +2,6 @@ =============================================================== +$Id$ + __________ Background |
From: Markus H. <mho...@us...> - 2003-12-31 00:27:30
|
Update of /cvsroot/refdb/refdb In directory sc8-pr-cvs1:/tmp/cvs-serv32431 Modified Files: README INSTALL NEWS Log Message: added version strings Index: README =================================================================== RCS file: /cvsroot/refdb/refdb/README,v retrieving revision 1.14 retrieving revision 1.15 diff -u -U2 -r1.14 -r1.15 --- README 30 Dec 2003 23:51:36 -0000 1.14 +++ README 31 Dec 2003 00:27:26 -0000 1.15 @@ -2,4 +2,6 @@ ============ +$Id$ + [Please scroll down for backwards incompatible changes] @@ -48,4 +50,9 @@ to use your existing reference data with 0.9.4, make sure to follow the instructions in UPGRADING. + +In contrast to previous releases, refdbd no longer accepts remote +connections by default. If you want to continue accessing refdbd from +a different box, make sure to start refdbd with the -I switch or use +the "remoteconnect" variable in refdbdrc. _______ Index: INSTALL =================================================================== RCS file: /cvsroot/refdb/refdb/INSTALL,v retrieving revision 1.7 retrieving revision 1.8 diff -u -U2 -r1.7 -r1.8 --- INSTALL 30 Dec 2003 23:51:36 -0000 1.7 +++ INSTALL 31 Dec 2003 00:27:26 -0000 1.8 @@ -1,2 +1,7 @@ +RefDB INSTALL +============= + +$Id$ + This file explains how to get RefDB installed from the sources. This is the short version for the impatient. It is strongly recommended Index: NEWS =================================================================== RCS file: /cvsroot/refdb/refdb/NEWS,v retrieving revision 1.17 retrieving revision 1.18 diff -u -U2 -r1.17 -r1.18 --- NEWS 30 Dec 2003 23:51:36 -0000 1.17 +++ NEWS 31 Dec 2003 00:27:26 -0000 1.18 @@ -2,4 +2,6 @@ =============== +$Id$ + ______________________________ Version 0.9.4 (December 2003) |
From: Markus H. <mho...@us...> - 2003-12-30 23:58:21
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv27253/scripts Modified Files: refdbnd.in Log Message: create makefile for existing documents Index: refdbnd.in =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdbnd.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -U2 -r1.6 -r1.7 --- refdbnd.in 30 Aug 2003 21:20:41 -0000 1.6 +++ refdbnd.in 30 Dec 2003 23:58:15 -0000 1.7 @@ -3,6 +3,6 @@ # refdbnd: creates a new document and sets up a Makefile for use # with RefDB bibliographies -# Invocation: refdbnewdoc basename doctype pubtype database style -# or: refdbnewdoc (interactive mode) +# Invocation: refdbnd basename doctype|filename pubtype database style +# or: refdbnd (interactive mode) # ma...@mh... 2002-11-26 @@ -29,8 +29,44 @@ defdatabase="refdbtest" defstyle="J.Biol.Chem." +xfile="" # Makefile-generated defaults maketemplate="<refdblib>/examples/Makefile.template" +check_existing_doc() { +# guess values from existing file + xfile=$basename + + if grep "^<!DOCTYPE.*DTD DocBook V3.1//EN" $basename; then + doctype="db31" + pubtype=`grep "DTD DocBook V3.1//EN" $basename | sed 's/^<!DOCTYPE \(.*\) PUBLIC.*/\1/'` + else + if grep "^<!DOCTYPE.*DTD DocBook V4.0//EN" $basename; then + doctype="db40" + pubtype=`grep "DTD DocBook V4.0//EN" $basename | sed 's/^<!DOCTYPE \(.*\) PUBLIC.*/\1/'` + else + if grep "^<!DOCTYPE.*DTD DocBook V4.1//EN" $basename; then + doctype="db41" + pubtype=`grep "DTD DocBook V4.1//EN" $basename | sed 's/^<!DOCTYPE \(.*\) PUBLIC.*/\1/'` + else + if grep "^<!DOCTYPE.*DTD DocBook XML V4.1.2//EN" $basename; then + doctype="db41x" + pubtype=`grep "DTD DocBook XML V4.1.2//EN" $basename | sed 's/^<!DOCTYPE \(.*\) PUBLIC.*/\1/'` + else + if grep "^<!DOCTYPE.*DTD DocBook XML V4.2//EN" $basename; then + doctype="db42x" + pubtype=`grep "DTD DocBook XML V4.2//EN" $basename | sed 's/^<!DOCTYPE \(.*\) PUBLIC.*/\1/'` + else + if grep "^<!DOCTYPE.*TEI P4//DTD Main DTD Driver File//EN" $basename; then + doctype="teix" + pubtype=`grep "TEI P4//DTD Main DTD Driver File//EN" $basename | sed 's/^<!DOCTYPE \(.*\) PUBLIC.*/\1/'` + fi + fi + fi + fi + fi + fi + basename=${xfile%%.*} +} # if we have five command line arguments, we'll use them. Otherwise @@ -50,24 +86,35 @@ echo "any suffix. For example, if your printed output file is supposed to" echo "be called refdbtest.pdf, the basename will be 'refdbtest'" + echo "Alternatively, enter the full name of an existing document in this" + echo "directory. I'll try and guess the proper values for this document." echo "[$defbasename]" read basename - echo "" - echo "Please enter the type of the document. Available types are 'db31'," - echo "'db40', and 'db41' for DocBook SGML versions 3.1, 4.0, and 4.1," - echo "respectively, 'db41x' and 'db42x' for DocBook XML versions 4.1.2 and" - echo "4.2, respectively, and 'teix' for TEI XML P4" - echo "[$defdoctype]" - read doctype - echo "" - echo "Please enter the element root which determines the type of the" - echo "publication. Common are 'set', 'book', and 'article' for DocBook" - echo "documents and 'TEI.2' for TEI documents" - - # use TEI.2 as default for TEI documents. $defpubtype defaults to 'book' - if [ "$doctype" = "teix" ]; then - defpubtype="TEI.2" + + if [ ! "$basename" = "db31" ] && [ ! "$basename" = "db40" ] && [ ! "$basename" = "db41" ] && [ ! "$basename" = "db41x" ] && [ ! "$basename" = "db42x" ] && [ ! "$basename" = "teix" ]; then + check_existing_doc fi - echo "[$defpubtype]" - read pubtype + + if [ -z $doctype ]; then + echo "" + echo "Please enter the type of the document. Available types are 'db31'," + echo "'db40', and 'db41' for DocBook SGML versions 3.1, 4.0, and 4.1," + echo "respectively, 'db41x' and 'db42x' for DocBook XML versions 4.1.2 and" + echo "4.2, respectively, and 'teix' for TEI XML P4" + echo "[$defdoctype]" + read doctype + + echo "" + echo "Please enter the element root which determines the type of the" + echo "publication. Common are 'set', 'book', and 'article' for DocBook" + echo "documents and 'TEI.2' for TEI documents" + + # use TEI.2 as default for TEI documents. $defpubtype defaults to 'book' + if [ "$doctype" = "teix" ]; then + defpubtype="TEI.2" + fi + echo "[$defpubtype]" + read pubtype + fi + echo "" echo "Please enter the name of the RefDB database where you take your" @@ -101,6 +148,10 @@ # all arguments were specified on the command line basename=$1 - doctype=$2 - pubtype=$3 + if [ ! "$basename" = "db31" ] && [ ! "$basename" = "db40" ] && [ ! "$basename" = "db41" ] && [ ! "$basename" = "db41x" ] && [ ! "$basename" = "db42x" ] && [ ! "$basename" = "teix" ]; then + check_existing_doc + else + doctype=$2 + pubtype=$3 + fi database=$4 style=$5 @@ -167,14 +218,19 @@ # create an empty document -case "$doctype" in - db31 ) echo -e "<!DOCTYPE $pubtype PUBLIC \"-//OASIS//DTD DocBook V3.1//EN\" [\n<!ENTITY bibliography SYSTEM \"$basename.bib.$extension\">\n]>" > $basename.short.$extension;; - db40 ) echo -e "<!DOCTYPE $pubtype PUBLIC \"-//OASIS//DTD DocBook V4.0//EN\" [\n<!ENTITY bibliography SYSTEM \"$basename.bib.$extension\">\n]>" > $basename.short.$extension;; - db41 ) echo -e "<!DOCTYPE $pubtype PUBLIC \"-//OASIS//DTD DocBook V4.1//EN\" [\n<!ENTITY bibliography SYSTEM \"$basename.bib.$extension\">\n]>" > $basename.short.$extension;; - db41x) echo -e "<?xml version=\"1.0\"?>\n<!DOCTYPE $pubtype PUBLIC \"-//OASIS//DTD DocBook XML V4.1.2//EN\" \"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd\" [\n<!ENTITY bibliography SYSTEM \"$basename.bib.$extension\">\n]>" > $basename.short.$extension;; - db42x) echo -e "<?xml version=\"1.0\"?>\n<!DOCTYPE $pubtype PUBLIC \"-//OASIS//DTD DocBook XML V4.2//EN\" \"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\" [\n<!ENTITY bibliography SYSTEM \"$basename.bib.$extension\">\n]>" > $basename.short.$extension;; - teix ) echo -e "<?xml version=\"1.0\"?>\n<!DOCTYPE TEI.2 PUBLIC \"-//TEI P4//DTD Main DTD Driver File//EN\" \"http://www.tei-c.org/P4X/DTD/tei2.dtd\" [\n<!ENTITY % TEI.general 'INCLUDE'>\n<!ENTITY % TEI.names.dates 'INCLUDE'>\n<!ENTITY % TEI.linking 'INCLUDE'>\n<!ENTITY % TEI.XML 'INCLUDE'>\n<!ENTITY bibliography SYSTEM \"$basename.bib.$extension\">\n]>" > $basename.short.$extension;; -esac +if [ -z $xfile ]; then + case "$doctype" in + db31 ) echo -e "<!DOCTYPE $pubtype PUBLIC \"-//OASIS//DTD DocBook V3.1//EN\" [\n<!ENTITY bibliography SYSTEM \"$basename.bib.$extension\">\n]>" > $basename.short.$extension;; + db40 ) echo -e "<!DOCTYPE $pubtype PUBLIC \"-//OASIS//DTD DocBook V4.0//EN\" [\n<!ENTITY bibliography SYSTEM \"$basename.bib.$extension\">\n]>" > $basename.short.$extension;; + db41 ) echo -e "<!DOCTYPE $pubtype PUBLIC \"-//OASIS//DTD DocBook V4.1//EN\" [\n<!ENTITY bibliography SYSTEM \"$basename.bib.$extension\">\n]>" > $basename.short.$extension;; + db41x) echo -e "<?xml version=\"1.0\"?>\n<!DOCTYPE $pubtype PUBLIC \"-//OASIS//DTD DocBook XML V4.1.2//EN\" \"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd\" [\n<!ENTITY bibliography SYSTEM \"$basename.bib.$extension\">\n]>" > $basename.short.$extension;; + db42x) echo -e "<?xml version=\"1.0\"?>\n<!DOCTYPE $pubtype PUBLIC \"-//OASIS//DTD DocBook XML V4.2//EN\" \"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\" [\n<!ENTITY bibliography SYSTEM \"$basename.bib.$extension\">\n]>" > $basename.short.$extension;; + teix ) echo -e "<?xml version=\"1.0\"?>\n<!DOCTYPE TEI.2 PUBLIC \"-//TEI P4//DTD Main DTD Driver File//EN\" \"http://www.tei-c.org/P4X/DTD/tei2.dtd\" [\n<!ENTITY % TEI.general 'INCLUDE'>\n<!ENTITY % TEI.names.dates 'INCLUDE'>\n<!ENTITY % TEI.linking 'INCLUDE'>\n<!ENTITY % TEI.XML 'INCLUDE'>\n<!ENTITY bibliography SYSTEM \"$basename.bib.$extension\">\n]>" > $basename.short.$extension;; + esac + echo "Document $basename.short.$extension created." +else + echo "Your existing document is called $xfile." +fi + -echo "Document $basename.short.$extension created." echo "" echo "After editing this file you can use the following commands to create" |
From: Markus H. <mho...@us...> - 2003-12-30 23:57:45
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv27079/scripts Modified Files: empty.mysql.dump empty.pgsql.dump.in Log Message: updated to new database schema Index: empty.mysql.dump =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/empty.mysql.dump,v retrieving revision 1.3 retrieving revision 1.4 diff -u -U2 -r1.3 -r1.4 --- empty.mysql.dump 4 Nov 2003 23:24:24 -0000 1.3 +++ empty.mysql.dump 30 Dec 2003 23:57:39 -0000 1.4 @@ -1,5 +1,5 @@ -- MySQL dump 8.21 -- --- Host: localhost Database: refdbtest1 +-- Host: localhost Database: alltypes --------------------------------------------------------- -- Server version 3.23.49 @@ -9,4 +9,5 @@ -- +DROP TABLE IF EXISTS t_author; CREATE TABLE t_author ( author_id int(11) NOT NULL auto_increment, @@ -20,8 +21,11 @@ ) TYPE=MyISAM; +/*!40000 ALTER TABLE t_author DISABLE KEYS */; + -- -- Table structure for table 't_keyword' -- +DROP TABLE IF EXISTS t_keyword; CREATE TABLE t_keyword ( keyword_id int(11) NOT NULL auto_increment, @@ -31,8 +35,49 @@ ) TYPE=MyISAM; +/*!40000 ALTER TABLE t_keyword DISABLE KEYS */; + +-- +-- Table structure for table 't_meta' +-- + +DROP TABLE IF EXISTS t_meta; +CREATE TABLE t_meta ( + meta_app varchar(20) default NULL, + meta_type varchar(20) default NULL, + meta_version varchar(20) default NULL, + meta_create_date datetime default NULL, + meta_modify_date datetime default NULL +) TYPE=MyISAM; + +/*!40000 ALTER TABLE t_meta DISABLE KEYS */; + +-- +-- Table structure for table 't_note' +-- + +DROP TABLE IF EXISTS t_note; +CREATE TABLE t_note ( + note_id int(11) NOT NULL auto_increment, + note_key varchar(255) default NULL, + note_title varchar(255) default NULL, + note_content blob, + note_content_type varchar(255) default NULL, + note_content_xmllang varchar(255) default NULL, + note_user_id int(11) default NULL, + note_date date default NULL, + PRIMARY KEY (note_id), + UNIQUE KEY note_key (note_key), + KEY note_title (note_title), + KEY note_user_id (note_user_id), + KEY note_date (note_date) +) TYPE=MyISAM; + +/*!40000 ALTER TABLE t_note DISABLE KEYS */; + -- -- Table structure for table 't_periodical' -- +DROP TABLE IF EXISTS t_periodical; CREATE TABLE t_periodical ( periodical_id int(11) NOT NULL auto_increment, @@ -48,8 +93,11 @@ ) TYPE=MyISAM; +/*!40000 ALTER TABLE t_periodical DISABLE KEYS */; + -- -- Table structure for table 't_refdb' -- +DROP TABLE IF EXISTS t_refdb; CREATE TABLE t_refdb ( refdb_id int(11) NOT NULL auto_increment, @@ -69,5 +117,5 @@ refdb_title_series blob, refdb_address blob, - refdb_url blob default NULL, + refdb_url blob, refdb_issn varchar(255) default NULL, refdb_pyother_info varchar(255) default NULL, @@ -82,8 +130,8 @@ refdb_misc2 varchar(255) default NULL, refdb_misc3 varchar(255) default NULL, - refdb_linkpdf blob default NULL, - refdb_linkfull blob default NULL, - refdb_linkrel blob default NULL, - refdb_linkimg blob default NULL, + refdb_linkpdf blob, + refdb_linkfull blob, + refdb_linkrel blob, + refdb_linkimg blob, PRIMARY KEY (refdb_id), UNIQUE KEY refdb_citekey (refdb_citekey), @@ -91,8 +139,11 @@ ) TYPE=MyISAM; +/*!40000 ALTER TABLE t_refdb DISABLE KEYS */; + -- -- Table structure for table 't_user' -- +DROP TABLE IF EXISTS t_user; CREATE TABLE t_user ( user_id int(11) NOT NULL auto_increment, @@ -102,8 +153,11 @@ ) TYPE=MyISAM; +/*!40000 ALTER TABLE t_user DISABLE KEYS */; + -- -- Table structure for table 't_xauthor' -- +DROP TABLE IF EXISTS t_xauthor; CREATE TABLE t_xauthor ( xauthor_id int(11) NOT NULL auto_increment, @@ -111,5 +165,5 @@ refdb_id int(11) NOT NULL default '0', xauthor_type enum('primary','secondary','tertiary') default NULL, - xauthor_role varchar(64), + xauthor_role varchar(64) default NULL, xauthor_position int(11) default NULL, PRIMARY KEY (xauthor_id), @@ -118,21 +172,45 @@ ) TYPE=MyISAM; +/*!40000 ALTER TABLE t_xauthor DISABLE KEYS */; + -- -- Table structure for table 't_xkeyword' -- +DROP TABLE IF EXISTS t_xkeyword; CREATE TABLE t_xkeyword ( xkeyword_id int(11) NOT NULL auto_increment, keyword_id int(11) NOT NULL default '0', - refdb_id int(11) NOT NULL default '0', + xref_id int(11) NOT NULL default '0', + xkeyword_type enum('REFERENCE','NOTE') default NULL, PRIMARY KEY (xkeyword_id), KEY keyword_id (keyword_id), - KEY refdb_id (refdb_id) + KEY xref_id (xref_id) +) TYPE=MyISAM; + +/*!40000 ALTER TABLE t_xkeyword DISABLE KEYS */; + +-- +-- Table structure for table 't_xnote' +-- + +DROP TABLE IF EXISTS t_xnote; +CREATE TABLE t_xnote ( + xnote_id int(11) NOT NULL auto_increment, + note_id int(11) NOT NULL default '0', + xref_id int(11) NOT NULL default '0', + xnote_type enum('REFERENCE','KEYWORD','AUTHOR','PERIODICAL') default NULL, + PRIMARY KEY (xnote_id), + KEY note_id (note_id), + KEY xref_id (xref_id) ) TYPE=MyISAM; +/*!40000 ALTER TABLE t_xnote DISABLE KEYS */; + -- -- Table structure for table 't_xuser' -- +DROP TABLE IF EXISTS t_xuser; CREATE TABLE t_xuser ( xuser_id int(11) NOT NULL auto_increment, @@ -147,3 +225,5 @@ KEY refdb_id (refdb_id) ) TYPE=MyISAM; + +/*!40000 ALTER TABLE t_xuser DISABLE KEYS */; Index: empty.pgsql.dump.in =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/empty.pgsql.dump.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -U2 -r1.3 -r1.4 --- empty.pgsql.dump.in 4 Nov 2003 23:24:24 -0000 1.3 +++ empty.pgsql.dump.in 30 Dec 2003 23:57:39 -0000 1.4 @@ -15,5 +15,29 @@ -- --- TOC Entry ID 2 (OID 31629) +-- TOC Entry ID 22 (OID 81827) +-- +-- Name: t_meta Type: TABLE Owner: pgsql +-- + +CREATE TABLE "t_meta" ( + "meta_app" character varying(20), + "meta_type" character varying(20), + "meta_version" character varying(20), + "meta_create_date" timestamp with time zone, + "meta_modify_date" timestamp with time zone +); + +-- +-- TOC Entry ID 23 (OID 81827) +-- +-- Name: t_meta Type: ACL Owner: +-- + +REVOKE ALL on "t_meta" from PUBLIC; +GRANT ALL on "t_meta" to "pgsql"; +GRANT INSERT,SELECT,UPDATE,DELETE on "t_meta" to GROUP "refdbtestuser"; + +-- +-- TOC Entry ID 2 (OID 81829) -- -- Name: t_refdb_refdb_id_seq Type: SEQUENCE Owner: pgsql @@ -23,5 +47,5 @@ -- --- TOC Entry ID 3 (OID 31629) +-- TOC Entry ID 3 (OID 81829) -- -- Name: t_refdb_refdb_id_seq Type: ACL Owner: @@ -33,5 +57,5 @@ -- --- TOC Entry ID 18 (OID 31631) +-- TOC Entry ID 24 (OID 81831) -- -- Name: t_refdb Type: TABLE Owner: pgsql @@ -40,4 +64,5 @@ CREATE TABLE "t_refdb" ( "refdb_id" bigint DEFAULT nextval('"t_refdb_refdb_id_seq"'::text) NOT NULL, + "refdb_citekey" character varying(255), "refdb_type" character varying(6), "refdb_pubyear" smallint, @@ -75,5 +100,5 @@ -- --- TOC Entry ID 19 (OID 31631) +-- TOC Entry ID 25 (OID 81831) -- -- Name: t_refdb Type: ACL Owner: @@ -85,5 +110,5 @@ -- --- TOC Entry ID 4 (OID 31638) +-- TOC Entry ID 4 (OID 81839) -- -- Name: t_author_author_id_seq Type: SEQUENCE Owner: pgsql @@ -93,5 +118,5 @@ -- --- TOC Entry ID 5 (OID 31638) +-- TOC Entry ID 5 (OID 81839) -- -- Name: t_author_author_id_seq Type: ACL Owner: @@ -103,5 +128,5 @@ -- --- TOC Entry ID 20 (OID 31640) +-- TOC Entry ID 26 (OID 81841) -- -- Name: t_author Type: TABLE Owner: pgsql @@ -119,5 +144,5 @@ -- --- TOC Entry ID 21 (OID 31640) +-- TOC Entry ID 27 (OID 81841) -- -- Name: t_author Type: ACL Owner: @@ -129,5 +154,5 @@ -- --- TOC Entry ID 6 (OID 31644) +-- TOC Entry ID 6 (OID 81848) -- -- Name: t_keyword_keyword_id_seq Type: SEQUENCE Owner: pgsql @@ -137,5 +162,5 @@ -- --- TOC Entry ID 7 (OID 31644) +-- TOC Entry ID 7 (OID 81848) -- -- Name: t_keyword_keyword_id_seq Type: ACL Owner: @@ -147,5 +172,5 @@ -- --- TOC Entry ID 22 (OID 31646) +-- TOC Entry ID 28 (OID 81850) -- -- Name: t_keyword Type: TABLE Owner: pgsql @@ -159,5 +184,5 @@ -- --- TOC Entry ID 23 (OID 31646) +-- TOC Entry ID 29 (OID 81850) -- -- Name: t_keyword Type: ACL Owner: @@ -169,5 +194,5 @@ -- --- TOC Entry ID 8 (OID 31650) +-- TOC Entry ID 8 (OID 81854) -- -- Name: t_periodical_periodical_id_seq Type: SEQUENCE Owner: pgsql @@ -177,5 +202,5 @@ -- --- TOC Entry ID 9 (OID 31650) +-- TOC Entry ID 9 (OID 81854) -- -- Name: t_periodical_periodical_id_seq Type: ACL Owner: @@ -187,5 +212,5 @@ -- --- TOC Entry ID 24 (OID 31652) +-- TOC Entry ID 30 (OID 81856) -- -- Name: t_periodical Type: TABLE Owner: pgsql @@ -202,5 +227,5 @@ -- --- TOC Entry ID 25 (OID 31652) +-- TOC Entry ID 31 (OID 81856) -- -- Name: t_periodical Type: ACL Owner: @@ -212,5 +237,51 @@ -- --- TOC Entry ID 10 (OID 31662) +-- TOC Entry ID 10 (OID 81866) +-- +-- Name: t_note_note_id_seq Type: SEQUENCE Owner: pgsql +-- + +CREATE SEQUENCE "t_note_note_id_seq" start 1 increment 1 maxvalue 9223372036854775807 minvalue 1 cache 1; + +-- +-- TOC Entry ID 11 (OID 81866) +-- +-- Name: t_note_note_id_seq Type: ACL Owner: +-- + +REVOKE ALL on "t_note_note_id_seq" from PUBLIC; +GRANT ALL on "t_note_note_id_seq" to "pgsql"; +GRANT INSERT,SELECT,UPDATE,DELETE on "t_note_note_id_seq" to GROUP "refdbtestuser"; + +-- +-- TOC Entry ID 32 (OID 81868) +-- +-- Name: t_note Type: TABLE Owner: pgsql +-- + +CREATE TABLE "t_note" ( + "note_id" bigint DEFAULT nextval('"t_note_note_id_seq"'::text) NOT NULL, + "note_key" character varying(255), + "note_title" character varying(255), + "note_content" text, + "note_content_type" character varying(255), + "note_content_xmllang" character varying(255), + "note_user_id" bigint, + "note_date" date, + Constraint "t_note_pkey" Primary Key ("note_id") +); + +-- +-- TOC Entry ID 33 (OID 81868) +-- +-- Name: t_note Type: ACL Owner: +-- + +REVOKE ALL on "t_note" from PUBLIC; +GRANT ALL on "t_note" to "pgsql"; +GRANT INSERT,SELECT,UPDATE,DELETE on "t_note" to GROUP "refdbtestuser"; + +-- +-- TOC Entry ID 12 (OID 81878) -- -- Name: t_user_user_id_seq Type: SEQUENCE Owner: pgsql @@ -220,5 +291,5 @@ -- --- TOC Entry ID 11 (OID 31662) +-- TOC Entry ID 13 (OID 81878) -- -- Name: t_user_user_id_seq Type: ACL Owner: @@ -230,5 +301,5 @@ -- --- TOC Entry ID 26 (OID 31664) +-- TOC Entry ID 34 (OID 81880) -- -- Name: t_user Type: TABLE Owner: pgsql @@ -242,5 +313,5 @@ -- --- TOC Entry ID 27 (OID 31664) +-- TOC Entry ID 35 (OID 81880) -- -- Name: t_user Type: ACL Owner: @@ -252,5 +323,5 @@ -- --- TOC Entry ID 12 (OID 31668) +-- TOC Entry ID 14 (OID 81884) -- -- Name: t_xauthor_xauthor_id_seq Type: SEQUENCE Owner: pgsql @@ -260,5 +331,5 @@ -- --- TOC Entry ID 13 (OID 31668) +-- TOC Entry ID 15 (OID 81884) -- -- Name: t_xauthor_xauthor_id_seq Type: ACL Owner: @@ -270,5 +341,5 @@ -- --- TOC Entry ID 28 (OID 31670) +-- TOC Entry ID 36 (OID 81886) -- -- Name: t_xauthor Type: TABLE Owner: pgsql @@ -280,5 +351,5 @@ "refdb_id" bigint NOT NULL, "xauthor_type" smallint DEFAULT 1, - "xauthor_role" character varying(64), + "xauthor_role" character varying(64), "xauthor_position" integer, Constraint "t_xauthor_pkey" Primary Key ("xauthor_id") @@ -286,5 +357,5 @@ -- --- TOC Entry ID 29 (OID 31670) +-- TOC Entry ID 37 (OID 81886) -- -- Name: t_xauthor Type: ACL Owner: @@ -296,5 +367,5 @@ -- --- TOC Entry ID 14 (OID 31675) +-- TOC Entry ID 16 (OID 81891) -- -- Name: t_xkeyword_xkeyword_id_seq Type: SEQUENCE Owner: pgsql @@ -304,5 +375,5 @@ -- --- TOC Entry ID 15 (OID 31675) +-- TOC Entry ID 17 (OID 81891) -- -- Name: t_xkeyword_xkeyword_id_seq Type: ACL Owner: @@ -314,5 +385,5 @@ -- --- TOC Entry ID 30 (OID 31677) +-- TOC Entry ID 38 (OID 81893) -- -- Name: t_xkeyword Type: TABLE Owner: pgsql @@ -322,10 +393,11 @@ "xkeyword_id" bigint DEFAULT nextval('"t_xkeyword_xkeyword_id_seq"'::text) NOT NULL, "keyword_id" bigint NOT NULL, - "refdb_id" bigint NOT NULL, + "xkeyword_type" character varying(11) DEFAULT 'REFERENCE', + "xref_id" bigint NOT NULL, Constraint "t_xkeyword_pkey" Primary Key ("xkeyword_id") ); -- --- TOC Entry ID 31 (OID 31677) +-- TOC Entry ID 39 (OID 81893) -- -- Name: t_xkeyword Type: ACL Owner: @@ -337,5 +409,5 @@ -- --- TOC Entry ID 16 (OID 31682) +-- TOC Entry ID 18 (OID 81898) -- -- Name: t_xuser_xuser_id_seq Type: SEQUENCE Owner: pgsql @@ -345,5 +417,5 @@ -- --- TOC Entry ID 17 (OID 31682) +-- TOC Entry ID 19 (OID 81898) -- -- Name: t_xuser_xuser_id_seq Type: ACL Owner: @@ -355,5 +427,5 @@ -- --- TOC Entry ID 32 (OID 31684) +-- TOC Entry ID 40 (OID 81900) -- -- Name: t_xuser Type: TABLE Owner: pgsql @@ -372,5 +444,5 @@ -- --- TOC Entry ID 33 (OID 31684) +-- TOC Entry ID 41 (OID 81900) -- -- Name: t_xuser Type: ACL Owner: @@ -382,13 +454,63 @@ -- --- TOC Entry ID 34 (OID 31637) +-- TOC Entry ID 20 (OID 81908) +-- +-- Name: t_xnote_xnote_id_seq Type: SEQUENCE Owner: pgsql +-- + +CREATE SEQUENCE "t_xnote_xnote_id_seq" start 1 increment 1 maxvalue 9223372036854775807 minvalue 1 cache 1; + +-- +-- TOC Entry ID 21 (OID 81908) +-- +-- Name: t_xnote_xnote_id_seq Type: ACL Owner: +-- + +REVOKE ALL on "t_xnote_xnote_id_seq" from PUBLIC; +GRANT ALL on "t_xnote_xnote_id_seq" to "pgsql"; +GRANT INSERT,SELECT,UPDATE,DELETE on "t_xnote_xnote_id_seq" to GROUP "refdbtestuser"; + +-- +-- TOC Entry ID 42 (OID 81910) +-- +-- Name: t_xnote Type: TABLE Owner: pgsql +-- + +CREATE TABLE "t_xnote" ( + "xnote_id" bigint DEFAULT nextval('"t_xnote_xnote_id_seq"'::text) NOT NULL, + "note_id" bigint NOT NULL, + "xref_id" bigint NOT NULL, + "xnote_type" character varying(11) DEFAULT 'REFERENCE', + Constraint "t_xnote_pkey" Primary Key ("xnote_id") +); + +-- +-- TOC Entry ID 43 (OID 81910) +-- +-- Name: t_xnote Type: ACL Owner: +-- + +REVOKE ALL on "t_xnote" from PUBLIC; +GRANT ALL on "t_xnote" to "pgsql"; +GRANT INSERT,SELECT,UPDATE,DELETE on "t_xnote" to GROUP "refdbtestuser"; + +-- +-- TOC Entry ID 44 (OID 81837) +-- +-- Name: "t_refdb_refdb_citekey_key" Type: INDEX Owner: pgsql +-- + +CREATE UNIQUE INDEX t_refdb_refdb_citekey_key ON t_refdb USING btree (refdb_citekey); + +-- +-- TOC Entry ID 45 (OID 81838) -- --- Name: "i_periodical" Type: INDEX Owner: pgsql +-- Name: "i_pubyear" Type: INDEX Owner: pgsql -- -CREATE INDEX i_periodical ON t_refdb USING btree (refdb_pubyear); +CREATE INDEX i_pubyear ON t_refdb USING btree (refdb_pubyear); -- --- TOC Entry ID 35 (OID 31643) +-- TOC Entry ID 46 (OID 81847) -- -- Name: "i_author_name" Type: INDEX Owner: pgsql @@ -398,5 +520,5 @@ -- --- TOC Entry ID 36 (OID 31649) +-- TOC Entry ID 47 (OID 81853) -- -- Name: "i_keyword_name" Type: INDEX Owner: pgsql @@ -406,5 +528,5 @@ -- --- TOC Entry ID 37 (OID 31658) +-- TOC Entry ID 48 (OID 81862) -- -- Name: "i_periodical_name" Type: INDEX Owner: pgsql @@ -414,5 +536,5 @@ -- --- TOC Entry ID 38 (OID 31659) +-- TOC Entry ID 49 (OID 81863) -- -- Name: "i_periodical_abbrev" Type: INDEX Owner: pgsql @@ -422,5 +544,5 @@ -- --- TOC Entry ID 39 (OID 31660) +-- TOC Entry ID 50 (OID 81864) -- -- Name: "i_periodical_custabbrev1" Type: INDEX Owner: pgsql @@ -430,5 +552,5 @@ -- --- TOC Entry ID 40 (OID 31661) +-- TOC Entry ID 51 (OID 81865) -- -- Name: "i_periodical_custabbrev2" Type: INDEX Owner: pgsql @@ -438,5 +560,37 @@ -- --- TOC Entry ID 41 (OID 31667) +-- TOC Entry ID 52 (OID 81874) +-- +-- Name: "t_note_note_key_key" Type: INDEX Owner: pgsql +-- + +CREATE UNIQUE INDEX t_note_note_key_key ON t_note USING btree (note_key); + +-- +-- TOC Entry ID 53 (OID 81875) +-- +-- Name: "i_note_title" Type: INDEX Owner: pgsql +-- + +CREATE INDEX i_note_title ON t_note USING btree (note_title); + +-- +-- TOC Entry ID 54 (OID 81876) +-- +-- Name: "i_note_note_user_id" Type: INDEX Owner: pgsql +-- + +CREATE INDEX i_note_note_user_id ON t_note USING btree (note_user_id); + +-- +-- TOC Entry ID 55 (OID 81877) +-- +-- Name: "i_note_date" Type: INDEX Owner: pgsql +-- + +CREATE INDEX i_note_date ON t_note USING btree (note_date); + +-- +-- TOC Entry ID 56 (OID 81883) -- -- Name: "i_user_name" Type: INDEX Owner: pgsql @@ -446,5 +600,5 @@ -- --- TOC Entry ID 42 (OID 31673) +-- TOC Entry ID 57 (OID 81889) -- -- Name: "i_xauthor_author_id" Type: INDEX Owner: pgsql @@ -454,5 +608,5 @@ -- --- TOC Entry ID 43 (OID 31674) +-- TOC Entry ID 58 (OID 81890) -- -- Name: "i_xauthor_refdb_id" Type: INDEX Owner: pgsql @@ -462,5 +616,5 @@ -- --- TOC Entry ID 44 (OID 31680) +-- TOC Entry ID 59 (OID 81896) -- -- Name: "i_xkeyword_keyword_id" Type: INDEX Owner: pgsql @@ -470,13 +624,13 @@ -- --- TOC Entry ID 45 (OID 31681) +-- TOC Entry ID 60 (OID 81897) -- --- Name: "i_xkeyword_refdb_id" Type: INDEX Owner: pgsql +-- Name: "i_xkeyword_xref_id" Type: INDEX Owner: pgsql -- -CREATE INDEX i_xkeyword_refdb_id ON t_xkeyword USING btree (refdb_id); +CREATE INDEX i_xkeyword_xref_id ON t_xkeyword USING btree (xref_id); -- --- TOC Entry ID 46 (OID 31690) +-- TOC Entry ID 61 (OID 81906) -- -- Name: "i_xuser_user_id" Type: INDEX Owner: pgsql @@ -486,5 +640,5 @@ -- --- TOC Entry ID 47 (OID 31691) +-- TOC Entry ID 62 (OID 81907) -- -- Name: "i_xuser_refdb_id" Type: INDEX Owner: pgsql @@ -492,3 +646,27 @@ CREATE INDEX i_xuser_refdb_id ON t_xuser USING btree (refdb_id); + +-- +-- TOC Entry ID 63 (OID 81913) +-- +-- Name: "i_xnote_note_id" Type: INDEX Owner: pgsql +-- + +CREATE INDEX i_xnote_note_id ON t_xnote USING btree (note_id); + +-- +-- TOC Entry ID 64 (OID 81914) +-- +-- Name: "i_xnote_xref_id" Type: INDEX Owner: pgsql +-- + +CREATE INDEX i_xnote_xref_id ON t_xnote USING btree (xref_id); + +-- +-- TOC Entry ID 65 (OID 81915) +-- +-- Name: "i_xnote_xnote_type" Type: INDEX Owner: pgsql +-- + +CREATE INDEX i_xnote_xnote_type ON t_xnote USING btree (xnote_type); |
From: Markus H. <mho...@us...> - 2003-12-30 23:57:09
|
Update of /cvsroot/refdb/refdb/examples In directory sc8-pr-cvs1:/tmp/cvs-serv26969/examples Modified Files: xnoteset.xml Log Message: updated to new DTD version Index: xnoteset.xml =================================================================== RCS file: /cvsroot/refdb/refdb/examples/xnoteset.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -U2 -r1.1 -r1.2 --- xnoteset.xml 29 Oct 2003 22:02:43 -0000 1.1 +++ xnoteset.xml 30 Dec 2003 23:57:05 -0000 1.2 @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE xnoteset PUBLIC "-//Markus Hoenicka//DTD Xnote V1.0//EN" "http://refdb.sourceforge.net/dtd/xnote-1.0/xnote.dtd" [ +<!DOCTYPE xnoteset PUBLIC "-//Markus Hoenicka//DTD Xnote V1.1//EN" "http://refdb.sourceforge.net/dtd/xnote-1.1/xnote.dtd" [ <!ENTITY lt "&#60;"> <!ENTITY gt ">"> @@ -7,13 +7,22 @@ <xnoteset> -<xnote id="1" key="firstnote"> +<xnote id="1" date="2003-10-12"> <title>myfirstnote</title> - <date><year>2003</year><month>10</month><day>12</day></date> - - <note>the note proper</note> + <content>the note proper</content> <keyword>biochemistry</keyword> <keyword>enzymes</keyword> <link type="reference" target="WANG2002"/> + <link type="reference" target="Phadke1994"/> + <link type="author" target="Walsh,N."/> + <link type="journalabbrev" target="Biochem.Pharmacol."/> +</xnote> + +<xnote id="2" key="secondnote"> + <title>mysecondnote</title> + + <content type="application/xhtml+xml" xml:lang="en-us"><para id='2' style='bold'>the note proper</para></content> + <keyword>biochemistry</keyword> + <keyword>enzymes</keyword> <link type="reference" target="Phadke1994"/> <link type="author" target="Walsh,N."/> |
From: Markus H. <mho...@us...> - 2003-12-30 23:56:41
|
Update of /cvsroot/refdb/refdb/etc In directory sc8-pr-cvs1:/tmp/cvs-serv26876/etc Modified Files: refdbdrc Log Message: added remoteconnect variable Index: refdbdrc =================================================================== RCS file: /cvsroot/refdb/refdb/etc/refdbdrc,v retrieving revision 1.8 retrieving revision 1.9 diff -u -U2 -r1.8 -r1.9 --- refdbdrc 7 Jul 2003 22:24:07 -0000 1.8 +++ refdbdrc 30 Dec 2003 23:56:36 -0000 1.9 @@ -71,4 +71,7 @@ remoteadmin f +# Allow (t) or deny (f) remote access +remoteconnect f + # Keep (t) or delete(f) periodical names and synonyms when deleting # references |
From: Markus H. <mho...@us...> - 2003-12-30 23:54:13
|
Update of /cvsroot/refdb/refdb/doc In directory sc8-pr-cvs1:/tmp/cvs-serv26387 Added Files: refdb-manual-chapter22.sgml Log Message: initial version --- NEW FILE --- <!DOCTYPE CHAPTER PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ <!ENTITY appname "refdb"> ]> <!-- $Id: refdb-manual-chapter22.sgml,v 1.1 2003/12/30 23:54:09 mhoenicka Exp $ --> <chapter id="chapter-managing-notes"> <title>Notes management</title> <para>Managing notes is very similar to <link linkend="chapter-managing-references">managing references</link>. The commands have analogous names and functionality. If you've familiarized yourself with managing references, the notes part should not be too hard either.</para> <sect1 id="sect-add-extended-notes"> <title>Add extended notes</title> <para>Extended notes must be supplied as datasets according to the <ulink url="http://refdb.sourceforge.net/dtd/xnote/xnote.dtd">xnote DTD</ulink>. Add them to the database using the <link linkend="app-c-command-addnote"><command>addnote</command></link> command. Each file supplied to this command may either contain a single <sgmltag class="element">xnote</sgmltag> element or several of these wrapped into a <sgmltag class="element">xnoteset</sgmltag> element.</para> <note> <para>The <sgmltag class="attribute">id</sgmltag> attribute, if any, will be ignored when you add extended notes. The database engine will assign each note a new, unique identifier. The <sgmltag class="attribute">citekey</sgmltag> attribute will be honored unless there is a clash with an existing note. In this case &appname;d will refuse to add the note.</para> <para>If you want to overwrite or update an existing note, use the <link linkend="app-c-command-updatenote"><command>updatenote</command></link> command instead.</para> </note> <simplesect> <title>Example</title> <para>Assume the file <filename moreinfo="none">foo.xml</filename> contains a couple of extended notes. The following command will add them to the database "bar" (use the full path to <filename moreinfo="none">foo.xml</filename> if necessary):</para> <screen><prompt>&appname;c: </prompt><userinput>addnote -d bar foo.xml</userinput></screen> </simplesect> </sect1> <sect1 id="sect-view-extended-notes"> <title>Find and view extended notes</title> <para>Just as you'd use the <link linkend="app-c-command-getref"><command>getref</command></link> command to locate references, you can use the <link linkend="app-c-command-getnote"><command>getnote</command></link> command to view notes. The query language is explained in a <link linkend="sect-description-notes-query-language">separate section</link>.</para> <para>The notes can be retrieved for screen display, as HTML or XHTML documents, or as xnote documents.</para> </sect1> <sect1 id="sect-delete-extended-notes"> <title>Delete extended notes</title> <para>Use the <link linkend="app-c-command-deletenote"><command>deletenote</command></link> command to remove extended notes from the database. The argument to this command is a space-separated list of ID values.</para> <simplesect> <title>Example</title> <para>The following command removes the notes with the IDs 4 and 132 from the database "bar":</para> <screen><prompt>&appname;c: </prompt><userinput>deletenote -d bar 4 132</userinput></screen> </simplesect> </sect1> <sect1 id="sect-edit-extended-notes"> <title>Edit extended notes</title> <para>Use the same strategy as you would for references:</para> <itemizedlist> <listitem> <para>First retrieve the notes you want to edit with the <link linkend="app-c-command-getnote"><command>getnote</command></link> command and write the output to a file:</para> <screen format="linespecific"><prompt>&appname;c: </prompt><userinput>getnote -d bar -o foo.xml -t xnote :NID:=4 OR :NCK:=biochemistry1999</userinput></screen> </listitem> <listitem> <para>Now use your favourite XML editor to edit the notes. Keep the <sgmltag class="attribute">citekey</sgmltag> and <sgmltag class="attribute">id</sgmltag> elements alone, as at least one of them is required to match the dataset with the existing copy in the database.</para> </listitem> <listitem> <para>Finally use the <link linkend="app-c-command-updatenote"><command moreinfo="none">updatenote</command></link> command to update the reference in the database:</para> <screen format="linespecific"><prompt>&appname;c: </prompt><userinput>updatenote -d bar foo.xml</userinput></screen> </listitem> </itemizedlist> </sect1> <sect1 id="sect-link-extended-notes"> <title>Link existing notes to other objects in the database</title> <para>If you want to link an existing extended notes to other objects in your database without modifying the contents of the note, the <link linkend="app-c-command-addlink"><command moreinfo="none">addlink</command></link> command comes in handy. The command requires at least two arguments. The first argument specifies an existing note by its ID or citation key. The second argument specifies an object in the database, either a reference by ID or citation key, or an author name, a keyword, or a periodical by their names. Removing links works just the same except that you need to provide the <option>-r</option> switch.</para> <simplesect> <title>Example</title> <para>The following command links the existing note with the ID 5 to two references which are specified by their citation keys:</para> <screen format="linespecific"><prompt>&appname;c: </prompt><userinput>addlink -d bar :NID:=5 :CK:=Miller1999 :CK:=Doe2000</userinput></screen> </simplesect> </sect1> </chapter> |
Update of /cvsroot/refdb/refdb/doc In directory sc8-pr-cvs1:/tmp/cvs-serv25739/doc Modified Files: refdb-manual-chapter1.sgml refdb-manual-chapter10.sgml refdb-manual-chapter11.sgml refdb-manual-chapter12.sgml refdb-manual-chapter13.sgml refdb-manual-chapter14.sgml refdb-manual-chapter16.sgml refdb-manual-chapter2.sgml refdb-manual-chapter20.sgml refdb-manual-chapter4.sgml refdb-manual-chapter5.sgml refdb-manual-chapter6.sgml refdb-manual-chapter7.sgml refdb-manual-chapter8.sgml refdb-manual-chapter9.sgml refdb-manual.sgml Log Message: updated for 0.9.4 Index: refdb-manual-chapter1.sgml =================================================================== RCS file: /cvsroot/refdb/refdb/doc/refdb-manual-chapter1.sgml,v retrieving revision 1.10 retrieving revision 1.11 diff -u -U2 -r1.10 -r1.11 --- refdb-manual-chapter1.sgml 17 Aug 2003 16:50:46 -0000 1.10 +++ refdb-manual-chapter1.sgml 30 Dec 2003 23:51:36 -0000 1.11 @@ -9,5 +9,5 @@ <itemizedlist> <listitem> - <para>&appname; is a reference database. Use it to manage your collection of offprints of scientific publications, or basically any other collection of printed or electronic documents.</para> + <para>&appname; is a reference and note database. Use it to manage your collection of offprints of scientific publications, or basically any other collection of printed or electronic documents along with your personal notes.</para> </listitem> <listitem> @@ -19,4 +19,5 @@ <title>Who should use &appname;?</title> <para>&appname; was designed with the needs of a scientist in mind. At least one third of a scientist's work hours are spent reading and evaluating other scientist's publications. In no time you have a pile of offprints or PDF files that you would like to archive in a way that keeps the information accessible. &appname; helps you to keep track of those papers by creating a database with the essential bibliographic information, keywords for easy retrieval, your personal comments, the reprint status, a hint where you can find the offprint (or a link to the electronic version), and additional information for your personal categorization.</para> + <para>Extended notes help you organize your references according to topics and allow you to associate additional information with references, keywords, authors, or periodicals. This goes far beyond the one-note per reference approach of commercial tools, although this is of course still supported. Extended notes are associated to the user that created them, but they are visible to all users unless you restrict the display accordingly.</para> <para>Scientists rarely work alone on a subject. More commonly they are members of a group with similar research interests. It would be a waste of time and effort if each member of the group hunts offprints individually, resulting in duplicate copies, and if each member keeps his personal reference database, making it hard to consolidate an information pool of the group. Instead of selling a complete database engine to each scientist and "allowing" the users to peek at each other's databases, &appname; uses the inverse approach: designed as a client/server application from the ground up, it allows a group to maintain a common reference database, but still allows each individual to view only those references that she added or explicitly selected. At the same time, each group member can find out in an instant which offprints are available in the whole group. However, there is no problem if you want to use &appname; as an individual user.</para> <para>Eventually you'll want to publish your own data. You'll have to cite dozens of papers that you've already read. Your &appname; database will make it a breeze to retrieve those papers by author, by keyword, or by any other field or combination of fields. If you write your document using one of the supported SGML or XML DTDs or as a LaTeX document, &appname; can create the bibliography based on the citations in your document. It will also help you to format the citations and the bibliography according to the instructions of your publisher. Your paper got rejected and you want to submit it to a different journal? Fear not, &appname; can easily re-transform your document and format it for a different publisher.</para> @@ -36,5 +37,5 @@ </listitem> <listitem> - <para>The data storage proper is done by a SQL database engine. Currently <ulink url="http://www.mysql.com"><application>MySQL</application></ulink> and <ulink url="http://www.postgresql.org"><application>PostgreSQL</application></ulink> are supported as external database engines. Additionally, an internal SQL engine based on <ulink url="http://www.sqlite.org">SQLite</ulink> is available, which allows data storage in a single file without any administration overhead.</para> + <para>The data storage proper is done by a SQL database engine. Currently <ulink url="http://www.mysql.com"><application>MySQL</application></ulink> and <ulink url="http://www.postgresql.org"><application>PostgreSQL</application></ulink> are supported as external database engines. Additionally, an internal SQL engine based on <ulink url="http://www.sqlite.org">SQLite</ulink> is available, which allows data storage in a single, operating-system and architecture-independent file without any administration overhead.</para> </listitem> <listitem> @@ -59,5 +60,5 @@ <itemizedlist> <listitem> - <para>Reference data are imported from text files or from stdin and exported to text files or to stdout. The data model sticks closely to the <wordasword>RIS</wordasword> specification that most Windows-based reference managers understand. &appname; natively understands both the tagged RIS format used by other reference management software and an XML format (risx) similar to RIS.</para> + <para>Reference data are imported from text files or from stdin and exported to text files or to stdout. The data model sticks closely to the <wordasword>RIS</wordasword> specification that most Windows-based reference managers understand. &appname; natively understands both the tagged RIS format used by other reference management software and an XML format according to the <ulink url="http://refdb.sourceforge.net/dtd/risx/risx.dtd">risx.dtd</ulink> similar to RIS.</para> </listitem> <listitem> @@ -66,8 +67,11 @@ </listitem> <listitem> + <para>Extended notes are supplied as XML files according to the <ulink url="http://refdb.sourceforge.net/dtd/xnote/xnote.dtd">xnote.dtd</ulink>.</para> + </listitem> + <listitem> <para>The query language is fairly simple yet powerful. You can search in all fields in the database. You can use the Boolean operators <wordasword>AND</wordasword>, <wordasword>OR</wordasword>, <wordasword>NOT</wordasword> to combine search expressions. You can use brackets <wordasword>()</wordasword> to group search expressions. All alphanumeric fields (i.e. most except e.g. the publication year) treat the search string as a Unix-style regular expression which gives you enormous flexibility in your search strategies. The readline library reads the user input in all interactive clients. You can recall any previous search strings with a few keystrokes and re-run them or modify them as needed.</para> </listitem> <listitem> - <para>The query results can be displayed in a variety of formats. The standard backends create screen, HTML, BiBTeX, DocBook, TEI, RIS, and risx formats. All output can either be viewed on stdout or with a pager, or the output can be redirected into a file or into a pipe for further manipulation. &appname; provides a simple API to implement custom backends if you need other output formats.</para> + <para>The query results can be displayed in a variety of formats. The standard backends create screen, HTML, XHTML, BiBTeX, DocBook (SGML and XML), TEI, RIS, and risx formats. All output can either be viewed on stdout or with a pager, or the output can be redirected into a file or into a pipe for further manipulation. &appname; provides a simple API to implement custom backends if you need other output formats.</para> <para>In addition, Perl programmers can use the risx output and the RefDBClient module to easily create any output format they desire.</para> </listitem> @@ -77,7 +81,5 @@ <listitem> <para>&appname; knows the concept of a personal reference list. This feature is useful if a database is shared among several users in a workgroup. In this case, all users benefit from the larger stock of references available in the database. &appname; keeps track of the user who added a reference to the database. You can use a switch in the <link linkend="app-c-command-getref">getref</link> command to restrict your search on those references that are associated with your username. On the other hand, if you find out that even your colleagues have one or two interesting papers, you can use the <link linkend="app-c-command-pickref">pickref</link> command to add these references to your personal reference list. The personal part of the reference information (the reprint status, the availability, and the notes) are saved for each user individually.</para> - <note> - <para>Due to a limitation in the SQLite library (which is likely to be fixed eventually), the SQLite driver currently does not allow using personal reference lists.</para> - </note> + <para>In a similar fashion, the display of extended notes can be limited to the notes of the current user, or all available extended notes are used.</para> </listitem> </itemizedlist> Index: refdb-manual-chapter10.sgml =================================================================== RCS file: /cvsroot/refdb/refdb/doc/refdb-manual-chapter10.sgml,v retrieving revision 1.17 retrieving revision 1.18 diff -u -U2 -r1.17 -r1.18 --- refdb-manual-chapter10.sgml 17 Aug 2003 16:50:46 -0000 1.17 +++ refdb-manual-chapter10.sgml 30 Dec 2003 23:51:36 -0000 1.18 @@ -34,4 +34,6 @@ <arg>-d <replaceable>database</replaceable></arg> <arg>-e <replaceable>log-destination</replaceable></arg> + <arg>-E <replaceable>encoding</replaceable></arg> + <arg>-F <replaceable>fields</replaceable></arg> <arg>-g <replaceable>deffile</replaceable></arg> <arg>-G <replaceable>CSS-file</replaceable></arg> @@ -59,4 +61,6 @@ <arg choice="req">-d <replaceable>database</replaceable></arg> <arg>-e <replaceable>log-destination</replaceable></arg> + <arg>-E <replaceable>encoding</replaceable></arg> + <arg>-F <replaceable>fields</replaceable></arg> <arg>-g <replaceable>deffile</replaceable></arg> <arg>-G <replaceable>CSS-file</replaceable></arg> @@ -80,5 +84,7 @@ </tip> <para>Remember that you don't have to specify all command-line options each time if you define the values in <link linkend="sect1-mystery-init-files">.&appname;crc</link>.</para> - <para>Use the <option>-d</option> option to specify the database that you want to work with. In an interactive session you can also set and change the default database with the <link linkend="app-c-command-selectdb"><command>selectdb</command> command</link></para> + <para>Use the <option>-d</option> option to specify the database that you want to work with. In an interactive session you can also set and change the default database with the <link linkend="app-c-command-selectdb"><command>selectdb</command> command</link>.</para> + <para>The encoding specified with the <option>-E</option> option is used by the HTML output of the <link linkend="app-c-command-getref"><command moreinfo="none">getref</command></link> command.</para> + <para>The <option>-F</option> option specifies the default fields that are to be displayed in a <link linkend="app-c-command-getref"><command moreinfo="none">getref</command></link> query.</para> <para>The <option>-g</option> option can be used to add some default fields to all references that are added or updated. The argument <replaceable>deffile</replaceable> is the filename of a <link linkend="sect1-ris-format">RIS file</link> containing these additional fields. &appname;c first tries the filename as is, so it should be a valid relative or absolute path. If the file is not found, &appname; looks for the file in <filename><envar>$HOME</envar>/</filename>. The command aborts if the file cannot be found.</para> <para>Use the <option>-G</option> option to specify the URL of a Cascading Style Sheets (CSS) file. This file will be used to customize the HTML output of the <link linkend="app-c-command-getref"><command>getref</command></link> command. The URL can be either a local path (e.g. <filename>refdb.css</filename>, <filename>/home/myname/custom.css</filename>) or the web address of a file on a web server (e.g. <filename>http://www.mycomp.com/refdb.css</filename>).</para> @@ -123,5 +129,5 @@ <entry>fields</entry> <entry>(none)</entry> - <entry>A list of additional fields which should be displayed by default in the reference output. The list is a simple concatenation of the field names. Possible fields are N1, N2, AB, AD, RP, SN, PB, CY, UR, U1 through U5, M1 through M3.</entry> + <entry>A list of additional fields which should be displayed by default in the reference output. The list is a simple concatenation of the field names. Possible fields are N1, N2, NX, AB, AD, RP, SN, PB, CY, UR, U1 through U5, M1 through M3. Use the string "ALL" to request all available fields.</entry> </row> <row> @@ -197,5 +203,5 @@ <entry>fields</entry> <entry>(none)</entry> - <entry>A list of additional fields which should be displayed by default in the reference output. The list is a simple concatenation of the field names. Possible fields are N1, N2, AB, AD, RP, SN, UR, PB, CY, U1 through U5, M1 through M3.</entry> + <entry>A list of additional fields which should be displayed by default in the reference output. The list is a simple concatenation of the field names. Possible fields are N1, N2, NX, AB, AD, RP, SN, UR, PB, CY, U1 through U5, M1 through M3. Use the string "ALL" to request all available fields.</entry> </row> <row> @@ -245,11 +251,77 @@ <sect1> <title>Commands</title> - <sect2> + <para>The following sections explain all commands available in &appname;c.</para> + <sect2 id="app-c-command-addlink"> + <title>addlink</title> + <simplesect> + <title>Synopsis</title> + <cmdsynopsis> + <command>addlink</command> + <arg choice="opt" rep="norepeat">-d <replaceable>database</replaceable></arg> + <arg choice="opt" rep="norepeat">-h</arg> + <group choice="opt" rep="norepeat"> + <arg>-c <replaceable>command</replaceable></arg> + <arg>-o <replaceable>outfile</replaceable></arg> + <arg>-O <replaceable>outfile</replaceable></arg> + </group> + <arg choice="opt" rep="norepeat">-r</arg> + <arg choice="req" rep="norepeat">note-specifier</arg> + <arg choice="req" rep="repeat">link-target</arg> + </cmdsynopsis> + </simplesect> + <simplesect> + <title>Description</title> + <para>The <command moreinfo="none">addlink</command> command links an extended note to one or more link targets. If you use the <option>-r</option> option, the specified links will be removed.</para> + <para>You have to specify exactly one note on the command line, either by using the :NID: field selector to specify the note ID, or by using the :NCK: field selector to specify the note key. Then you need at least one link target. This can be one of :ID: (reference by ID), :CK: (reference by citation key), :AU: (author by name), :KW: (keyword by name), or one of :JF:, :JO:, :J1:, :J2: (periodical by full name, abbreviated name, or user abbreviations 1 and 2).</para> + </simplesect> + <simplesect> + <title>Example</title> + <screen><prompt>&appname;c: </prompt><userinput>addlink :NID:=12 :CK:=Miller1999 :KW:=biochemistry</userinput></screen> + <para>This command will link the note carrying the ID 12 with a reference specified by its citation key "Miller1999" and with the keyword "biochemistry".</para> + </simplesect> + </sect2> + <sect2 id="app-c-command-addnote"> + <title>addnote</title> + <simplesect> + <title>Synopsis</title> + <cmdsynopsis> + <command>addnote</command> + <arg>-d <replaceable>database</replaceable></arg> + <arg>-h</arg> + <group choice="opt" rep="norepeat"> + <arg>-c <replaceable>command</replaceable></arg> + <arg>-o <replaceable>outfile</replaceable></arg> + <arg>-O <replaceable>outfile</replaceable></arg> + </group> + <group choice="req" rep="repeat"> + <arg rep="repeat"><replaceable>file</replaceable></arg> + <arg>-f <replaceable>infile</replaceable></arg> + </group> + </cmdsynopsis> + </simplesect> + <simplesect> + <title>Description</title> + <para>Adds the extended notes in <replaceable>file</replaceable> to the current database. You can specify several files in one run. Any ID fields in the notes are ignored.</para> + <para>The <option>-c</option> switch allows to specify a <command>command</command>. &appname;c will open a pipe to the first program in the command and send the output to this program's stdin. The command may be any valid command that you can run in your shell, so further plumbing is perfectly legal.</para> + <para>Use the <option>-d</option> option to specify the database that you want to work with if it is different from the currently selected database.</para> + <para>The <option>-h</option> option displays a short command syntax and description, then returns to the command prompt. </para> + <para>The <option>-o</option> and <option>-O</option> switches allow to redirect the output to <filename>outfile</filename> instead of the default screen display. The two options differ in the way they handle an existing <filename>outfile</filename>. <option>-o</option> will replace the existing file, while <option>-O</option> will append to the existing file. If <filename>outfile</filename> cannot be opened with the proper permissions, the output is sent to stdout instead.</para> + <para>The <option>-f</option> switch allows to specify a file which contains a whitespace-separated list of filenames instead of explicitly naming these files on the command line.</para> + <para>All other command-line arguments will be interpreted as filenames to read references from. If data are available on stdin, all files will be ignored and the data will be read from stdin.</para> + </simplesect> + <simplesect> + <title>Example</title> + <screen><prompt>&appname;c: </prompt><userinput>addnote foo.xml</userinput></screen> + <para>This command will add the extended notes in <filename moreinfo="none">foo.ris</filename> to the currently selected database. If the notes do not specify a date, &appname;d will insert a timestamp automatically.</para> + </simplesect> + </sect2> + <sect2 id="app-c-command-addref"> <title>addref</title> <simplesect> <title>Synopsis</title> <cmdsynopsis> - <command><anchor id="app-c-command-addref">addref</command> + <command>addref</command> <arg>-d <replaceable>database</replaceable></arg> + <arg>-g <replaceable>deffile</replaceable></arg> <arg>-h</arg> <group choice="opt" rep="norepeat"> @@ -294,10 +366,47 @@ </simplesect> </sect2> - <sect2> + <sect2 id="app-c-command-deletenote"> + <title>deletenote</title> + <simplesect> + <title>Synopsis</title> + <cmdsynopsis> + <command>deletenote</command> + <arg>-d <replaceable>database</replaceable></arg> + <arg>-h</arg> + <group choice="opt" rep="norepeat"> + <arg>-c <replaceable>command</replaceable></arg> + <arg>-o <replaceable>outfile</replaceable></arg> + <arg>-O <replaceable>outfile</replaceable></arg> + </group> + <group choice="req" rep="repeat"> + <arg choice="req" rep="repeat"><replaceable>ID</replaceable></arg> + <arg choice="req" rep="norepeat">-f <replaceable>infile</replaceable></arg> + </group> + </cmdsynopsis> + </simplesect> + <simplesect> + <title>Description</title> + <para>Deletes the extended note with the identifier <replaceable>ID</replaceable> from the current database. Several extended notes may be specified in a single call of this command. Notes with consecutive ID values may be specified as ranges.</para> + <para>Alternatively you can specify a file with the <option>-f</option> switch which contains a list of IDs in the RIS format. This can e.g. be a previously saved search with the <option>-o</option> and <option>-s ID</option> options of <command>getnote</command>. The <option>-f</option> switch can also be combined with IDs specified as arguments.</para> + <para>The <option>-c</option> switch allows to specify a shell <command>command</command>. &appname;c will open a pipe to the first program in the command and send the output to this program's stdin. The command may be any valid command that you can run in your shell, so further plumbing is perfectly legal. This feature may e.g. be used to filter the output with grep.</para> + <para>Use the <option>-d</option> option to specify the database that you want to work with.</para> + <para>The <option>-h</option> option displays a short command syntax and description, then returns to the command prompt. </para> + <para>The <option>-o</option> and <option>-O</option> switches allow to redirect the output to <filename>outfile</filename> instead of the default screen display. The two options differ in the way they handle an existing <filename>outfile</filename>. <option>-o</option> will replace the existing file, while <option>-O</option> will append to the existing file. If <filename>outfile</filename> cannot be opened with the proper permissions, the output is sent to stdout instead.</para> + <caution> + <para>It is not possible to delete a note if it belongs to a different user.</para> + </caution> + </simplesect> + <simplesect> + <title>Example</title> + <screen><prompt>&appname;c: </prompt><userinput>deletenote 3 5-10 26</userinput></screen> + <para>This command will delete the extended notes with the ID values 3, 5 through 10, and 26.</para> + </simplesect> + </sect2> + <sect2 id="app-c-command-deleteref"> <title>deleteref</title> <simplesect> <title>Synopsis</title> <cmdsynopsis> - <command><anchor id="app-c-command-deleteref">deleteref</command> + <command>deleteref</command> <arg>-d <replaceable>database</replaceable></arg> <arg>-h</arg> @@ -322,5 +431,6 @@ <para>The <option>-o</option> and <option>-O</option> switches allow to redirect the output to <filename>outfile</filename> instead of the default screen display. The two options differ in the way they handle an existing <filename>outfile</filename>. <option>-o</option> will replace the existing file, while <option>-O</option> will append to the existing file. If <filename>outfile</filename> cannot be opened with the proper permissions, the output is sent to stdout instead.</para> <caution> - <para>All data saved in the specified references will be gone, so be careful with this command. Make sure you understand the difference between the <command>deleteref</command> command and the <link linkend="app-c-command-pickref"><command>pickref -r</command></link> command. The former deletes the data, the latter deletes only your personal data associated with the specified references (the notes, availability, and reprint data) and removes your association with this reference. In other words, <command>deleteref</command> removes the reference from the database, whereas <link linkend="app-c-command-pickref"><command>pickref -r</command></link> removes the reference from your personal reference list, leaving the remaining data for the other users of the database.</para> + <para>It is not possible to delete a reference if it belongs to the personal reference list of more than one user.</para> + <para>If you're the only user of this reference and go ahead and delete it, all data saved in the specified references will be gone, so be careful with this command. Make sure you understand the difference between the <command>deleteref</command> command and the <link linkend="app-c-command-pickref"><command>pickref -r</command></link> command. The former deletes the data, the latter deletes only your personal data associated with the specified references (the notes, availability, and reprint data) and removes your association with this reference. In other words, <command>deleteref</command> removes the reference from the database, whereas <link linkend="app-c-command-pickref"><command>pickref -r</command></link> removes the reference from your personal reference list, leaving the remaining data for the other users of the database.</para> </caution> </simplesect> @@ -331,10 +441,10 @@ </simplesect> </sect2> - <sect2> + <sect2 id="app-c-command-getau"> <title>getau, geted, getas</title> <simplesect> <title>Synopsis</title> <cmdsynopsis> - <command><anchor id="app-c-command-getau">getau</command> + <command>getau</command> <arg>-d <replaceable>database</replaceable></arg> <arg>-h</arg> @@ -385,10 +495,10 @@ </simplesect> </sect2> - <sect2> + <sect2 id="app-c-command-getjo"> <title>getjo, getjf, getj1, getj2</title> <simplesect> <title>Synopsis</title> <cmdsynopsis> - <command><anchor id="app-c-command-getjo">getjo</command> + <command>getjo</command> <arg>-a</arg> <arg>-d <replaceable>database</replaceable></arg> @@ -456,10 +566,10 @@ </simplesect> </sect2> - <sect2> + <sect2 id="app-c-command-getkw"> <title>getkw</title> <simplesect> <title>Synopsis</title> <cmdsynopsis> - <command><anchor id="app-c-command-getkw">getkw</command> + <command>getkw</command> <arg>-d <replaceable>database</replaceable></arg> <arg>-h</arg> @@ -488,10 +598,56 @@ </simplesect> </sect2> - <sect2> + <sect2 id="app-c-command-getnote"> + <title>getnote</title> + <simplesect> + <title>Synopsis</title> + <cmdsynopsis> + <command>getnote</command> + <arg>-d <replaceable>database</replaceable></arg> + <arg>-h</arg> + <group choice="opt" rep="norepeat"> + <arg>-c <replaceable>command</replaceable></arg> + <arg>-o <replaceable>outfile</replaceable></arg> + <arg>-O <replaceable>outfile</replaceable></arg> + </group> + <arg>-P</arg> + <arg>-s <replaceable>format-string</replaceable></arg> + <arg>-S <replaceable>sort-string</replaceable></arg> + <arg>-t <replaceable>output-format</replaceable></arg> + <group choice="req" rep="norepeat"> + <arg><replaceable>search-string</replaceable></arg> + <arg>-f <replaceable>file</replaceable></arg> + </group> + </cmdsynopsis> + </simplesect> + <simplesect> + <title>Description</title> + <para>Displays all extended notes which match the <replaceable>search-string</replaceable> in the current database. Refer to the section <link linkend="sect1-query-language">The query language</link> for a description of the syntax of a search string.</para> + <para>The <option>-c</option> switch allows to specify a shell <command>command</command>. &appname;c will open a pipe to the first program in the command and send the output to this program's stdin. The command may be any valid command that you can run in your shell, so further plumbing is perfectly legal. This command is handy if you want to search potentially long fields like the content for certain strings. Searching all abstracts of a database with a normal query is slow. It is usually faster to narrow down the search using other fields as far as possible without including the content field and then use grep to find what you want.</para> + <para>Use the <option>-d</option> option to specify the database that you want to work with.</para> + <para>The <option>-h</option> option displays a short command syntax and description, then returns to the command prompt. </para> + <para>The <option>-o</option> and <option>-O</option> switches allow to redirect the output to <filename>outfile</filename> instead of the default screen display. The two options differ in the way they handle an existing <filename>outfile</filename>. <option>-o</option> will replace the existing file, while <option>-O</option> will append to the existing file. If <filename>outfile</filename> cannot be opened with the proper permissions, the output is sent to stdout instead.</para> + <caution> + <para>Depending on your query, the getref command can generate an enormous amount of output. If you view the output with a pager, the client-server communication will stall as soon as the pager accepts no new data. If the connection times out, your query results will be incomplete. It is strongly recommended to redirect all queries which return a lot of references (rule of thumb: more than 100 for screen output, more than 50 for other output) to a file or to a pipe that can handle the amount of data.</para> + </caution> + <para>Except for RIS and risx output which always display the full dataset, the <option>-s</option> switch allows to specify additional fields (N1, N2/AB, NX, RP, SN, AD, CY, PB, UR, U1 through U5, M1 through M3) that are not displayed by default. Use "ALL" as an argument to display all available fields. If several fields are specified, the argument has to be enclosed by single quotation marks. If applied to RIS output, you can specify <wordasword>ID</wordasword> as <replaceable>format-string</replaceable> to get only a list of ID values in RIS format for all references that match the search. This is a convenient way to generate ID lists for later operations like <link linkend="app-c-command-deleteref"><command>deleteref</command></link>.</para> + <para>The <option>-S</option> switch is used to sort the output. Currently you can sort only by <wordasword>ID</wordasword> (the default) or by <wordasword>PY</wordasword> (publication year).</para> + <para>The <option>-P</option> switch limits the search to the files which are in the current user's personal reference list. If this switch is absent, the whole database will be searched.</para> + <para>The <option>-t</option> switch determines the <link linkend="sect-output-formats">type of output</link>. The default value for <replaceable>output-format</replaceable> is <wordasword>scrn</wordasword> (screen output), other possible values are <wordasword>db31</wordasword> (DocBook SGML V. 3.1), <wordasword>db31x</wordasword> (DocBook XML), <wordasword>ris</wordasword> (RIS as of Reference Manager 8.01), <wordasword>risx</wordasword> (XML according to the <link linkend="sect1-writing-risx">risx DTD</link>), <wordasword>html</wordasword> (HTML), <wordasword>xhtml</wordasword> (XHTML), and <wordasword>bibtex</wordasword> (BibTeX).</para> + <para>The <option>-f</option> switch reads the search string from <filename>file</filename> instead of from the command line, thus allowing to save searches which will be run repeatedly.</para> + <para>The syntax of the queries is described in the section <link linkend="sect1-query-language">query language</link>.</para> + </simplesect> + <simplesect> + <title>Example</title> + <screen width="60" format="linespecific"><prompt>&appname;c: </prompt><userinput>getref -t db31 -o temp.sgml ":AU:='& ^Doe ^Jones' AND :KW:=circular\ dichroism"</userinput></screen> + <para>This command retrieves articles with both an author starting with <quote>Doe</quote> and an author starting with <quote>Jones</quote> that have the keyword <quote>circular dichroism</quote>. The output will be saved as DocBook SGML into the file <filename moreinfo="none">temp.sgml</filename>.</para> + </simplesect> + </sect2> + <sect2 id="app-c-command-getref"> <title>getref</title> <simplesect> <title>Synopsis</title> <cmdsynopsis> - <command><anchor id="app-c-command-getref">getref</command> + <command>getref</command> <arg>-d <replaceable>database</replaceable></arg> <arg>-h</arg> @@ -521,8 +677,8 @@ <para>Depending on your query, the getref command can generate an enormous amount of output. If you view the output with a pager, the client-server communication will stall as soon as the pager accepts no new data. If the connection times out, your query results will be incomplete. It is strongly recommended to redirect all queries which return a lot of references (rule of thumb: more than 100 for screen output, more than 50 for other output) to a file or to a pipe that can handle the amount of data.</para> </caution> - <para>Except for RIS and risx output which always display the full dataset, the <option>-s</option> switch allows to specify additional fields (N1, N2/AB, RP, SN, AD, CY, PB, UR, U1 through U5, M1 through M3) that are not displayed by default. Use "ALL" as an argument to display all available fields. If several fields are specified, the argument has to be enclosed by single quotation marks. If applied to RIS output, you can specify <wordasword>ID</wordasword> as <replaceable>format-string</replaceable> to get only a list of ID values in RIS format for all references that match the search. This is a convenient way to generate ID lists for later operations like <link linkend="app-c-command-deleteref"><command>deleteref</command></link>.</para> + <para>Except for RIS and risx output which always display the full dataset, the <option>-s</option> switch allows to specify additional fields (N1, N2/AB, NX, RP, SN, AD, CY, PB, UR, U1 through U5, M1 through M3) that are not displayed by default. Use "ALL" as an argument to display all available fields. If several fields are specified, the argument has to be enclosed by single quotation marks. If applied to RIS output, you can specify <wordasword>ID</wordasword> as <replaceable>format-string</replaceable> to get only a list of ID values in RIS format for all references that match the search. This is a convenient way to generate ID lists for later operations like <link linkend="app-c-command-deleteref"><command>deleteref</command></link>.</para> <para>The <option>-S</option> switch is used to sort the output. Currently you can sort only by <wordasword>ID</wordasword> (the default) or by <wordasword>PY</wordasword> (publication year).</para> <para>The <option>-P</option> switch limits the search to the files which are in the current user's personal reference list. If this switch is absent, the whole database will be searched.</para> - <para>The <option>-t</option> switch determines the <link linkend="sect-output-formats">type of output</link>. The default value for <replaceable>output-format</replaceable> is <wordasword>scrn</wordasword> (screen output), other possible values are <wordasword>db31</wordasword> (DocBook V. 3.1), <wordasword>ris</wordasword> (RIS as of Reference Manager 8.01), <wordasword>html</wordasword> (HTML), and <wordasword>bibtex</wordasword> (BibTeX).</para> + <para>The <option>-t</option> switch determines the <link linkend="sect-output-formats">type of output</link>. The default value for <replaceable>output-format</replaceable> is <wordasword>scrn</wordasword> (screen output), other possible values are <wordasword>db31</wordasword> (DocBook SGML V. 3.1), <wordasword>db31x</wordasword> (DocBook XML), <wordasword>ris</wordasword> (RIS as of Reference Manager 8.01), <wordasword>risx</wordasword> (XML according to the <link linkend="sect1-writing-risx">risx DTD</link>), <wordasword>html</wordasword> (HTML), <wordasword>xhtml</wordasword> (XHTML), and <wordasword>bibtex</wordasword> (BibTeX).</para> <para>The <option>-f</option> switch reads the search string from <filename>file</filename> instead of from the command line, thus allowing to save searches which will be run repeatedly.</para> <para>The syntax of the queries is described in the section <link linkend="sect1-query-language">query language</link>.</para> @@ -599,10 +755,10 @@ </simplesect> </sect2> - <sect2> + <sect2 id="app-c-command-pickref"> <title>pickref</title> <simplesect> <title>Synopsis</title> <cmdsynopsis> - <command><anchor id="app-c-command-pickref">pickref</command> + <command>pickref</command> <arg>-d <replaceable>database</replaceable></arg> <arg>-h</arg> @@ -634,10 +790,10 @@ </simplesect> </sect2> - <sect2> + <sect2 id="app-c-command-selectdb"> <title>selectdb</title> <simplesect> <title>Synopsis</title> <cmdsynopsis> - <command><anchor id="app-c-command-selectdb">selectdb</command> + <command>selectdb</command> <arg>-h</arg> <arg choice="req" rep="norepeat"><replaceable>database</replaceable></arg> @@ -657,10 +813,10 @@ </simplesect> </sect2> - <sect2> + <sect2 id="app-c-command-set"> <title>set</title> <simplesect> <title>Synopsis</title> <cmdsynopsis> - <command><anchor id="app-c-command-set">set</command> + <command>set</command> <arg>-h</arg> <arg choice="opt" rep="norepeat"><replaceable>varname</replaceable></arg> @@ -686,10 +842,41 @@ </simplesect> </sect2> - <sect2> + <sect2 id="app-c-command-updatenote"> + <title>updatenote</title> + <simplesect> + <title>Synopsis</title> + <cmdsynopsis> + <command>updatenote</command> + <arg>-d <replaceable>database</replaceable></arg> + <arg>-h</arg> + <group choice="opt" rep="norepeat"> + <arg>-c <replaceable>command</replaceable></arg> + <arg>-o <replaceable>outfile</replaceable></arg> + <arg>-O <replaceable>outfile</replaceable></arg> + </group> + <group choice="req" rep="repeat"> + <arg rep="repeat"><replaceable>file</replaceable></arg> + <arg>-f <replaceable>infile</replaceable></arg> + </group> + </cmdsynopsis> + </simplesect> + <simplesect> + <title>Description</title> + <para>Updates the extended notes in <replaceable>file</replaceable> in the current database.</para> + <para>This command is essentially the same as <link linkend="app-c-command-addnote">addnote</link>, but it uses the <sgmltag class="attribute">citekey</sgmltag> or <sgmltag class="attribute">id</sgmltag> attributes (in this order) to update an existing note in the database. If the specified note does not exist in the database, a new one will be created.</para> + <para>The command line options are the same as described for the <link linkend="app-c-command-addnote">addnote</link> command.</para> + </simplesect> + <simplesect> + <title>Example</title> + <screen><prompt>&appname;c: </prompt><userinput>updatenote foo.xml</userinput></screen> + <para>This command will update the extended notes in <filename moreinfo="none">foo.ris</filename> in the currently selected database. If the notes do not specify a date, &appname;d will insert a timestamp automatically.</para> + </simplesect> + </sect2> + <sect2 id="app-c-command-updateref"> <title>updateref</title> <simplesect> <title>Synopsis</title> <cmdsynopsis> - <command><anchor id="app-c-command-updateref">updateref</command> + <command>updateref</command> <arg>-d <replaceable>database</replaceable></arg> <arg>-g <replaceable>deffile</replaceable></arg> @@ -722,10 +909,10 @@ </simplesect> </sect2> - <sect2> + <sect2 id="app-c-command-verbose"> <title>verbose</title> <simplesect> <title>Synopsis</title> <cmdsynopsis> - <command><anchor id="app-c-command-verbose">verbose</command> + <command>verbose</command> <arg>-h</arg> </cmdsynopsis> @@ -742,10 +929,10 @@ </simplesect> </sect2> - <sect2> + <sect2 id="app-c-command-whichdb"> <title>whichdb</title> <simplesect> <title>Synopsis</title> <cmdsynopsis> - <command><anchor id="app-c-command-whichdb">whichdb</command> + <command>whichdb</command> <arg>-h</arg> </cmdsynopsis> @@ -753,5 +940,5 @@ <simplesect> <title>Description</title> - <para>Displays the name of the currently selected database, the number of references in this database, and the highest ID in this database.</para> + <para>Displays a plethora of information about the currently selected database.</para> <para>The <option>-h</option> option displays a short command syntax and description, then returns to the command prompt. </para> </simplesect> @@ -759,10 +946,22 @@ <title>Example</title> <screen><prompt>&appname;c: </prompt><userinput>whichdb</userinput></screen> - <para>This will print the information about the active database. Refer to the <link linkend="app-c-command-selectdb"><command moreinfo="none">selectdb</command></link> command for information how to change the active database.</para> + <para>This will print the information about the active database. Refer to the <link linkend="app-c-command-selectdb"><command moreinfo="none">selectdb</command></link> command for information how to change the active database. The <command moreinfo="none">whichdb</command> output looks like this:</para> + <programlisting format="linespecific"> +Current database: alltypes +Number of references: 45 +Highest reference ID: 45 +Number of notes: 2 +Highest note ID: 2 +Database type: risx +Server type: pgsql +Created: 2003-12-24 22:27:43 UTC +Using refdb version: 0.9.4-pre2 +Last modified: 2003-12-24 22:29:05 UTC +</programlisting> </simplesect> </sect2> </sect1> <sect1 id="sect-output-formats"> - <title>Output formats</title> + <title>Reference data output formats</title> <para>&appname;d implements several standard backends for data output. You can select them with the <option>-t</option> option of the <link linkend="app-c-command-getref"><command>getref</command></link> command in &appname;c. Remember that all backends just send data. It is your decision what you want to do with the information. You can either view the data on the screen or pipe them to another application or write them to a disk file.</para> <sect2> @@ -770,5 +969,5 @@ <para>The screen backend provides a basic data output for viewing in a terminal, preferably through a pager. By default, the reference ID, the publication year, the authors, the title, and the source information are displayed. You can use the <option>-s</option> option to additionally display the abstract (AB or N2), the notes (N1), the reprint info (RP), the address (AD), the publisher (PB), the city (CY), the URL (UR), and the user (U1 through U5) and misc (M1 through M3) fields. <option>-s ALL</option> will display all available fields.</para> </sect2> - <sect2> + <sect2 id="sect-getref-output-html"> <title>html</title> <para>The html backend works just like the scrn backend, but encodes this information in a <acronym>HTML</acronym> text. This comes in handy if you would like to view the results of your queries in a web browser rather than in a terminal window. You simply use the <option>-o</option> switch to write the results of your queries to a file, reusing the same filename for each query. After each query you just have to hit the reload button of your browser to view the results of the most recent query.</para> @@ -826,4 +1025,8 @@ </sect2> <sect2> + <title>xhtml</title> + <para>This is a variant of the html output which creates valid XML output according to the <ulink url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">XHTML V1.0 Transitional DTD</ulink>.</para> + </sect2> + <sect2> <title>ris</title> <para>This is identical to the input format. Use it to export references to other reference management systems.</para> @@ -831,5 +1034,5 @@ <sect2> <title>risx</title> - <para>Retrieves the data as an XML document using the risx DTD. Use it to edit references or to create backups of your databases.</para> + <para>Retrieves the data as an XML document using the <link linkend="sect1-writing-risx">risx DTD</link>. Use it to edit references or to create backups of your databases.</para> </sect2> <sect2> @@ -850,9 +1053,30 @@ </sect2> </sect1> + <sect1 id="sect-notes-output-formats"> + <title>Extended notes output formats</title> + <para>&appname; implements a few backends to output extended notes. You can select them with the <option>-t</option> option of the <link linkend="app-c-command-getnote"><command moreinfo="none">getnote</command></link> command.</para> + <sect2> + <title>scrn</title> + <para>The screen backend provides the output most suitable for viewing notes in a terminal. Send the output through a pager for best results. Use the <option>-s NL</option> or <option>-s ALL</option> options to display all objects the note is linked to.</para> + </sect2> + <sect2> + <title>html</title> + <para>The information returned by this backend is encoded as a HTML document. Otherwise the same applies as said for the scrn backend. See <link linkend="sect-getref-output-html">above</link> for some hints about formatting the output with a CSS file.</para> + </sect2> + <sect2> + <title>xhtml</title> + <para>The output is the same as for the html backend but the output is formatted as an XHTML document according to the <ulink url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">XHTML V1.0 Transitional DTD</ulink>.</para> + </sect2> + <sect2> + <title>xnote</title> + <para>This backend encodes the output in <ulink url="http://refdb.sourceforge.net/dtd/xnote/xnote.dtd">xnote</ulink> documents, the same as the input format for extended notes.</para> + </sect2> + </sect1> <sect1 id="sect1-query-language"> <title id="sect1.title-query-language">The query language</title> - <para>The <link linkend="app-c-command-getref"><command>getref</command></link> command is probably the most heavily used command. You use it to retrieve the references that you collected and saved in the database. To find a certain article or several related articles, all you have to do is to express your query in a language that &appname; understands. This section describes how to formulate search strings for your queries.</para> - <sect2> - <title>Description of the query language</title> + <para>The <link linkend="app-c-command-getref"><command>getref</command></link> command is probably the most heavily used command. You use it to retrieve the references that you collected and saved in the database. To find a certain article or several related articles, all you have to do is to express your query in a language that &appname; understands. The first section describes how to formulate search strings for your queries.</para> + <para>The <link linkend="app-c-command-getnote"><command>getnote</command></link> command used to locate extended notes is very similar. The specifics of this command will be described in the following section.</para> + <sect2 id="sect-description-reference-query-language"> + <title>The reference query language</title> <para>The syntax for the search string follows these rules:</para> <itemizedlist> @@ -868,5 +1092,5 @@ <para>The current implementation of &appname; is very picky about spaces. Please make sure that you do not insert spaces or other whitespace on either side of the operators ("=", "!=", "<", ">"). If your value should start with a space, include the value in quotation marks or protect the space with a backslash.</para> </warning> - <para>The sequence ":XY:" denotes the field to search in. The names are mostly taken from the RIS specification. Possible field names are:</para> + <para>The sequence ":XY:" denotes the reference data field to search in. The names are mostly taken from the RIS specification. Possible field names are:</para> <variablelist> <varlistentry> @@ -1003,4 +1227,10 @@ </varlistentry> <varlistentry> + <term>:L1: through :L4:</term> + <listitem> + <para>The link fields 1 through 4.</para> + </listitem> + </varlistentry> + <varlistentry> <term>:AD:</term> <listitem> @@ -1015,4 +1245,19 @@ </varlistentry> </variablelist> + <para>In addition to the above field specifiers, there are a few that allow to retrieve references based on extended notes attached to them:</para> + <variablelist> + <varlistentry> + <term>:NID:</term> + <listitem> + <para>The ID of an extended note.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>:NCK:</term> + <listitem> + <para>The alphanumeric key of an extended note.</para> + </listitem> + </varlistentry> + </variablelist> <para>References are matched according to these rules:</para> <itemizedlist> @@ -1053,7 +1298,76 @@ </itemizedlist> </sect2> + <sect2 id="sect-description-notes-query-language"> + <title>The notes query language</title> + <para>The <link linkend="app-c-command-getnote">getnote</link> command uses essentially the same query language as described above. However, there is a different set of field specifiers that you can use to locate extended notes:</para> + <variablelist> + <varlistentry> + <term>:NID:</term> + <listitem> + <para>The unique id of an extended note.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>:NCK:</term> + <listitem> + <para>The unique citation key of an extended note.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>:NPY:</term> + <listitem> + <para>The date of an extended note.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>:NTI:</term> + <listitem> + <para>The title of an extended note.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>:NKW:</term> + <listitem> + <para>A keyword. This is a keyword attached to a note in order to categorize the latter, similar to a keyword in a reference.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>:KW:</term> + <listitem> + <para>A keyword. This is a keyword that the note is linked to, i.e. a keyword that the note was attached to in order to supply additional information.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>:AU:</term> + <listitem> + <para>The name of an author or editor. Use this field specifier to locate notes that are linked to a particular author.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>:JF:, :JO:, :J1:, :J2:</term> + <listitem> + <para>The full, abbreviated, or user-abbreviated name of a periodical. Use this field specifier to locate notes that are linked to a periodical.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>:ID:</term> + <listitem> + <para>The id of a reference. Use this field specifier to locate notes linked to a particular reference.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>:CK:</term> + <listitem> + <para>The citation key of a reference. Use this field specifier to locate notes linked to a particular reference.</para> + </listitem> + </varlistentry> + </variablelist> + </sect2> <sect2 id="sect2-query-examples"> <title>Some example queries</title> <para>This section shows a few example queries to help you get familiar with the syntax. If you are not familiar with the regular expressions used here, please peruse the <link linkend="sect1-regular-expressions">regular expressions section</link>. We will not use any of the fancy switches of the <link linkend="app-c-command-getref"><command>getref</command></link> command here, so the output will always be a simple listing on the screen.</para> + <note> + <para>These examples assume that your database engine performs partial matches by default. This holds true for MySQL and PostgreSQL, wherease SQLite always attempts a full match. To emulate partial matches with the latter, append a percent sign (%) after each string to match. See also the section about <link linkend="sect2-regular-expressions-sql">SQL regular expressions</link>.</para> + </note> <para>We'll start with some easy queries. First we want to display a reference with a specific ID (25 in this example):</para> <informalexample> @@ -1081,4 +1395,12 @@ <screen format="linespecific"><prompt moreinfo="none">refdbc: </prompt><userinput moreinfo="none">getref :AU:=^Miller AND :AU:=^Doe AND :PY:>1994 AND :PY:<2000 AND (:KW:=[bB]lood OR :KW:=[aA]nimal OR (:KW:=[gG]uanyl AND :KW:=[cC]yclase))</userinput></screen> + </informalexample> + <para>And now for something completely different. If you've added a couple extended notes to your database, you can retrieve references that are attached to a specific extended note, e.g. to the note with the citation key "Miller1999":</para> + <informalexample> + <screen format="linespecific"><prompt moreinfo="none">refdbc: </prompt><userinput moreinfo="none">getnote :NCK:=biochemistry1999</userinput></screen> + </informalexample> + <para>If you want to see all notes which are attached to a reference with the citation key "Miller1999", use the following command:</para> + <informalexample> + <screen format="linespecific"><prompt moreinfo="none">refdbc: </prompt><userinput moreinfo="none">getnote :CK:=Miller1999</userinput></screen> </informalexample> <tip> Index: refdb-manual-chapter11.sgml =================================================================== RCS file: /cvsroot/refdb/refdb/doc/refdb-manual-chapter11.sgml,v retrieving revision 1.11 retrieving revision 1.12 diff -u -U2 -r1.11 -r1.12 --- refdb-manual-chapter11.sgml 17 Aug 2003 16:50:46 -0000 1.11 +++ refdb-manual-chapter11.sgml 30 Dec 2003 23:51:37 -0000 1.12 @@ -5,5 +5,5 @@ <chapter> <title>Data input</title> - <para>This chapter explains the ways how you can generate reference data suitable for &appname; databases. We'll cover manual generation of RIS files and automatic conversion of other bibliographic data with the help of input filters. Finally you'll learn about writing risx documents, a new XML data format designed to simplify funneling XML or SGML bibliographic data into &appname;. risx is the preferable format to fully utilize &appname;'s capabilities.</para> + <para>This chapter explains the ways how you can generate reference and extended note data suitable for &appname; databases. We'll cover manual generation of RIS files and automatic conversion of other bibliographic data with the help of input filters. You'll learn about writing risx documents, a new XML data format designed to simplify funneling XML or SGML bibliographic data into &appname;. risx is the preferable format to fully utilize &appname;'s capabilities. Finally we'll cover writing extended notes that allow to append additional information to objects in your database or to categorize references in a very flexible way.</para> <para>To actually import the resulting RIS datasets into the &appname; database, use the <link linkend="sect1-add-references">addref</link> command of the &appname;c command line client, as explained in the next chapter.</para> <sect1 id="sect1-ris-format"> @@ -118,6 +118,9 @@ </listitem> <listitem> + <para>HEAR (hearing)</para> + </listitem> + <listitem> <para>ICOMM (internet communication)</para> - </listitem> + </listitem> <listitem> <para>INPR (in press reference)</para> @@ -632,5 +635,5 @@ <sect1 id="sect1-writing-risx"> <title>Writing risx datasets</title> - <para>XML documents using the risx DTD are an alternative way to add datasets to &appname; databases. You can use your favourite SGML/XML editor to edit these datasets. You can also use DSSSL or XSLT scripts to transform bibliographic data available as SGML or XML documents to risx.</para> + <para>XML documents using the <ulink url="http://refdb.sourceforge.net/dtd/risx/risx.dtd">risx DTD</ulink> are an alternative way to add datasets to &appname; databases. You can use your favourite SGML/XML editor to edit these datasets. You can also use DSSSL or XSLT scripts to transform bibliographic data available as SGML or XML documents to risx.</para> <para>This section provides a quick outline of risx datasets. For a description of all available elements and their relationships, please visit the <ulink url="http://refdb.sourceforge.net/risx/book1.html">risx documentation</ulink>.</para> <para>The top-level element of a risx XML document is either <sgmltag>ris</sgmltag> (if the file provides multiple datasets) or <sgmltag>entry</sgmltag>, which corresponds to a single dataset. The <sgmltag>ris</sgmltag> element holds one or more <sgmltag>entry</sgmltag> elements. The <sgmltag class="attribute">type</sgmltag> attribute specifies the type of the reference. These are the same types as described above for the RIS <link linkend="ris-typetag">TY tag</link>. The <sgmltag class="attribute">id</sgmltag> and <sgmltag class="attribute">citekey</sgmltag> attributes specify a numeric ID (which will only be used if you update references) and a citation key, respectively. The latter should be all uppercase if you intend to use the references with SGML documents.</para> @@ -650,4 +653,83 @@ <para>The <sgmltag>libinfo</sgmltag> element contains the local "housekeeping" information of a particular user. Each dataset may contain <sgmltag>libinfo</sgmltag> elements of one or more users who are specified with the <sgmltag class="attribute">user</sgmltag> attribute. Use this element to specify the notes, the reprint status, and the availability information.</para> <para>The <sgmltag>contents</sgmltag> element specifies, you've guessed right, the contents of the reference, i.e. an abstract and an unlimited number of keywords for indexing purposes.</para> + </sect1> + <sect1 id="sect1-write-extended-notes"> + <title>Writing extended notes</title> + <para>Both the RIS and the risx formats allow to keep user-supplied notes of unlimited length with each dataset. This is a great way to keep additional explanatory information along with the hard bibliographic data, but this approach is still somewhat limited.</para> + <para>Extended notes are kept separately from the reference data, but there is a mechanism to link each note to an unlimited number of references, author names, keywords, or periodical names. Possible applications of this feature include:</para> + <itemizedlist> + <listitem> + <para>Write a note about a topic and link it to all references relevant to this topic</para> + </listitem> + <listitem> + <para>Keep biographic data or alternative (mis)spellings with author/editor names</para> + </listitem> + <listitem> + <para>Store the impact factor, the official web page, or your personal access information to the restricted part of that web page along with a journal name</para> + </listitem> + <listitem> + <para>Explain alternative spellings or synonyms of keywords</para> + </listitem> + </itemizedlist> + <para>Searching for notes is similar to searching for references. Notes may have keywords, keys, and a title attached to them to easily find them. In addition, you can search for notes that link to a particular reference, author, keyword, or periodical. The inverse works as well: you can search for references that are linked to particular notes.</para> + <para>Extended notes are XML documents according to the <ulink url="http://refdb.sourceforge.net/dtd/xnote/xnote.dtd">xnote DTD</ulink>. The structure of these documents is simple enough to do without a separate documentation. If you want to write several extended notes in a file, start with an <sgmltag class="element">xnoteset</sgmltag> element. Each individual extended note is kept in an <sgmltag class="element">xnote</sgmltag> element. This element carries up to four optional attributes:</para> + <variablelist> + <varlistentry> + <term><sgmltag class="attribute">id</sgmltag></term> + <listitem> + <para>An unique identifier supplied by the database engine. This attribute is ignored if you add a new note, but it is respected if you update an existing note.</para> + </listitem> + </varlistentry> + <varlistentry> + <term><sgmltag class="attribute">citekey</sgmltag></term> + <listitem> + <para>This is a un... [truncated message content] |
From: Markus H. <mho...@us...> - 2003-12-30 23:51:40
|
Update of /cvsroot/refdb/refdb In directory sc8-pr-cvs1:/tmp/cvs-serv25739 Modified Files: INSTALL NEWS README UPGRADING Log Message: updated for 0.9.4 Index: INSTALL =================================================================== RCS file: /cvsroot/refdb/refdb/INSTALL,v retrieving revision 1.6 retrieving revision 1.7 diff -u -U2 -r1.6 -r1.7 --- INSTALL 19 Feb 2003 22:59:38 -0000 1.6 +++ INSTALL 30 Dec 2003 23:51:36 -0000 1.7 @@ -9,7 +9,6 @@ The following libraries have to be installed: -- libdbi (0.6.7 or newer, earlier versions do *NOT* work) -- libdbi-drivers (0.2 or newer, 0.1 does *NOT* work; required for the - embedded SQLite database engine only) +- libdbi (0.7.0 or newer, earlier versions do *NOT* work) +- libdbi-drivers (0.7.0 or newer, earlier versions do *NOT* work) - libreadline - expat @@ -70,5 +69,5 @@ Apparently you use a platform that RefDB has not been ported to. RefDB -has so far been tested only on Linux, FreeBSD, Solaris, and +has so far been tested only on Linux, FreeBSD, NetBSD, OSX, Solaris, and WinNT/Cygwin. This might be an outstanding opportunity to gain 15 minutes of fame by providing a port to your platform. Otherwise you Index: NEWS =================================================================== RCS file: /cvsroot/refdb/refdb/NEWS,v retrieving revision 1.16 retrieving revision 1.17 diff -u -U2 -r1.16 -r1.17 --- NEWS 17 Aug 2003 16:53:22 -0000 1.16 +++ NEWS 30 Dec 2003 23:51:36 -0000 1.17 @@ -3,4 +3,60 @@ ______________________________ +Version 0.9.4 (December 2003) + +Bugfixes: + +- fixed a serious bug when updating personal information which may + lead to data loss + +- fixed risx output + +- added publication type HEAR to the risx DTD + +- fixed a possible segfault if messages are not logged in a custom file + +- fixed case mismatches in DocBook XML driver files + +- fixed bug in bibliography code for subsequent multiple citations + +- fixed deleteref return message if the requested reference does not + exist + +- fixed junk error messages if refdbc was run in batch mode without + specifying a default database. + + +Improvements: + +- added XHTML support to the getref command and to DocBook XML + bibliographies + +- added support for extended notes. Extended notes can be linked to + any number of references, keywords, author names, and periodical + names in your database. You can search for references and display + all notes attached to them, or you can search for notes and display + which references they are linked to. You can search for notes which + are attached to particular references and vice versa. The new + refdbc commands addnote, updatenote, deletenote, and getnote work + essentially like their *ref counterparts. The new refdbc command + addlink adds or removes links from notes to other database objects. + +- by default refdbd answers only connections from localhost. The new + -I switch allows remote connections as well. + +- deleteref will refuse to delete a reference if it is in the personal + lists of more than one user. + +- reference databases now carry additional meta information like the + refdb version they were created with and the dates of creation and + last modification. This information is available through the + refdbc:whichdb command. + +- listdb will now only return RefDB reference databases + +- the refdbnd script was enhanced to simplify generating a Makefile + for an existing SGML or XML document + +______________________________ Version 0.9.3 (August 2003) Index: README =================================================================== RCS file: /cvsroot/refdb/refdb/README,v retrieving revision 1.13 retrieving revision 1.14 diff -u -U2 -r1.13 -r1.14 --- README 29 May 2003 21:35:14 -0000 1.13 +++ README 30 Dec 2003 23:51:36 -0000 1.14 @@ -10,8 +10,9 @@ scientists, publishers, and anyone else writing publications to keep track of journal articles, books, and other printed or electronic -material and to automatically generate bibliographies for all kinds of -publications. The primary output formats are RIS, DocBook SGML/XML, TEI -XML, and TeX compatible with bibtex/natbib. Other SGML and XML -document types can be added by creating suitable stylesheets. +material, to associate notes with their material, and to automatically +generate bibliographies for all kinds of publications. The primary +output formats are RIS, DocBook SGML/XML, TEI XML, and TeX compatible +with bibtex/natbib. Other SGML and XML document types can be added by +creating suitable stylesheets. refdb runs on Linux, FreeBSD, NetBSD, Darwin/OSX, Solaris, @@ -29,6 +30,6 @@ Creating DocBook or TEI XML documents with automatically generated -bibliographies requires a XSL engine and DocBook or TEI XSL -stylesheets, respectively. +bibliographies requires a XSLT engine and DocBook or TEI XSL +stylesheets, respectively. xsltproc is an excellent choice. refdb is at home at http://refdb.sourceforge.net. @@ -39,4 +40,12 @@ Backwards incompatible changes ****************************** +_______ +V 0.9.4 + +Both the system database (now called refdb instead of refdb1 to allow +parallel installations of new and older versions) and the reference +databases use different layouts compared to older versions. In order +to use your existing reference data with 0.9.4, make sure to follow +the instructions in UPGRADING. _______ Index: UPGRADING =================================================================== RCS file: /cvsroot/refdb/refdb/UPGRADING,v retrieving revision 1.4 retrieving revision 1.5 diff -u -U2 -r1.4 -r1.5 --- UPGRADING 8 Jul 2003 19:45:40 -0000 1.4 +++ UPGRADING 30 Dec 2003 23:51:36 -0000 1.5 @@ -1,2 +1,48 @@ +Migrating your existing RefDB installation from <0.9.4 to 0.9.4 +=============================================================== + +__________ +Background + +The citation and bibliography styles now support the full range of +fields in the reference databases. The system database uses a +different schema to accommodate the new data. + +RefDB now supports extended notes which can be attached to any number +of references, author names, keywords, or periodical names. To store +these data, the reference database schema was changed as well. + +In order to use your existing data, you'll have to migrate your +databases to the new version. + +_________ +Procedure + +- Make all sorts of backups of your existing databases. Use the native + tools of your database server to create SQL dumps. In case of MySQL or + SQLite databases, you can also make copies of the subdirectories and + files, respectively. + +- While still running your existing installation, use the refdbc + command "getref -t risx -o dbname.xml :ID:>0" to dump your reference + databases to XML files. + +- Unless you kept copies of your bibliography styles in XML files, + export these as well, using the refdba command getstyle: + "getstyle -o stylename.xml stylename" + +- Now install 0.9.4. Make sure to restart refdbd if it is running. + +- Follow the instructions to generate the system database and make + sure it is called "refdb". + +- Add any of your custom styles using the refdba command addstyle: + "addstyle stylename.xml" + +- Create new reference databases and read back your existing data + with the refdbc command "addref -t risx dbname.xml" + + + Migrating your existing RefDB databases from <0.9.3 to 0.9.3 ============================================================ |
From: Markus H. <mho...@us...> - 2003-12-28 23:44:26
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv32635 Modified Files: backend-bibtex.c backend-dbib.c refdbdbib.c refdbdnote.c refdbdref.c xmlhandler.c Log Message: use changed connect_to_db() argument list Index: backend-bibtex.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-bibtex.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -U2 -r1.13 -r1.14 --- backend-bibtex.c 26 Dec 2003 21:16:11 -0000 1.13 +++ backend-bibtex.c 28 Dec 2003 23:44:22 -0000 1.14 @@ -171,5 +171,5 @@ sprintf(sql_command, "SELECT ID from CITSTYLE where JOURNAL=%s", quoted_journal); /* need another connection to the database refdb */ - if ((bibconns.conn_refdb = connect_to_db(ptr_rendinfo->ptr_clrequest, MAIN_DB)) == NULL) { + if ((bibconns.conn_refdb = connect_to_db(ptr_rendinfo->ptr_clrequest, MAIN_DB, 0)) == NULL) { LOG_PRINT(LOG_WARNING, connerr.text); free(sql_command); @@ -852,5 +852,5 @@ /* connect to database server*/ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); LOG_PRINT(LOG_ERR, "could not connect to database server"); @@ -929,5 +929,5 @@ if (strcmp(prev_db, the_db)) { dbi_conn_close(conn); - if ((conn = connect_to_db(ptr_clrequest, the_db)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, the_db, 0)) == NULL) { iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); LOG_PRINT(LOG_ERR, "could not connect to database server"); Index: backend-dbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbib.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -U2 -r1.24 -r1.25 --- backend-dbib.c 26 Dec 2003 21:16:11 -0000 1.24 +++ backend-dbib.c 28 Dec 2003 23:44:22 -0000 1.25 @@ -606,5 +606,5 @@ sprintf(sql_command, "SELECT refdb_id, refdb_type, refdb_pubyear, refdb_startpage, refdb_endpage, refdb_abstract, refdb_title, refdb_volume, refdb_issue, refdb_booktitle, refdb_city, refdb_publisher, refdb_title_series, refdb_address, refdb_url, refdb_issn, refdb_periodical_id, refdb_pyother_info, refdb_secyear, refdb_secother_info, refdb_user1, refdb_user2, refdb_user3, refdb_user4, refdb_user5, refdb_misc1, refdb_misc2, refdb_misc3 FROM t_refdb WHERE refdb_id="ULLSPEC, (unsigned long long)n_orig_id); /* need a connection to item_dbname */ - ptr_bibconns->conn_source = connect_to_db(ptr_clrequest, item_dbname); + ptr_bibconns->conn_source = connect_to_db(ptr_clrequest, item_dbname, 0); if (!ptr_bibconns->conn_source) { LOG_PRINT(LOG_WARNING, connerr.text); Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -U2 -r1.27 -r1.28 --- refdbdbib.c 26 Dec 2003 21:16:11 -0000 1.27 +++ refdbdbib.c 28 Dec 2003 23:44:22 -0000 1.28 @@ -240,5 +240,5 @@ /* connect to the default reference database as provided by the client */ - if ((bibconns.conn = connect_to_db(ptr_clrequest, NULL)) != NULL) { + if ((bibconns.conn = connect_to_db(ptr_clrequest, NULL, 0)) != NULL) { drivername = dbi_driver_get_name(dbi_conn_get_driver(bibconns.conn)); @@ -249,5 +249,5 @@ } else { - bibconns.conn_refdb = connect_to_db(ptr_clrequest, MAIN_DB); + bibconns.conn_refdb = connect_to_db(ptr_clrequest, MAIN_DB, 0); if (!bibconns.conn_refdb) { LOG_PRINT(LOG_WARNING, connerr.text); @@ -737,5 +737,5 @@ else { /* get new connection to source reference database */ - bibconns.conn_source = connect_to_db(ptr_clrequest, item); + bibconns.conn_source = connect_to_db(ptr_clrequest, item, 0); if (!bibconns.conn_source) { LOG_PRINT(LOG_WARNING, connerr.text); @@ -1157,5 +1157,5 @@ else { /* need a connection to the source database */ - ptr_bibconns->conn_source = connect_to_db(ptr_clrequest, item); + ptr_bibconns->conn_source = connect_to_db(ptr_clrequest, item, 0); if (!ptr_bibconns->conn_source) { LOG_PRINT(LOG_WARNING, connerr.text); @@ -1468,5 +1468,5 @@ /* connect to database server*/ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); free(return_msg); @@ -1602,5 +1602,5 @@ /* connect to database server*/ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { /* printf("connect_to_db failed\n"); */ iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); @@ -1675,5 +1675,5 @@ /* connect to the database */ - if ((conn = connect_to_db(ptr_clrequest, MAIN_DB)) != NULL) { + if ((conn = connect_to_db(ptr_clrequest, MAIN_DB, 0)) != NULL) { driver = dbi_conn_get_driver(conn); @@ -1802,5 +1802,5 @@ /* connect to the database */ - if ((conn = connect_to_db(ptr_clrequest, MAIN_DB)) != NULL) { + if ((conn = connect_to_db(ptr_clrequest, MAIN_DB, 0)) != NULL) { driver = dbi_conn_get_driver(conn); Index: refdbdnote.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdnote.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -U2 -r1.10 -r1.11 --- refdbdnote.c 26 Dec 2003 21:16:12 -0000 1.10 +++ refdbdnote.c 28 Dec 2003 23:44:22 -0000 1.11 @@ -116,5 +116,5 @@ /* connect to database server*/ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { iwrite(ptr_clrequest->fd, connerr.text, connerr.length); delete_all_lilimem(&sentinel); @@ -309,5 +309,5 @@ /* connect to database server*/ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); LOG_PRINT(LOG_ERR, connerr.text); @@ -658,5 +658,5 @@ /* connect to the database */ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); delete_all_lilimem(&sentinel); @@ -2038,5 +2038,5 @@ /* connect to the database */ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); delete_all_lilimem(&sentinel); Index: refdbdref.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdref.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -U2 -r1.46 -r1.47 --- refdbdref.c 27 Dec 2003 00:15:02 -0000 1.46 +++ refdbdref.c 28 Dec 2003 23:44:22 -0000 1.47 @@ -139,5 +139,5 @@ /* connect to database server*/ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); free(return_msg); @@ -322,5 +322,5 @@ /* connect to database server*/ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { if (ptr_clrequest->n_cgi) { iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); @@ -336,5 +336,5 @@ the refdb database */ - conn_refdb = connect_to_db(ptr_clrequest, MAIN_DB); + conn_refdb = connect_to_db(ptr_clrequest, MAIN_DB, 0); if (conn_refdb == NULL) { @@ -655,5 +655,5 @@ if (n_insert) { /* connect to database server*/ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { LOG_PRINT(LOG_ERR, connerr.text); return 1; @@ -710,5 +710,5 @@ /* connect to database server*/ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { LOG_PRINT(LOG_ERR, connerr.text); free(sql_command); @@ -964,5 +964,5 @@ /* connect to database server*/ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { if (ptr_clrequest->n_cgi) { iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); @@ -1414,5 +1414,5 @@ /* connect to database server*/ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { if (ptr_clrequest->n_cgi) { iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); @@ -2091,5 +2091,5 @@ /* connect to the database */ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { if (ptr_clrequest->n_cgi) { /* cgi output */ iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); Index: xmlhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/xmlhandler.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -U2 -r1.19 -r1.20 --- xmlhandler.c 26 Dec 2003 21:16:12 -0000 1.19 +++ xmlhandler.c 28 Dec 2003 23:44:22 -0000 1.20 @@ -1356,5 +1356,5 @@ else { /* get additional connection */ - if ((conn_source = connect_to_db(ptr_gbdata->ptr_clrequest, database)) == NULL) { + if ((conn_source = connect_to_db(ptr_gbdata->ptr_clrequest, database, 0)) == NULL) { LOG_PRINT(LOG_ERR, connerr.text); return; @@ -1391,5 +1391,5 @@ else { /* get additional connection */ - if ((conn_source = connect_to_db(ptr_gbdata->ptr_clrequest, database)) == NULL) { + if ((conn_source = connect_to_db(ptr_gbdata->ptr_clrequest, database, 0)) == NULL) { LOG_PRINT(LOG_ERR, connerr.text); return; @@ -1459,5 +1459,5 @@ /* get a connection to the source database */ - if ((conn_source = connect_to_db(ptr_gbdata->ptr_clrequest, database)) == NULL) { + if ((conn_source = connect_to_db(ptr_gbdata->ptr_clrequest, database, 0)) == NULL) { LOG_PRINT(LOG_ERR, connerr.text); return; |
From: Markus H. <mho...@us...> - 2003-12-28 23:42:08
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv32407 Modified Files: refdbda.c refdbd.h.in Log Message: added nocheck option to connect_to_db(); now verifies by default that the requested database is a RefDB database Index: refdbda.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbda.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -U2 -r1.35 -r1.36 --- refdbda.c 28 Dec 2003 21:36:46 -0000 1.35 +++ refdbda.c 28 Dec 2003 23:42:05 -0000 1.36 @@ -72,5 +72,5 @@ /* forward declarations of local functions */ -static int is_reference_database(struct CLIENT_REQUEST* ptr_clrequest, const char* dbname); +static int is_reference_database(struct CLIENT_REQUEST* ptr_clrequest, dbi_conn conn, const char* dbname); static int daemon_started_by_init(void); static int daemon_started_by_inetd(void); @@ -138,5 +138,5 @@ else if (ptr_clrequest->inargc == *(ptr_clrequest->ptr_optind)+1 && strcmp(ptr_clrequest->inargv[*(ptr_clrequest->ptr_optind)], "cleanvar") == 0) { /* connect to the database */ - if ((conn = connect_to_db(ptr_clrequest, NULL)) != NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) != NULL) { /* get a list of the tables in the database */ @@ -392,8 +392,12 @@ the one in ptr_clrequest + int nocheck if 1, don't verify the database is a RefDB database + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -dbi_conn connect_to_db(struct CLIENT_REQUEST* ptr_clrequest, const char* special_db) { +dbi_conn connect_to_db(struct CLIENT_REQUEST* ptr_clrequest, const char* special_db, int nocheck) { dbi_conn conn; - + char *my_db; + char main_db[] = MAIN_DB; + LOG_PRINT(LOG_DEBUG, ptr_clrequest->server_ip); LOG_PRINT(LOG_DEBUG, ptr_clrequest->username); @@ -411,4 +415,6 @@ } + my_db = (special_db && *special_db) ? (char*)special_db : ((*(ptr_clrequest->current_db)) ? ptr_clrequest->current_db : main_db); + LOG_PRINT(LOG_DEBUG, my_db); /* common driver options */ dbi_conn_set_option(conn, "username", ptr_clrequest->username); @@ -416,5 +422,5 @@ /* connect to refdb unless a specific reference database is requested special_db overrides ptr_clrequest->current_db */ - dbi_conn_set_option(conn, "dbname", (special_db && *special_db) ? (char*)special_db : ((*(ptr_clrequest->current_db)) ? ptr_clrequest->current_db : MAIN_DB)); + dbi_conn_set_option(conn, "dbname", my_db); dbi_conn_set_option_numeric(conn, "port", atoi(ptr_clrequest->dbs_port_address)); @@ -440,6 +446,12 @@ } + if (!nocheck && strcmp(my_db, MAIN_DB) && !is_reference_database(NULL, conn, my_db)) { + LOG_PRINT(LOG_WARNING, "failed to connect to database server"); + dbi_conn_close(conn); + return NULL; + } + LOG_PRINT(LOG_DEBUG, "connected to database server using database:"); - LOG_PRINT(LOG_DEBUG, (special_db && *special_db) ? (char*)special_db : ((*(ptr_clrequest->current_db)) ? ptr_clrequest->current_db : MAIN_DB)); + LOG_PRINT(LOG_DEBUG, my_db); return conn; } @@ -469,5 +481,5 @@ /* connect to the database */ - if ((conn = connect_to_db(ptr_clrequest, NULL)) != NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) != NULL) { driver = dbi_conn_get_driver(conn); @@ -529,5 +541,5 @@ /* connect to the database */ - if ((conn = connect_to_db(ptr_clrequest, NULL)) != NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) != NULL) { if (*(ptr_clrequest->argument)) { /* this will list the databases that match the provided pattern */ @@ -566,5 +578,5 @@ dbname = dbi_result_get_string_idx(dbires, 1); /* 1-based index */ if (dbname) { - if (is_reference_database(ptr_clrequest, dbname)) { + if (is_reference_database(ptr_clrequest, NULL, dbname)) { if (strlen(dbname) > DBNAME_LENGTH) { iwrite(ptr_clrequest->fd, dbname, DBNAME_LENGTH); @@ -602,5 +614,5 @@ dbname = dbi_result_get_string_idx(dbires, 1); if (dbname) { - if (is_reference_database(ptr_clrequest, dbname)) { + if (is_reference_database(ptr_clrequest, NULL, dbname)) { if (ptr_clrequest->n_cgi) { iwrite(ptr_clrequest->fd, "<tr><td class=\"result\"><input type=\"radio\" name=\"selectdb\" value=\"", 66); @@ -637,9 +649,13 @@ struct CLIENT_REQUEST* ptr_clrequest ptr to structure with client info + set to NULL if using conn + + dbi_conn conn optional existing connection to database. Overrides + ptr_clrequest. Set to NULL if not used const char* dbname ptr to a string containing the database name ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -static int is_reference_database(struct CLIENT_REQUEST* ptr_clrequest, const char* dbname) { +static int is_reference_database(struct CLIENT_REQUEST* ptr_clrequest, dbi_conn conn, const char* dbname) { dbi_conn conn_ref; dbi_result dbires; @@ -647,10 +663,16 @@ const char* app; const char* type; - int close_conn_ref = 0; int retval = 0; + int close_conn_ref = 0; - if ((conn_ref = connect_to_db(ptr_clrequest, dbname)) == NULL) { - /* can't access */ - return 0; + if (conn) { + conn_ref = conn; /* legal as conn and conn_ref are pointers */ + } + else { + if ((conn_ref = connect_to_db(ptr_clrequest, dbname, 1)) == NULL) { + /* can't access */ + return 0; + } + close_conn_ref++; } @@ -701,5 +723,5 @@ /* connect to the database */ - if ((conn = connect_to_db(ptr_clrequest, NULL)) != NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) != NULL) { driver = dbi_conn_get_driver(conn); @@ -765,5 +787,5 @@ /* connect to the database */ - if ((conn = connect_to_db(ptr_clrequest, NULL)) != NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) != NULL) { driver = dbi_conn_get_driver(conn); @@ -834,6 +856,6 @@ /* it is not necessary to quote database names */ - /* connect to the database */ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + /* connect to the main database */ + if ((conn = connect_to_db(ptr_clrequest, MAIN_DB, 0)) == NULL) { iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); return 0; @@ -906,5 +928,6 @@ dbi_conn_close(conn); - if ((conn = connect_to_db(ptr_clrequest, dbname)) == NULL) { + /* do not check the database as it is brand new */ + if ((conn = connect_to_db(ptr_clrequest, dbname, 1)) == NULL) { iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); free(sql_command); @@ -988,5 +1011,5 @@ /* connect to database */ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); return 0; @@ -1134,5 +1157,5 @@ /* connect to the database */ - if ((conn = connect_to_db(ptr_clrequest, NULL)) != NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) != NULL) { /* read from client and increase buffer size until we have all arguments */ while (!nread_done) { @@ -1512,5 +1535,5 @@ /* connect to the database */ - if ((conn = connect_to_db(ptr_clrequest, NULL)) != NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) != NULL) { /* read from client and increase buffer size until we have all arguments */ @@ -1627,5 +1650,5 @@ /* connect to the database */ - if ((conn = connect_to_db(ptr_clrequest, NULL)) != NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) != NULL) { driver = dbi_conn_get_driver(conn); @@ -1829,5 +1852,5 @@ /* connect to database server */ - if ((conn = connect_to_db(ptr_clrequest, NULL)) == NULL) { + if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); LOG_PRINT(LOG_ERR, connerr.text); Index: refdbd.h.in =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbd.h.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -U2 -r1.3 -r1.4 --- refdbd.h.in 24 Dec 2003 21:58:28 -0000 1.3 +++ refdbd.h.in 28 Dec 2003 23:42:05 -0000 1.4 @@ -95,5 +95,5 @@ #define STDERR_FILENO 2 -dbi_conn connect_to_db(struct CLIENT_REQUEST* ptr_clrequest, const char* special_db); +dbi_conn connect_to_db(struct CLIENT_REQUEST* ptr_clrequest, const char* special_db, int nocheck); void viewstat(struct CLIENT_REQUEST* ptr_clrequest); void listdb(struct CLIENT_REQUEST* ptr_clrequest, int select); |
From: Markus H. <mho...@us...> - 2003-12-28 21:36:49
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv11441 Modified Files: refdbda.c Log Message: selectdb() now checks type of database and returns useful status message Index: refdbda.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbda.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -U2 -r1.34 -r1.35 --- refdbda.c 26 Dec 2003 21:16:11 -0000 1.34 +++ refdbda.c 28 Dec 2003 21:36:46 -0000 1.35 @@ -554,4 +554,5 @@ if (select) { + /* selectdb */ if (ptr_clrequest->n_cgi) { iwrite(ptr_clrequest->fd, cgihead_html.text, cgihead_html.length); @@ -565,11 +566,22 @@ dbname = dbi_result_get_string_idx(dbires, 1); /* 1-based index */ if (dbname) { - if (strlen(dbname) > DBNAME_LENGTH) { - iwrite(ptr_clrequest->fd, dbname, DBNAME_LENGTH); + if (is_reference_database(ptr_clrequest, dbname)) { + if (strlen(dbname) > DBNAME_LENGTH) { + iwrite(ptr_clrequest->fd, dbname, DBNAME_LENGTH); + } + else { + iwrite(ptr_clrequest->fd, dbname, strlen(dbname)); + } } else { - iwrite(ptr_clrequest->fd, dbname, strlen(dbname)); + iwrite(ptr_clrequest->fd, "not a RefDB database\n", 21); } } + else { + iwrite(ptr_clrequest->fd, "not a RefDB database\n", 21); + } + } + else { + iwrite(ptr_clrequest->fd, "database does not exist\n", 24); } if (ptr_clrequest->n_cgi) { @@ -580,4 +592,5 @@ } else { + /* listdb */ if (ptr_clrequest->n_cgi) { iwrite(ptr_clrequest->fd, cgihead_html.text, cgihead_html.length); |
From: Markus H. <mho...@us...> - 2003-12-28 21:35:20
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv11154 Modified Files: refdbc.c Log Message: run selectdb() on startup if a default database is specified Index: refdbc.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbc.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -U2 -r1.60 -r1.61 --- refdbc.c 24 Dec 2003 21:42:47 -0000 1.60 +++ refdbc.c 28 Dec 2003 21:35:13 -0000 1.61 @@ -763,5 +763,6 @@ if (*current_db) { - fprintf(stderr, "I will try to use\n%s\nas the current database.\n", current_db); + com_selectdb(current_db); +/* fprintf(stderr, "I will try to use\n%s\nas the current database.\n", current_db); */ LOG_PRINT(LOG_INFO, current_db); } @@ -1665,14 +1666,15 @@ fprintf(stdout, "\n%s selected as current database\n", arg); } + return 0; } else { if (!n_cgi) { - fprintf(stderr, "No database %s. Server said: %s<<. Stop.\n", arg, slvals.inbuffer); + fprintf(stderr, "No database %s\n", arg); if (n_verbose) { fprintf(stderr, "Use listdb to see a list of available databases\n"); } } + return 1; } - return 0; } @@ -2004,5 +2006,5 @@ break; case 'h': - printf("Displays the result of a database search.\nSyntax: getref [-c command] [-d database] [-h] [-o outfile] [-O outfile][-P] [-R pdfroot] [-s format] [-S tag] [-t output-format] {search-string|-f infile}\nSearch-string: {:XY:{<|=|!=|>}{unix-regexp}} [AND|OR|AND NOT] [...]\nwhere XY specifies the field to search in\nOptions: -c command pipe the output through command\n -d database specify the database to work with\n -h prints this mini-help\n -o outfile save the output in outfile (overwrite)\n -O outfile append the output to outfile\n -P limit search to personal interest list\n -R use pdfroot as root for path of pdf files\n -s format specify fields for screen or style for DocBook output\n -S tag sort output by tag ID (default) or PY\n -t output-format display as format scrn, html, db31, teix, ris, or bibtex\n -f infile use the saved search line in file infile\n All other arguments are interpreted as the search string.\n"); + printf("Displays the result of a database search.\nSyntax: getref [-c command] [-d database] [-h] [-o outfile] [-O outfile][-P] [-R pdfroot] [-s format] [-S tag] [-t output-format] {search-string|-f infile}\nSearch-string: {:XY:{<|=|!=|>}{unix-regexp}} [AND|OR|AND NOT] [...]\nwhere XY specifies the field to search in\nOptions: -c command pipe the output through command\n -d database specify the database to work with\n -h prints this mini-help\n -o outfile save the output in outfile (overwrite)\n -O outfile append the output to outfile\n -P limit search to personal interest list\n -R use pdfroot as root for path of pdf files\n -s format specify fields for screen or style for DocBook output\n -S tag sort output by tag ID (default) or PY\n -t output-format display as format scrn, html, xhtml, db31, db31x, teix, ris, risx, or bibtex\n -f infile use the saved search line in file infile\n All other arguments are interpreted as the search string.\n"); delete_all_lilimem(&sentinel); return 0; @@ -4413,5 +4415,5 @@ break; case 'h': - printf("Displays the result of a database search for notes.\nSyntax: getnote [-c command] [-d database] [-h] [-o outfile] [-O outfile][-P] [-R pdfroot] [-s format] [-S tag] [-t output-format] {search-string|-f infile}\nSearch-string: {:XY:{<|=|!=|>}{unix-regexp}} [AND|OR|AND NOT] [...]\nwhere XY specifies the field to search in\nOptions: -c command pipe the output through command\n -d database specify the database to work with\n -h prints this mini-help\n -o outfile save the output in outfile (overwrite)\n -O outfile append the output to outfile\n -P limit search to personal interest list\n -R use pdfroot as root for path of pdf files\n -s format specify fields for screen or style for DocBook output\n -S tag sort output by tag ID (default) or PY\n -t output-format display as format scrn, html, db31, teix, ris, or bibtex\n -f infile use the saved search line in file infile\n All other arguments are interpreted as the search string.\n"); + printf("Displays the result of a database search for notes.\nSyntax: getnote [-c command] [-d database] [-h] [-o outfile] [-O outfile][-P] [-R pdfroot] [-s format] [-S tag] [-t output-format] {search-string|-f infile}\nSearch-string: {:XY:{<|=|!=|>}{unix-regexp}} [AND|OR|AND NOT] [...]\nwhere XY specifies the field to search in\nOptions: -c command pipe the output through command\n -d database specify the database to work with\n -h prints this mini-help\n -o outfile save the output in outfile (overwrite)\n -O outfile append the output to outfile\n -P limit search to personal interest list\n -R use pdfroot as root for path of pdf files\n -s format specify fields for screen or style for DocBook output\n -S tag sort output by tag ID (default) or PY\n -t output-format display as format scrn, html, xhtml, or xnote\n -f infile use the saved search line in file infile\n All other arguments are interpreted as the search string.\n"); delete_all_lilimem(&sentinel); return 0; |
From: Michael S. <xm...@us...> - 2003-12-28 12:02:11
|
Update of /cvsroot/refdb/elisp In directory sc8-pr-cvs1:/tmp/cvs-serv5864 Modified Files: refdb-mode.el Log Message: RFE #866615 (listb query only at startup), RFE #865893 (deleteref) http://sourceforge.net/tracker/index.php?func=detail&aid=866615&group_id=26091&atid=385994 http://sourceforge.net/tracker/index.php?func=detail&aid=865893&group_id=26091&atid=385994 RFE #866615 - do listdb query only at startup Enhancement: refdb-mode now does a listdb query only once per session, instead of doing it each time refdb-mode-hook runs RFE #865893 - Add deletref support to refdb-mode Enhancement: Added refdb-deleteref-on-region command and corresponding menu item. Index: refdb-mode.el =================================================================== RCS file: /cvsroot/refdb/elisp/refdb-mode.el,v retrieving revision 1.6 retrieving revision 1.7 diff -u -U2 -r1.6 -r1.7 --- refdb-mode.el 26 Dec 2003 09:48:49 -0000 1.6 +++ refdb-mode.el 28 Dec 2003 12:02:07 -0000 1.7 @@ -295,4 +295,6 @@ (defvar refdb-input-type "ris") +(defvar refdb-database-list-initilized-flag nil) +(defvar refdb-default-database-set-flag nil) ;; ******************************************************************* @@ -340,4 +342,9 @@ :group 'refdb) +(defcustom refdb-deleteref-options "-f stdin" + "Options included when running the 'refdbc -c deleteref' command." + :type 'string + :group 'refdb) + (defcustom refdb-getref-options "" "Options included when running the 'refdbc -c addref' command." @@ -437,13 +444,18 @@ (defun refdb-initialize-database-list () "Initialize list of RefDB databases." - (message "Initializing RefDB database list...") - (setq refdb-current-database-list (refdb-list-databases)) - (message - "Building list of databases using '%s %s -C listdb %s'...done" - refdb-refdbc-program - refdb-refdbc-options - refdb-listdb-sql-regexp - ) - (message "Initializing RefDB database list...done") + (if (eq refdb-database-list-initilized-flag nil) + (progn + (message "Initializing RefDB database list...") + (setq refdb-current-database-list (refdb-list-databases)) + (message + "Building list of databases using '%s %s -C listdb %s'...done" + refdb-refdbc-program + refdb-refdbc-options + refdb-listdb-sql-regexp + ) + (message "Initializing RefDB database list...done") + (setq refdb-database-list-initilized-flag t) + ) + ) ) @@ -454,31 +466,36 @@ file or in his or her ~/.refdbcrc file. If so, that value is used as the database value in all RefDB commands." - (message "Setting default database...") - (setq refdb-database-default - (car - (last - (split-string - (with-output-to-string - (with-current-buffer - standard-output - (call-process shell-file-name nil '(t t) nil shell-command-switch - (format "%s %s -C set defaultdb" - refdb-refdbc-program - refdb-refdbc-options - ) - ) + (if (eq refdb-default-database-set-flag nil) + (progn + (message "Setting default database...") + (setq refdb-database-default + (car + (last + (split-string + (with-output-to-string + (with-current-buffer + standard-output + (call-process shell-file-name nil '(t t) nil shell-command-switch + (format "%s %s -C set defaultdb" + refdb-refdbc-program + refdb-refdbc-options + ) + ) + ) + ) + ) + ) ) + ) + (if (and + (equal refdb-database "") + (not (equal refdb-database-default "defaultdb")) ) - ) + (setq refdb-database refdb-database-default) ) - ) + (message "Setting default database...done") + (setq refdb-default-database-set-flag t) ) - (if (and - (equal refdb-database "") - (not (equal refdb-database-default "defaultdb")) - ) - (setq refdb-database refdb-database-default) ) - (message "Setting default database...done") ) @@ -546,4 +563,9 @@ ) +(defvar refdb-deleteref-menu-item + ["Delete References" (refdb-deleteref-on-region) t] + "RefDB menu item for deleting references." + ) + (defvar refdb-getref-by-author-menu-item ["Author..." @@ -732,5 +754,5 @@ (defun refdb-addref-on-region () - "Add references in the current region to the current RefDB database." + "Add all references in region to current database." (interactive) ;; temporarily set resize-mini-windows to nil to force Emacs to show @@ -753,6 +775,6 @@ ) "*refdb-output*" nil "*refdb-messages*") - (message - "Displaying output for '%s %s -C addref %s -d %s -t %s'" + (message + "Displaying output for '%s %s -C addref %s -d %s -t %s'...done" refdb-refdbc-program refdb-refdbc-options @@ -763,5 +785,5 @@ (display-buffer "*refdb-output*") ) - (message "Error: No region marked.") + (error "No region marked") ) ;; else if no databases specified, prompt to select from available @@ -775,4 +797,53 @@ ) +(defun refdb-deleteref-on-region () + "Delete all references in region from current database." + (interactive) + (if (yes-or-no-p + "Really delete all references in the current region? " + ) + ;; temporarily set resize-mini-windows to nil to force Emacs to show + ;; addref output in separate buffer instead of minibuffer + (progn + (setq resize-mini-windows nil) + (if (not (eq (length refdb-database) 0)) + (if (mark) + (progn + (refdb-determine-input-type) + (message "Deleting references in selected region from %s database..." refdb-database) + (shell-command-on-region + (point) (mark) + (format + "%s %s -C deleteref %s -d %s" + refdb-refdbc-program + refdb-refdbc-options + refdb-deleteref-options + refdb-database + ) + "*refdb-output*" nil "*refdb-messages*") + (message + "Displaying output for '%s %s -C deleteref %s -d %s'...done" + refdb-refdbc-program + refdb-refdbc-options + refdb-deleteref-options + refdb-database + ) + (display-buffer "*refdb-output*") + ) + (error "No region marked") + ) + ;; else if no databases specified, prompt to select from available + ;; databases, then re-call command + (call-interactively 'refdb-select-database) + (refdb-deleteref-on-region) + ) + (message "Deleting references in selected region from %s database...done" refdb-database) + ;; set resize-mini-windows back to default value + (setq resize-mini-windows (get 'resize-mini-windows 'standard-value)) + ) + (error "Deletion aborted") + ) + ) + (defun refdb-message-getting-refs (field value) "Emit appropriate status message for FIELD and VALUE. @@ -785,4 +856,14 @@ ) +(defun refdb-message-getting-refs-done (field value) + "Emit appropriate status message for FIELD and VALUE. +This function is called by the various refdb-getref-by commands." + (message + "Getting datasets for %s %s...done" + field + value + ) + ) + (defun refdb-getref-by-field (field value) "Display all RefDB datasets that match the specified FIELD and VALUE. @@ -829,5 +910,5 @@ (message (format - "Displaying output for '%s %s -C getref :%s:=%s %s -d %s -t %s -s %s'" + "Displaying output for '%s %s -C getref :%s:=%s %s -d %s -t %s -s %s'...done" refdb-refdbc-program refdb-refdbc-options @@ -891,4 +972,5 @@ (refdb-message-getting-refs 'author author) (refdb-getref-by-field "AU" author) + (refdb-message-getting-refs-done 'author author) ) @@ -898,4 +980,5 @@ (refdb-message-getting-refs 'title title) (refdb-getref-by-field "TI" title) + (refdb-message-getting-refs-done 'title title) ) @@ -905,4 +988,5 @@ (refdb-message-getting-refs 'keyword keyword) (refdb-getref-by-field "KW" keyword) + (refdb-message-getting-refs-done 'keyword keyword) ) @@ -912,4 +996,5 @@ (refdb-message-getting-refs 'id id) (refdb-getref-by-field "ID" id) + (refdb-message-getting-refs-done 'id id) ) @@ -919,4 +1004,5 @@ (refdb-message-getting-refs 'citekey citekey) (refdb-getref-by-field "CK" citekey) + (refdb-message-getting-refs-done 'citekey citekey) ) @@ -965,5 +1051,5 @@ (message (format - "Displaying output for '%s %s -C getref %s %s -d %s -t %s -s %s'" + "Displaying output for '%s %s -C getref %s %s -d %s -t %s -s %s'...done" refdb-refdbc-program refdb-refdbc-options @@ -983,4 +1069,5 @@ (setq resize-mini-windows resize-mini-windows-default) ) + (message (format "Getting datasets for search string %s...done" searchstring)) ) @@ -1209,4 +1296,5 @@ '( refdb-addref-menu-item + refdb-deleteref-menu-item refdb-getref-submenu-definition refdb-data-output-submenu-definition |
From: Markus H. <mho...@us...> - 2003-12-28 05:36:10
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv21567 Modified Files: risxhandler.c Log Message: risx_end_handler(): use author:role attribute if given Index: risxhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/risxhandler.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -U2 -r1.18 -r1.19 --- risxhandler.c 26 Dec 2003 21:16:12 -0000 1.18 +++ risxhandler.c 28 Dec 2003 00:44:37 -0000 1.19 @@ -747,5 +747,21 @@ set_authorinfo_role(ptr_ardata->ptr_ainfo, get_attr(ptr_ardata->ptr_first, "role")); - if (is_descendant_of(ptr_ardata->ptr_first, "part")) { + /* first check whether role is given explicitly */ + if (!strcmp(ptr_ardata->ptr_ainfo->role, "author")) { + result = insert_author(ptr_ardata->ptr_ainfo, 1 /*primary author*/, ptr_ardata->authorpos, ptr_ardata->n_refdb_id, ptr_ardata->conn, ptr_ardata->driver, ptr_ardata->drivername); + if (!ptr_ardata->authorpos) { + strncpy(ptr_ardata->first_author, ptr_ardata->ptr_ainfo->lastname, 255); + (ptr_ardata->first_author)[255] = '\0'; + } + } + else if (!strcmp(ptr_ardata->ptr_ainfo->role, "editor")) { + result = insert_author(ptr_ardata->ptr_ainfo, 2 /*secondary author*/, ptr_ardata->authorpos, ptr_ardata->n_refdb_id, ptr_ardata->conn, ptr_ardata->driver, ptr_ardata->drivername); + } + else if (!strcmp(ptr_ardata->ptr_ainfo->role, "seditor")) { + result = insert_author(ptr_ardata->ptr_ainfo, 3 /*tertiary author*/, ptr_ardata->authorpos, ptr_ardata->n_refdb_id, ptr_ardata->conn, ptr_ardata->driver, ptr_ardata->drivername); + } + + /* now guess author type by occurrence */ + else if (is_descendant_of(ptr_ardata->ptr_first, "part")) { result = insert_author(ptr_ardata->ptr_ainfo, 1 /*primary author*/, ptr_ardata->authorpos, ptr_ardata->n_refdb_id, ptr_ardata->conn, ptr_ardata->driver, ptr_ardata->drivername); if (!ptr_ardata->authorpos) { |
From: Markus H. <mho...@us...> - 2003-12-28 00:59:47
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv21469 Modified Files: authorinfo.c Log Message: set_authorinfo_role(): if role is NULL, dont bail out but truncate the string Index: authorinfo.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/authorinfo.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -U2 -r1.2 -r1.3 --- authorinfo.c 7 Oct 2003 22:56:34 -0000 1.2 +++ authorinfo.c 28 Dec 2003 00:43:19 -0000 1.3 @@ -348,11 +348,17 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ char* set_authorinfo_role(struct AUTHOR_INFO* ptr_ainfo, const char* role) { - if (!ptr_ainfo || !role) { + if (!ptr_ainfo) { return NULL; } - /* truncate string */ - strncpy(ptr_ainfo->role, role, 64); - (ptr_ainfo->role)[63] = '\0'; + if (role) { + /* truncate string */ + strncpy(ptr_ainfo->role, role, 64); + (ptr_ainfo->role)[63] = '\0'; + } + else { + *(ptr_ainfo->role) = '\0'; + } + return ptr_ainfo->role; } |
From: Markus H. <mho...@us...> - 2003-12-27 22:47:42
|
Update of /cvsroot/refdb/refdb/dtd In directory sc8-pr-cvs1:/tmp/cvs-serv4054 Modified Files: xnote.dtd Log Message: removed comment Index: xnote.dtd =================================================================== RCS file: /cvsroot/refdb/refdb/dtd/xnote.dtd,v retrieving revision 1.2 retrieving revision 1.3 diff -u -U2 -r1.2 -r1.3 --- xnote.dtd 21 Dec 2003 22:57:22 -0000 1.2 +++ xnote.dtd 27 Dec 2003 22:40:38 -0000 1.3 @@ -10,5 +10,4 @@ <!-- this element describes one extended note --> -<!-- todo: demote date to an attribute and use YYYY-MM-DD notation? --> <!ELEMENT xnote (title?, content, keyword*, link*)> <!ATTLIST xnote id NMTOKEN #IMPLIED |
From: Markus H. <mho...@us...> - 2003-12-27 00:15:19
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv17174 Modified Files: refdbdref.c Log Message: fixed double vs single quotation marks typo in deleteref() Index: refdbdref.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdref.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -U2 -r1.45 -r1.46 --- refdbdref.c 26 Dec 2003 21:16:12 -0000 1.45 +++ refdbdref.c 27 Dec 2003 00:15:02 -0000 1.46 @@ -1014,5 +1014,5 @@ } - sprintf(sql_command, "SELECT refdb_id FROM t_refdb WHERE refdb_type != \"DUMMY\" AND refdb_id="ULLSPEC, (unsigned long long)(ptr_curr->value)); + sprintf(sql_command, "SELECT refdb_id FROM t_refdb WHERE refdb_type != \'DUMMY\' AND refdb_id="ULLSPEC, (unsigned long long)(ptr_curr->value)); LOG_PRINT(LOG_DEBUG, sql_command); dbires = dbi_conn_query(conn, sql_command); |
From: Markus H. <mho...@us...> - 2003-12-26 21:19:28
|
Update of /cvsroot/refdb/refdb In directory sc8-pr-cvs1:/tmp/cvs-serv21072 Modified Files: configure.in Log Message: added support for new libdbi string quoting API Index: configure.in =================================================================== RCS file: /cvsroot/refdb/refdb/configure.in,v retrieving revision 1.37 retrieving revision 1.38 diff -u -U2 -r1.37 -r1.38 --- configure.in 4 Nov 2003 23:17:15 -0000 1.37 +++ configure.in 26 Dec 2003 21:19:23 -0000 1.38 @@ -6,5 +6,5 @@ dnl Use automake -AM_INIT_AUTOMAKE(refdb, 0.9.4-pre2) +AM_INIT_AUTOMAKE(refdb, 0.9.4-pre3) dnl Find out host type @@ -152,5 +152,12 @@ exit 1]) -dnl compress is in glibc, but not in Cygwin newlib +dnl check version of libdbi - older versions use string, newer string_inplace +AC_SEARCH_LIBS_VAR(dbi_driver_quote_string_inplace, dbi, ac_dbi_have_inplace=1, , , dummy) + +if test "$ac_dbi_have_inplace" = "1" ; then + AC_DEFINE(HAVE_QUOTE_STRING_INPLACE) +fi + +dnl compress is in glibc, but not in Cygwin newlib AC_SEARCH_LIBS_VAR(compress, z, , , , refdbd_LDADD) @@ -158,5 +165,5 @@ AC_SEARCH_LIBS(setsockopt, socket,,) -dnl in some cases Solaris seems to need libnsl too +dnl in some cases Solaris seems to need libnsl too AC_SEARCH_LIBS(gethostbyname, nsl,,) |
From: Markus H. <mho...@us...> - 2003-12-26 21:16:16
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv20352 Modified Files: backend-bibtex.c backend-dbib.c backend.c noteshandler.c refdbda.c refdbdbib.c refdbdnote.c refdbdref.c risdata.c risdb.c risxhandler.c xmlhandler.c Log Message: added support for new libdbi string quoting API Index: backend-bibtex.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-bibtex.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -U2 -r1.12 -r1.13 --- backend-bibtex.c 2 Sep 2003 00:23:34 -0000 1.12 +++ backend-bibtex.c 26 Dec 2003 21:16:11 -0000 1.13 @@ -52,4 +52,9 @@ static char* bibtexify_author(char** ptr_bibauthor, char* author); +/* libdbi changed the string quoting API after 0.7.0 */ +#ifndef HAVE_QUOTE_STRING_INPLACE +# define dbi_driver_quote_string_inplace dbi_driver_quote_string +#endif + /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -151,5 +156,5 @@ /* retrieve basic information about the bibliography style from CITSTYLE into ptr_result */ quoted_journal = mstrdup((ptr_rendinfo->ptr_biblio_info)->format_string); - if (!dbi_driver_quote_string(driver, "ed_journal)) { + if (!dbi_driver_quote_string_inplace(driver, "ed_journal)) { LOG_PRINT(LOG_WARNING, outomem.text); free(sql_command); Index: backend-dbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbib.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -U2 -r1.23 -r1.24 --- backend-dbib.c 13 Sep 2003 20:18:37 -0000 1.23 +++ backend-dbib.c 26 Dec 2003 21:16:11 -0000 1.24 @@ -45,4 +45,9 @@ static char* set_mset(char* current_mset, char* new_mset, char** ref, size_t* ptr_ref_len); +/* libdbi changed the string quoting API after 0.7.0 */ +#ifndef HAVE_QUOTE_STRING_INPLACE +# define dbi_driver_quote_string_inplace dbi_driver_quote_string +#endif + /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ prepare_render_dbib(): writes a header for the docbook output of a @@ -81,5 +86,5 @@ } - if (dbi_driver_quote_string(dbi_conn_get_driver(conn), &myjournal) == -1) { + if (dbi_driver_quote_string_inplace(dbi_conn_get_driver(conn), &myjournal) == -1) { LOG_PRINT(LOG_WARNING, outomem.text); free(myjournal); @@ -256,5 +261,5 @@ } - if (dbi_driver_quote_string(dbi_conn_get_driver(ptr_bibconns->conn_refdb), &myjournal) == -1) { + if (dbi_driver_quote_string_inplace(dbi_conn_get_driver(ptr_bibconns->conn_refdb), &myjournal) == -1) { LOG_PRINT(LOG_WARNING, outomem.text); delete_all_lilimem(&sentinel); @@ -888,5 +893,5 @@ } - if (dbi_driver_quote_string(dbi_conn_get_driver(ptr_bibconns->conn_refdb), &myjournal) == -1) { + if (dbi_driver_quote_string_inplace(dbi_conn_get_driver(ptr_bibconns->conn_refdb), &myjournal) == -1) { LOG_PRINT(LOG_WARNING, outomem.text); delete_all_lilimem(&sentinel); Index: backend.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -U2 -r1.20 -r1.21 --- backend.c 26 Dec 2003 00:06:28 -0000 1.20 +++ backend.c 26 Dec 2003 21:16:11 -0000 1.21 @@ -47,4 +47,9 @@ +/* libdbi changed the string quoting API after 0.7.0 */ +#ifndef HAVE_QUOTE_STRING_INPLACE +# define dbi_driver_quote_string_inplace dbi_driver_quote_string +#endif + @@ -2321,5 +2326,5 @@ return -1; } - if (dbi_driver_quote_string(driver, "ed_username) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_username) == -1) { free(quoted_username); free(sql_command); Index: noteshandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/noteshandler.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -U2 -r1.8 -r1.9 --- noteshandler.c 21 Dec 2003 23:10:14 -0000 1.8 +++ noteshandler.c 26 Dec 2003 21:16:11 -0000 1.9 @@ -48,4 +48,9 @@ static int set_notesdata_int_field(const char* field, unsigned long long n_value, dbi_conn conn, dbi_driver driver, unsigned long long n_note_id); +/* libdbi changed the string quoting API after 0.7.0 */ +#ifndef HAVE_QUOTE_STRING_INPLACE +# define dbi_driver_quote_string_inplace dbi_driver_quote_string +#endif + /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1045,5 +1050,5 @@ return 1; } - if (dbi_driver_quote_string(driver, "ed_value) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_value) == -1) { free(quoted_value); LOG_PRINT(LOG_WARNING, "malloc failed"); @@ -1170,5 +1175,5 @@ /* quote target to make it usable for a SQL query */ if ((quoted_target = strdup(target)) == NULL - || dbi_driver_quote_string(driver, "ed_target) == -1) { + || dbi_driver_quote_string_inplace(driver, "ed_target) == -1) { LOG_PRINT(LOG_WARNING, "malloc failed"); free(sql_command); Index: refdbda.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbda.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -U2 -r1.33 -r1.34 --- refdbda.c 26 Dec 2003 19:04:54 -0000 1.33 +++ refdbda.c 26 Dec 2003 21:16:11 -0000 1.34 @@ -82,4 +82,9 @@ #endif +/* libdbi changed the string quoting API after 0.7.0 */ +#ifndef HAVE_QUOTE_STRING_INPLACE +# define dbi_driver_quote_string_inplace dbi_driver_quote_string +#endif + /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ child_confserv(): configures the application server (child process) @@ -700,5 +705,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &myarg) == -1) { + if (dbi_driver_quote_string_inplace(driver, &myarg) == -1) { dbi_conn_close(conn); free(myarg); @@ -764,5 +769,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &myarg) == -1) { + if (dbi_driver_quote_string_inplace(driver, &myarg) == -1) { dbi_conn_close(conn); free(myarg); @@ -1539,5 +1544,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &mytoken) == -1) { + if (dbi_driver_quote_string_inplace(driver, &mytoken) == -1) { free(mytoken); failed++; @@ -1628,5 +1633,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &myarg) == -1) { + if (dbi_driver_quote_string_inplace(driver, &myarg) == -1) { if (ptr_clrequest->n_cgi) { iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -U2 -r1.26 -r1.27 --- refdbdbib.c 24 Dec 2003 21:49:05 -0000 1.26 +++ refdbdbib.c 26 Dec 2003 21:16:11 -0000 1.27 @@ -73,4 +73,9 @@ static void close_dbi_connections(struct BIBCONNS* ptr_bibconns, const char* drivername); +/* libdbi changed the string quoting API after 0.7.0 */ +#ifndef HAVE_QUOTE_STRING_INPLACE +# define dbi_driver_quote_string_inplace dbi_driver_quote_string +#endif + /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ getbib(): executes client command getbib @@ -261,5 +266,5 @@ } - if (dbi_driver_quote_string(dbi_conn_get_driver(bibconns.conn_refdb), &myjournal) == -1) { + if (dbi_driver_quote_string_inplace(dbi_conn_get_driver(bibconns.conn_refdb), &myjournal) == -1) { LOG_PRINT(LOG_WARNING, outomem.text); delete_all_lilimem(&sentinel); @@ -1171,5 +1176,5 @@ } - if (dbi_driver_quote_string(dbi_conn_get_driver(ptr_bibconns->conn), &authorlist_buffer) == -1) { + if (dbi_driver_quote_string_inplace(dbi_conn_get_driver(ptr_bibconns->conn), &authorlist_buffer) == -1) { iwrite(ptr_clrequest->fd, "", 1); if (!assemble_return_msg(ptr_addresult, noformatupdatecolon.text, ptr_bibconns->conn)) { @@ -1616,5 +1621,5 @@ } - if (dbi_driver_quote_string(driver, &myarg) == -1) { + if (dbi_driver_quote_string_inplace(driver, &myarg) == -1) { LOG_PRINT(LOG_WARNING, outomem.text); iwrite(ptr_clrequest->fd, outomem_n.text, outomem_n.length); @@ -1688,5 +1693,5 @@ } - if (dbi_driver_quote_string(driver, &myarg) == -1) { + if (dbi_driver_quote_string_inplace(driver, &myarg) == -1) { LOG_PRINT(LOG_WARNING, outomem.text); iwrite(ptr_clrequest->fd, outomem_n.text, outomem_n.length); Index: refdbdnote.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdnote.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -U2 -r1.9 -r1.10 --- refdbdnote.c 26 Dec 2003 00:10:02 -0000 1.9 +++ refdbdnote.c 26 Dec 2003 21:16:12 -0000 1.10 @@ -48,4 +48,9 @@ extern int n_log_level; /* numeric version of log_level */ +/* libdbi changed the string quoting API after 0.7.0 */ +#ifndef HAVE_QUOTE_STRING_INPLACE +# define dbi_driver_quote_string_inplace dbi_driver_quote_string +#endif + /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ addnote(): implements the client command addnote @@ -731,5 +736,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -771,5 +776,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -838,5 +843,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -978,5 +983,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -1018,5 +1023,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -1079,5 +1084,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -1218,5 +1223,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -1258,5 +1263,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -1319,5 +1324,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -1493,5 +1498,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -1608,5 +1613,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -1784,5 +1789,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -2237,5 +2242,5 @@ else { if ((quoted_token = strdup(ptr_curr->value)) == NULL - || dbi_driver_quote_string(driver, "ed_token) == -1) { + || dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { iwrite(ptr_clrequest->fd, outomem_n.text, outomem_n.length); ptr_addresult->failure++; Index: refdbdref.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdref.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -U2 -r1.44 -r1.45 --- refdbdref.c 26 Dec 2003 19:04:54 -0000 1.44 +++ refdbdref.c 26 Dec 2003 21:16:12 -0000 1.45 @@ -62,4 +62,8 @@ static int real_run_keyword_scan(struct CLIENT_REQUEST* ptr_clrequest, Lilid* ptr_sentinel, int mode, int* ptr_insert); +/* libdbi changed the string quoting API after 0.7.0 */ +#ifndef HAVE_QUOTE_STRING_INPLACE +# define dbi_driver_quote_string_inplace dbi_driver_quote_string +#endif /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -2194,5 +2198,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -2238,5 +2242,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -2311,5 +2315,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -2449,5 +2453,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -2489,5 +2493,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -2556,5 +2560,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -2729,5 +2733,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -2825,5 +2829,5 @@ return 0; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { dbi_conn_close(conn); delete_all_lilimem(&sentinel); @@ -2938,5 +2942,5 @@ return 0; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { dbi_conn_close(conn); delete_all_lilimem(&sentinel); @@ -2985,5 +2989,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -3109,5 +3113,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -3522,5 +3526,5 @@ break; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { error = 1; break; @@ -3637,5 +3641,5 @@ return 0; } - if (dbi_driver_quote_string(driver, "ed_token) == -1) { + if (dbi_driver_quote_string_inplace(driver, "ed_token) == -1) { dbi_conn_close(conn); delete_all_lilimem(&sentinel); Index: risdata.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/risdata.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -U2 -r1.3 -r1.4 --- risdata.c 18 Oct 2003 23:59:23 -0000 1.3 +++ risdata.c 26 Dec 2003 21:16:12 -0000 1.4 @@ -31,4 +31,9 @@ extern int n_log_level; +/* libdbi changed the string quoting API after 0.7.0 */ +#ifndef HAVE_QUOTE_STRING_INPLACE +# define dbi_driver_quote_string_inplace dbi_driver_quote_string +#endif + /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ new_risdata(): creates a new risdata object @@ -191,5 +196,5 @@ /* escape any characters that the db cannot digest */ - if (dbi_driver_quote_string(dbidrv, &escape_buffer) == -1) { + if (dbi_driver_quote_string_inplace(dbidrv, &escape_buffer) == -1) { free(escape_buffer); LOG_PRINT(LOG_WARNING, "malloc failed"); @@ -363,5 +368,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &escape_buffer) == -1) { + if (dbi_driver_quote_string_inplace(driver, &escape_buffer) == -1) { LOG_PRINT(LOG_WARNING, "out of memory"); free(escape_buffer); Index: risdb.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/risdb.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -U2 -r1.34 -r1.35 --- risdb.c 24 Dec 2003 21:59:48 -0000 1.34 +++ risdb.c 26 Dec 2003 21:16:12 -0000 1.35 @@ -55,4 +55,9 @@ static int update_user_field(const char* fieldvalue, unsigned long long n_refdb_id, unsigned long long n_user_id, dbi_conn conn, dbi_driver driver, const char* query_stub, const char* errmsg); +/* libdbi changed the string quoting API after 0.7.0 */ +#ifndef HAVE_QUOTE_STRING_INPLACE +# define dbi_driver_quote_string_inplace dbi_driver_quote_string +#endif + @@ -138,5 +143,5 @@ strup(mytoken); /* convert token to uppercase */ - if (dbi_driver_quote_string(dbi_conn_get_driver(conn), &mytoken) == -1) { + if (dbi_driver_quote_string_inplace(dbi_conn_get_driver(conn), &mytoken) == -1) { free(dest); free(mytoken); @@ -905,5 +910,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &(perinfo.full)) == -1) { + if (dbi_driver_quote_string_inplace(driver, &(perinfo.full)) == -1) { LOG_PRINT(LOG_WARNING, "out of memory"); iwrite(ptr_clrequest->fd, "out of memory\n", 14); @@ -922,5 +927,5 @@ } - if (dbi_driver_quote_string(driver, &(perinfo.custabbrev1)) == -1) { + if (dbi_driver_quote_string_inplace(driver, &(perinfo.custabbrev1)) == -1) { LOG_PRINT(LOG_WARNING, "out of memory"); iwrite(ptr_clrequest->fd, "out of memory\n", 14); @@ -939,5 +944,5 @@ } - if (dbi_driver_quote_string(driver, &(perinfo.custabbrev2)) == -1) { + if (dbi_driver_quote_string_inplace(driver, &(perinfo.custabbrev2)) == -1) { LOG_PRINT(LOG_WARNING, "out of memory"); iwrite(ptr_clrequest->fd, "out of memory\n", 14); @@ -960,5 +965,5 @@ dotify_journal(perinfo.abbrev, conn, conn_refdb); - if (dbi_driver_quote_string(driver, &(perinfo.abbrev)) == -1) { + if (dbi_driver_quote_string_inplace(driver, &(perinfo.abbrev)) == -1) { LOG_PRINT(LOG_WARNING, "out of memory"); iwrite(ptr_clrequest->fd, "out of memory\n", 14); @@ -2058,5 +2063,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &escape_buffer) == -1) { + if (dbi_driver_quote_string_inplace(driver, &escape_buffer) == -1) { LOG_PRINT(LOG_WARNING, "out of memory"); return 1; @@ -2161,5 +2166,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &escape_buffer) == -1) { + if (dbi_driver_quote_string_inplace(driver, &escape_buffer) == -1) { LOG_PRINT(LOG_WARNING, "out of memory"); free(sql_command); @@ -2223,5 +2228,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &another_escape_buffer) == -1) { + if (dbi_driver_quote_string_inplace(driver, &another_escape_buffer) == -1) { LOG_PRINT(LOG_WARNING, "out of memory"); free(sql_command); @@ -2278,5 +2283,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &another_escape_buffer) == -1) { + if (dbi_driver_quote_string_inplace(driver, &another_escape_buffer) == -1) { LOG_PRINT(LOG_WARNING, "out of memory"); free(sql_command); @@ -2333,5 +2338,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &another_escape_buffer) == -1) { + if (dbi_driver_quote_string_inplace(driver, &another_escape_buffer) == -1) { LOG_PRINT(LOG_WARNING, "out of memory"); free(sql_command); @@ -2388,5 +2393,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &another_escape_buffer) == -1) { + if (dbi_driver_quote_string_inplace(driver, &another_escape_buffer) == -1) { LOG_PRINT(LOG_WARNING, "out of memory"); free(sql_command); @@ -2472,5 +2477,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &escape_buffer) == -1) { + if (dbi_driver_quote_string_inplace(driver, &escape_buffer) == -1) { LOG_PRINT(LOG_WARNING, "out of memory"); free(sql_command); @@ -2572,5 +2577,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &escape_buffer) == -1) { + if (dbi_driver_quote_string_inplace(driver, &escape_buffer) == -1) { LOG_PRINT(LOG_WARNING, "out of memory"); free(sql_command); @@ -2658,5 +2663,5 @@ /* escape any characters that the database server cannot digest */ - if (dbi_driver_quote_string(driver, &escape_buffer) == -1) { + if (dbi_driver_quote_string_inplace(driver, &escape_buffer) == -1) { LOG_PRINT(LOG_WARNING, "out of memory"); return 1; Index: risxhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/risxhandler.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -U2 -r1.17 -r1.18 --- risxhandler.c 5 Dec 2003 23:48:51 -0000 1.17 +++ risxhandler.c 26 Dec 2003 21:16:12 -0000 1.18 @@ -53,4 +53,9 @@ +/* libdbi changed the string quoting API after 0.7.0 */ +#ifndef HAVE_QUOTE_STRING_INPLACE +# define dbi_driver_quote_string_inplace dbi_driver_quote_string +#endif + /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -648,5 +653,5 @@ title_type = get_attr(ptr_ardata->ptr_first, "type"); if (title_type && !strcmp(title_type, "full")) { - if (((ptr_ardata->perinfo).full = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string(ptr_ardata->driver, &((ptr_ardata->perinfo).full)) == -1) { + if (((ptr_ardata->perinfo).full = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string_inplace(ptr_ardata->driver, &((ptr_ardata->perinfo).full)) == -1) { if ((new_msgpool = mstrcat(ptr_ardata->msgpool, outomem_n.text, &(ptr_ardata->msgpool_len), 0)) == NULL) { (ptr_ardata->nmem_error)++; @@ -661,5 +666,5 @@ } else if (title_type && !strcmp(title_type, "abbrev")) { - if (((ptr_ardata->perinfo).abbrev = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string(ptr_ardata->driver, &((ptr_ardata->perinfo).abbrev)) == -1) { + if (((ptr_ardata->perinfo).abbrev = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string_inplace(ptr_ardata->driver, &((ptr_ardata->perinfo).abbrev)) == -1) { if ((new_msgpool = mstrcat(ptr_ardata->msgpool, outomem_n.text, &(ptr_ardata->msgpool_len), 0)) == NULL) { (ptr_ardata->nmem_error)++; @@ -674,5 +679,5 @@ } else if (title_type && !strcmp(title_type, "custabbrev1")) { - if (((ptr_ardata->perinfo).custabbrev1 = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string(ptr_ardata->driver, &((ptr_ardata->perinfo).custabbrev1)) == -1) { + if (((ptr_ardata->perinfo).custabbrev1 = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string_inplace(ptr_ardata->driver, &((ptr_ardata->perinfo).custabbrev1)) == -1) { if ((new_msgpool = mstrcat(ptr_ardata->msgpool, outomem_n.text, &(ptr_ardata->msgpool_len), 0)) == NULL) { (ptr_ardata->nmem_error)++; @@ -687,5 +692,5 @@ } else if (title_type && !strcmp(title_type, "custabbrev2")) { - if (((ptr_ardata->perinfo).custabbrev2 = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string(ptr_ardata->driver, &((ptr_ardata->perinfo).custabbrev2)) == -1) { + if (((ptr_ardata->perinfo).custabbrev2 = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string_inplace(ptr_ardata->driver, &((ptr_ardata->perinfo).custabbrev2)) == -1) { if ((new_msgpool = mstrcat(ptr_ardata->msgpool, outomem_n.text, &(ptr_ardata->msgpool_len), 0)) == NULL) { (ptr_ardata->nmem_error)++; Index: xmlhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/xmlhandler.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -U2 -r1.18 -r1.19 --- xmlhandler.c 9 Sep 2003 22:42:05 -0000 1.18 +++ xmlhandler.c 26 Dec 2003 21:16:12 -0000 1.19 @@ -56,4 +56,9 @@ static char* get_ancestor_attr(struct elstack* ptr_current_element, char* ancestor_name, char* ancestor_attribute); +/* libdbi changed the string quoting API after 0.7.0 */ +#ifndef HAVE_QUOTE_STRING_INPLACE +# define dbi_driver_quote_string_inplace dbi_driver_quote_string +#endif + /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1481,9 +1486,9 @@ my_refdb_startpage = my_dbi_result_get_string_copy(dbires, "refdb_startpage"); - /* the quote_string function checks for non-NULL arguments */ - dbi_driver_quote_string(driver, &my_refdb_title); - dbi_driver_quote_string(driver, &my_refdb_volume); - dbi_driver_quote_string(driver, &my_refdb_issue); - dbi_driver_quote_string(driver, &my_refdb_startpage); + /* the quote_string_inplace function checks for non-NULL arguments */ + dbi_driver_quote_string_inplace(driver, &my_refdb_title); + dbi_driver_quote_string_inplace(driver, &my_refdb_volume); + dbi_driver_quote_string_inplace(driver, &my_refdb_issue); + dbi_driver_quote_string_inplace(driver, &my_refdb_startpage); sprintf(sql_command, "INSERT INTO %s (article_title,volume,issue,startpage,pubyear) VALUES (%s,%s,%s,%s,%d)", ptr_gbdata->ptr_table_name, (my_refdb_title) ? my_refdb_title : "\'\'", (my_refdb_volume) ? my_refdb_volume : "\'\'", (my_refdb_issue) ? my_refdb_issue : "\'\'", (my_refdb_startpage) ? my_refdb_startpage : "\'\'", dbi_result_get_short(dbires, "refdb_pubyear")); |
From: Markus H. <mho...@us...> - 2003-12-26 19:04:57
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv32383 Modified Files: refdbda.c refdbdref.c Log Message: made strftime formatting portable Index: refdbda.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbda.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -U2 -r1.32 -r1.33 --- refdbda.c 26 Dec 2003 01:02:05 -0000 1.32 +++ refdbda.c 26 Dec 2003 19:04:54 -0000 1.33 @@ -917,5 +917,5 @@ /* insert the meta data */ time(&the_time); - strftime(date_buffer, 24, "%F %T", gmtime(&the_time)); + strftime(date_buffer, 24, "%Y-%m-%d %H:%M:%S", gmtime(&the_time)); sprintf(sql_command, "INSERT INTO t_meta (meta_app,meta_type,meta_version,meta_create_date,meta_modify_date) VALUES (\'%s\', \'risx\', \'%s\', \'%s\', \'%s\')", PACKAGE, VERSION, date_buffer, date_buffer); LOG_PRINT(LOG_DEBUG, sql_command); Index: refdbdref.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdref.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -U2 -r1.43 -r1.44 --- refdbdref.c 26 Dec 2003 00:11:16 -0000 1.43 +++ refdbdref.c 26 Dec 2003 19:04:54 -0000 1.44 @@ -80,5 +80,5 @@ time(&the_time); - strftime(date_buffer, 24, "%F %T", gmtime(&the_time)); + strftime(date_buffer, 24, "%Y-%m-%d %H:%M:%S", gmtime(&the_time)); if (!strcmp(my_dbi_conn_get_cap(conn, "multiple_db"), "f")) { @@ -207,5 +207,5 @@ if (dbi_conn_error_flag(conn) == 0) { if (the_time) { - strftime(create_date, 64, "%F %T", gmtime(&the_time)); + strftime(create_date, 64, "%Y-%m-%d %H:%M:%S", gmtime(&the_time)); } else { @@ -220,5 +220,5 @@ if (dbi_conn_error_flag(conn) == 0) { if (the_time) { - strftime(modify_date, 64, "%F %T", gmtime(&the_time)); + strftime(modify_date, 64, "%Y-%m-%d %H:%M:%S", gmtime(&the_time)); } else { |
From: Michael S. <xm...@us...> - 2003-12-26 09:48:53
|
Update of /cvsroot/refdb/elisp In directory sc8-pr-cvs1:/tmp/cvs-serv22230 Modified Files: refdb-mode.el Log Message: RFE #865873 (set default db) and #865812 (refdb-mode in output buffer) http://sourceforge.net/tracker/index.php?func=detail&aid=865873&group_id=26091&atid=385994 http://sourceforge.net/tracker/index.php?func=detail&aid=865812&group_id=26091&atid=385994 RFE #865873 - refdb-mode should read refdbcrc to set default database Enhancement: refdb-mode now sets the default database based on output from 'refdbc -C set defaultdb'. RFE #865812 - Put refdb-output buffer into refdb-mode Enhancement: refdb-mode now automatically puts the refdb-output buffer into refdb-mode; this enables you can start working with output data right away, without needing to manually invoke refdb-mode. Index: refdb-mode.el =================================================================== RCS file: /cvsroot/refdb/elisp/refdb-mode.el,v retrieving revision 1.5 retrieving revision 1.6 diff -u -U2 -r1.5 -r1.6 --- refdb-mode.el 25 Dec 2003 10:11:49 -0000 1.5 +++ refdb-mode.el 26 Dec 2003 09:48:49 -0000 1.6 @@ -43,7 +43,7 @@ ;;; Compatibility ;; ------------------------------------------------------------------- -;; `refdb-mode' has been tested and found to work with the Linux -;; (Debian), Cygwin/X-Windows, and MS Windows-native "NTEmacs" -;; versions of GNU Emacs 21.2 and 20.7. +;; `refdb-mode' requires RefDB version 0.9.4 or later. It has been +;; tested and found to work with the Linux (Debian), Cygwin/X-Windows, +;; and Win32-native "NTEmacs" versions of GNU Emacs 21.2 and 20.7. ;; ;; It has also been tested with OSX (Panther) using a build compiled @@ -54,8 +54,4 @@ ;; most likely will not work with those. ;; -;; Cygwin users need RefDB 0.9.4 or later in order to use the "addref" -;; feature (because releases prior to 0.9.4 cannot read from standard -;; input on Cygwin). -;; ;; ------------------------------------------------------------------- ;;; Installation and Configuration @@ -266,5 +262,5 @@ ;;; History: ;; ------------------------------------------------------------------- -;; 2003-12-nn - first public release +;; 2004-01-nn - first public release ;; ;; ------------------------------------------------------------------- @@ -295,4 +291,5 @@ (add-hook 'refdb-mode-hook 'refdb-initialize-all-menus) (add-hook 'refdb-mode-hook 'refdb-make-selectdb-menu) +(add-hook 'refdb-mode-hook 'refdb-set-default-database) (add-hook 'refdb-mode-hook 'refdb-initialize-database-list) @@ -416,5 +413,5 @@ (setq refdb-selectdb-submenu-contents nil) (message - "Building list of databases using '%s %s -C listdb %s' ..." + "Building list of databases using '%s %s -C listdb %s'..." refdb-refdbc-program refdb-refdbc-options @@ -442,5 +439,46 @@ (message "Initializing RefDB database list...") (setq refdb-current-database-list (refdb-list-databases)) - + (message + "Building list of databases using '%s %s -C listdb %s'...done" + refdb-refdbc-program + refdb-refdbc-options + refdb-listdb-sql-regexp + ) + (message "Initializing RefDB database list...done") + ) + +(defun refdb-set-default-database () + "Set default database for all RefDB commands. +This function uses output from 'refdbc -C set defaultdb' to determine +if a user has a 'defaultdb' value set in either the global refdbcrc +file or in his or her ~/.refdbcrc file. If so, that value is used as +the database value in all RefDB commands." + (message "Setting default database...") + (setq refdb-database-default + (car + (last + (split-string + (with-output-to-string + (with-current-buffer + standard-output + (call-process shell-file-name nil '(t t) nil shell-command-switch + (format "%s %s -C set defaultdb" + refdb-refdbc-program + refdb-refdbc-options + ) + ) + ) + ) + ) + ) + ) + ) + (if (and + (equal refdb-database "") + (not (equal refdb-database-default "defaultdb")) + ) + (setq refdb-database refdb-database-default) + ) + (message "Setting default database...done") ) @@ -732,4 +770,5 @@ (refdb-addref-on-region) ) + (message "Adding references in selected region to %s database...done" refdb-database) ;; set resize-mini-windows back to default value (setq resize-mini-windows (get 'resize-mini-windows 'standard-value)) @@ -806,4 +845,5 @@ ) (refdb-output-buffer-choose-mode) + (refdb-mode) (setq resize-mini-windows resize-mini-windows-default) ) @@ -940,4 +980,5 @@ ) (refdb-output-buffer-choose-mode) + (refdb-mode) (setq resize-mini-windows resize-mini-windows-default) ) |
From: Markus H. <mho...@us...> - 2003-12-26 01:23:50
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv31573 Modified Files: refdb-client.c Log Message: fixed timeout bug with invalid XML data Index: refdb-client.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdb-client.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -U2 -r1.24 -r1.25 --- refdb-client.c 1 Jun 2003 17:56:23 -0000 1.24 +++ refdb-client.c 26 Dec 2003 01:23:47 -0000 1.25 @@ -611,8 +611,15 @@ numbyte = tread(n_sockfd, inbuffer, OUTBUF_LEN); /* printf("phase4 server reply:%s<<\n", inbuffer); */ - if (numbyte == -1) { - fprintf(errstream, "could not read from refdbd. Stop\n"); - free(buffer); - return 3; + if (numbyte == -1 || strcmp(inbuffer, "POS") != 0) { + if (numbyte == -1) { + fprintf(errstream, "could not read from refdbd. Stop\n"); + free(buffer); + return 3; + } + else { + fprintf(errstream, "server error: %s\n", inbuffer); + free(buffer); + return 4; + } } @@ -722,10 +729,11 @@ cgi_header(CGI_PLAIN); fprintf(errstream, "could not read from refdbd. Stop\n"); + return 3; } else { cgi_header(CGI_PLAIN); fprintf(errstream, "server error: %s\n", inbuffer); + return 4; } - return 3; } |
From: Markus H. <mho...@us...> - 2003-12-26 01:02:09
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv29282 Modified Files: refdbda.c Log Message: listdb() now returns only RefDB reference databases; new function is_reference_database() Index: refdbda.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbda.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -U2 -r1.31 -r1.32 --- refdbda.c 24 Dec 2003 21:47:31 -0000 1.31 +++ refdbda.c 26 Dec 2003 01:02:05 -0000 1.32 @@ -72,4 +72,5 @@ /* forward declarations of local functions */ +static int is_reference_database(struct CLIENT_REQUEST* ptr_clrequest, const char* dbname); static int daemon_started_by_init(void); static int daemon_started_by_inetd(void); @@ -583,14 +584,16 @@ dbname = dbi_result_get_string_idx(dbires, 1); if (dbname) { - if (ptr_clrequest->n_cgi) { - iwrite(ptr_clrequest->fd, "<tr><td class=\"result\"><input type=\"radio\" name=\"selectdb\" value=\"", 66); - } - iwrite(ptr_clrequest->fd, dbname, strlen(dbname)); - if (ptr_clrequest->n_cgi) { - iwrite(ptr_clrequest->fd, "\">", 2); + if (is_reference_database(ptr_clrequest, dbname)) { + if (ptr_clrequest->n_cgi) { + iwrite(ptr_clrequest->fd, "<tr><td class=\"result\"><input type=\"radio\" name=\"selectdb\" value=\"", 66); + } iwrite(ptr_clrequest->fd, dbname, strlen(dbname)); - iwrite(ptr_clrequest->fd, "</td></tr>", 10); + if (ptr_clrequest->n_cgi) { + iwrite(ptr_clrequest->fd, "\">", 2); + iwrite(ptr_clrequest->fd, dbname, strlen(dbname)); + iwrite(ptr_clrequest->fd, "</td></tr>", 10); + } + iwrite(ptr_clrequest->fd, "\n", sizeof(char)); } - iwrite(ptr_clrequest->fd, "\n", sizeof(char)); } } @@ -606,4 +609,58 @@ iwrite(ptr_clrequest->fd, connerr.text, connerr.length); } +} + +/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + is_reference_database(): checks whether a database is a RefDB + reference database + + int is_reference_database returns 1 if the database is a RefDB database, + 0 if not + + struct CLIENT_REQUEST* ptr_clrequest ptr to structure with client info + + const char* dbname ptr to a string containing the database name + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +static int is_reference_database(struct CLIENT_REQUEST* ptr_clrequest, const char* dbname) { + dbi_conn conn_ref; + dbi_result dbires; + char sql_command[128]; + const char* app; + const char* type; + int close_conn_ref = 0; + int retval = 0; + + if ((conn_ref = connect_to_db(ptr_clrequest, dbname)) == NULL) { + /* can't access */ + return 0; + } + + sprintf(sql_command, "SELECT meta_app,meta_type from t_meta"); + + LOG_PRINT(LOG_DEBUG, sql_command); + dbires = dbi_conn_query(conn_ref, sql_command); + + if (!dbires) { + goto Finish; + } + + if (!dbi_result_next_row(dbires)) { + goto Finish; + } + + app = dbi_result_get_string(dbires, "meta_app"); + type = dbi_result_get_string(dbires, "meta_type"); + + if (!strcmp(app, "refdb")) { + retval = 1; + } + + Finish: + if (close_conn_ref) { + dbi_conn_close(conn_ref); + } + + return retval; } |
From: Markus H. <mho...@us...> - 2003-12-26 00:11:24
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv22218 Modified Files: refdbdref.c Log Message: added database server to whichdb output Index: refdbdref.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdref.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -U2 -r1.42 -r1.43 --- refdbdref.c 24 Dec 2003 21:58:05 -0000 1.42 +++ refdbdref.c 26 Dec 2003 00:11:16 -0000 1.43 @@ -111,4 +111,5 @@ int whichdb(struct CLIENT_REQUEST* ptr_clrequest) { dbi_conn conn; + dbi_driver driver; dbi_result dbires; dbi_error_flag errflag; @@ -141,4 +142,6 @@ } + driver = dbi_conn_get_driver(conn); + dbires = dbi_conn_query(conn, "SELECT COUNT(*), MAX(refdb_id) FROM t_refdb WHERE refdb_type!='DUMMY'"); if (!dbires) { @@ -228,5 +231,5 @@ /* The returned integers are quads (8byte) */ - sprintf(return_msg, "Current database: %s\nNumber of references: "ULLSPEC"\nHighest reference ID: "ULLSPEC"\nNumber of notes: "ULLSPEC"\nHighest note ID: "ULLSPEC"\nDatabase type: %s\nCreated: %s UTC\nUsing %s version: %s\nLast modified: %s UTC\n", ptr_clrequest->current_db, (unsigned long long)numrefs, (unsigned long long)maxid, (unsigned long long)numnotes, (unsigned long long)maxnid, dbi_result_get_string(dbires, "meta_type"), create_date, dbi_result_get_string(dbires, "meta_app"), dbi_result_get_string(dbires, "meta_version"), modify_date); + sprintf(return_msg, "Current database: %s\nNumber of references: "ULLSPEC"\nHighest reference ID: "ULLSPEC"\nNumber of notes: "ULLSPEC"\nHighest note ID: "ULLSPEC"\nDatabase type: %s\nDatabase server: %s\nCreated: %s UTC\nUsing %s version: %s\nLast modified: %s UTC\n", ptr_clrequest->current_db, (unsigned long long)numrefs, (unsigned long long)maxid, (unsigned long long)numnotes, (unsigned long long)maxnid, dbi_result_get_string(dbires, "meta_type"), dbi_driver_get_name(driver), create_date, dbi_result_get_string(dbires, "meta_app"), dbi_result_get_string(dbires, "meta_version"), modify_date); dbi_result_free(dbires); |