Modification de l'insertion de publi dans la bdd (id)master
@@ -16,6 +16,7 @@ | |||
<File Name="cosmosGUI.cpp"/> | |||
<File Name="correcGUI.cpp"/> | |||
<File Name="optionsRcheGUI.cpp"/> | |||
<File Name="RcheGUI.cpp"/> | |||
</VirtualDirectory> | |||
<File Name="config.cpp"/> | |||
<File Name="options.cpp"/> | |||
@@ -23,6 +24,7 @@ | |||
<File Name="optionsRche.cpp"/> | |||
<File Name="recherche.cpp"/> | |||
<File Name="misc.cpp"/> | |||
<File Name="rche.cpp"/> | |||
</VirtualDirectory> | |||
<VirtualDirectory Name="include"> | |||
<File Name="bdd.h"/> | |||
@@ -32,6 +34,7 @@ | |||
<File Name="cosmosGUI.h"/> | |||
<File Name="correcGUI.h"/> | |||
<File Name="optionsRcheGUI.h"/> | |||
<File Name="RcheGUI.h"/> | |||
</VirtualDirectory> | |||
<File Name="config.h"/> | |||
<File Name="options.h"/> | |||
@@ -39,6 +42,7 @@ | |||
<File Name="optionsRche.h"/> | |||
<File Name="recherche.h"/> | |||
<File Name="misc.h"/> | |||
<File Name="rche.h"/> | |||
</VirtualDirectory> | |||
<VirtualDirectory Name="resources"> | |||
<File Name="cosmos.fbp"/> | |||
@@ -53,6 +57,7 @@ | |||
</VirtualDirectory> | |||
<File Name="correc.fbp"/> | |||
<File Name="optionsRche.fbp"/> | |||
<File Name="rche.fbp"/> | |||
</VirtualDirectory> | |||
<VirtualDirectory Name="tinyxml"> | |||
<File Name="tinyxml2.h"/> | |||
@@ -228,4 +233,8 @@ | |||
</Completion> | |||
</Configuration> | |||
</Settings> | |||
<Dependencies Name="Debug"/> | |||
<Dependencies Name="Debug_WIN"/> | |||
<Dependencies Name="Release"/> | |||
<Dependencies Name="Release_WIN"/> | |||
</CodeLite_Project> |
@@ -0,0 +1,136 @@ | |||
/////////////////////////////////////////////////////////////////////////// | |||
// C++ code generated with wxFormBuilder (version Sep 8 2010) | |||
// http://www.wxformbuilder.org/ | |||
// | |||
// PLEASE DO "NOT" EDIT THIS FILE! | |||
/////////////////////////////////////////////////////////////////////////// | |||
#include "RcheGUI.h" | |||
/////////////////////////////////////////////////////////////////////////// | |||
dialog_rche::dialog_rche( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) | |||
{ | |||
this->SetSizeHints( wxDefaultSize, wxDefaultSize ); | |||
wxBoxSizer* verticalsizer; | |||
verticalsizer = new wxBoxSizer( wxVERTICAL ); | |||
wxBoxSizer* horizontalsizer; | |||
horizontalsizer = new wxBoxSizer( wxHORIZONTAL ); | |||
grid_publis = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); | |||
// Grid | |||
grid_publis->CreateGrid( 0, 1 ); | |||
grid_publis->EnableEditing( false ); | |||
grid_publis->EnableGridLines( false ); | |||
grid_publis->EnableDragGridSize( false ); | |||
grid_publis->SetMargins( 0, 0 ); | |||
// Columns | |||
grid_publis->EnableDragColMove( false ); | |||
grid_publis->EnableDragColSize( true ); | |||
grid_publis->SetColLabelSize( 0 ); | |||
grid_publis->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); | |||
// Rows | |||
grid_publis->EnableDragRowSize( true ); | |||
grid_publis->SetRowLabelSize( 0 ); | |||
grid_publis->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); | |||
// Label Appearance | |||
// Cell Defaults | |||
grid_publis->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); | |||
horizontalsizer->Add( grid_publis, 1, wxALL|wxEXPAND, 5 ); | |||
wxBoxSizer* sizer_detail; | |||
sizer_detail = new wxBoxSizer( wxVERTICAL ); | |||
statictext_titre = new wxStaticText( this, wxID_ANY, wxT("Titre :"), wxDefaultPosition, wxDefaultSize, 0 ); | |||
statictext_titre->Wrap( -1 ); | |||
sizer_detail->Add( statictext_titre, 0, wxALL, 5 ); | |||
textctrl_titre = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_WORDWRAP ); | |||
sizer_detail->Add( textctrl_titre, 0, wxALL|wxEXPAND, 5 ); | |||
statictext_auteurs = new wxStaticText( this, wxID_ANY, wxT("Auteurs :"), wxDefaultPosition, wxDefaultSize, 0 ); | |||
statictext_auteurs->Wrap( -1 ); | |||
sizer_detail->Add( statictext_auteurs, 0, wxALL|wxEXPAND, 5 ); | |||
textctrl_auteurs = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_WORDWRAP ); | |||
sizer_detail->Add( textctrl_auteurs, 0, wxALL|wxEXPAND, 5 ); | |||
statictext_abstract = new wxStaticText( this, wxID_ANY, wxT("Abstract :"), wxDefaultPosition, wxDefaultSize, 0 ); | |||
statictext_abstract->Wrap( -1 ); | |||
sizer_detail->Add( statictext_abstract, 0, wxALL|wxEXPAND, 5 ); | |||
textctrl_abstract = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxTE_WORDWRAP ); | |||
sizer_detail->Add( textctrl_abstract, 1, wxALL|wxEXPAND, 5 ); | |||
statictext_revue = new wxStaticText( this, wxID_ANY, wxT("Revue :"), wxDefaultPosition, wxDefaultSize, 0 ); | |||
statictext_revue->Wrap( -1 ); | |||
sizer_detail->Add( statictext_revue, 0, wxALL|wxEXPAND, 5 ); | |||
textctrl_revue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_WORDWRAP ); | |||
sizer_detail->Add( textctrl_revue, 0, wxALL|wxEXPAND, 5 ); | |||
statictext_date = new wxStaticText( this, wxID_ANY, wxT("Date de publication :"), wxDefaultPosition, wxDefaultSize, 0 ); | |||
statictext_date->Wrap( -1 ); | |||
sizer_detail->Add( statictext_date, 0, wxALL|wxEXPAND, 5 ); | |||
hyperlink_lien = new wxHyperlinkCtrl( this, wxID_ANY, wxT("Lien vers la page PubMed"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); | |||
sizer_detail->Add( hyperlink_lien, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); | |||
wxString m_radioBox1Choices[] = { wxT("Publi"), wxT("Publi CHU"), wxT("Consultant associé"), wxT("Pas cette publi") }; | |||
int m_radioBox1NChoices = sizeof( m_radioBox1Choices ) / sizeof( wxString ); | |||
m_radioBox1 = new wxRadioBox( this, wxID_ANY, wxT("Publication"), wxDefaultPosition, wxDefaultSize, m_radioBox1NChoices, m_radioBox1Choices, 3, wxRA_SPECIFY_COLS ); | |||
m_radioBox1->SetSelection( 0 ); | |||
sizer_detail->Add( m_radioBox1, 0, wxALL|wxEXPAND, 5 ); | |||
horizontalsizer->Add( sizer_detail, 3, wxEXPAND, 5 ); | |||
verticalsizer->Add( horizontalsizer, 1, wxEXPAND, 5 ); | |||
wxBoxSizer* sizer_boutons; | |||
sizer_boutons = new wxBoxSizer( wxHORIZONTAL ); | |||
bouton_prec = new wxButton( this, wxID_ANY, wxT("<---"), wxDefaultPosition, wxDefaultSize, 0 ); | |||
sizer_boutons->Add( bouton_prec, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | |||
bouton_suiv = new wxButton( this, wxID_ANY, wxT("--->"), wxDefaultPosition, wxDefaultSize, 0 ); | |||
sizer_boutons->Add( bouton_suiv, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | |||
sizer_boutons->Add( 0, 0, 1, wxEXPAND, 5 ); | |||
bouton_ok = new wxButton( this, wxID_ANY, wxT("Ok"), wxDefaultPosition, wxDefaultSize, 0 ); | |||
sizer_boutons->Add( bouton_ok, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | |||
verticalsizer->Add( sizer_boutons, 0, wxEXPAND, 5 ); | |||
this->SetSizer( verticalsizer ); | |||
this->Layout(); | |||
verticalsizer->Fit( this ); | |||
this->Centre( wxBOTH ); | |||
// Connect Events | |||
grid_publis->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( dialog_rche::OnCellClick ), NULL, this ); | |||
m_radioBox1->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( dialog_rche::OnRadio ), NULL, this ); | |||
bouton_prec->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_rche::OnPrev ), NULL, this ); | |||
bouton_suiv->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_rche::OnNext ), NULL, this ); | |||
bouton_ok->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_rche::OnOk ), NULL, this ); | |||
} | |||
dialog_rche::~dialog_rche() | |||
{ | |||
// Disconnect Events | |||
grid_publis->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( dialog_rche::OnCellClick ), NULL, this ); | |||
m_radioBox1->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( dialog_rche::OnRadio ), NULL, this ); | |||
bouton_prec->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_rche::OnPrev ), NULL, this ); | |||
bouton_suiv->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_rche::OnNext ), NULL, this ); | |||
bouton_ok->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( dialog_rche::OnOk ), NULL, this ); | |||
} |
@@ -0,0 +1,68 @@ | |||
/////////////////////////////////////////////////////////////////////////// | |||
// C++ code generated with wxFormBuilder (version Sep 8 2010) | |||
// http://www.wxformbuilder.org/ | |||
// | |||
// PLEASE DO "NOT" EDIT THIS FILE! | |||
/////////////////////////////////////////////////////////////////////////// | |||
#ifndef __RcheGUI__ | |||
#define __RcheGUI__ | |||
#include <wx/colour.h> | |||
#include <wx/settings.h> | |||
#include <wx/string.h> | |||
#include <wx/font.h> | |||
#include <wx/grid.h> | |||
#include <wx/gdicmn.h> | |||
#include <wx/stattext.h> | |||
#include <wx/textctrl.h> | |||
#include <wx/hyperlink.h> | |||
#include <wx/radiobox.h> | |||
#include <wx/sizer.h> | |||
#include <wx/button.h> | |||
#include <wx/dialog.h> | |||
/////////////////////////////////////////////////////////////////////////// | |||
/////////////////////////////////////////////////////////////////////////////// | |||
/// Class dialog_rche | |||
/////////////////////////////////////////////////////////////////////////////// | |||
class dialog_rche : public wxDialog | |||
{ | |||
private: | |||
protected: | |||
wxGrid* grid_publis; | |||
wxStaticText* statictext_titre; | |||
wxTextCtrl* textctrl_titre; | |||
wxStaticText* statictext_auteurs; | |||
wxTextCtrl* textctrl_auteurs; | |||
wxStaticText* statictext_abstract; | |||
wxTextCtrl* textctrl_abstract; | |||
wxStaticText* statictext_revue; | |||
wxTextCtrl* textctrl_revue; | |||
wxStaticText* statictext_date; | |||
wxHyperlinkCtrl* hyperlink_lien; | |||
wxRadioBox* m_radioBox1; | |||
wxButton* bouton_prec; | |||
wxButton* bouton_suiv; | |||
wxButton* bouton_ok; | |||
// Virtual event handlers, overide them in your derived class | |||
virtual void OnCellClick( wxGridEvent& event ) { event.Skip(); } | |||
virtual void OnRadio( wxCommandEvent& event ) { event.Skip(); } | |||
virtual void OnPrev( wxCommandEvent& event ) { event.Skip(); } | |||
virtual void OnNext( wxCommandEvent& event ) { event.Skip(); } | |||
virtual void OnOk( wxCommandEvent& event ) { event.Skip(); } | |||
public: | |||
dialog_rche( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Résultats"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); | |||
~dialog_rche(); | |||
}; | |||
#endif //__RcheGUI__ |
@@ -371,12 +371,13 @@ bool class_bdd::publiexists(const wxString& id) | |||
return true; | |||
} | |||
void class_bdd::addpubli(wxString titre, wxString auteurs, wxString abstract, wxString revue, wxString lien, wxString date) | |||
void class_bdd::addpubli(wxString id, wxString titre, wxString auteurs, wxString abstract, wxString revue, wxString lien, wxString date) | |||
{ | |||
titre.Replace("\"", "_"); | |||
abstract.Replace("\"", "_"); | |||
wxString requete = "INSERT OR REPLACE INTO Publi (titre, auteurs, abstract, revue, lien, date_publi) VALUES ("; | |||
requete << "\"" << titre << "\", " | |||
wxString requete = "INSERT OR REPLACE INTO Publi (id, titre, auteurs, abstract, revue, lien, date_publi) VALUES ("; | |||
requete << id << ", " | |||
<< "\"" << titre << "\", " | |||
<< "\"" << auteurs << "\", " | |||
<< "\"" << abstract << "\", " | |||
<< "\"" << revue << "\", " | |||
@@ -41,7 +41,7 @@ class class_bdd | |||
void addidresult(const wxString& id, const wxString& idresult); | |||
bool publiexists(const wxString& id); | |||
void addpubli(wxString titre, wxString auteurs, wxString abstract, wxString revue, wxString lien, wxString date); | |||
void addpubli(wxString id, wxString titre, wxString auteurs, wxString abstract, wxString revue, wxString lien, wxString date); | |||
}; | |||
#endif //__bdd__ |
@@ -0,0 +1,33 @@ | |||
#include "rche.h" | |||
rche::rche( wxWindow* parent ) | |||
: | |||
dialog_rche( parent ) | |||
{ | |||
} | |||
void rche::OnCellClick( wxGridEvent& event ) | |||
{ | |||
// TODO: Implement OnCellClick | |||
} | |||
void rche::OnRadio( wxCommandEvent& event ) | |||
{ | |||
// TODO: Implement OnRadio | |||
} | |||
void rche::OnPrev( wxCommandEvent& event ) | |||
{ | |||
// TODO: Implement OnPrev | |||
} | |||
void rche::OnNext( wxCommandEvent& event ) | |||
{ | |||
// TODO: Implement OnNext | |||
} | |||
void rche::OnOk( wxCommandEvent& event ) | |||
{ | |||
// TODO: Implement OnOk | |||
} |
@@ -0,0 +1,30 @@ | |||
#ifndef __rche__ | |||
#define __rche__ | |||
/** | |||
@file | |||
Subclass of dialog_rche, which is generated by wxFormBuilder. | |||
*/ | |||
#include "RcheGUI.h" | |||
//// end generated include | |||
/** Implementing dialog_rche */ | |||
class rche : public dialog_rche | |||
{ | |||
protected: | |||
// Handlers for dialog_rche events. | |||
void OnCellClick( wxGridEvent& event ); | |||
void OnRadio( wxCommandEvent& event ); | |||
void OnPrev( wxCommandEvent& event ); | |||
void OnNext( wxCommandEvent& event ); | |||
void OnOk( wxCommandEvent& event ); | |||
public: | |||
/** Constructor */ | |||
rche( wxWindow* parent ); | |||
//// end generated class members | |||
}; | |||
#endif // __rche__ |
@@ -96,10 +96,11 @@ void class_recherche::parsefetch() | |||
parcours = parcours->FirstChildElement("PubmedArticle"); | |||
do | |||
{ | |||
wxString titre, auteurs, abstract, revue, lien, date; | |||
wxString id, titre, auteurs, abstract, revue, lien, date; | |||
parcours = parcours->FirstChildElement("MedlineCitation"); //MedlineCitation | |||
lien << "http://www.ncbi.nlm.nih.gov/pubmed/" << parcours->FirstChildElement("PMID")->GetText();// PMID | |||
id << parcours->FirstChildElement("PMID")->GetText(); // PMID | |||
lien << "http://www.ncbi.nlm.nih.gov/pubmed/" << id; | |||
parcours = parcours->FirstChildElement("Article"); // Article | |||
parcours = parcours->FirstChildElement("Journal"); // Journal | |||
parcours = parcours->FirstChildElement("JournalIssue"); // JournalIssue | |||
@@ -144,7 +145,7 @@ void class_recherche::parsefetch() | |||
auteurs = auteurs.BeforeLast(','); | |||
parcours = parcours->Parent()->Parent()->Parent()->ToElement()->NextSiblingElement("PubmedArticle"); | |||
bdd->addpubli(titre, auteurs, abstract, revue, lien, date); | |||
bdd->addpubli(id, titre, auteurs, abstract, revue, lien, date); | |||
}while(parcours); | |||
delete(doc); | |||
@@ -36,7 +36,7 @@ | |||
<Project Name="testcurl" ConfigName="Debug_WIN"/> | |||
<Project Name="testsqlite" ConfigName="Debug_WIN"/> | |||
</WorkspaceConfiguration> | |||
<WorkspaceConfiguration Name="Release_WIN" Selected="no"> | |||
<WorkspaceConfiguration Name="Release_WIN" Selected="yes"> | |||
<Project Name="CosMoS" ConfigName="Release_WIN"/> | |||
<Project Name="grid" ConfigName="Release_WIN"/> | |||
<Project Name="testcurl" ConfigName="Release_WIN"/> | |||
@@ -23,38 +23,26 @@ | |||
</TabInfo> | |||
<TabInfo> | |||
<wxString Value="C:\Projets\CosMoS\bdd.h" Name="FileName"/> | |||
<int Value="16" Name="FirstVisibleLine"/> | |||
<int Value="44" Name="CurrentLine"/> | |||
<int Value="2" Name="FirstVisibleLine"/> | |||
<int Value="43" Name="CurrentLine"/> | |||
<wxArrayString Name="Bookmarks"/> | |||
</TabInfo> | |||
<TabInfo> | |||
<wxString Value="C:\Projets\CosMoS\bdd.cpp" Name="FileName"/> | |||
<int Value="346" Name="FirstVisibleLine"/> | |||
<int Value="375" Name="CurrentLine"/> | |||
<int Value="343" Name="FirstVisibleLine"/> | |||
<int Value="364" Name="CurrentLine"/> | |||
<wxArrayString Name="Bookmarks"/> | |||
</TabInfo> | |||
<TabInfo> | |||
<wxString Value="C:\Projets\CosMoS\recherche.h" Name="FileName"/> | |||
<int Value="0" Name="FirstVisibleLine"/> | |||
<int Value="8" Name="FirstVisibleLine"/> | |||
<int Value="8" Name="CurrentLine"/> | |||
<wxArrayString Name="Bookmarks"/> | |||
</TabInfo> | |||
<TabInfo> | |||
<wxString Value="C:\Projets\CosMoS\recherche.cpp" Name="FileName"/> | |||
<int Value="101" Name="FirstVisibleLine"/> | |||
<int Value="116" Name="CurrentLine"/> | |||
<wxArrayString Name="Bookmarks"/> | |||
</TabInfo> | |||
<TabInfo> | |||
<wxString Value="C:\Projets\CosMoS\config.cpp" Name="FileName"/> | |||
<int Value="87" Name="FirstVisibleLine"/> | |||
<int Value="126" Name="CurrentLine"/> | |||
<wxArrayString Name="Bookmarks"/> | |||
</TabInfo> | |||
<TabInfo> | |||
<wxString Value="C:\Projets\CosMoS\tinyxml2.cpp" Name="FileName"/> | |||
<int Value="146" Name="FirstVisibleLine"/> | |||
<int Value="161" Name="CurrentLine"/> | |||
<int Value="102" Name="CurrentLine"/> | |||
<wxArrayString Name="Bookmarks"/> | |||
</TabInfo> | |||
</TabInfoArray> | |||
@@ -158,4 +158,8 @@ | |||
</Completion> | |||
</Configuration> | |||
</Settings> | |||
<Dependencies Name="Debug"/> | |||
<Dependencies Name="Debug_WIN"/> | |||
<Dependencies Name="Release"/> | |||
<Dependencies Name="Release_WIN"/> | |||
</CodeLite_Project> |
@@ -178,4 +178,8 @@ | |||
</Completion> | |||
</Configuration> | |||
</Settings> | |||
<Dependencies Name="Debug"/> | |||
<Dependencies Name="Debug_WIN"/> | |||
<Dependencies Name="Release"/> | |||
<Dependencies Name="Release_WIN"/> | |||
</CodeLite_Project> |
@@ -169,4 +169,8 @@ | |||
</Completion> | |||
</Configuration> | |||
</Settings> | |||
<Dependencies Name="Debug"/> | |||
<Dependencies Name="Debug_WIN"/> | |||
<Dependencies Name="Release"/> | |||
<Dependencies Name="Release_WIN"/> | |||
</CodeLite_Project> |