00001
00009 #ifndef BIBLDB_H
00010 #define BIBLDB_H
00011
00012 #include "wx/string.h"
00013 #include "wx/dbtable.h"
00014
00015 #include "hastring.h"
00016 #include "haio.h"
00017 #include "halinalg.h"
00018
00019 typedef long SQL_LONG;
00020
00021 class AuthorRef
00022 {
00023 public:
00024 AuthorRef();
00025 AuthorRef(const AuthorRef& ref);
00026 ~AuthorRef();
00027
00028 int auth_id;
00029 HaString last_name;
00030 HaString first_name;
00031 HaString initials;
00032 HaString middle_name;
00033 HaString suffix;
00034 HaString address;
00035 };
00036
00037 class AuthVec: public vector<AuthorRef>
00038 {
00039 public:
00040 AuthVec();
00041
00042 ~AuthVec();
00043
00044 AuthorRef& GetByIdx(int idx);
00045
00046
00047 };
00048
00049 class JournalRef
00050 {
00051 public:
00052 JournalRef();
00053 JournalRef( const JournalRef& ref);
00054 virtual ~JournalRef();
00055
00056 int journal_id;
00057 HaString full_name;
00058 HaString std_abbr;
00059 HaString short_abbr;
00060 HaString fname_abbr;
00061 HaString publisher_id;
00062 };
00063
00064 class BiblRef
00065 {
00066 public:
00067 BiblRef();
00068 ~BiblRef();
00069
00070 int ref_id;
00071 HaString ext_ref_id;
00072 int ref_type;
00073 AuthVec auth_vec;
00074 HaString title;
00075 JournalRef jrn;
00076 HaString vol;
00077 HaString iss;
00078 HaString pub_year;
00079 HaString pub_month;
00080 HaString first_page;
00081 HaString last_page;
00082 HaString isi_id;
00083 int isi_id_int;
00084 HaString ga_code;
00085 HaString medline_id;
00086 HaString reprint_status;
00087 int importance;
00088 HaString doi;
00089
00090 StrVec keywords;
00091 HaString abstract;
00092 HaString notes;
00093
00094 };
00095
00096 class BiblDB
00098 {
00099 public:
00100 BiblDB();
00101 ~BiblDB();
00102
00103 int Init();
00104
00105 int init_flag;
00106
00107 wxDb* db_ro;
00108
00109 wxDbConnectInf* db_con_info;
00110
00111 wxDbTable* abstracts_table;
00112 wxDbTable* auth_order_table;
00113 wxDbTable* authors_table;
00114 wxDbTable* citations_table;
00115 wxDbTable* journals_table;
00116 wxDbTable* journals_syn_table;
00117 wxDbTable* keywords_list_table;
00118 wxDbTable* keywords_tree_table;
00119 wxDbTable* kw_authors_table;
00120 wxDbTable* kw_notes_table;
00121 wxDbTable* kw_refs_table;
00122 wxDbTable* notes_table;
00123 wxDbTable* refs_table;
00124 wxDbTable* refs_table_rid;
00125
00126 char abstract[20000];
00127 char note[20000];
00128
00130
00131 long auth_id;
00132 long auth_pos;
00133
00135
00136 char auth_last_name[128];
00137 char auth_first_name[128];
00138 char auth_initials[20];
00139 char auth_middle_name[128];
00140 char auth_suffix[20];
00141 char auth_address[1000];
00142
00144
00145 long journal_id;
00146 char full_name[128];
00147 char std_abbr[128];
00148 char short_abbr[128];
00149 char fname_abbr[128];
00150 char publisher_id[128];
00151
00153
00154 SQL_LONG ref_id;
00155 char ext_ref_id[256];
00156 SQL_LONG ref_type;
00157 char title[3000];
00158
00159 char volume[20];
00160 char issue[20];
00161 char pub_year[20];
00162 char pub_month[20];
00163 char first_page[20];
00164 char last_page[20];
00165 char isi_id[20];
00166 SQL_LONG isi_id_int;
00167 char ga_code[20];
00168 char medline_id[40];
00169 char reprint_status[80];
00170 SQL_LONG importance;
00171 char doi[256];
00172
00173 SQL_LONG ref_id_s;
00174
00176
00177 wxString ref_id_from;
00178 wxString ref_id_to;
00179 wxString pub_year_from;
00180 wxString pub_year_to;
00181 wxString author_flt_str;
00182 wxString title_flt_str;
00183
00184 HaVec_int SearchRefs();
00185
00186 BiblRef GetRefByID(int ref_id_a);
00187 AuthVec GetAuthForRef(int ref_id_a);
00188 AuthorRef GetAuthByID(int auth_id_a);
00189 JournalRef GetJournalByID(int journal_id);
00190
00191 void PrintRef1(const BiblRef& bref);
00192 void PrintRef2(const BiblRef& bref, wxString& str, int format = 0);
00193
00194 };
00195
00196
00197
00198 #endif // end of !BIBLDB_H