refdb-devel Mailing List for RefDB (Page 24)
Status: Beta
Brought to you by:
mhoenicka
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(14) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
(1) |
Jun
(1) |
Jul
(1) |
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2003 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(6) |
May
(6) |
Jun
(4) |
Jul
(11) |
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
(174) |
2004 |
Jan
(10) |
Feb
(2) |
Mar
|
Apr
|
May
(2) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(2) |
Feb
(6) |
Mar
(11) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
(25) |
Oct
(18) |
Nov
(16) |
Dec
(19) |
2006 |
Jan
(6) |
Feb
|
Mar
|
Apr
(21) |
May
(9) |
Jun
(5) |
Jul
(51) |
Aug
(89) |
Sep
(42) |
Oct
(19) |
Nov
(47) |
Dec
(4) |
2007 |
Jan
(8) |
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(4) |
Aug
(4) |
Sep
(5) |
Oct
|
Nov
(7) |
Dec
(4) |
2008 |
Jan
|
Feb
|
Mar
|
Apr
(14) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2009 |
Jan
|
Feb
(21) |
Mar
(8) |
Apr
(5) |
May
(6) |
Jun
(2) |
Jul
(5) |
Aug
|
Sep
(3) |
Oct
(14) |
Nov
|
Dec
|
2010 |
Jan
(18) |
Feb
(5) |
Mar
|
Apr
|
May
(4) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
|
From: Markus H. <mar...@mh...> - 2003-12-26 19:09:26
|
Bruce D'Arcus writes: > > On Fri, 26 Dec 2003 19:27:35 +0900, "Michael Smith" <sm...@xm...> > said: > > Is the experimental notes feature intended as a replacement for the > > pickref and updateref -P functionality? > > Markus can correct me if I'm wrong, but answer is "no." It is a > supplement, to handle free-standing notes that have links to > bibliographic records. For example, say you want to attach a note to an > author... > No need to correct this! I'm currently trying to get the documentation in sync with the code. This will make it a little easier to understand what the extended notes are good for and how they should be used. regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
From: Markus H. <mar...@mh...> - 2003-12-26 19:09:24
|
Hi Mike, thanks for tracking this down. I've just checked in the fixed files. regards, Markus Michael Smith writes: > It appears that the cause for this is that Cygwin 'strftime' doesn't > support %F and %T. So I think refdbda.c needs to use %Y-%m-%d and > %H:%M:%S instead. I noticed the %F and %T format specifiers are also > %used in refdbdref.c, so I think it'll need to be changed there too. > > Diffs attached (tar'ed to keep my mailer from munging the backslashes). > -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
From: Bruce D'A. <bd...@fa...> - 2003-12-26 16:17:20
|
On Fri, 26 Dec 2003 19:27:35 +0900, "Michael Smith" <sm...@xm...> said: > Is the experimental notes feature intended as a replacement for the > pickref and updateref -P functionality? Markus can correct me if I'm wrong, but answer is "no." It is a supplement, to handle free-standing notes that have links to bibliographic records. For example, say you want to attach a note to an author... Bruce |
From: Michael S. <sm...@xm...> - 2003-12-26 10:27:39
|
Is the experimental notes feature intended as a replacement for the pickref and updateref -P functionality? I ask because I'm wondering whether I should take the time to try to implement support for pickref and updateref -P. --Mike |
From: Michael S. <sm...@xm...> - 2003-12-26 10:08:13
|
Markus, For the record, I just wanted to report that the new listdb behavior works for me as expected (though on Cygwin, only with the 'strftime' change). Thanks for adding it -- I was thinking that if I had to handle it in Emacs, I'd either need to resort to loading the Common Lisp library and using the CL "intersection" function (between blacklist and database list) or figure out how to handle it in native Emacs lisp. Now I can move on to other stuff instead (like adding updateref and pickref support maybe...) --Mike Markus Hoenicka <mar...@mh...> writes: > Hi, > > I just wanted to point out that the new listdb behaviour to only list > RefDB reference databases relies on a new table containing > meta-data. Therefore listdb will only show databases that were created > with a fairly recent CVS version. > > regards, > Markus > |
From: Michael S. <sm...@xm...> - 2003-12-26 07:04:32
|
It appears that the cause for this is that Cygwin 'strftime' doesn't support %F and %T. So I think refdbda.c needs to use %Y-%m-%d and %H:%M:%S instead. I noticed the %F and %T format specifiers are also %used in refdbdref.c, so I think it'll need to be changed there too. Diffs attached (tar'ed to keep my mailer from munging the backslashes). --Mike Michael Smith <sm...@xm...> writes: > It's a Cygwin problem. Works fine on Linux. > > --Mike > > Michael Smith <sm...@xm...> writes: > > > OK, here's where it seems to be failing: > > > > INSERT INTO t_meta > > (meta_app,meta_type,meta_version,meta_create_date,meta_modify_date) > > VALUES ('refdb', 'risx', '0.9.4-pre2', ' ', ' ') > > ERROR: invalid input syntax for type timestamp: " " > > insert into t_meta failed > > > > Seems like it's RefDB is not generating a timestamp correctly. Maybe > > it's a Cygwin-specific issue -- I'll try it on Linux and see if I get > > the same error or not. > > > > --Mike > > > > Michael Smith <sm...@xm...> writes: > > > > > Markus Hoenicka <mar...@mh...> writes: > > > > > > > Hi, > > > > > > > > I just wanted to point out that the new listdb behaviour to only list > > > > RefDB reference databases relies on a new table containing > > > > meta-data. Therefore listdb will only show databases that were created > > > > with a fairly recent CVS version. > > > > > > I just rebuilt from latest CVS source and now can't seem to get any > > > refdb databases created correctly. I filed bug #865817 - > > > > > > http://sourceforge.net/tracker/index.php?func=detail&aid=865817&group_id=26091&atid=385991 > > > > > > Please let me know what I'm doing wrong. I removed the old "refdb" > > > database, then created a new one using the latest refdb.dump.pgsql file, > > > then tried to run "refdba -C createdb foo", and the database seems to > > > get created, but I get an "insert into t_meta failed" error, and the new > > > db doesn't show up when I run "refdba -C listdb". |
From: Michael S. <sm...@xm...> - 2003-12-26 02:57:47
|
It's a Cygwin problem. Works fine on Linux. --Mike Michael Smith <sm...@xm...> writes: > OK, here's where it seems to be failing: > > INSERT INTO t_meta > (meta_app,meta_type,meta_version,meta_create_date,meta_modify_date) > VALUES ('refdb', 'risx', '0.9.4-pre2', ' ', ' ') > ERROR: invalid input syntax for type timestamp: " " > insert into t_meta failed > > Seems like it's RefDB is not generating a timestamp correctly. Maybe > it's a Cygwin-specific issue -- I'll try it on Linux and see if I get > the same error or not. > > --Mike > > Michael Smith <sm...@xm...> writes: > > > Markus Hoenicka <mar...@mh...> writes: > > > > > Hi, > > > > > > I just wanted to point out that the new listdb behaviour to only list > > > RefDB reference databases relies on a new table containing > > > meta-data. Therefore listdb will only show databases that were created > > > with a fairly recent CVS version. > > > > I just rebuilt from latest CVS source and now can't seem to get any > > refdb databases created correctly. I filed bug #865817 - > > > > http://sourceforge.net/tracker/index.php?func=detail&aid=865817&group_id=26091&atid=385991 > > > > Please let me know what I'm doing wrong. I removed the old "refdb" > > database, then created a new one using the latest refdb.dump.pgsql file, > > then tried to run "refdba -C createdb foo", and the database seems to > > get created, but I get an "insert into t_meta failed" error, and the new > > db doesn't show up when I run "refdba -C listdb". > > > > --Mike > > > -- Michael Smith Openwave Systems Japan +81 90 9148 0269 (mobile) Nishishinjuku 6-22-1 +81 3 5909 6347 (office) Tokyo, Japan 163-1117 +81 3 5909 6241 (fax) |
From: Michael S. <sm...@xm...> - 2003-12-26 02:39:25
|
OK, here's where it seems to be failing: INSERT INTO t_meta (meta_app,meta_type,meta_version,meta_create_date,meta_modify_date) VALUES ('refdb', 'risx', '0.9.4-pre2', ' ', ' ') ERROR: invalid input syntax for type timestamp: " " insert into t_meta failed Seems like it's RefDB is not generating a timestamp correctly. Maybe it's a Cygwin-specific issue -- I'll try it on Linux and see if I get the same error or not. --Mike Michael Smith <sm...@xm...> writes: > Markus Hoenicka <mar...@mh...> writes: > > > Hi, > > > > I just wanted to point out that the new listdb behaviour to only list > > RefDB reference databases relies on a new table containing > > meta-data. Therefore listdb will only show databases that were created > > with a fairly recent CVS version. > > I just rebuilt from latest CVS source and now can't seem to get any > refdb databases created correctly. I filed bug #865817 - > > http://sourceforge.net/tracker/index.php?func=detail&aid=865817&group_id=26091&atid=385991 > > Please let me know what I'm doing wrong. I removed the old "refdb" > database, then created a new one using the latest refdb.dump.pgsql file, > then tried to run "refdba -C createdb foo", and the database seems to > get created, but I get an "insert into t_meta failed" error, and the new > db doesn't show up when I run "refdba -C listdb". > > --Mike -- Michael Smith Openwave Systems Japan +81 90 9148 0269 (mobile) Nishishinjuku 6-22-1 +81 3 5909 6347 (office) Tokyo, Japan 163-1117 +81 3 5909 6241 (fax) |
From: Michael S. <sm...@xm...> - 2003-12-26 02:17:56
|
Markus Hoenicka <mar...@mh...> writes: > Hi, > > I just wanted to point out that the new listdb behaviour to only list > RefDB reference databases relies on a new table containing > meta-data. Therefore listdb will only show databases that were created > with a fairly recent CVS version. I just rebuilt from latest CVS source and now can't seem to get any refdb databases created correctly. I filed bug #865817 - http://sourceforge.net/tracker/index.php?func=detail&aid=865817&group_id=26091&atid=385991 Please let me know what I'm doing wrong. I removed the old "refdb" database, then created a new one using the latest refdb.dump.pgsql file, then tried to run "refdba -C createdb foo", and the database seems to get created, but I get an "insert into t_meta failed" error, and the new db doesn't show up when I run "refdba -C listdb". --Mike |
From: Michael S. <sm...@xm...> - 2003-12-26 01:26:17
|
Markus Hoenicka <mar...@mh...> writes: > Michael Smith writes: > > Happy Holidays. > > > > Same to you. > > > I just checked in a new version of refdb-mode. Changes: > > > > Thanks for these additions. This "X-mas edition" works great for me. > > One minor issue: If I run a query, the output ends up in a buffer > called *refdb-output*. This automatically uses the ris mode and all, > so I'm basically all set to edit and update references. However, the > RefDB menu item is gone in this buffer and I have to manually switch > it on again. Is there anything you can do about this? Yeah, I'll set it up to automatically put the refdb-output buffer into refdb-mode. The only downside to that is, the way I currently have things set up, I think that will mean that every time you run a query and it returns output, Emacs will re-initialize the database list and rebuild the RefDB menu, which (on my machine at least) takes a couple of seconds to do. I had it set up before to build the database list only once at Emacs startup, but changed it because it seemed like bad design to have it slowing things down at Emacs startup. --Mike |
From: Markus H. <mar...@mh...> - 2003-12-26 01:08:10
|
Hi, I just wanted to point out that the new listdb behaviour to only list RefDB reference databases relies on a new table containing meta-data. Therefore listdb will only show databases that were created with a fairly recent CVS version. regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
From: Markus H. <mar...@mh...> - 2003-12-26 00:26:00
|
Michael Smith writes: > Happy Holidays. > Same to you. > I just checked in a new version of refdb-mode. Changes: > Thanks for these additions. This "X-mas edition" works great for me. One minor issue: If I run a query, the output ends up in a buffer called *refdb-output*. This automatically uses the ris mode and all, so I'm basically all set to edit and update references. However, the RefDB menu item is gone in this buffer and I have to manually switch it on again. Is there anything you can do about this? regards, Markus -- Markus Hoenicka mar...@ca... (Spam-protected email: replace the quadrupeds with "mhoenicka") http://www.mhoenicka.de |
From: Michael S. <sm...@xm...> - 2003-12-25 11:22:10
|
Bruce D'Arcus <bd...@fa...> writes: > On Dec 18, 2003, at 4:56 PM, Markus Hoenicka wrote: > > >Depends on your current permissions. I'd do something like: > > > >sudo chmod u=rw,g-rwx,o-rwx .cvspass > > I still get the permission error. Any other ideas? Can you do an "ls -l ‾/.cvspass" and double-check to make sure the perms are actually getting set? BTW, "chmod 600 ‾/.cvspass" will have the same effect as "chmod u=rw,g-rwx,o-rwx ‾/.cvspass". |
From: Michael S. <sm...@xm...> - 2003-12-25 11:12:52
|
Bruce D'Arcus <bd...@fa...> writes: > On Dec 16, 2003, at 8:36 PM, Michael Smith wrote: > > >So when I type a backslash in mail messages -- I actually edit as > >temporary files vim, it shows up in vim as a Yen symbol. But if I then > >open that temp file in Emacs (or some other text editor), before I send > >it, it'l still show up as a real backslash. So I guess the problem is > >with what mutt does with those messages before I send it them. > > Curious question: why vim? mutt doesn't have a built-in editor -- it needs to call a separate editing app, and I've always had it set up to call vim. I guess I could probably set it up to use the console version of emacs, but I've never tried it. I used Emac Gnus for e-mail for quite a while, but switched back to vim some time ago. I can't remember why exactly, but I think I was having problems with getting Japanese encodings set up in Gnus. > Also, do you ever use vip-mode in emacs? I've never tried it. I sort of seems like the "worst of both worlds" to me :) At one time, I used an editor called "jed" that had an Emacs emulation mode but was much smaller and faster than Emacs. I think I was using it at the time because it had console color support and very good support for doing "folded" editing. --Mike |
From: Michael S. <sm...@xm...> - 2003-12-25 10:54:38
|
Happy Holidays. I just checked in a new version of refdb-mode. Changes: RFE #864364 - provide control over which fields appear in dataset output Enhancement: Added new functions refdb-select-data-output-format and refdb-select-additional-data-fields and corresponding new menu items 'Select Output Format' and 'Select Additional Data Fields'. Those control the value passed to the 'refdcbc -C getref -s' option, and so enable you to control which fields appear in data output -- either the default fields, all fields, IDs only, or a user-customizable set of additional fields that appear in addition to the default fields. ---------------------------------------------------------------------- RFE #865638 - Add "show version" feature Enhancement: Added new function refdb-show-version and corresponding menu item 'Show RefDB Version' for displaying version information both for refdb-mode and the version of refdbd that refdbd-mode is running against. |
From: Michael S. <xm...@us...> - 2003-12-24 02:23:00
|
Update of /cvsroot/refdb/CVSROOT In directory sc8-pr-cvs1:/tmp/cvs-serv9511 Modified Files: loginfo Log Message: notifications -> ref...@li... Index: loginfo =================================================================== RCS file: /cvsroot/refdb/CVSROOT/loginfo,v retrieving revision 1.2 retrieving revision 1.3 diff -u -U2 -r1.2 -r1.3 --- loginfo 17 Dec 2003 10:03:23 -0000 1.2 +++ loginfo 24 Dec 2003 02:22:57 -0000 1.3 @@ -25,4 +25,4 @@ # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog -CVSROOT $CVSROOT/CVSROOT/syncmail %{sVv} ref...@li... -DEFAULT $CVSROOT/CVSROOT/syncmail %{sVv} ref...@li... +CVSROOT $CVSROOT/CVSROOT/syncmail %{sVv} ref...@li... +DEFAULT $CVSROOT/CVSROOT/syncmail %{sVv} ref...@li... |
From: Markus H. <mho...@us...> - 2003-12-21 23:15:13
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv2202/src Modified Files: xmlhelper.c xmlhelper.h Log Message: added support for fourth attribute to print_elstart_x() Index: xmlhelper.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/xmlhelper.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -U2 -r1.1 -r1.2 --- xmlhelper.c 18 Oct 2003 23:30:34 -0000 1.1 +++ xmlhelper.c 21 Dec 2003 23:15:07 -0000 1.2 @@ -72,5 +72,5 @@ } - if ((new_ref = print_elstart_x(ptr_buffer, ptr_buflen, elname, attname, attvalue, NULL, NULL, NULL, NULL, is_empty, ptr_indent)) == NULL) { + if ((new_ref = print_elstart_x(ptr_buffer, ptr_buflen, elname, attname, attvalue, NULL, NULL, NULL, NULL, NULL, NULL, is_empty, ptr_indent)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); return NULL; @@ -122,7 +122,11 @@ const char* attvalue1 value of 2nd attribute, if any - const char* attname2 name of 2nd attribute, if any + const char* attname2 name of 3rd attribute, if any - const char* attvalue2 value of 2nd attribute, if any + const char* attvalue2 value of 3rd attribute, if any + + const char* attname3 name of 4th attribute, if any + + const char* attvalue3 value of 4th attribute, if any int is_empty if non-zero, element is assumed to be empty @@ -131,5 +135,5 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -char* print_elstart_x(char** ptr_buffer, size_t* ptr_buflen, const char* elname, const char* attname, const char* attvalue, const char* attname1, const char* attvalue1, const char* attname2, const char* attvalue2, int is_empty, struct xmlindent* ptr_indent) { +char* print_elstart_x(char** ptr_buffer, size_t* ptr_buflen, const char* elname, const char* attname, const char* attvalue, const char* attname1, const char* attvalue1, const char* attname2, const char* attvalue2, const char* attname3, const char* attvalue3, int is_empty, struct xmlindent* ptr_indent) { /* ToDo: The attname/attname1 thing is pretty much like cheating. This could be done in a cleaner way using an attribute @@ -228,4 +232,10 @@ } /* end if attname */ + if (attname3 && *attname3) { + if (!print_attribute_x(ptr_buffer, ptr_buflen, attname3, attvalue3)) { + return NULL; + } + } /* end if attname */ + if (is_empty) { ptr_indent->maybe_in_leaf = 0; @@ -270,4 +280,9 @@ char* print_attribute_x(char** ptr_buffer, size_t* ptr_buflen, const char* attname, const char* attvalue) { char* new_ref; + + if (!attname || !*attname || !attvalue || !*attvalue) { + /* nothing to do */ + return *ptr_buffer; + } /* need to print a space, the attribute name, a '=', the Index: xmlhelper.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/xmlhelper.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -U2 -r1.1 -r1.2 --- xmlhelper.h 18 Oct 2003 23:30:34 -0000 1.1 +++ xmlhelper.h 21 Dec 2003 23:15:07 -0000 1.2 @@ -36,5 +36,5 @@ char* print_element_x(const char* elvalue, char** ptr_buffer, size_t* ptr_buflen, const char* elname, const char* attname, const char* attvalue, struct xmlindent* ptr_indent); -char* print_elstart_x(char** ptr_buffer, size_t* ptr_buflen, const char* elname, const char* attname, const char* attvalue, const char* attname1, const char* attvalue1, const char* attname2, const char* attvalue2, int is_empty, struct xmlindent* ptr_indent); +char* print_elstart_x(char** ptr_buffer, size_t* ptr_buflen, const char* elname, const char* attname, const char* attvalue, const char* attname1, const char* attvalue1, const char* attname2, const char* attvalue2, const char* attname3, const char* attvalue3, int is_empty, struct xmlindent* ptr_indent); char* print_elend_x(char** ptr_buffer, size_t* ptr_buflen, const char* elname, struct xmlindent* ptr_indent); char* print_attribute_x(char** ptr_buffer, size_t* ptr_buflen, const char* attname, const char* attvalue); |
From: Markus H. <mho...@us...> - 2003-12-21 23:14:11
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv1864/src Modified Files: refdbdref.c Log Message: whichdb now returns number of notes; use content instead of note Index: refdbdref.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdref.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -U2 -r1.40 -r1.41 --- refdbdref.c 19 Nov 2003 23:35:54 -0000 1.40 +++ refdbdref.c 21 Dec 2003 23:14:08 -0000 1.41 @@ -78,4 +78,6 @@ unsigned long long numrefs; unsigned long long maxid; + unsigned long long numnotes; + unsigned long long maxnid; unsigned short fieldtype; int numbyte; @@ -117,8 +119,30 @@ numrefs = my_dbi_result_get_idval_idx(dbires, 1); /* 1-base index */ maxid = my_dbi_result_get_idval_idx(dbires, 2); - /* The returned integers are quads (8byte) */ - sprintf(return_msg, "Current database: %s\nNumber of references: "ULLSPEC"\nHighest reference ID: "ULLSPEC"\n", ptr_clrequest->current_db, (unsigned long long)numrefs, (unsigned long long)maxid); dbi_result_free(dbires); + dbires = dbi_conn_query(conn, "SELECT COUNT(*), MAX(note_id) FROM t_note"); + if (!dbires) { + iwrite(ptr_clrequest->fd, "cannot get row count\n", 21); + dbi_conn_close(conn); + free(return_msg); + LOG_PRINT(LOG_WARNING, "Cannot get row count"); + return 0; + } + + if (!dbi_result_next_row(dbires)) { + iwrite(ptr_clrequest->fd, "whichdb failed\n", 15); + dbi_conn_close(conn); + LOG_PRINT(LOG_WARNING, "whichdb query error"); + free(return_msg); + return 0; + } + + numnotes = my_dbi_result_get_idval_idx(dbires, 1); /* 1-base index */ + maxnid = my_dbi_result_get_idval_idx(dbires, 2); + dbi_result_free(dbires); + + /* 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"\n", ptr_clrequest->current_db, (unsigned long long)numrefs, (unsigned long long)maxid, (unsigned long long)numnotes, (unsigned long long)maxnid); + numbyte = iwrite(ptr_clrequest->fd, return_msg, strlen(return_msg)); if (numbyte == -1) { @@ -553,5 +577,5 @@ const char scanfields[2][5][19] = { {"refdb_abstract", "refdb_title", "refdb_booktitle", "refdb_title_series", ""}, - {"note_title", "note_note", ""}}; + {"note_title", "note_content", ""}}; dbi_conn conn; @@ -591,5 +615,5 @@ } else { - strcpy(sql_command, "SELECT note_id,note_title,note_note FROM t_note WHERE note_id IN ("); + strcpy(sql_command, "SELECT note_id,note_title,note_content FROM t_note WHERE note_id IN ("); } @@ -638,5 +662,5 @@ } else { - strcpy(sql_command, "SELECT note_id,note_title,note_note FROM t_note WHERE note_id>0"); + strcpy(sql_command, "SELECT note_id,note_title,note_content FROM t_note WHERE note_id>0"); } } |
From: Markus H. <mho...@us...> - 2003-12-21 23:12:42
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv1666/src Modified Files: refdbdnote.c Log Message: select additional fields from t_note Index: refdbdnote.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdnote.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -U2 -r1.6 -r1.7 --- refdbdnote.c 15 Dec 2003 23:37:00 -0000 1.6 +++ refdbdnote.c 21 Dec 2003 23:12:36 -0000 1.7 @@ -1290,8 +1290,8 @@ /* now assemble the SQL query string proper */ if (n_privatelist) { - sprintf(sql_command, "SELECT DISTINCT t_note.note_id, t_note.note_key, t_note.note_title, t_note.note_user_id, t_note.note_date, t_note.note_note FROM t_note,t_user WHERE t_note.note_user_id=t_user.user_id AND t_user.user_name=\'%s\' AND ", ptr_clrequest->username); + sprintf(sql_command, "SELECT DISTINCT t_note.note_id, t_note.note_key, t_note.note_title, t_note.note_user_id, t_note.note_date, t_note.note_content, t_note.note_content_type, t_note.note_content_xmllang FROM t_note,t_user WHERE t_note.note_user_id=t_user.user_id AND t_user.user_name=\'%s\' AND ", ptr_clrequest->username); } else { - strcpy(sql_command, "SELECT DISTINCT t_note.note_id, t_note.note_key, t_note.note_title, t_note.note_user_id, t_note.note_date, t_note.note_note FROM t_note,t_user WHERE t_note.note_user_id=t_user.user_id AND t_user.user_name LIKE \'%\' AND "); + strcpy(sql_command, "SELECT DISTINCT t_note.note_id, t_note.note_key, t_note.note_title, t_note.note_user_id, t_note.note_date, t_note.note_content, t_note.note_content_type, t_note.note_content_xmllang FROM t_note,t_user WHERE t_note.note_user_id=t_user.user_id AND t_user.user_name LIKE \'%\' AND "); } |
From: Markus H. <mho...@us...> - 2003-12-21 23:11:44
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv1547/src Modified Files: noteshandler.h Log Message: removed day and month, added content_type and content_xmllang members from/to addnotes_data Index: noteshandler.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/noteshandler.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -U2 -r1.3 -r1.4 --- noteshandler.h 9 Nov 2003 00:52:56 -0000 1.3 +++ noteshandler.h 21 Dec 2003 23:11:38 -0000 1.4 @@ -22,8 +22,8 @@ struct addnotes_data { char year[5]; - char month[3]; - char day[3]; char date_buffer[12]; char real_key[256]; + char content_type[256]; + char content_xmllang[256]; char user[DBUSER_LENGTH]; char* msgpool; |
From: Markus H. <mho...@us...> - 2003-12-21 23:10:27
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv1341/src Modified Files: noteshandler.c Log Message: cater for new xnote:date attribute; remove handling for date, year, month, day elements; use content instead of note element; handle content_type and content_xmllang attributes Index: noteshandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/noteshandler.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -U2 -r1.7 -r1.8 --- noteshandler.c 4 Dec 2003 00:33:36 -0000 1.7 +++ noteshandler.c 21 Dec 2003 23:10:14 -0000 1.8 @@ -66,4 +66,5 @@ const char* id = NULL; const char* key = NULL; + const char* date = NULL; char* new_msgpool; char sql_command[1024] = ""; @@ -104,4 +105,7 @@ /* reset a few variables relevant to entries */ ptr_andata->create_new = 1; + *(ptr_andata->date_buffer) = '\0'; + *(ptr_andata->content_type) = '\0'; + *(ptr_andata->content_xmllang) = '\0'; /* isolate attributes */ @@ -116,4 +120,7 @@ key = ptr_attr[i+1]; } + else if (!strcmp(ptr_attr[i], "date")) { + date = ptr_attr[i+1]; + } } @@ -132,7 +139,47 @@ } - /* set date to current time in case no date is specified */ - time(&the_time); - strftime(ptr_andata->date_buffer, 12, "%Y-%m-%d", gmtime(&the_time)); + if (date && strlen(date) == 10) { + /* try to parse date according to YYYY-MM-DD */ + int year; + int month; + int day; + char my_date[11]; + + /* get a copy that we can modify. length is checked above */ + strcpy(my_date, date); + + if (my_date[4] == '-') { + my_date[4] = '\0'; + year = atoi(my_date); + + if (year >= 1900 && year <= 2036) { + if (my_date[7] == '-') { + my_date[7] = '\0'; + month = atoi(my_date+5); + + if (month > 0 && month < 13) { + day = atoi(my_date+8); + + if (day > 0 && day < 32) { + strcpy(ptr_andata->date_buffer, date); + strcpy(ptr_andata->year, my_date); + } + /* else: day out of range */ + } + /* else: month out of range */ + } + /* else: invalid month */ + } + /* else: year out of range */ + } + /* else: invalid year */ + } + + if (!*(ptr_andata->date_buffer)) { + /* set date to current time in case no date is specified */ + time(&the_time); + strftime(ptr_andata->date_buffer, 12, "%Y-%m-%d", gmtime(&the_time)); + strftime(ptr_andata->year, 5, "%Y", gmtime(&the_time)); + } /* see whether id or key already exist in the database */ @@ -292,5 +339,5 @@ /* reset all values in t_note, keep key, use new type */ - sprintf(sql_command, "UPDATE t_note SET note_title=NULL, note_note=NULL WHERE note_id="ULLSPEC, (unsigned long long)(ptr_andata->n_note_id)); + sprintf(sql_command, "UPDATE t_note SET note_title=NULL, note_content=NULL WHERE note_id="ULLSPEC, (unsigned long long)(ptr_andata->n_note_id)); LOG_PRINT(LOG_DEBUG, sql_command); @@ -416,11 +463,5 @@ } } - else if (!strcmp(el, "date")) { - *(ptr_andata->year) = '\0'; - *(ptr_andata->month) = '\0'; - *(ptr_andata->day) = '\0'; - *(ptr_andata->date_buffer) = '\0'; - } - else if (!strcmp(el, "note")) { + else if (!strcmp(el, "content")) { ptr_andata->notepool_len = ELVALUE_LENGTH; ptr_andata->notepool = (char*)malloc(ELVALUE_LENGTH); @@ -431,7 +472,18 @@ *(ptr_andata->notepool) = '\0'; } + + for (i = 0; ptr_attr[i]; i += 2) { + if (!strcmp(ptr_attr[i], "type")) { + strncpy(ptr_andata->content_type, ptr_attr[i+1], 255); + ptr_andata->content_type[255] = '\0'; + } + else if (!strcmp(ptr_attr[i], "xml:lang")) { + strncpy(ptr_andata->content_xmllang, ptr_attr[i+1], 255); + ptr_andata->content_xmllang[255] = '\0'; + } + } } else { - if (is_descendant_of(ptr_andata->ptr_first, "note")) { + if (is_descendant_of(ptr_andata->ptr_first, "content")) { char* new_notepool; char attribute_buf[EL_LENGTH]; @@ -592,52 +644,4 @@ /* ------------------------------------------------------------ */ - else if (!strcmp(el, "date")) { - sprintf(ptr_andata->date_buffer, "%s-%s-%s", ptr_andata->year, ptr_andata->month, ptr_andata->day); -/* result = set_notesdata_field("date", ptr_andata->date_buffer, ptr_andata->conn, ptr_andata->driver, ptr_andata->n_note_id); */ - } - /* ------------------------------------------------------------ */ - else if (!strcmp(el, "year")) { - strncpy(ptr_andata->year, (ptr_andata->ptr_first)->ptr_elvalue, 4); - (ptr_andata->year)[4] = '\0'; - } - /* ------------------------------------------------------------ */ - else if (!strcmp(el, "month")) { - size_t len; - - len = strlen((ptr_andata->ptr_first)->ptr_elvalue); - - if (len > 1) { - strncpy(ptr_andata->month, (ptr_andata->ptr_first)->ptr_elvalue, 2); - (ptr_andata->month)[2] = '\0'; - } - else if (len == 1) { - (ptr_andata->month)[0] = '0'; - (ptr_andata->month)[1] = (ptr_andata->ptr_first)->ptr_elvalue[0]; - (ptr_andata->month)[2] = '\0'; - } - else { - strcpy(ptr_andata->month, "00"); - } - } - /* ------------------------------------------------------------ */ - else if (!strcmp(el, "day")) { - size_t len; - - len = strlen((ptr_andata->ptr_first)->ptr_elvalue); - - if (len > 1) { - strncpy(ptr_andata->day, (ptr_andata->ptr_first)->ptr_elvalue, 2); - (ptr_andata->day)[2] = '\0'; - } - else if (len == 1) { - (ptr_andata->day)[0] = '0'; - (ptr_andata->day)[1] = (ptr_andata->ptr_first)->ptr_elvalue[1]; - (ptr_andata->day)[2] = '\0'; - } - else { - strcpy(ptr_andata->day, "00"); - } - } - /* ------------------------------------------------------------ */ else if (!strcmp(el, "link") && ptr_andata->replace_note != 2) { char* type; @@ -664,10 +668,10 @@ } /* ------------------------------------------------------------ */ - else if (!strcmp(el, "note")) { + else if (!strcmp(el, "content")) { if (ptr_andata->ptr_first->ptr_elvalue && *ptr_andata->ptr_first->ptr_elvalue) { - result = set_notesdata_field("note", ptr_andata->ptr_first->ptr_elvalue, ptr_andata->conn, ptr_andata->driver, ptr_andata->n_note_id); + result = set_notesdata_field("content", ptr_andata->ptr_first->ptr_elvalue, ptr_andata->conn, ptr_andata->driver, ptr_andata->n_note_id); } else { - result = set_notesdata_field("note", ptr_andata->notepool, ptr_andata->conn, ptr_andata->driver, ptr_andata->n_note_id); + result = set_notesdata_field("content", ptr_andata->notepool, ptr_andata->conn, ptr_andata->driver, ptr_andata->n_note_id); free(ptr_andata->notepool); ptr_andata->notepool = NULL; @@ -687,6 +691,6 @@ } else if (result == 2) { - LOG_PRINT(LOG_WARNING, "update N1 failed"); - if ((new_msgpool = mstrcat(ptr_andata->msgpool, "update N1 failed\n", &(ptr_andata->msgpool_len), 0)) == NULL) { + LOG_PRINT(LOG_WARNING, "update note failed"); + if ((new_msgpool = mstrcat(ptr_andata->msgpool, "update note failed\n", &(ptr_andata->msgpool_len), 0)) == NULL) { (ptr_andata->nmem_error)++; return; @@ -699,4 +703,36 @@ } /* else: all fine */ + + if (*(ptr_andata->content_type)) { + result = set_notesdata_field("content_type", ptr_andata->content_type, ptr_andata->conn, ptr_andata->driver, ptr_andata->n_note_id); + + if (result == 1) { + if ((new_msgpool = mstrcat(ptr_andata->msgpool, outomem_n.text, &(ptr_andata->msgpool_len), 0)) == NULL) { + (ptr_andata->nmem_error)++; + return; + } + else { + ptr_andata->msgpool = new_msgpool; + } + (ptr_andata->ndb_error)++; + return; + } + } + + if (*(ptr_andata->content_xmllang)) { + result = set_notesdata_field("content_xmllang", ptr_andata->content_xmllang, ptr_andata->conn, ptr_andata->driver, ptr_andata->n_note_id); + + if (result == 1) { + if ((new_msgpool = mstrcat(ptr_andata->msgpool, outomem_n.text, &(ptr_andata->msgpool_len), 0)) == NULL) { + (ptr_andata->nmem_error)++; + return; + } + else { + ptr_andata->msgpool = new_msgpool; + } + (ptr_andata->ndb_error)++; + return; + } + } } @@ -845,5 +881,5 @@ } else { - if (is_descendant_of(ptr_andata->ptr_first, "note")) { + if (is_descendant_of(ptr_andata->ptr_first, "content")) { char* new_notepool; new_notepool = mstrcat(ptr_andata->notepool, (ptr_andata->ptr_first)->ptr_elvalue, &(ptr_andata->notepool_len), 0); |
From: Markus H. <mho...@us...> - 2003-12-21 23:08:03
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv937/src Modified Files: dbfncs.c Log Message: added content_type and content_xmllang fields to t_note Index: dbfncs.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/dbfncs.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -U2 -r1.10 -r1.11 --- dbfncs.c 29 Oct 2003 22:09:23 -0000 1.10 +++ dbfncs.c 21 Dec 2003 23:07:59 -0000 1.11 @@ -250,5 +250,7 @@ note_key VARCHAR(255), \ note_title VARCHAR(255), \ - note_note BLOB, \ + note_content BLOB, \ + note_content_type VARCHAR(255), \ + note_content_xmllang VARCHAR(255), \ note_user_id INT, \ note_date DATE, \ @@ -559,5 +561,7 @@ note_key VARCHAR(255) UNIQUE, \ note_title VARCHAR(255), \ - note_note TEXT, \ + note_content TEXT, \ + note_content_type VARCHAR(255), \ + note_content_xmllang VARCHAR(255), \ note_user_id BIGINT, \ note_date DATE, \ @@ -1020,7 +1024,9 @@ note_key TEXT, \ note_title TEXT, \ + note_content_type TEXT, \ + note_content_xmllang TEXT, \ note_user_id INTEGER, \ note_date DATE, \ - note_note TEXT)"); + note_content TEXT)"); |
From: Markus H. <mho...@us...> - 2003-12-21 23:07:23
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv851/src Modified Files: backendn-scrn.c Log Message: use renamed function get_refdb_note_content_copy() Index: backendn-scrn.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backendn-scrn.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -U2 -r1.2 -r1.3 --- backendn-scrn.c 25 Oct 2003 23:48:40 -0000 1.2 +++ backendn-scrn.c 21 Dec 2003 23:07:20 -0000 1.3 @@ -210,5 +210,5 @@ /*----------------------------------------------------------------*/ /* the note proper */ - item = get_refdb_note_note_copy(ptr_rendinfo->dbires); + item = get_refdb_note_content_copy(ptr_rendinfo->dbires); if (item != NULL) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* note proper */ |
From: Markus H. <mho...@us...> - 2003-12-21 23:05:59
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv511/src Modified Files: backendn-notex.c Log Message: use new print_elstart_x() argument list; output according to new xnote.dtd Index: backendn-notex.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backendn-notex.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -U2 -r1.3 -r1.4 --- backendn-notex.c 4 Nov 2003 23:27:23 -0000 1.3 +++ backendn-notex.c 21 Dec 2003 23:05:55 -0000 1.4 @@ -154,7 +154,9 @@ citem = NULL; } + + get_refdb_note_date(ptr_rendinfo->dbires, date_buffer, 1); if (*id) { - if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "xnote", "id", id, "key", citem, "user", ptr_rendinfo->username, 0, &xindent) == NULL) { + if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "xnote", "id", id, "key", citem, "user", ptr_rendinfo->username, "date", date_buffer, 0, &xindent) == NULL) { return NULL; } @@ -185,36 +187,8 @@ /*----------------------------------------------------------------*/ - /* date */ - if (get_refdb_note_date(ptr_rendinfo->dbires, date_buffer, 1) != NULL) { - if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "date", NULL, NULL, NULL, NULL, NULL, NULL, 0, &xindent) == NULL) { - return NULL; - } - - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), date_buffer, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; - } - else { - *(ptr_rendinfo->ptr_ref) = new_ref; - } - - if (print_elend_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "date", &xindent) == NULL) { - return NULL; - } - } - - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; - } - else { - *(ptr_rendinfo->ptr_ref) = new_ref; - } - - /*----------------------------------------------------------------*/ - /* the note proper */ - item = get_refdb_note_note_copy(ptr_rendinfo->dbires); + /* the content of the note */ + item = get_refdb_note_content_copy(ptr_rendinfo->dbires); if (item != NULL) { - if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "note", NULL, NULL, NULL, NULL, NULL, NULL, 0, &xindent) == NULL) { + if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "content", "type", get_refdb_note_content_type(ptr_rendinfo->dbires), "xml:lang", get_refdb_note_content_xmllang(ptr_rendinfo->dbires), NULL, NULL, NULL, NULL, 0, &xindent) == NULL) { free(item); return NULL; @@ -232,5 +206,5 @@ free(item); - if (print_elend_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "note", &xindent) == NULL) { + if (print_elend_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "content", &xindent) == NULL) { return NULL; } @@ -269,20 +243,20 @@ if (i == 3) { /* periodical */ if (!mode) { /* full name */ - if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "link", "type", "journalfull", "target", citem, NULL, NULL, 1, &xindent) == NULL) { + if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "link", "type", "journalfull", "target", citem, NULL, NULL, NULL, NULL, 1, &xindent) == NULL) { return NULL; } } else if (mode == 1) { /* abbrev */ - if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "link", "type", "journalabbrev", "target", citem, NULL, NULL, 1, &xindent) == NULL) { + if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "link", "type", "journalabbrev", "target", citem, NULL, NULL, NULL, NULL, 1, &xindent) == NULL) { return NULL; } } else if (mode == 2) { /* custabbrev 1 */ - if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "link", "type", "journalcustabbrev1", "target", citem, NULL, NULL, 1, &xindent) == NULL) { + if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "link", "type", "journalcustabbrev1", "target", citem, NULL, NULL, NULL, NULL, 1, &xindent) == NULL) { return NULL; } } else if (mode == 3) { /* custabbrev 2 */ - if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "link", "type", "journalcustabbrev2", "target", citem, NULL, NULL, 1, &xindent) == NULL) { + if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "link", "type", "journalcustabbrev2", "target", citem, NULL, NULL, NULL, NULL, 1, &xindent) == NULL) { return NULL; } @@ -290,5 +264,5 @@ } else { - if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "link", "type", linktype[i], "target", citem, NULL, NULL, 1, &xindent) == NULL) { + if (print_elstart_x(ptr_rendinfo->ptr_ref, ptr_rendinfo->ptr_ref_len, "link", "type", linktype[i], "target", citem, NULL, NULL, NULL, NULL, 1, &xindent) == NULL) { return NULL; } |
From: Markus H. <mho...@us...> - 2003-12-21 23:04:49
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1:/tmp/cvs-serv32757/src Modified Files: backendn-html.c Log Message: use renamed function get_refdb_note_content_copy() Index: backendn-html.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backendn-html.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -U2 -r1.2 -r1.3 --- backendn-html.c 26 Oct 2003 00:12:06 -0000 1.2 +++ backendn-html.c 21 Dec 2003 23:04:42 -0000 1.3 @@ -266,5 +266,5 @@ /*----------------------------------------------------------------*/ /* the note proper */ - item = get_refdb_note_note_copy(ptr_rendinfo->dbires); + item = get_refdb_note_content_copy(ptr_rendinfo->dbires); if (item != NULL) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "<p class=\'note\'>", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { |