refdb-cvs Mailing List for RefDB (Page 63)
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...> - 2004-09-09 23:16:31
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14223/src Modified Files: Tag: Release_0_9_5_stable refdbdbib.c Log Message: output font-size-adjust if appropriate Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.36.2.7 retrieving revision 1.36.2.8 diff -u -U2 -r1.36.2.7 -r1.36.2.8 --- refdbdbib.c 8 Sep 2004 20:23:32 -0000 1.36.2.7 +++ refdbdbib.c 9 Sep 2004 21:34:03 -0000 1.36.2.8 @@ -2802,5 +2802,10 @@ if (fontsize) { - sprintf(outbuffer+strlen(outbuffer), "<xsl:attribute name=\"font-size\">%s</xsl:attribute>", fontsize); + if (is_real_number(fontsize)) { + sprintf(outbuffer+strlen(outbuffer), "<xsl:attribute name=\"font-size-adjust\">%s</xsl:attribute>", fontsize); + } + else { + sprintf(outbuffer+strlen(outbuffer), "<xsl:attribute name=\"font-size\">%s</xsl:attribute>", fontsize); + } } |
From: Markus H. <mho...@us...> - 2004-09-09 22:27:15
|
Update of /cvsroot/refdb/refdb/xsl/refdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13726/xsl/refdb Modified Files: Tag: Release_0_9_5_stable Makefile.am Log Message: added makecss.xsl Index: Makefile.am =================================================================== RCS file: /cvsroot/refdb/refdb/xsl/refdb/Makefile.am,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -U2 -r1.3 -r1.3.2.1 --- Makefile.am 13 Sep 2003 20:13:38 -0000 1.3 +++ Makefile.am 9 Sep 2004 21:31:34 -0000 1.3.2.1 @@ -3,5 +3,5 @@ SUBDIRS = common-refdb docbk-refdb-xsl tei-refdb-xsl -objects = citations.xsl bibdb2tei.xsl +objects = citations.xsl bibdb2tei.xsl makecss.xsl EXTRA_DIST = $(objects) |
From: Markus H. <mho...@us...> - 2004-09-09 22:12:35
|
Update of /cvsroot/refdb/refdb/xsl/refdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13896/xsl/refdb Modified Files: Tag: Release_0_9_5_stable makecss.xsl Log Message: fixed font-size-adjust Index: makecss.xsl =================================================================== RCS file: /cvsroot/refdb/refdb/xsl/refdb/Attic/makecss.xsl,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -U2 -r1.1.2.1 -r1.1.2.2 --- makecss.xsl 8 Sep 2004 20:11:09 -0000 1.1.2.1 +++ makecss.xsl 9 Sep 2004 21:32:05 -0000 1.1.2.2 @@ -16,21 +16,13 @@ <xsl:template match="xsl:attribute[@name='text-indent']"> -div.bibliomixed {text-indent <xsl:value-of select="."/>}; +div.bibliomixed {text-indent: <xsl:value-of select="."/>}; </xsl:template> <xsl:template match="xsl:attribute[@name='font-size']"> - <!-- the font size may be given as an absolute value, carrying a - unit like "pt", or as a relative value without a unit. The former - is represented in css using "font-size", the latter using - "font-size-adjust" --> - <xsl:variable name="attval"><xsl:value-of select='.'/></xsl:variable> - <xsl:choose> - <xsl:when test="number($attval)"> -div.bibliomixed {font-size-adjust <xsl:value-of select="."/>}; - </xsl:when> - <xsl:otherwise> -div.bibliomixed {font-size <xsl:value-of select="."/>}; - </xsl:otherwise> - </xsl:choose> +div.bibliomixed {font-size: <xsl:value-of select="."/>}; + </xsl:template> + + <xsl:template match="xsl:attribute[@name='font-size-adjust']"> +div.bibliomixed {font-size-adjust: <xsl:value-of select="."/>}; </xsl:template> |
From: Markus H. <mho...@us...> - 2004-09-09 21:50:15
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13994/src Modified Files: Tag: Release_0_9_5_stable strfncs.c strfncs.h Log Message: added fn is_real_number() Index: strfncs.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/strfncs.c,v retrieving revision 1.15.2.2 retrieving revision 1.15.2.3 diff -u -U2 -r1.15.2.2 -r1.15.2.3 --- strfncs.c 23 Jul 2004 02:02:07 -0000 1.15.2.2 +++ strfncs.c 9 Sep 2004 21:32:50 -0000 1.15.2.3 @@ -230,4 +230,39 @@ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + is_real_number(): tests whether a string is a number including + decimal fractions + + int is_real_number returns 1 if the string is a representation of a positive + number; returns 0 if the string does not exist or is + empty or contains other characters than digits or a decimal + point or if there is more than one decimal point + + char* string address of string to test + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +int is_real_number(const char *string) { + char *curr; + int decpoint = 0; + + if (!string || !*string) { + return 0; + } + + curr = (char*)string; + + while (*curr) { + if (*curr == '.') { + decpoint++; + } + + if ((!isdigit((int)(*curr)) && *curr != '.') || decpoint > 1) { + return 0; + } + curr++; + } + return 1; +} + +/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ stripwhite(): strips whitespace from the start and end of STRING Index: strfncs.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/strfncs.h,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -u -U2 -r1.8.2.1 -r1.8.2.2 --- strfncs.h 23 Jul 2004 02:02:07 -0000 1.8.2.1 +++ strfncs.h 9 Sep 2004 21:32:50 -0000 1.8.2.2 @@ -51,4 +51,5 @@ int is_port(char *port); int is_number(char *string); +int is_real_number(const char *string); char *stripwhite(char *string, int mode, int type); char* strup(char* string); |
From: Markus H. <mho...@us...> - 2004-09-08 20:37:52
|
Update of /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-fo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11917/xsl/refdb/docbk-refdb-xsl/docbk-fo Modified Files: Tag: Release_0_9_5_stable docbk-refdb-fo.xsl.in Log Message: use style-supplied bib formatting Index: docbk-refdb-fo.xsl.in =================================================================== RCS file: /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-fo/docbk-refdb-fo.xsl.in,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -U2 -r1.9 -r1.9.2.1 --- docbk-refdb-fo.xsl.in 28 Apr 2004 03:06:04 -0000 1.9 +++ docbk-refdb-fo.xsl.in 8 Sep 2004 20:37:43 -0000 1.9.2.1 @@ -96,5 +96,5 @@ <xsl:otherwise> <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable> - <fo:block id="{$id}" xsl:use-attribute-sets="normal.para.spacing"> + <fo:block id="{$id}" xsl:use-attribute-sets="refdb.bibliomset"> <xsl:apply-templates select="bibliomset[@role='bibliography']" mode="refdb"/> </fo:block> |
From: Markus H. <mho...@us...> - 2004-09-08 20:36:34
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11718/src Modified Files: Tag: Release_0_9_5_stable refdbd.h.in Log Message: changed main db name to refdb1 Index: refdbd.h.in =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbd.h.in,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -u -U2 -r1.7.2.1 -r1.7.2.2 --- refdbd.h.in 21 Aug 2004 15:40:20 -0000 1.7.2.1 +++ refdbd.h.in 8 Sep 2004 20:36:24 -0000 1.7.2.2 @@ -63,5 +63,5 @@ #define MSG_BUF_SIZE 256 #define FIFO_NAME "/tmp/refdbd_fifo" /* base name of a fifo */ -#define MAIN_DB "refdb" /* name of the main database */ +#define MAIN_DB "refdb1" /* name of the main database */ #define CITEKEY_BASE_LENGTH 240 /* maximum length of authorname+year */ |
From: Markus H. <mho...@us...> - 2004-09-08 20:35:42
|
Update of /cvsroot/refdb/refdb/styles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11567/styles Modified Files: Tag: Release_0_9_5_stable Eur.J.Pharmacol.xml J.Biol.Chem.xml Log Message: updated for new dtd version Index: Eur.J.Pharmacol.xml =================================================================== RCS file: /cvsroot/refdb/refdb/styles/Eur.J.Pharmacol.xml,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -U2 -r1.7 -r1.7.2.1 --- Eur.J.Pharmacol.xml 6 Jan 2004 21:49:40 -0000 1.7 +++ Eur.J.Pharmacol.xml 8 Sep 2004 20:35:32 -0000 1.7.2.1 @@ -1,4 +1,4 @@ <?xml version="1.0"?> -<!DOCTYPE CITESTYLE PUBLIC "-//Markus Hoenicka//DTD CiteStyle V1.0//EN" "http://refdb.sourceforge.net/dtd/citestylex-1.0/citestylex.dtd"> +<!DOCTYPE CITESTYLE PUBLIC "-//Markus Hoenicka//DTD CiteStyle V1.3//EN" "http://refdb.sourceforge.net/dtd/citestylex-1.3/citestylex.dtd"> <CITESTYLE> <STYLENAME>Eur.J.Pharmacol.</STYLENAME> @@ -429,9 +429,8 @@ <!-- type-independent stuff --> - <CITSTYLE INTEXTSEQUENCE="ASIS" BIBLIOSEQUENCE="BAUTHORDATE"> + <CITSTYLE INTEXTSEQUENCE="ASIS"> <PRECEEDING>(</PRECEEDING> <FOLLOWING>)</FOLLOWING> <CITSEPARATOR>; </CITSEPARATOR> - <BIBLIOTITLE>Reference List</BIBLIOTITLE> <INTEXTDEF> <AUTHORLIST ROLE="PRIMARY"> @@ -484,4 +483,10 @@ </PUBDATE> </YEARONLY> + </CITSTYLE> + + <!-- bibliography formatting --> + + <BIBSTYLE BIBLIOSEQUENCE="BAUTHORDATE" BIBLIOBLOCKINDENT="1cm"> + <BIBLIOTITLE>Reference List</BIBLIOTITLE> <MONTHS> <JAN FULL="January" ABBREV="Jan." THREELET="Jan"/> @@ -498,4 +503,5 @@ <DEC FULL="December" ABBREV="Dec." THREELET="Dec"/> </MONTHS> - </CITSTYLE> + </BIBSTYLE> + </CITESTYLE> Index: J.Biol.Chem.xml =================================================================== RCS file: /cvsroot/refdb/refdb/styles/J.Biol.Chem.xml,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -U2 -r1.8 -r1.8.2.1 --- J.Biol.Chem.xml 6 Jan 2004 21:49:40 -0000 1.8 +++ J.Biol.Chem.xml 8 Sep 2004 20:35:32 -0000 1.8.2.1 @@ -1,4 +1,4 @@ <?xml version="1.0"?> -<!DOCTYPE CITESTYLE PUBLIC "-//Markus Hoenicka//DTD CiteStyle V1.0//EN" "http://refdb.sourceforge.net/dtd/citestylex-1.0/citestylex.dtd"> +<!DOCTYPE CITESTYLE PUBLIC "-//Markus Hoenicka//DTD CiteStyle V1.3//EN" "http://refdb.sourceforge.net/dtd/citestylex-1.3/citestylex.dtd"> <CITESTYLE> <STYLENAME>J.Biol.Chem.</STYLENAME> @@ -445,10 +445,9 @@ <!-- type-independent stuff --> - <CITSTYLE INTEXTSEQUENCE="ASIS" BIBLIOSEQUENCE="BASIS"> + <CITSTYLE INTEXTSEQUENCE="ASIS"> <PRECEEDING>(</PRECEEDING> <FOLLOWING>)</FOLLOWING> <CITSEPARATOR>; </CITSEPARATOR> <RANGESEPARATOR>-</RANGESEPARATOR> - <BIBLIOTITLE>Reference List</BIBLIOTITLE> <INTEXTDEF> <REFNUMBER/> @@ -475,4 +474,10 @@ <REFNUMBER/> </YEARONLY> + </CITSTYLE> + + <!-- bibliography formatting --> + + <BIBSTYLE BIBLIOSEQUENCE="BASIS" BIBLIOBLOCKINDENT="1cm"> + <BIBLIOTITLE>Reference List</BIBLIOTITLE> <MONTHS> <JAN FULL="January" ABBREV="Jan." THREELET="Jan"/> @@ -489,5 +494,6 @@ <DEC FULL="December" ABBREV="Dec." THREELET="Dec"/> </MONTHS> - </CITSTYLE> + </BIBSTYLE> + </CITESTYLE> |
From: Markus H. <mho...@us...> - 2004-09-08 20:34:46
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11385/src Modified Files: Tag: Release_0_9_5_stable xmlhandler.c Log Message: added support for BIBSTYLE Index: xmlhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/xmlhandler.c,v retrieving revision 1.22.2.5 retrieving revision 1.22.2.6 diff -u -U2 -r1.22.2.5 -r1.22.2.6 --- xmlhandler.c 29 Jul 2004 20:55:01 -0000 1.22.2.5 +++ xmlhandler.c 8 Sep 2004 20:34:35 -0000 1.22.2.6 @@ -787,5 +787,6 @@ /* citstyle elements with attributes only, no column_name req */ - else if (strcmp((ptr_asdata->ptr_first)->elname, "CITSTYLE") == 0) { + else if (strcmp((ptr_asdata->ptr_first)->elname, "CITSTYLE") == 0 + || strcmp((ptr_asdata->ptr_first)->elname, "BIBSTYLE") == 0) { strcpy(table_name, "CITSTYLE"); n_attrdata = 1; |
From: Markus H. <mho...@us...> - 2004-09-08 20:24:00
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9518/src Modified Files: Tag: Release_0_9_5_stable refdbdbib.c Log Message: added write_bibstyle_info();add year suffix to first author/year duplicate too;added support for BIBSTYLE output Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.36.2.6 retrieving revision 1.36.2.7 diff -u -U2 -r1.36.2.6 -r1.36.2.7 --- refdbdbib.c 22 Aug 2004 22:22:03 -0000 1.36.2.6 +++ refdbdbib.c 8 Sep 2004 20:23:32 -0000 1.36.2.7 @@ -74,4 +74,5 @@ static int fill_in_authoryear_info(struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbires_cit, struct CLIENT_REQUEST* ptr_clrequest, struct ADDRESULT* ptr_addresult, struct bibinfo* biblio_info, const char* table_name, char* pubtype, char* current_mset, unsigned long long* nref_counter); static void close_dbi_connections(struct BIBCONNS* ptr_bibconns, const char* drivername); +static int write_bibstyle_info(int fd, const char* bibliofirstindent, const char* biblioblockindent, const char* fontsize, int type); @@ -1522,5 +1523,5 @@ if (dbi_result_get_numrows(dbires2) > 1) { /* more than one entry with identical author/year combo */ /* add a unique suffix to each entry */ - unique_count = 0; + unique_count = 1; /* todo: was 0 */ *suffix = '\0'; /* reset suffix to empty string */ @@ -2055,5 +2056,5 @@ /* loop over all requested styles */ for (; *(ptr_clrequest->ptr_optind) < ptr_clrequest->inargc; (*(ptr_clrequest->ptr_optind))++) { - sprintf(sql_command, "SELECT ID,JOURNAL,CITSEPARATOR,FOLLOWING,PRECEEDING,RANGESEPARATOR,BIBLIOTITLE,INTEXTSEQUENCE,BIBLIOSEQUENCE,STYLE,JANABBREV,FEBABBREV,MARABBREV,APRABBREV,MAYABBREV,JUNABBREV,JULABBREV,AUGABBREV,SEPABBREV,OCTABBREV,NOVABBREV,DECABBREV,JANFULL,FEBFULL,MARFULL,APRFULL,MAYFULL,JUNFULL,JULFULL,AUGFULL,SEPFULL,OCTFULL,NOVFULL,DECFULL,JANTHREELET,FEBTHREELET,MARTHREELET,APRTHREELET,MAYTHREELET,JUNTHREELET,JULTHREELET,AUGTHREELET,SEPTHREELET,OCTTHREELET,NOVTHREELET,DECTHREELET FROM CITSTYLE WHERE JOURNAL='%s'", (ptr_clrequest->inargv)[*(ptr_clrequest->ptr_optind)]); + sprintf(sql_command, "SELECT ID,JOURNAL,CITSEPARATOR,FOLLOWING,PRECEEDING,RANGESEPARATOR,BIBLIOTITLE,INTEXTSEQUENCE,BIBLIOSEQUENCE,BIBLIOFIRSTINDENT,BIBLIOBLOCKINDENT,FONTSIZE,STYLE,JANABBREV,FEBABBREV,MARABBREV,APRABBREV,MAYABBREV,JUNABBREV,JULABBREV,AUGABBREV,SEPABBREV,OCTABBREV,NOVABBREV,DECABBREV,JANFULL,FEBFULL,MARFULL,APRFULL,MAYFULL,JUNFULL,JULFULL,AUGFULL,SEPFULL,OCTFULL,NOVFULL,DECFULL,JANTHREELET,FEBTHREELET,MARTHREELET,APRTHREELET,MAYTHREELET,JUNTHREELET,JULTHREELET,AUGTHREELET,SEPTHREELET,OCTTHREELET,NOVTHREELET,DECTHREELET FROM CITSTYLE WHERE JOURNAL='%s'", (ptr_clrequest->inargv)[*(ptr_clrequest->ptr_optind)]); dbires = dbi_conn_query(conn, sql_command); @@ -2093,5 +2094,5 @@ break; } - if (insert_liliform(&attr_sentinel, "BIBLIOSEQUENCE", (char*)my_dbi_result_get_string(dbires, "BIBLIOSEQUENCE"))) { + if (insert_liliform(&attr_sentinel, "STYLE", (char*)my_dbi_result_get_string(dbires, "STYLE"))) { LOG_PRINT(LOG_WARNING, outomem.text); delete_all_liliform(&attr_sentinel); @@ -2114,7 +2115,4 @@ iwrite_element(ptr_clrequest, "RANGESEPARATOR", NULL, my_dbi_result_get_string(dbires, "RANGESEPARATOR")); - /* bibliotitle */ - iwrite_element(ptr_clrequest, "BIBLIOTITLE", NULL, my_dbi_result_get_string(dbires, "BIBLIOTITLE")); - /* intextdef */ iwrite_pubtype(ptr_clrequest, "INTEXTDEF", citstyle_id, conn); @@ -2126,9 +2124,43 @@ iwrite_pubtype(ptr_clrequest, "YEARONLY", citstyle_id, conn); + /* end citstyle block */ + iwrite_elend(ptr_clrequest, "CITSTYLE"); + + /* begin bibstyle block */ + if (insert_liliform(&attr_sentinel, "BIBLIOSEQUENCE", (char*)my_dbi_result_get_string(dbires, "BIBLIOSEQUENCE"))) { + LOG_PRINT(LOG_WARNING, outomem.text); + delete_all_liliform(&attr_sentinel); + break; + } + + if (insert_liliform(&attr_sentinel, "BIBLIOFIRSTINDENT", (char*)my_dbi_result_get_string(dbires, "BIBLIOFIRSTINDENT"))) { + LOG_PRINT(LOG_WARNING, outomem.text); + delete_all_liliform(&attr_sentinel); + break; + } + + if (insert_liliform(&attr_sentinel, "BIBLIOBLOCKINDENT", (char*)my_dbi_result_get_string(dbires, "BIBLIOBLOCKINDENT"))) { + LOG_PRINT(LOG_WARNING, outomem.text); + delete_all_liliform(&attr_sentinel); + break; + } + + if (insert_liliform(&attr_sentinel, "FONTSIZE", (char*)my_dbi_result_get_string(dbires, "FONTSIZE"))) { + LOG_PRINT(LOG_WARNING, outomem.text); + delete_all_liliform(&attr_sentinel); + break; + } + + iwrite_elstart(ptr_clrequest, "BIBSTYLE", &attr_sentinel, 0); + delete_all_liliform(&attr_sentinel); + + /* bibliotitle */ + iwrite_element(ptr_clrequest, "BIBLIOTITLE", NULL, my_dbi_result_get_string(dbires, "BIBLIOTITLE")); + /* months block */ iwrite_months(ptr_clrequest, dbires); - /* end citstyle block */ - iwrite_elend(ptr_clrequest, "CITSTYLE"); + /* end bibstyle block */ + iwrite_elend(ptr_clrequest, "BIBSTYLE"); /* end citestyle */ @@ -2487,4 +2519,7 @@ const char *item_pubtype; const char *drivername; + const char *bibliofirstindent; + const char *biblioblockindent; + const char *fontsize; /* this array of strings contains part of the variable names in the output file (the column names in the database) */ @@ -2558,8 +2593,8 @@ /* read style elements from the citestyle table */ if (!strcmp(my_dbi_conn_get_cap(conn, "multiple_db"), "t")) { - sprintf(sql_command, "SELECT ID, STYLE from %s.CITSTYLE where JOURNAL=%s", MAIN_DB, format_string); + sprintf(sql_command, "SELECT ID, STYLE, BIBLIOFIRSTINDENT, BIBLIOBLOCKINDENT, FONTSIZE FROM %s.CITSTYLE WHERE JOURNAL=%s", MAIN_DB, format_string); } else { - sprintf(sql_command, "SELECT ID, STYLE from CITSTYLE where JOURNAL=%s", format_string); + sprintf(sql_command, "SELECT ID, STYLE, BIBLIOFIRSTINDENT, BIBLIOBLOCKINDENT, FONTSIZE FROM CITSTYLE WHERE JOURNAL=%s", format_string); } @@ -2577,4 +2612,9 @@ } + /* NULL check will be done later */ + bibliofirstindent = dbi_result_get_string(dbires_cit, "BIBLIOFIRSTINDENT"); + biblioblockindent = dbi_result_get_string(dbires_cit, "BIBLIOBLOCKINDENT"); + fontsize = dbi_result_get_string(dbires_cit, "FONTSIZE"); + /* now retrieve the styles for individual publication types */ n_id = my_dbi_result_get_idval_idx(dbires_cit, 1); @@ -2639,7 +2679,19 @@ if (n_ref_format == REFDOCBK) { + if (write_bibstyle_info(fd, bibliofirstindent, biblioblockindent, fontsize, 1 /* DSSSL */)) { + dbi_result_free(dbires_cit); + dbi_result_free(dbires_ref); + LOG_PRINT(LOG_WARNING, "could not write bibstyle info"); + return 0; + } sprintf(outbuffer, "</style-specification-body>\n</style-specification>\n<style-specification id=\"%s\" use=\"%s\">\n<style-specification-body>\n", STYLESHEET_PRINT_ID, STYLESHEET_PRINT_BASENAME); } else { + if (write_bibstyle_info(fd, bibliofirstindent, biblioblockindent, fontsize, 0 /* XSLT */)) { + dbi_result_free(dbires_cit); + dbi_result_free(dbires_ref); + LOG_PRINT(LOG_WARNING, "could not write bibstyle info"); + return 0; + } strcpy(outbuffer, "</xsl:stylesheet>"); } @@ -2696,4 +2748,9 @@ dbi_result_free(dbires_ref); + if (write_bibstyle_info(fd, bibliofirstindent, biblioblockindent, fontsize, 1 /* DSSSL */)) { + LOG_PRINT(LOG_WARNING, "could not write bibstyle info"); + return 0; + } + sprintf(outbuffer, "</style-specification-body>\n</style-specification>\n<external-specification id=\"%s\" document=\"%s\">\n<external-specification id=\"%s\" document=\"%s\">\n</style-sheet>\n", STYLESHEET_HTML_BASENAME, STYLESHEET_HTML_NAME, STYLESHEET_PRINT_BASENAME, STYLESHEET_PRINT_NAME); numbyte = tiwrite(fd, outbuffer, TERM_YES); @@ -2709,4 +2766,69 @@ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + write_bibstyle_info() writes bibliography style info as part of a + xslt/dsssl driver file + + static int write_bibstyle_info returns 1 in case of an error, 0 if successful + + int fd file descriptor to write data to + + const char* bibliofirstindent ptr to string containing bibliofirstindent info + + const char* biblioblockindent ptr to string containing biblioblockindent info + + const char* fontsize ptr to string containing fontsize info + + int type 0 = xslt output 1 = dsssl output + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +static int write_bibstyle_info(int fd, const char* bibliofirstindent, const char* biblioblockindent, const char* fontsize, int type) { + char outbuffer[512]; + int numbyte; + + /* todo: check string lengths or use mstrcat et al. */ + + *outbuffer = '\0'; + + if (!type) { /* XSLT */ + strcpy(outbuffer, "<!-- REFDBBIBSTYLE --><xsl:attribute-set name=\"refdb.bibliomset\" use-attribute-sets=\"normal.para.spacing\">"); + + if (bibliofirstindent) { + sprintf(outbuffer+strlen(outbuffer), "<xsl:attribute name=\"text-indent\">%s</xsl:attribute>", bibliofirstindent); + } + + if (biblioblockindent) { + sprintf(outbuffer+strlen(outbuffer), "<xsl:attribute name=\"start-indent\">%s</xsl:attribute>", biblioblockindent); + } + + if (fontsize) { + sprintf(outbuffer+strlen(outbuffer), "<xsl:attribute name=\"font-size\">%s</xsl:attribute>", fontsize); + } + + strcat(outbuffer, "</xsl:attribute-set><!-- /REFDBBIBSTYLE -->\n"); + } + else { /* DSSSL */ + if (bibliofirstindent) { + sprintf(outbuffer, "(define text-indent \"%s\")\n", bibliofirstindent); + } + + if (biblioblockindent) { + sprintf(&(outbuffer[strlen(outbuffer)]), "(define start-indent \"%s\")\n", biblioblockindent); + } + + if (fontsize) { + sprintf(&(outbuffer[strlen(outbuffer)]), "(define font-size \"%s\")\n", fontsize); + } + } + + numbyte = tiwrite(fd, outbuffer, TERM_NO); +/* printf("outbuffer:%s<<\n", outbuffer); */ + if (numbyte == -1) { + return 1; + } + + return 0; +} + +/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ assemble_return_msg() assembles a message from a given static part and a dbi error message |
From: Markus H. <mho...@us...> - 2004-09-08 20:20:09
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8646/scripts Modified Files: Tag: Release_0_9_5_stable runbib.in Log Message: added processing of REFDBBIBSTYLE section to sed calls Index: runbib.in =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/runbib.in,v retrieving revision 1.14.2.1 retrieving revision 1.14.2.2 diff -u -U2 -r1.14.2.1 -r1.14.2.2 --- runbib.in 24 Jun 2004 20:28:33 -0000 1.14.2.1 +++ runbib.in 8 Sep 2004 20:19:59 -0000 1.14.2.2 @@ -78,9 +78,9 @@ if [ $2 = "TEI" ]; then - echo "sed 's&<!-- REFDBSTYLESHEET -->.*<!-- /REFDBSTYLESHEET -->&<xsl:import href=\"$teihtml\"/>&' < $1 > $basename.html.xsl" | sh + echo "sed 's&<!-- REFDBSTYLESHEET -->.*<!-- /REFDBSTYLESHEET -->&<xsl:import href=\"$teihtml\"/>& ; s&<!-- REFDBBIBSTYLE -->.*<!-- /REFDBBIBSTYLE -->&&' < $1 > $basename.html.xsl" | sh echo "sed 's&<!-- REFDBSTYLESHEET -->.*<!-- /REFDBSTYLESHEET -->&<xsl:import href=\"$teifo\"/>&' < $1 > $basename.fo.xsl" | sh elif [ $2 = "DOCBOOK" ]; then - echo "sed 's&<!-- REFDBSTYLESHEET -->.*<!-- /REFDBSTYLESHEET -->&<xsl:import href=\"$docbkhtml\"/>&' < $1 > $basename.html.xsl" | sh - echo "sed 's&<!-- REFDBSTYLESHEET -->.*<!-- /REFDBSTYLESHEET -->&<xsl:import href=\"$docbkxhtml\"/>&' < $1 > $basename.xhtml.xsl" | sh + echo "sed 's&<!-- REFDBSTYLESHEET -->.*<!-- /REFDBSTYLESHEET -->&<xsl:import href=\"$docbkhtml\"/>& ; s&<!-- REFDBBIBSTYLE -->.*<!-- /REFDBBIBSTYLE -->&&' < $1 > $basename.html.xsl" | sh + echo "sed 's&<!-- REFDBSTYLESHEET -->.*<!-- /REFDBSTYLESHEET -->&<xsl:import href=\"$docbkxhtml\"/>& ; s&<!-- REFDBBIBSTYLE -->.*<!-- /REFDBBIBSTYLE -->&&' < $1 > $basename.xhtml.xsl" | sh echo "sed 's&<!-- REFDBSTYLESHEET -->.*<!-- /REFDBSTYLESHEET -->&<xsl:import href=\"$docbkfo\"/>&' < $1 > $basename.fo.xsl" | sh fi |
From: Markus H. <mho...@us...> - 2004-09-08 20:18:42
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8279/scripts Modified Files: Tag: Release_0_9_5_stable refdb.dump refdb.dump.sqlite refdb.dump.pgsql Log Message: added support for BIBSTYLE Index: refdb.dump =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdb.dump,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -U2 -r1.6 -r1.6.2.1 --- refdb.dump 8 Feb 2004 00:36:03 -0000 1.6 +++ refdb.dump 8 Sep 2004 20:18:30 -0000 1.6.2.1 @@ -18,4 +18,7 @@ INTEXTSEQUENCE varchar(10), BIBLIOSEQUENCE varchar(11), + BIBLIOFIRSTINDENT varchar(16), + BIBLIOBLOCKINDENT varchar(16), + FONTSIZE varchar(16), STYLE varchar(12), JANABBREV varchar(16), Index: refdb.dump.sqlite =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdb.dump.sqlite,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -U2 -r1.5 -r1.5.2.1 --- refdb.dump.sqlite 8 Feb 2004 00:36:03 -0000 1.5 +++ refdb.dump.sqlite 8 Sep 2004 20:18:30 -0000 1.5.2.1 @@ -9,4 +9,7 @@ INTEXTSEQUENCE TEXT, BIBLIOSEQUENCE TEXT, + BIBLIOFIRSTINDENT TEXT, + BIBLIOBLOCKINDENT TEXT, + FONTSIZE TEXT, STYLE TEXT, JANABBREV TEXT, Index: refdb.dump.pgsql =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdb.dump.pgsql,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -U2 -r1.6 -r1.6.2.1 --- refdb.dump.pgsql 8 Feb 2004 00:36:03 -0000 1.6 +++ refdb.dump.pgsql 8 Sep 2004 20:18:30 -0000 1.6.2.1 @@ -9,4 +9,7 @@ INTEXTSEQUENCE TEXT, BIBLIOSEQUENCE TEXT, + BIBLIOFIRSTINDENT TEXT, + BIBLIOBLOCKINDENT TEXT, + FONTSIZE TEXT, STYLE TEXT, JANABBREV TEXT, |
From: Markus H. <mho...@us...> - 2004-09-08 20:16:53
|
Update of /cvsroot/refdb/refdb/dtd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7950/dtd Modified Files: Tag: Release_0_9_5_stable citestylex.dtd Log Message: added element BIBSTYLE;set default for FORMAT to YES Index: citestylex.dtd =================================================================== RCS file: /cvsroot/refdb/refdb/dtd/citestylex.dtd,v retrieving revision 1.7.2.2 retrieving revision 1.7.2.3 diff -u -U2 -r1.7.2.2 -r1.7.2.3 --- citestylex.dtd 23 Jul 2004 01:56:09 -0000 1.7.2.2 +++ citestylex.dtd 8 Sep 2004 20:16:43 -0000 1.7.2.3 @@ -4,9 +4,9 @@ <!-- suggested invocation: --> -<!-- <!DOCTYPE CITESTYLE PUBLIC "-//Markus Hoenicka//DTD CiteStyle V1.2//EN" "http://refdb.sourceforge.net/dtd/citestylex-1.2/citestylex.dtd"> --> +<!-- <!DOCTYPE CITESTYLE PUBLIC "-//Markus Hoenicka//DTD CiteStyle V1.3//EN" "http://refdb.sourceforge.net/dtd/citestylex-1.3/citestylex.dtd"> --> <!ELEMENT STYLESET (CITESTYLE)+> -<!ELEMENT CITESTYLE (STYLENAME, REFSTYLE, CITSTYLE)> +<!ELEMENT CITESTYLE (STYLENAME, REFSTYLE, CITSTYLE, BIBSTYLE)> <!ELEMENT STYLENAME (#PCDATA)> @@ -85,5 +85,5 @@ <!ELEMENT PUBDATE (PRECEEDING?, FOLLOWING?, FIRSTSEP?, SECONDSEP?)> -<!ATTLIST PUBDATE FORMAT (YES | NO) "NO" +<!ATTLIST PUBDATE FORMAT (YES | NO) "YES" SEQUENCE (MDY | DMY | YMD | MY | Y) "Y" MONTHFORMAT (FULL | ABBREVDOT | THREELETTER | ARABICMONTH | ROMANMONTH) "ARABICMONTH" @@ -178,12 +178,18 @@ <!ELEMENT SEPARATOR (#PCDATA)> -<!ELEMENT CITSTYLE (PRECEEDING?, FOLLOWING?, CITSEPARATOR, RANGESEPARATOR?, BIBLIOTITLE?, INTEXTDEF?, AUTHORONLY?, YEARONLY?, MONTHS?)> +<!ELEMENT CITSTYLE (PRECEEDING?, FOLLOWING?, CITSEPARATOR, RANGESEPARATOR?, INTEXTDEF?, AUTHORONLY?, YEARONLY?)> <!ATTLIST CITSTYLE INTEXTSEQUENCE (ASIS | AUTHORDATE | DATEASC | DATEDESC) "AUTHORDATE" - BIBLIOSEQUENCE (BASIS | BAUTHORDATE | BDATEASC | BDATEDESC) "BAUTHORDATE" STYLE (BOLD | ITALIC | BOLDITALIC | SUPER | SUB | ULINE | BOLDULINE | ITULINE | BOLDITULINE | NONE) #IMPLIED> <!ELEMENT CITSEPARATOR (#PCDATA)> +<!ELEMENT BIBSTYLE (BIBLIOTITLE?, MONTHS?)> + +<!ATTLIST BIBSTYLE BIBLIOSEQUENCE (BASIS | BAUTHORDATE | BDATEASC | BDATEDESC) "BAUTHORDATE" + BIBLIOFIRSTINDENT CDATA #IMPLIED + BIBLIOBLOCKINDENT CDATA #IMPLIED + FONTSIZE CDATA #IMPLIED> + <!ELEMENT BIBLIOTITLE (#PCDATA)> |
From: Markus H. <mho...@us...> - 2004-09-08 20:11:18
|
Update of /cvsroot/refdb/refdb/xsl/refdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7009 Added Files: Tag: Release_0_9_5_stable makecss.xsl Log Message: initial version --- NEW FILE --- <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" media-type="text/css"/> <!-- This is a simplistic stylesheet to extract the bibliography formatting from a stylename.xsl file and write it to a css file. Invocation: xsltproc makecss.xsl stylename.xsl > stylename.css --> <xsl:template match="xsl:stylesheet"> <xsl:apply-templates select="xsl:attribute-set"/> </xsl:template> <xsl:template match="xsl:attribute[@name='text-indent']"> div.bibliomixed {text-indent <xsl:value-of select="."/>}; </xsl:template> <xsl:template match="xsl:attribute[@name='font-size']"> <!-- the font size may be given as an absolute value, carrying a unit like "pt", or as a relative value without a unit. The former is represented in css using "font-size", the latter using "font-size-adjust" --> <xsl:variable name="attval"><xsl:value-of select='.'/></xsl:variable> <xsl:choose> <xsl:when test="number($attval)"> div.bibliomixed {font-size-adjust <xsl:value-of select="."/>}; </xsl:when> <xsl:otherwise> div.bibliomixed {font-size <xsl:value-of select="."/>}; </xsl:otherwise> </xsl:choose> </xsl:template> <!-- suppress all attributes that we don't transcribe into css --> <xsl:template match="xsl:attribute"></xsl:template> </xsl:stylesheet> |
From: Markus H. <mho...@us...> - 2004-08-23 22:15:32
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28421 Modified Files: Tag: Release_0_9_5_stable backend-dbiba.c Log Message: set pubdate attributes to citestylex defaults if not specified Index: backend-dbiba.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbiba.c,v retrieving revision 1.26.2.7 retrieving revision 1.26.2.8 diff -u -U2 -r1.26.2.7 -r1.26.2.8 --- backend-dbiba.c 29 Jul 2004 20:52:36 -0000 1.26.2.7 +++ backend-dbiba.c 23 Aug 2004 22:15:19 -0000 1.26.2.8 @@ -935,4 +935,9 @@ const char *item_sequence; const char *item_format; + const char default_sequence[] = "Y"; /* defaults are taken from citestylex.dtd. Be aware of code duplication which is bad per se */ + const char default_yearformat[] = "FOURDIGIT"; + const char default_pad[] = "NN"; + const char default_monthformat[] = "ARABICMONTH"; + const char default_dayformat[] = "ARABICDAY"; enum refdbref_col n_date_index; enum refdbref_col n_dateother_index; @@ -1095,11 +1100,33 @@ item_format = dbi_result_get_string_idx(dbires_ref, n_format_index); - if (item_format && strcmp(item_format, "YES") == 0) { + + /* switch on formatting if the attribute is either missing or set to "YES". To disable formatting, the attribute has to be set to "NO" explicitly */ + if (!item_format || strcmp(item_format, "YES") == 0) { /* do some formatting here */ item_sequence = dbi_result_get_string_idx(dbires_ref, n_sequence_index); + if (!item_sequence) { + item_sequence = default_sequence; + } + item_yearformat = dbi_result_get_string_idx(dbires_ref, n_yearformat_index); + if (!item_yearformat) { + item_yearformat = default_yearformat; + } + item_pad = dbi_result_get_string_idx(dbires_ref, n_pad_index); + if (!item_pad) { + item_pad = default_pad; + } + item_monthformat = dbi_result_get_string_idx(dbires_ref, n_monthformat_index); + if (!item_monthformat) { + item_monthformat = default_monthformat; + } + item_dayformat = dbi_result_get_string_idx(dbires_ref, n_dayformat_index); + if (!item_dayformat) { + item_dayformat = default_dayformat; + } + item_firstsep = my_dbi_result_get_string_copy_idx(dbires_ref, n_firstsep_index); if (item_firstsep && *item_firstsep && !dbi_conn_error_flag(ptr_bibconns->conn_refdb)) { |
From: Markus H. <mho...@us...> - 2004-08-22 22:22:14
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23687 Modified Files: Tag: Release_0_9_5_stable refdbdbib.c Log Message: reset unique year suffix between each author/pubdate group Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.36.2.5 retrieving revision 1.36.2.6 diff -u -U2 -r1.36.2.5 -r1.36.2.6 --- refdbdbib.c 21 Aug 2004 23:02:04 -0000 1.36.2.5 +++ refdbdbib.c 22 Aug 2004 22:22:03 -0000 1.36.2.6 @@ -1523,4 +1523,6 @@ /* add a unique suffix to each entry */ unique_count = 0; + *suffix = '\0'; /* reset suffix to empty string */ + while (dbi_result_next_row(dbires2)) { if (unique_count > 0) { |
From: Markus H. <mho...@us...> - 2004-08-21 23:02:23
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9593 Modified Files: Tag: Release_0_9_5_stable refdbdbib.c Log Message: fixed unique suffix Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.36.2.4 retrieving revision 1.36.2.5 diff -u -U2 -r1.36.2.4 -r1.36.2.5 --- refdbdbib.c 21 Aug 2004 15:45:12 -0000 1.36.2.4 +++ refdbdbib.c 21 Aug 2004 23:02:04 -0000 1.36.2.5 @@ -1457,5 +1457,5 @@ /* select all unique author_abbrevlists */ - sprintf(sql_command, "SELECT DISTINCT author_abbrevlist,pubyear,sorted_pos FROM %s WHERE sorted_pos>0 ORDER BY sorted_pos", table_name); + sprintf(sql_command, "SELECT DISTINCT author_abbrevlist,pubyear FROM %s WHERE sorted_pos>0 ORDER BY sorted_pos", table_name); LOG_PRINT(LOG_DEBUG, sql_command); dbires1 = dbi_conn_query(ptr_bibconns->conn, sql_command); @@ -1469,4 +1469,5 @@ } + /* loop over all abbrevlists */ while (dbi_result_next_row(dbires1)) { item = my_dbi_result_get_string_copy(dbires1, "author_abbrevlist"); @@ -1534,5 +1535,5 @@ return 1; } - +/* printf("suffix went to %s<<\n", suffix); */ id_string = my_dbi_result_get_string_copy(dbires2, "entry_id"); if (!id_string || !strcmp(id_string, "ERROR")) { @@ -2422,8 +2423,4 @@ } - if ((sql_command = (char*)malloc(strlen(author_concat_q)+256)) == NULL) { - return -1; - } - if ((author_concat_q = strdup(author_concat)) == NULL || dbi_driver_quote_string(dbi_conn_get_driver(conn), &author_concat_q) == -1) { return -1; |
From: Markus H. <mho...@us...> - 2004-08-21 15:45:26
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6297 Modified Files: Tag: Release_0_9_5_stable refdbdbib.c Log Message: new function check_is_subseq(); various fixes for sorting order and related stuff Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.36.2.3 retrieving revision 1.36.2.4 diff -u -U2 -r1.36.2.3 -r1.36.2.4 --- refdbdbib.c 26 Jul 2004 20:36:55 -0000 1.36.2.3 +++ refdbdbib.c 21 Aug 2004 15:45:12 -0000 1.36.2.4 @@ -115,15 +115,8 @@ int ndb_error; int nread_done = 0; - size_t inbuffer_len; - size_t sql_command_len; - size_t outbuffer_len; - size_t authorlist_buffer_len = 0; - size_t curr_multi_id_len; int token_size; int numbyte; int i; int n_writeresult; - unsigned int n_pubyear; - unsigned long long nref_counter; int citation_count; /* counter for citations in id handler */ int xref_count; /* counter for xrefs in id handler */ @@ -131,8 +124,17 @@ int nis_numeric = 0; /* 1 for numeric in-text citation, 0 for author/year */ int n_mydistinct; - unsigned long long n_id; - unsigned long long ndb_notfound = 0; /* number of refs not found */ + int n_currpos; + int n_is_subseq = 0; + size_t inbuffer_len; + size_t sql_command_len; + size_t outbuffer_len; + size_t authorlist_buffer_len = 0; + size_t curr_multi_id_len; size_t msg_len = 0; size_t result_len; + short int n_pubyear; + unsigned long long nref_counter; + unsigned long long n_id; + unsigned long long ndb_notfound = 0; /* number of refs not found */ char table_buffer[256]; char entry_id[128]; @@ -158,4 +160,5 @@ char *prev_authorconcat = NULL; const char *bibsequence; + const char *intextsequence; const char* item; const char* item1; @@ -369,4 +372,27 @@ /* both MySQL and PostgreSQL use separate namespaces per connection so it is safe to reuse the same table name */ + + /* the columns mean : */ + /* + dbname the name of the database the ref is taken from + orig_id the numeric ID of the entry in the reference database + entry_id the ID string as taken from the foo.id.xml file + article_title the title of the work + author_concat the concatenated author string + periodical the journal name + volume + issue + startpage + pubyear + citation_pos position of the citation in the document, 0-based, identical for all references of a multiple citation + xref_pos position of the reference within a citation, 0-based and thus 0 for all references which are not part of a multiple citation + multi_id ID string of the multiple citation a ref is part of, if any + sorted_pos position of the ref in the bibliography after sorting + author_abbrevlist the proper et al.-like string + year_uni_suffix the unique suffix for the pubyear, if any + + */ + + if (!strcmp(ptr_clrequest->dbserver, "mysql")) { sprintf(sql_command, "CREATE TEMPORARY TABLE %s (id INT NOT NULL AUTO_INCREMENT, \ @@ -384,5 +410,5 @@ xref_pos INT, \ multi_id BLOB, \ - sorted_pos INT, \ + sorted_pos INT DEFAULT 1, \ author_abbrevlist BLOB, \ year_uni_suffix VARCHAR(16), \ @@ -404,5 +430,5 @@ xref_pos INTEGER, \ multi_id TEXT, \ - sorted_pos INTEGER, \ + sorted_pos INTEGER DEFAULT 1, \ author_abbrevlist TEXT, \ year_uni_suffix VARCHAR(16), \ @@ -424,5 +450,5 @@ xref_pos INTEGER, \ multi_id TEXT, \ - sorted_pos INTEGER, \ + sorted_pos INTEGER DEFAULT 1, \ author_abbrevlist TEXT, \ year_uni_suffix TEXT)", table_name); @@ -570,8 +596,8 @@ /* see how the references should be sorted */ if (!strcmp(my_dbi_conn_get_cap(bibconns.conn_refdb, "multiple_db"), "t")) { - sprintf(sql_command, "SELECT BIBLIOSEQUENCE from %s.CITSTYLE where JOURNAL=%s", MAIN_DB, myjournal); + sprintf(sql_command, "SELECT BIBLIOSEQUENCE,INTEXTSEQUENCE from %s.CITSTYLE where JOURNAL=%s", MAIN_DB, myjournal); } else { - sprintf(sql_command, "SELECT BIBLIOSEQUENCE from CITSTYLE where JOURNAL=%s", myjournal); + sprintf(sql_command, "SELECT BIBLIOSEQUENCE,INTEXTSEQUENCE from CITSTYLE where JOURNAL=%s", myjournal); } @@ -602,4 +628,5 @@ prepare_render_dbib(outbuffer, ptr_biblio_info, bibconns.conn_refdb, n_ref_format); + /* this is the sequence of the entries in the bibliography */ bibsequence = dbi_result_get_string(dbires, "BIBLIOSEQUENCE"); @@ -614,4 +641,17 @@ } + /* this is the sequence of references in a multiple citation */ + intextsequence = dbi_result_get_string(dbires, "INTEXTSEQUENCE"); + + if (!intextsequence || !strcmp(bibsequence, "ERROR")) { + tiwrite(ptr_clrequest->fd, "", TERM_YES); + if (!assemble_return_msg(ptr_addresult, "could not access format information: ", bibconns.conn)) { + LOG_PRINT(LOG_WARNING, ptr_addresult->msg); + } + dbi_result_free(dbires); + close_dbi_connections(&bibconns, drivername); + goto Finish; + } + if (strcmp(bibsequence, "BASIS") == 0) { /* sort the entries according to their appearance in the document */ @@ -622,15 +662,29 @@ goto Finish; } - /* now do the real query */ - sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix FROM %s WHERE sorted_pos>0 ORDER BY id", table_name); + + /* now do the real query. We have to take care of the fact that + the sorting order, although "ASIS", may be affected by the + sorting order of multiple in-text citations */ + if (strcmp(intextsequence, "ASIS") == 0) { + sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos FROM %s WHERE sorted_pos>0 ORDER BY id", table_name); + } + else if (strcmp(intextsequence, "AUTHORDATE") == 0) { + sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos FROM %s WHERE sorted_pos>0 ORDER BY citation_pos, author_concat, pubyear, periodical, volume, issue, startpage", table_name); + } + else if (strcmp(intextsequence, "DATEASC") == 0) { + sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos FROM %s WHERE sorted_pos>0 ORDER BY citation_pos, pubyear, author_concat, periodical, volume, issue, startpage", table_name); + } + else if (strcmp(intextsequence, "DATEDESC") == 0) { + sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos FROM %s WHERE sorted_pos>0 ORDER BY citation_pos, pubyear DESC, author_concat, periodical, volume, issue, startpage", table_name); + } } else if (strcmp(bibsequence, "BAUTHORDATE") == 0) { - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix FROM %s ORDER BY author_concat, pubyear, volume, issue, article_title, periodical, startpage", table_name); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos FROM %s ORDER BY author_concat, pubyear, volume, issue, article_title, periodical, startpage", table_name); } else if (strcmp(bibsequence, "BDATEASC") == 0) { - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix FROM %s ORDER BY pubyear, author_concat, volume, issue, article_title, periodical, startpage", table_name); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos FROM %s ORDER BY pubyear, author_concat, volume, issue, article_title, periodical, startpage", table_name); } else if (strcmp(bibsequence, "BDATEDESC") == 0) { - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix FROM %s ORDER BY pubyear DESC, author_concat, volume, issue, article_title, periodical, startpage", table_name); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos FROM %s ORDER BY pubyear DESC, author_concat, volume, issue, article_title, periodical, startpage", table_name); } @@ -862,4 +916,5 @@ ptr_biblio_info->year_unique_suffix = dbi_result_get_string(dbires, "year_uni_suffix"); + /* compare current string with the string of the previous iteration */ /* we have to work around a MySQL peculiarity as it returns NULL if @@ -877,14 +932,45 @@ } + n_currpos = dbi_result_get_long(dbires, "sorted_pos"); + if ((!n_currpos && dbi_conn_error_flag(bibconns.conn))) { + tiwrite(ptr_clrequest->fd, "", TERM_YES); + if (!assemble_return_msg(ptr_addresult, notempselectcolon.text, bibconns.conn)) { + LOG_PRINT(LOG_WARNING, ptr_addresult->msg); + } + dbi_result_free(dbires1); + dbi_result_free(dbires); + close_dbi_connections(&bibconns, drivername); + goto Finish; + } + + n_pubyear = dbi_result_get_short(dbires, "pubyear"); + if ((!n_pubyear && dbi_conn_error_flag(bibconns.conn))) { + tiwrite(ptr_clrequest->fd, "", TERM_YES); + if (!assemble_return_msg(ptr_addresult, notempselectcolon.text, bibconns.conn)) { + LOG_PRINT(LOG_WARNING, ptr_addresult->msg); + } + dbi_result_free(dbires1); + dbi_result_free(dbires); + close_dbi_connections(&bibconns, drivername); + goto Finish; + } + /* empty authorlists are never treated as subseq. Both the current and the previous authorlist may be NULL */ - if (item && *item && prev_authorconcat && *prev_authorconcat - && strcmp(item, prev_authorconcat) == 0) { - ptr_biblio_info->is_subseq = 1; - } - else { - ptr_biblio_info->is_subseq = 0; + n_is_subseq = check_is_subseq(item, table_name, n_currpos, n_pubyear, bibconns.conn); + + if (n_is_subseq == -1) { + tiwrite(ptr_clrequest->fd, "", TERM_YES); + if (!assemble_return_msg(ptr_addresult, noformatupdatecolon.text, bibconns.conn)) { + LOG_PRINT(LOG_WARNING, ptr_addresult->msg); + } + dbi_result_free(dbires1); + dbi_result_free(dbires); + close_dbi_connections(&bibconns, drivername); + goto Finish; } + ptr_biblio_info->is_subseq = n_is_subseq; + /* free memory */ if (prev_authorconcat) { @@ -1005,4 +1091,5 @@ /* printf("n_writeresult=%d<<\n", n_writeresult); */ + /* todo: switch on after debugging */ /* remove the temporary table */ sprintf(sql_command, "DROP TABLE %s", table_name); @@ -2306,4 +2393,69 @@ } + +/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + check_is_subseq(): checks whether a citation is the first or a subsequent + in the document + + int check_is_subseq returns -1 in case of an error, 0 if first, 1 if subsequent + + const char* author_concat ptr to the author_concat + + const char* table_name name of the table that contains author_concat data + + int n_currpos current position of citation + + int n_pubyear publication year + + dbi_conn conn ptr to an existing connection to the refdb database + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +int check_is_subseq(const char* author_concat, const char* table_name, int n_currpos, short int n_pubyear, dbi_conn conn) { + char* author_concat_q; + char* sql_command; + int n_is_subseq = 0; + dbi_result dbires; + + if (!author_concat || !*author_concat) { + /* nothing to do */ + return 0; + } + + if ((sql_command = (char*)malloc(strlen(author_concat_q)+256)) == NULL) { + return -1; + } + + if ((author_concat_q = strdup(author_concat)) == NULL || dbi_driver_quote_string(dbi_conn_get_driver(conn), &author_concat_q) == -1) { + return -1; + } + + if ((sql_command = (char*)malloc(strlen(author_concat_q)+256)) == NULL) { + free(author_concat_q); + return -1; + } + + sprintf(sql_command, "SELECT id FROM %s WHERE sorted_pos>0 AND sorted_pos < %d AND author_concat=%s AND pubyear=%d", table_name, n_currpos, author_concat_q, n_pubyear); + + free(author_concat_q); + + LOG_PRINT(LOG_DEBUG, sql_command); + dbires = dbi_conn_query(conn, sql_command); + free(sql_command); + + if (!dbires) { + return -1; + } + + if (dbi_result_get_numrows(dbires)) { + n_is_subseq = 1; + } + else { + n_is_subseq = 0; + } + dbi_result_free(dbires); + + return n_is_subseq; +} + /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ send_stylespec(): sends a style specification to the client; the |
From: Markus H. <mho...@us...> - 2004-08-21 15:42:19
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5482 Modified Files: Tag: Release_0_9_5_stable backend-dbib.c Log Message: various fixes to get sorting order, subsequent status, and year suffix right in multiple citation strings Index: backend-dbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbib.c,v retrieving revision 1.28.2.2 retrieving revision 1.28.2.3 diff -u -U2 -r1.28.2.2 -r1.28.2.3 --- backend-dbib.c 11 Aug 2004 20:59:15 -0000 1.28.2.2 +++ backend-dbib.c 21 Aug 2004 15:42:05 -0000 1.28.2.3 @@ -220,4 +220,5 @@ const char *item_entry_id; const char *drivername; + const char *author_concat; char *item_preceeding; char *item_following; @@ -233,4 +234,7 @@ int n_consec; int n_multiple_db = 0; /* if 1, conn allows multiple databases */ + int n_is_subseq = 0; + int n_currpos; + short int n_pubyear; unsigned long long n_sorted_pos1; unsigned long long n_citation_pos; @@ -408,14 +412,14 @@ /* request all xrefs of this citation and sort them according to the required format */ if (strcmp(item_intextseq, "ASIS") == 0) { - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos FROM %s WHERE citation_pos="ULLSPEC" ORDER BY xref_pos", table_name, (unsigned long long)n_citation_pos); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos, year_uni_suffix FROM %s WHERE citation_pos="ULLSPEC" ORDER BY xref_pos", table_name, (unsigned long long)n_citation_pos); } else if (strcmp(item_intextseq, "AUTHORDATE") == 0) { - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos FROM %s WHERE citation_pos="ULLSPEC" ORDER BY author_concat, pubyear, periodical, volume, issue, startpage", table_name, (unsigned long long)n_citation_pos); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos, year_uni_suffix FROM %s WHERE citation_pos="ULLSPEC" ORDER BY author_concat, pubyear, periodical, volume, issue, startpage", table_name, (unsigned long long)n_citation_pos); } else if (strcmp(item_intextseq, "DATEASC") == 0) { - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos FROM %s WHERE citation_pos="ULLSPEC" ORDER BY pubyear, author_concat, periodical, volume, issue, startpage", table_name, (unsigned long long)n_citation_pos); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos, year_uni_suffix FROM %s WHERE citation_pos="ULLSPEC" ORDER BY pubyear, author_concat, periodical, volume, issue, startpage", table_name, (unsigned long long)n_citation_pos); } else if (strcmp(item_intextseq, "DATEDESC") == 0) { - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos FROM %s WHERE citation_pos="ULLSPEC" ORDER BY pubyear DESC, author_concat, periodical, volume, issue, startpage", table_name, (unsigned long long)n_citation_pos); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos, year_uni_suffix FROM %s WHERE citation_pos="ULLSPEC" ORDER BY pubyear DESC, author_concat, periodical, volume, issue, startpage", table_name, (unsigned long long)n_citation_pos); } @@ -483,4 +487,7 @@ } + ptr_biblio_info->year_unique_suffix = dbi_result_get_string(dbires2, "year_uni_suffix"); + + /* start with the code that appears in front of all xrefs */ if (nis_first) { @@ -645,4 +652,27 @@ /* item_entry_id checked for non-NULL above */ ptr_biblio_info->entry_id = item_entry_id; + ptr_biblio_info->n_refdb_id = my_dbi_result_get_idval(dbires3, "n_refdb_id"); + + + author_concat = dbi_result_get_string(dbires2, "author_concat"); + n_currpos = dbi_result_get_long(dbires2, "sorted_pos"); + n_pubyear = dbi_result_get_short(dbires2, "pubyear"); + + n_is_subseq = check_is_subseq(author_concat, table_name, n_currpos, n_pubyear, ptr_bibconns->conn); + + if (n_is_subseq == -1) { + LOG_PRINT(LOG_WARNING, "could not retrieve query results"); + delete_all_lilimem(&sentinel); + dbi_result_free(dbires); + dbi_result_free(dbires1); + dbi_result_free(dbires2); + dbi_result_free(dbires3); + return NULL; + } + + ptr_biblio_info->is_subseq = n_is_subseq; + + + |
From: Markus H. <mho...@us...> - 2004-08-21 15:40:33
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5062 Modified Files: Tag: Release_0_9_5_stable refdbd.h.in Log Message: new function check_is_subseq() Index: refdbd.h.in =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbd.h.in,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -U2 -r1.7 -r1.7.2.1 --- refdbd.h.in 16 Feb 2004 21:25:24 -0000 1.7 +++ refdbd.h.in 21 Aug 2004 15:40:20 -0000 1.7.2.1 @@ -134,4 +134,5 @@ int free_client_request(struct CLIENT_REQUEST* ptr_clrequest); int update_meta(dbi_conn conn, struct CLIENT_REQUEST* ptr_clrequest); +int check_is_subseq(const char* author_concat, const char* table_name, int n_currpos, short int n_pubyear, dbi_conn conn); |
From: Markus H. <mho...@us...> - 2004-08-18 23:02:35
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1304 Modified Files: Tag: Release_0_9_5_stable med2ris.pl.in Log Message: handle MedlineDate element Index: med2ris.pl.in =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/med2ris.pl.in,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -U2 -r1.3 -r1.3.2.1 --- med2ris.pl.in 30 Apr 2003 21:36:51 -0000 1.3 +++ med2ris.pl.in 18 Aug 2004 23:02:19 -0000 1.3.2.1 @@ -638,4 +638,12 @@ $currpubdate{$elname} = $string; } + elsif ($elname eq "MedlineDate") { + ## apparently common in older citations, contains plain text date + $currpubdate{"Year"} = $string; + ## make no attempt to extract anything but a 4-digit year + $currpubdate{"Year"} =~ s/.*(\d{4,}).*/$1/; + $currpubdate{"Month"} = ""; + $currpubdate{"Day"} = ""; + } elsif ($elname eq "FirstName" || $elname eq "ForeName" |
From: Markus H. <mho...@us...> - 2004-08-17 00:40:07
|
Update of /cvsroot/refdb/refdb/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4766 Modified Files: Tag: Release_0_9_5_stable refdbcgirc Log Message: added refdblib to refdbcgirc Index: refdbcgirc =================================================================== RCS file: /cvsroot/refdb/refdb/etc/refdbcgirc,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -u -U2 -r1.3 -r1.3.4.1 --- refdbcgirc 24 Feb 2002 07:52:56 -0000 1.3 +++ refdbcgirc 17 Aug 2004 00:36:22 -0000 1.3.4.1 @@ -12,4 +12,7 @@ # system +# The full path of a directory for shareable application files +refdblib <pkgdatadir> + # Either the IP address or the hostname of the computer that runs the # application server refdbd. Use 127.0.0.1 if refdba and refdbd run |
From: David N. <dav...@sw...> - 2004-08-13 09:44:31
|
The refdb-ms (makestyle) utility, recently discussed on refdb-users, has been checked in to refdb cvs. See the top-level directory 'makestyle'. Many thanks to Markus for his invitation to add refdb-ms to the sf repository. Regards, David. |
From: David N. <dav...@us...> - 2004-08-12 13:46:57
|
Update of /cvsroot/refdb/makestyle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17641/makestyle Added Files: README refdb-ms refdb-ms.pl document-dtd-entities Log Message: Initial import of makestyle. --- NEW FILE --- RefDB Makestyle (refdb-ms) This utility aids in the creation of RefDB styles. More detailed help is available when running the program. FILES README: This file refdb-ms: Main (executable) program file refbd-ms.pl: Custom library needed by 'refdb-ms' document-dtd-entities: Uses 'refdb-ms.pl' to generate html documentation for attributes and elements INSTALL If you keep all files in a single directory and run them from that directory, then no further system configuration is required. If you want to be able to run the utility from any directory you must ensure: refdb-ms: - must be installed to a directory on the path - to see the current path type echo $PATH refdb-ms.pl - must be installed to a directory in perl's @INC array - to see the directories in the @INC array type perl -e "print join( \"\n\" , @INC );" CONSOLE EDITOR This utility makes use of your default console editor. It will use the editor specified by the EDITOR variable. It that variable is not set it will use 'vi' (often located in /usr/bin/vi). If the EDITOR variable is set it must be set to a valid value. You can test this by executing the following command from a terminal: $EDITOR If a console editor starts it means the variable is correctly configured. If you get an error message you must either set the EDITOR variable to a correct value or unset it entirely. If nothing happens it means the variable is not set and you should ensure that 'vi' is installed on your system. To check for an operating 'vi', just execute the following command at a terminal prompt: vi If the vi editor does not start you must either install it or set the EDITOR variable to another console editor. Some widely installed console editors are 'pico', 'nano' and 'emacs'. REQUIREMENTS See above for how to ensure that 'refdb-ms' can find 'refdb-ms.pl' and for how to ensure that 'refdb-ms' can access a console editor. The following perl modules are explicitly required: Scalar::Util Term::Clui Text::Wrap File::Temp --- NEW FILE --- #!/usr/bin/perl =head1 RefDB MakeStyle (refdb-ms) =head1 Summary A utility to aid the generation of RefDB Styles. =head1 Requirements One of the design goals for this utility was to minimise external dependencies. B<refdb-ms.pl> is a custom library needed by this script and is distributed with it. See C<refdb-ms.pl> documentation for its dependencies. =cut use strict; require "refdb-ms.pl"; $ENV{'CLUI_DIR'} = "OFF"; my $ui = UI->new(); die "Fatal errors encountered.\n" if not $ui->startup_checks(); =head1 The program =head2 Style root The root element of the style, C<CiteStyle>, is a data member of the user-interface (C<ui>) object. All other elements of the style are children of the C<CiteStyle> element. =cut $ui->set_root( CiteStyle->new() ); =head2 Help system There is a series of help screens. See C<refdb-ms.pl> library for details. =cut print "RefDB MakeStyle -- a utility to aid in the generation of RefDB styles.\n"; $ui->help_system() if $ui->_input_confirm( "Do you require help?" ); =head2 Main entry loop This is the main part of the program -- where the style itself is created. It is short as most of the "work" is done by the C<refdb-ms.pl> library. =cut my ( $current_element , @choice , $child ) = ( $ui->get_root()->get_last_incomplete() ); $current_element->add_attributes(); $current_element->enter_value(); while ( 1 ) { # Get working element $current_element = $ui->get_root()->get_last_incomplete(); last if not defined $current_element; # style is complete # Add element attributes and content $current_element->add_attributes(); $current_element->enter_value(); # Provide feedback printf "\nProgress report:\n%s\n" , $ui->get_root()->show_progress(); printf "Current element: %s\n" , $current_element->get_name(); # Select next element/action @choice = $current_element->select_next_child(); # Delete element if user selected that option if ( @choice[1] eq "[DELETE]" ) { $ui->delete_selected_element(); next; } # If current element complete, skip next part next if not defined $choice[1]; # current element is complete printf "\n%s" , @choice[0]; # Add newly selected element to style $child = $ui->create_element( @choice[1] ); $current_element->add_child( $child ); } print "\nThe style is now complete.\n"; =head2 Write output The style is written to an C<xml> file. If the default name, E<lt>I<stylename>-style.xmlE<gt>, already exists, another is created. =cut $ui->write_style(); =head2 Write summary A summary of the style is written to an C<html> file. It is meant as an aide memoire when entering references. =cut $ui->write_summary(); =head2 Upload style The style can be uploaded to refdb. If a pre-existing style of the same name exists it is backed up to file before the new style is added. =cut $ui->upload_style(); printf "\nStyle \"%s\" has been created.\nIt has been saved to file <%s>.\nA summary of the style has been written to file <%s>.\n\nRefDB Makestyle is finished.\n" , $ui->get_root()->get_style_name() , $ui->get_style_file() , $ui->get_summary_file(); exit 0; =head1 AUTHOR David Nebauer, david E<lt>atE<gt> nebauer E<lt>dotE<gt> org =head1 COPYRIGHT AND LICENSE Copyright (C) 2004 by David Nebauer Distributed under the same license and conditions as the C<Refdb> project E<lt>L<http://refdb.sourceforge.net/>E<gt>. =cut --- NEW FILE --- package Makestyle; use strict; use warnings; =head1 refdb-ms.pl A library used by I<refdb-ms> (RefDB MakeStyle). I<refdb-ms> is designed for use with the Refdb project to generate bibliography I<style>s. =head1 SUMMARY Provides C<< Element >> and C<< Attribute >> classes for use in generating Refdb I<style>s. =head1 DEPENDENCIES The following perl modules are required by this library: =over [...6088 lines suppressed...] =back =cut 1; __END__ =head1 AUTHOR David Nebauer, david E<lt>atE<gt> nebauer E<lt>dotE<gt> org =head1 COPYRIGHT AND LICENSE Copyright (C) 2004 by David Nebauer This library is distributed under the same license and conditions as the C<Refdb> project E<lt>L<http://refdb.sourceforge.net/>E<gt>. =cut --- NEW FILE --- #!/usr/bin/perl =head1 document-dtd-entities =head1 Summary Extracts from C<refdb-ms.pl> certain data elements associated with citestylex DTD entities (i.e., elements and attributes). This includes help and prompt text, default values and attribute enumerations. Output is written to an html file. =head1 Configuration =head3 Find 'refdb-ms.pl' This script must be able to find the perl library C<refdb-ms.pl>. Either run this script in the same directory as C<refdb-ms.pl> or make sure C<refdb-ms.pl> is in a directory included in perl's @INC array. To see the directories in the @INC array use the following command: perl -e "print join(\"\n\", @INC);" =head3 Output filename The output filename can be specified as an argument to C<document-dtd-entities>. If one is not supplied the default filename C<dtd-entities.html> is used. =head1 Running When running this program an object of each entity class is created in order to be queried for its properties. The object creation process usually requires no user input. There are three exceptions: TYPE - Type_PubType, ROLE - Role_UserDef and ROLE - Role_Misc. When these attributes are created you will be required to select a value from the enumeration list. Select any value -- it does not matter. =head1 Programmer notes I have broken a general object-oriented programming "rule" in this utility. I have directly accessed the attribute enumeration instead of using a "getter". There is a good reason: for three attributes (TYPE - Type_PubType, ROLE - Role_UserDef and ROLE - Role_Misc) the get->enumeration method returns an incomplete list. It omits those enumeration values already selected by existing attributes. =cut use strict; require "refdb-ms.pl"; # Print informational message print "In the process of extracting entity help each entity is created once.\nSome entities require user interaction.\nIt does not matter what values you enter/select when this occurs.\n-----------------------------------------\n"; # Get output filename my $file = shift; $file = ( $file ) ? $file : "dtd-entities.html"; # Set attribute and element lists my @attributes = qw/ Type_PubType Type_PageRange Style Role_AuthorList Role_PubDate Role_Title Role_UserDef Role_Misc DisplayAuthor MaxAuthor UpperCase InitialStyle NameOrder Sequence Format YearFormat MonthFormat PadLeadingZero DayFormat Case AlternateText DefaultText Punctuation BiblioSequence InTextSequence Threelet_Jan Threelet_Feb Threelet_Mar Threelet_Apr Threelet_May Threelet_Jun Threelet_Jul Threelet_Aug Threelet_Sep Threelet_Oct Threelet_Nov Threelet_Dec Abbrev_Jan Abbrev_Feb Abbrev_Mar Abbrev_Apr Abbrev_May Abbrev_Jun Abbrev_Jul Abbrev_Aug Abbrev_Sep Abbrev_Oct Abbrev_Nov Abbrev_Dec Full_Jan Full_Feb Full_Mar Full_Apr Full_May Full_Jun Full_Jul Full_Aug Full_Sep Full_Oct Full_Nov Full_Dec /; my @elements = qw/ StyleSet CiteStyle StyleName RefStyle PubType RefNumber Preceeding Following AuthorList AbbreviateFirst AbbreviateSubseq Aempty Asame AuthorSeps TwoSeps ThreeSeps ThreeSepsEach ThreeSepsLast AuthorNames NameFirst NameOther Text TextSingle TextMultiple PubDate FirstSep SecondSep Title JournalName Volume Issue Pages SinglePage PageRange RangeSeparator Publisher PubPlace Serial Address Url UserDef Misc Notes Abstract Separator CitStyle CitSeparator BiblioTitle InTextDef AuthorOnly YearOnly Months Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec /; # Start output file my $output = "<html>\n<head><title>'citestylex' DTD Entity Documentation</title></head>\n<body>\n<h1><i>citestylex</i> DTD Entity Documentation</h1>\n<h4>Source</h4>\n<p>Extracted from <<tt>refdb-ms.pl</tt>>>.</p>\n"; # Extract attribute help $output .= "<h2>Attributes</h2>\n"; foreach ( @attributes ) { my ( $att , $enum_list ) = ( $_->new() , "" ); my ( $att_name , $att_class ) = ( $att->get_name() , $att->get_classname() ); $output .= sprintf "<h3>%s (%s)</h3>\n" , $att_name , $att_class; $output .= sprintf "<h4>Prompt</h4>\n<p>%s</p>\n" , $att->get_prompt(); if ( defined( $att->{enumeration} ) ) { foreach ( sort @{ $att->{enumeration} } ) { $enum_list .= $_ . " | "; } } if ( $enum_list =~ /|/ ) { $enum_list =~ /^(.*) \| $/; $enum_list = $1; } $enum_list = $enum_list ? $enum_list : "<i>[None]</i>"; $output .= sprintf "<h4>Enumeration</h4>\n<p>%s</p>\n" , $enum_list; $output .= sprintf "<h4>Default</h4>\n<p>%s</p>\n" , $att->get_default(); } # Extract element help $output .= "<hr><br>\n<h2>Elements</h2>\n"; foreach ( @elements ) { my $element = $_->new(); $output .= sprintf "<h3>%s</h3>\n" , $element->get_name(); $output .= sprintf "<h4>Prompt</h4>\n<p>%s</p>\n" , $element->get_prompt(); if ( $element->get_suggestion() ) { $output .= sprintf( "<h4>Suggested value</h4>\n<p>\"%s\"</p>\n" , $element->get_suggestion() ); } $output .= sprintf "<h4>Help</h4>\n<p>%s</p>\n" , $element->get_help(); } # Finish output $output .= "<hr>\n</body>\n</html>"; # Print to file open FILE , "> $file"; print FILE $output; close FILE; # Print informational message printf "-----------------------------------------\nOutput written to \"%s\".\n" , $file; |
From: David N. <dav...@us...> - 2004-08-12 13:40:35
|
Update of /cvsroot/refdb/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16889/CVSROOT Modified Files: modules Log Message: Added ms (makestyle) module. Index: modules =================================================================== RCS file: /cvsroot/refdb/CVSROOT/modules,v retrieving revision 1.1 retrieving revision 1.2 diff -u -U2 -r1.1 -r1.2 --- modules 25 Apr 2001 22:11:05 -0000 1.1 +++ modules 12 Aug 2004 13:40:27 -0000 1.2 @@ -25,2 +25,4 @@ # can be useful for creating a module that consists of many directories # spread out over the entire source repository. +ms makestyle + |
From: David N. <dav...@us...> - 2004-08-12 13:34:53
|
Update of /cvsroot/refdb/makestyle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15803/makestyle Log Message: Directory /cvsroot/refdb/makestyle added to the repository |