NCBI C++ ToolKit
publicationtype_panel.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: publicationtype_panel.cpp 47405 2023-03-14 16:17:24Z asztalos $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Colleen Bollin
27  */
28 
29 
30 #include <ncbi_pch.hpp>
31 #include <objects/seq/Pubdesc.hpp>
33 #include <objects/pub/Pub.hpp>
42 #include <objects/biblio/Affil.hpp>
45 #include <objects/biblio/Title.hpp>
52 
53 ////@begin includes
54 #include "wx/imaglist.h"
55 ////@end includes
56 
57 #include <wx/sizer.h>
58 #include <wx/bitmap.h>
59 #include <wx/icon.h>
60 #include <wx/choice.h>
61 #include <wx/textctrl.h>
62 #include <wx/stattext.h>
63 #include <wx/valtext.h>
64 
68 #include "journal_panel.hpp"
69 #include "book_panel.hpp"
70 #include "bookchapter_panel.hpp"
71 #include "citsub_panel.hpp"
72 #include "locale_panel.hpp"
74 #include "patent_panel.hpp"
75 #include "proceedings_panel.hpp"
77 #include "publisher_panel.hpp"
79 #include "titlepanel.hpp"
82 
85 
86 ////@begin XPM images
87 ////@end XPM images
88 
89 
90 /*
91  * CPublicationTypePanel type definition
92  */
93 
94 IMPLEMENT_DYNAMIC_CLASS( CPublicationTypePanel, wxPanel )
95 
96 
97 /*
98  * CPublicationTypePanel event table definition
99  */
100 
101 BEGIN_EVENT_TABLE( CPublicationTypePanel, wxPanel )
102 
103 ////@begin CPublicationTypePanel event table entries
107 ////@end CPublicationTypePanel event table entries
108 
110 
111 
112 /*
113  * CPublicationTypePanel constructors
114  */
115 
117 {
118  Init();
119 }
120 
122  bool create_mode, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
123  : m_SerialNumber(0), m_CreateMode(create_mode), m_CurrentStatus(0), m_CurrentType(ePubTypeJournalArticle), m_Pmid(0), m_Muid(0), m_PublisherPanel(0)
124 {
125  Init();
126  m_Pubdesc = new objects::CPubdesc();
127  if (pubdesc) {
128  m_Pubdesc->Assign(*pubdesc);
129  }
130  Create(parent, id, pos, size, style);
131 }
132 
133 
134 /*
135  * CPublicationTypePanel creator
136  */
137 
138 bool CPublicationTypePanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
139 {
140 ////@begin CPublicationTypePanel creation
141  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
142  wxPanel::Create( parent, id, pos, size, style );
143 
144  CreateControls();
145  if (GetSizer())
146  {
147  GetSizer()->SetSizeHints(this);
148  }
149  Centre();
150 ////@end CPublicationTypePanel creation
151  return true;
152 }
153 
154 
155 /*
156  * CPublicationTypePanel destructor
157  */
158 
160 {
161 ////@begin CPublicationTypePanel destruction
162 ////@end CPublicationTypePanel destruction
163 }
164 
165 
166 /*
167  * Member initialisation
168  */
169 
171 {
172 ////@begin CPublicationTypePanel member initialisation
173  m_Status = NULL;
174  m_PubClass = NULL;
176 ////@end CPublicationTypePanel member initialisation
182  m_PmidCtrl = NULL;
184 }
185 
186 
187 /*
188  * Control creation for CPublicationTypePanel
189  */
190 
192 {
193 ////@begin CPublicationTypePanel content construction
194  CPublicationTypePanel* itemPanel1 = this;
195 
196  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
197  itemPanel1->SetSizer(itemBoxSizer2);
198 
199  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
200  itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_TOP|wxALL, 5);
201 
202  wxArrayString m_StatusStrings;
203  m_StatusStrings.Add(_("&Unpublished"));
204  m_StatusStrings.Add(_("&In Press"));
205  m_StatusStrings.Add(_("&Published"));
206  m_Status = new wxRadioBox( itemPanel1, ID_UNPUB_INPRESS_PUB, _("Status"), wxDefaultPosition, wxDefaultSize, m_StatusStrings, 1, wxRA_SPECIFY_COLS );
207  m_Status->SetSelection(0);
208  itemBoxSizer3->Add(m_Status, 0, wxGROW|wxALL, 5);
209 
210  wxArrayString m_PubClassStrings;
211  m_PubClassStrings.Add(_("&Journal"));
212  m_PubClassStrings.Add(_("Book &Chapter"));
213  m_PubClassStrings.Add(_("&Book"));
214  m_PubClassStrings.Add(_("&Thesis/Monograph"));
215  m_PubClassStrings.Add(_("&Proceedings Chapter"));
216  m_PubClassStrings.Add(_("&Proceedings"));
217  m_PubClassStrings.Add(_("&Patent"));
218  m_PubClassStrings.Add(_("&Submission"));
219  m_PubClass = new wxRadioBox( itemPanel1, ID_PUBCLASS, _("Class"), wxDefaultPosition, wxDefaultSize, m_PubClassStrings, 1, wxRA_SPECIFY_COLS );
220  m_PubClass->SetSelection(0);
221  itemBoxSizer3->Add(m_PubClass, 0, wxGROW|wxALL, 5);
222 
223  wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL);
224  itemBoxSizer2->Add(itemBoxSizer6, 1, wxGROW|wxALL, 0);
225 
226  m_PubdescDetails = new wxNotebook( itemPanel1, ID_TREEBOOK, wxDefaultPosition, wxSize(700, 630), wxBK_DEFAULT );
227 
228  itemBoxSizer6->Add(m_PubdescDetails, 1, wxALIGN_LEFT|wxALL, 5);
229 
230  itemBoxSizer6->Add(500, 0, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
231 
232 ////@end CPublicationTypePanel content construction
233  wxWindow* panel;
235  m_PubdescDetails->AddPage (panel, wxT("Remarks"));
236 
237  wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
238  itemBoxSizer6->Add(itemBoxSizer7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
239 
240  m_PmidCtrl = new wxTextCtrl( itemPanel1, ID_DOI_PMID, wxEmptyString, wxDefaultPosition, wxSize(200, -1), 0 );
241  itemBoxSizer7->Add(m_PmidCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
242 
243  m_LookupButton = new wxButton( itemPanel1, ID_DOI_LOOKUP, _("Lookup DOI/PMID"), wxDefaultPosition, wxDefaultSize, 0 );
244  itemBoxSizer7->Add(m_LookupButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
245 }
246 
247 static bool s_IsOnlySetSerialNumber(const CCit_gen& gen)
248 {
249  if (gen.IsSetSerial_number()) {
250  if (!gen.IsSetCit()
251  && !gen.IsSetAuthors()
252  && !gen.IsSetMuid()
253  && !gen.IsSetJournal()
254  && !gen.IsSetVolume()
255  && !gen.IsSetIssue()
256  && !gen.IsSetPages()
257  && !gen.IsSetDate()
258  && !gen.IsSetTitle()
259  && !gen.IsSetPmid()) {
260  return true;
261  }
262  }
263  return false;
264 }
265 
266 
268 {
269  CRef<CPub> main_pub;
270 
271  NON_CONST_ITERATE (CPub_equiv::Tdata, pub_it, m_Pubdesc->SetPub().Set()) {
272  switch ((*pub_it)->Which()) {
273  case CPub::e_Muid:
274  m_Muid = ENTREZ_ID_TO(long, (*pub_it)->GetMuid());
275  break;
276  case CPub::e_Pmid:
277  m_Pmid = ENTREZ_ID_TO(long, (*pub_it)->GetPmid().Get());
278  break;
279  case CPub::e_Gen:
280  {
281  if ((*pub_it)->GetGen().IsSetSerial_number()) {
282  m_SerialNumber = (*pub_it)->GetGen().GetSerial_number();
283  if (s_IsOnlySetSerialNumber((*pub_it)->GetGen())) {
284  break;
285  }
286  }
287  }
288  // note - deliberately falling through to default case
289  default:
290  if (!main_pub) {
291  main_pub = *pub_it;
292  }
293  break;
294  }
295  }
296 
297  if (!main_pub) {
299  if (m_Pmid > 0 || m_Muid > 0) {
300  m_CurrentStatus = 2;
301  } else {
302  m_CurrentStatus = 0;
303  }
304 
305  main_pub = x_GetMainPub();
306  }
307  Freeze();
308  x_CreatePubControls (main_pub);
309  wxWindow* panel;
311  m_PubdescDetails->AddPage (panel, wxT("Remarks"));
312 
313  if (m_Pmid > 0)
314  m_PmidCtrl->SetValue(wxString::Format(wxT("%ld"), m_Pmid));
315  else {
316  if (m_Pubdesc->IsSetPub() && m_Pubdesc->GetPub().IsSet()) {
317  ITERATE(CPubdesc::TPub::Tdata, it, m_Pubdesc->GetPub().Get()) {
318  if ((*it)->IsArticle()) {
319  if ((*it)->GetArticle().IsSetIds()) {
320  ITERATE(CArticleIdSet::Tdata, id, (*it)->GetArticle().GetIds().Get()) {
321  if ((*id)->IsDoi()) {
322  m_PmidCtrl->SetValue(wxString((*id)->GetDoi()));
323  break;
324  }
325  }
326  }
327  }
328  }
329  }
330  }
331 
332  x_SetStatusAndClass (main_pub);
333  if (m_CurrentType == ePubTypeSub) {
334  m_PubClass->Enable(false);
335  m_PubdescDetails->SetSelection(2);
336  } else if (!m_CreateMode) {
337  m_PubClass->Enable(ePubTypeSub, false);
338  }
339 
340  m_PubdescDetails->TransferDataToWindow();
341  for (size_t i = 0; i < m_PubdescDetails->GetPageCount(); ++i) {
342  m_PubdescDetails->GetPage(i)->TransferDataToWindow();
343  }
344  Thaw();
345  Refresh();
346 
347  return wxPanel::TransferDataToWindow();
348 }
349 
350 
352 {
353  if (imprint.IsSetPrepub() && imprint.GetPrepub() == CImprint::ePrepub_in_press) {
354  m_CurrentStatus = 1;
355  }
356  else if (imprint.IsSetPubstatus() && imprint.GetPubstatus() == ePubStatus_aheadofprint) {
357  m_CurrentStatus = 1;
358  }
359  else
360  {
361  m_CurrentStatus = 2;
362  }
363 }
364 
365 
367 {
368  if (!pub) {
369  m_CurrentStatus = 0;
371  } else {
372  switch (pub->Which()) {
373  case CPub::e_Gen:
374  m_CurrentStatus = 0;
375  break;
376  case CPub::e_Article:
377  {
378  objects::CCit_art& art = pub->SetArticle();
379  if (art.IsSetFrom())
380  {
381  switch (art.GetFrom().Which())
382  {
383  case objects::CCit_art::C_From::e_Journal:
384  x_SetStatus (art.SetFrom().SetJournal().SetImp());
386  break;
387  case objects::CCit_art::C_From::e_Book:
388  x_SetStatus (art.SetFrom().SetBook().SetImp());
390  break;
391  case objects::CCit_art::C_From::e_Proc:
392  x_SetStatus (art.SetFrom().SetProc().SetBook().SetImp());
394  break;
395  default:
396  m_CurrentStatus = 0;
398  break;
399  }
400  } else {
401  m_CurrentStatus = 0;
403  }
404  }
405  break;
406  case CPub::e_Book:
407  x_SetStatus (pub->SetBook().SetImp());
409  break;
410  case CPub::e_Proc:
411  m_CurrentStatus = 2;
413  break;
414  case CPub::e_Sub:
416  break;
417  case CPub::e_Patent:
418  m_CurrentStatus = 2;
420  break;
421  case CPub::e_Man:
422  x_SetStatus (pub->SetMan().SetCit().SetImp());
424  break;
425  case CPub::e_Pmid:
426  case CPub::e_Muid:
427  m_CurrentStatus = 2;
429  break;
430  default:
431  m_CurrentStatus = 0;
433  break;
434  }
435  }
436 
437  if (m_CurrentType == ePubTypeSub) {
438  m_PubClass->SetSelection(ePubTypeSub);
439  m_Status->Enable(false);
440  m_PmidCtrl->Hide();
441  m_LookupButton->Hide();
442  } else {
443  m_Status->SetSelection(m_CurrentStatus);
444  m_Status->Enable(true);
445  m_PmidCtrl->Show();
446  m_LookupButton->Show();
447  if (m_CurrentStatus == 0) {
448  m_Status->Enable(true);
449  m_PubClass->Enable(false);
450  } else {
451  m_PubClass->Enable(true);
452  m_PubClass->SetSelection(m_CurrentType);
454  m_Status->Enable(1, false);
455  } else {
456  m_Status->Enable(1, true);
457  }
458  if (!m_CreateMode) {
459  m_PubClass->Enable(ePubTypeSub, false);
460  }
461  }
462  }
463 }
464 
465 
467 {
468  if (!pub) {
469  return false;
470  }
471  if (pub->IsArticle() && pub->GetArticle().IsSetFrom() && pub->GetArticle().GetFrom().IsJournal()) {
472  return true;
473  } else {
474  return false;
475  }
476 }
477 
478 
479 static bool s_IsProcChapter (CRef<CPub> pub)
480 {
481  if (!pub) {
482  return false;
483  }
484  if (pub->IsArticle() && pub->GetArticle().IsSetFrom() && pub->GetArticle().GetFrom().IsProc()) {
485  return true;
486  } else {
487  return false;
488  }
489 }
490 
491 
492 static bool s_IsBookChapter (CRef<CPub> pub)
493 {
494  if (!pub) {
495  return false;
496  }
497  if (pub->IsArticle() && pub->GetArticle().IsSetFrom() && pub->GetArticle().GetFrom().IsBook()) {
498  return true;
499  } else {
500  return false;
501  }
502 }
503 
504 
506 {
507  if (!m_Pubdesc->IsSetPub() || m_Pubdesc->GetPub().Get().size() == 0) {
508  return CRef<CPub>(NULL);
509  }
510 
511  bool found = false;
512 
513  CPub_equiv::Tdata::iterator pub_it = m_Pubdesc->SetPub().Set().begin();
514  while (pub_it != m_Pubdesc->SetPub().Set().end() && !found) {
515  if (pub_type == ePubTypeSub) {
516  // looking for citsub
517  if ((*pub_it)->IsSub()) {
518  found = true;
519  }
520  } else if (status == 0) {
521  // looking for unpublished pub
522  if ((*pub_it)->IsGen()) {
523  found = true;
524  }
525  } else {
526  switch (pub_type) {
528  if (s_IsJournalArticle(*pub_it)) {
529  found = true;
530  }
531  break;
532  case ePubTypeBookChapter:
533  if (s_IsBookChapter(*pub_it)) {
534  found = true;
535  }
536  break;
537  case ePubTypeProcChapter:
538  if (s_IsProcChapter(*pub_it)) {
539  found = true;
540  }
541  break;
542  case ePubTypeBook:
543  if ((*pub_it)->IsBook()) {
544  found = true;
545  }
546  break;
547  case ePubTypeThesis:
548  if ((*pub_it)->IsMan()) {
549  found = true;
550  }
551  break;
552  case ePubTypeProc:
553  if ((*pub_it)->IsProc()) {
554  found = true;
555  }
556  break;
557  case ePubTypePatent:
558  if ((*pub_it)->IsPatent()) {
559  found = true;
560  }
561  break;
562  default:
563  break;
564  }
565  }
566  if (!found) {
567  pub_it++;
568  }
569  }
570  if (found) {
571  if (pub_it != m_Pubdesc->SetPub().Set().begin()) {
572  CRef<CPub> tmp(new CPub());
573  tmp->Assign(**pub_it);
574  m_Pubdesc->SetPub().Set().erase(pub_it);
575  m_Pubdesc->SetPub().Set().insert(m_Pubdesc->SetPub().Set().begin(), tmp);
576  return tmp;
577  } else {
578  return *pub_it;
579  }
580  } else {
581  return CRef<CPub>(NULL);
582  }
583 }
584 
585 
587 {
588  CRef<objects::CPub> main_pub;
589 
590  NON_CONST_ITERATE (CPub_equiv::Tdata, pub_it, m_Pubdesc->SetPub().Set()) {
591  if (m_CurrentType == ePubTypeSub) {
592  // looking for citsub
593  if ((*pub_it)->IsSub()) {
594  main_pub = *pub_it;
595  break;
596  }
597  } else if (m_CurrentStatus == 0) {
598  // looking for unpublished pub
599  if ((*pub_it)->IsGen()) {
600  main_pub = *pub_it;
601  break;
602  }
603  } else {
604  switch (m_CurrentType) {
606  if (s_IsJournalArticle(*pub_it)) {
607  main_pub = *pub_it;
608  }
609  break;
610  case ePubTypeBookChapter:
611  if (s_IsBookChapter(*pub_it)) {
612  main_pub = *pub_it;
613  }
614  break;
615  case ePubTypeProcChapter:
616  if (s_IsProcChapter(*pub_it)) {
617  main_pub = *pub_it;
618  }
619  break;
620  case ePubTypeBook:
621  if ((*pub_it)->IsBook()) {
622  main_pub = *pub_it;
623  }
624  break;
625  case ePubTypeThesis:
626  if ((*pub_it)->IsMan()) {
627  main_pub = *pub_it;
628  }
629  break;
630  case ePubTypeProc:
631  if ((*pub_it)->IsProc()) {
632  main_pub = *pub_it;
633  }
634  break;
635  case ePubTypePatent:
636  if ((*pub_it)->IsPatent()) {
637  main_pub = *pub_it;
638  }
639  break;
640  default:
641  break;
642  }
643  }
644  }
645 
646  if (!main_pub) {
647  // TODO might be secondary identifier
648  }
649 
650  if (!main_pub) {
651  // create new pub to hold data
652  CRef<objects::CPub> new_pub(new CPub());
653  if (m_CurrentType == ePubTypeSub) {
654  new_pub->SetSub();
655  } else if (m_CurrentStatus == 0) {
656  new_pub->SetGen().SetCit("unpublished");
657  } else {
658  switch (m_CurrentType) {
660  new_pub->SetArticle().SetFrom().SetJournal();
661  break;
662  case ePubTypeBookChapter:
663  new_pub->SetArticle().SetFrom().SetBook();
664  break;
665  case ePubTypeBook:
666  new_pub->SetBook();
667  break;
668  case ePubTypeThesis:
669  new_pub->SetMan();
670  break;
671  case ePubTypeProcChapter:
672  new_pub->SetArticle().SetFrom().SetProc();
673  break;
674  case ePubTypeProc:
675  new_pub->SetProc();
676  break;
677  case ePubTypePatent:
678  new_pub->SetPatent();
679  break;
680  default:
681  new_pub->SetGen().SetCit("unpublished");
682  break;
683  }
684  main_pub = new_pub;
685  }
686  m_Pubdesc->SetPub().Set().insert(m_Pubdesc->SetPub().Set().begin(), new_pub);
687  main_pub = new_pub;
688  }
689 
691  return main_pub;
692 }
693 
694 
696 {
697  m_PubdescDetails->DeleteAllPages();
703  switch (pub->Which()) {
704  case CPub::e_Gen:
706  break;
707  case CPub::e_Article:
708  if (s_IsJournalArticle(pub)) {
710  } else if (s_IsBookChapter (pub)) {
712  } else if (s_IsProcChapter (pub)) {
714  } else {
716  }
717  break;
718  case CPub::e_Book:
719  x_CreateBookControls(pub->SetBook(), false);
720  break;
721  case CPub::e_Proc:
723  break;
724  case CPub::e_Sub:
725  x_CreateSubControls(pub->SetSub());
726  break;
727  case CPub::e_Patent:
729  break;
730  case CPub::e_Man:
732  break;
733  default:
734  x_CreateUnpubControls (pub->SetGen());
735  break;
736  }
737 }
738 
739 
740 void CPublicationTypePanel::x_CreateUnpubControls(objects::CCit_gen& cit_gen)
741 {
742  wxWindow* panel;
743  m_Unpublished = new CUnpublishedPanel(m_PubdescDetails, cit_gen.IsSetTitle() ? cit_gen.GetTitle() : kEmptyStr);
744  m_PubdescDetails->AddPage (m_Unpublished, wxT("Title"));
745 
746  CAuth_list& auth_list = cit_gen.SetAuthors();
747  panel = new CAuthorNamesPanel(m_PubdescDetails, auth_list, true);
748  m_PubdescDetails->AddPage (panel, wxT("Author Names"));
749 
750  panel = new CAuthorAffiliationPanel(m_PubdescDetails, auth_list.SetAffil());
751  m_PubdescDetails->AddPage (panel, wxT("Author Affiliation"));
752 }
753 
754 
756 {
757  wxWindow* panel;
758  CCit_jour& journal = art.SetFrom().SetJournal();
759 
760  if (!art.IsSetTitle() || art.GetTitle().Get().empty()) {
761  CRef<objects::CTitle::C_E> blank_title(new objects::CTitle::C_E());
762  blank_title->SetName("?");
763  art.SetTitle().Set().push_back(blank_title);
764  }
765  if (art.IsSetIds())
766  {
768  {
769  if ((*id)->IsPubmed() && m_Pmid <= 0)
770  m_Pmid = ENTREZ_ID_TO(long, (*id)->GetPubmed().Get());
771  }
772  }
773  // panel for article title
774  panel = new CTitlePanel (m_PubdescDetails, art.SetTitle().Set().front());
775  m_PubdescDetails->AddPage (panel, wxT("Article Title"));
777  m_PubdescDetails->AddPage (m_JournalPanel, wxT("Journal"));
778 
779  CAuth_list& auth_list = art.SetAuthors();
780  panel = new CAuthorNamesPanel(m_PubdescDetails, auth_list, true);
781  m_PubdescDetails->AddPage (panel, wxT("Author Names"));
782 
783  panel = new CAuthorAffiliationPanel(m_PubdescDetails, auth_list.SetAffil());
784  m_PubdescDetails->AddPage (panel, wxT("Author Affiliation"));
785 }
786 
787 
789 
790 {
791  wxWindow* panel;
792 
793  CCit_book& book = art.SetFrom().SetBook();
794 
795  if (!art.IsSetTitle() || art.GetTitle().Get().empty()) {
796  CRef<objects::CTitle::C_E> blank_title(new objects::CTitle::C_E());
797  blank_title->SetName("?");
798  art.SetTitle().Set().push_back(blank_title);
799  }
800  // panel for chapter title
801  panel = new CTitlePanel (m_PubdescDetails, art.SetTitle().Set().front());
802  m_PubdescDetails->AddPage (panel, wxT("Chapter Title"));
803 
804  if (!book.IsSetTitle() || book.GetTitle().Get().empty()) {
805  CRef<objects::CTitle::C_E> blank_title(new objects::CTitle::C_E());
806  blank_title->SetName("?");
807  book.SetTitle().Set().push_back(blank_title);
808  }
809 
810  CAuth_list& auth_list = art.SetAuthors();
811  panel = new CAuthorNamesPanel(m_PubdescDetails, auth_list, true);
812  m_PubdescDetails->AddPage (panel, wxT("Chapter Authors"));
813 
814  panel = new CAuthorAffiliationPanel(m_PubdescDetails, auth_list.SetAffil());
815  m_PubdescDetails->AddPage (panel, wxT("Chapter Author Affiliation"));
816 
817  x_CreateBookControls (art.SetFrom().SetBook(), true);
818 }
819 
820 
822 {
823  wxWindow* panel;
824 
825  if (!art.IsSetTitle() || art.GetTitle().Get().empty()) {
826  CRef<objects::CTitle::C_E> blank_title(new objects::CTitle::C_E());
827  blank_title->SetName("?");
828  art.SetTitle().Set().push_back(blank_title);
829  }
830  panel = new CTitlePanel (m_PubdescDetails, art.SetTitle().Set().front());
831  m_PubdescDetails->AddPage (panel, wxT("Abstract Title"));
832 
833  CCit_proc& proc = art.SetFrom().SetProc();
834  CCit_book& book = proc.SetBook();
835  if (!book.IsSetTitle() || book.GetTitle().Get().empty()) {
836  CRef<objects::CTitle::C_E> blank_title(new objects::CTitle::C_E());
837  blank_title->SetName("?");
838  book.SetTitle().Set().push_back(blank_title);
839  }
840  panel = new CTitlePanel (m_PubdescDetails, book.SetTitle().Set().front());
841  m_PubdescDetails->AddPage (panel, wxT("Proceedings Title"));
842 
843  CAuth_list& auth_list = art.SetAuthors();
844  panel = new CAuthorNamesPanel(m_PubdescDetails, auth_list, true);
845  m_PubdescDetails->AddPage (panel, wxT("Presenters"));
846 
847  panel = new CAuthorAffiliationPanel(m_PubdescDetails, auth_list.SetAffil());
848  m_PubdescDetails->AddPage (panel, wxT("Presenter Affiliation"));
849 
850  CAuth_list& editors = book.SetAuthors();
851  panel = new CAuthorNamesPanel(m_PubdescDetails, editors, true);
852  m_PubdescDetails->AddPage (panel, wxT("Chairpersons"));
853 
854  panel = new CAuthorAffiliationPanel(m_PubdescDetails, editors.SetAffil());
855  m_PubdescDetails->AddPage (panel, wxT("Chairperson Affiliation"));
856 
857  panel = new CLocalePanel (m_PubdescDetails, proc.SetMeet());
858  m_PubdescDetails->AddPage (panel, wxT("Locale"));
859 
861  m_PubdescDetails->AddPage (m_PublisherPanel, wxT("Publisher"));
862 }
863 
864 
866 {
867  wxWindow* panel;
868 
869  CRef<CCit_book> book(&(proc.SetBook()));
870  panel = new CTitlePanel (m_PubdescDetails, book->SetTitle().Set().front());
871  m_PubdescDetails->AddPage (panel, wxT("Proceedings Title"));
872 
873  CAuth_list& auth_list = book->SetAuthors();
874  panel = new CAuthorNamesPanel(m_PubdescDetails, auth_list, true);
875  m_PubdescDetails->AddPage (panel, wxT("Conveners"));
876  panel = new CAuthorAffiliationPanel(m_PubdescDetails, auth_list.SetAffil());
877  m_PubdescDetails->AddPage (panel, wxT("Convener Affiliation"));
878  panel = new CLocalePanel (m_PubdescDetails, proc.SetMeet());
879  m_PubdescDetails->AddPage (panel, wxT("Locale"));
881  m_PubdescDetails->AddPage (m_PublisherPanel, wxT("Publisher"));
882 }
883 
884 
885 void CPublicationTypePanel::x_CreateBookControls(objects::CCit_book& book, bool is_chapter)
886 {
887  wxWindow* panel;
888 
889  if (!book.IsSetTitle() || book.GetTitle().Get().empty()) {
890  CRef<objects::CTitle::C_E> blank_title(new objects::CTitle::C_E());
891  blank_title->SetName("?");
892  book.SetTitle().Set().push_back(blank_title);
893  }
894  // panel for book title
895  panel = new CTitlePanel (m_PubdescDetails, book.SetTitle().Set().front());
896  m_PubdescDetails->AddPage (panel, wxT("Book Title"));
897 
898  CAuth_list& auth_list = book.SetAuthors();
899  panel = new CAuthorNamesPanel(m_PubdescDetails, auth_list, true);
900  m_PubdescDetails->AddPage (panel, is_chapter ? wxT("Editor Names") : wxT("Author Names"));
901 
902  panel = new CAuthorAffiliationPanel(m_PubdescDetails, auth_list.SetAffil());
903  m_PubdescDetails->AddPage (panel, is_chapter ? wxT("Editor Affiliation") : wxT("Author Affiliation"));
904  m_PublisherPanel = new CPublisherPanel (m_PubdescDetails, book.SetImp(), is_chapter);
905  m_PubdescDetails->AddPage (m_PublisherPanel, wxT("Publisher"));
906 
907 }
908 
909 
910 void CPublicationTypePanel::x_CreateSubControls(objects::CCit_sub& sub)
911 {
912  wxWindow* panel;
913 
915  m_PubdescDetails->AddPage (m_CitSubPanel, wxT("CitSub"));
916  CAuth_list& auth_list = sub.SetAuthors();
917  panel = new CAuthorNamesPanel(m_PubdescDetails, auth_list, true);
918  m_PubdescDetails->AddPage (panel, wxT("Authors"));
919  panel = new CAuthorAffiliationPanel(m_PubdescDetails, auth_list.SetAffil());
920  m_PubdescDetails->AddPage (panel, wxT("Author Affiliation"));
921 }
922 
923 
925 {
926  wxWindow* panel;
928  m_PubdescDetails->AddPage (m_PatentPanel, wxT("Patent"));
929  CAuth_list& auth_list = pat.SetAuthors();
930  panel = new CAuthorNamesPanel(m_PubdescDetails, auth_list, true);
931  m_PubdescDetails->AddPage (panel, wxT("Authors"));
932  panel = new CAuthorAffiliationPanel(m_PubdescDetails, auth_list.SetAffil());
933  m_PubdescDetails->AddPage (panel, wxT("Author Affiliation"));
934  panel = new CAuthorNamesPanel(m_PubdescDetails, pat.SetApplicants(), true);
935  m_PubdescDetails->AddPage (panel, wxT("Applicants"));
936  panel = new CAuthorAffiliationPanel(m_PubdescDetails, pat.SetApplicants().SetAffil());
937  m_PubdescDetails->AddPage (panel, wxT("Applicant Affiliation"));
938  panel = new CAuthorNamesPanel(m_PubdescDetails, pat.SetAssignees(), true);
939  m_PubdescDetails->AddPage (panel, wxT("Assignees"));
940  panel = new CAuthorAffiliationPanel(m_PubdescDetails, pat.SetAssignees().SetAffil());
941  m_PubdescDetails->AddPage (panel, wxT("Assignee Affiliation"));
942 }
943 
944 
946 {
947  wxWindow* panel;
948  CCit_book& book = let.SetCit();
949  panel = new CTitlePanel (m_PubdescDetails, book.SetTitle().Set().front());
950  m_PubdescDetails->AddPage (panel, wxT("Title"));
951 
952  CAuth_list& auth_list = book.SetAuthors();
953  panel = new CAuthorNamesPanel(m_PubdescDetails, auth_list, true);
954  m_PubdescDetails->AddPage (panel, wxT("Author Names"));
955  panel = new CAuthorAffiliationPanel(m_PubdescDetails, auth_list.SetAffil());
956  m_PubdescDetails->AddPage (panel, wxT("Author Affiliation"));
958  m_PubdescDetails->AddPage (m_PublisherPanel, wxT("Publisher"));
959 }
960 
961 
964 
965 void s_ApplyStatusToPub(int status, CRef<CPub> pub)
966 {
967  // apply status
968  if (status != 0) {
969  CRef<CImprint> imprint = s_GetPubImprint (pub);
970  if (imprint) {
971  if (status == 1) {
972  if (!imprint->IsSetPrepub() || imprint->GetPrepub() != CImprint::ePrepub_in_press) {
974  s_SetPubImprint (pub, imprint);
975  }
976  } else {
977  if (imprint->IsSetPrepub()) {
978  imprint->ResetPrepub();
979  s_SetPubImprint (pub, imprint);
980  }
981  }
982  }
983  }
984 }
985 
987 {
988  if (m_JournalPanel)
989  {
991  }
992 }
993 
995 {
996 
997  if (!wxPanel::TransferDataFromWindow())
998  return false;
999 
1000  if (!x_CollectDetails()) {
1001  return false;
1002  }
1003 
1004  // remove "placeholder" pubs for storing unused information
1005  if (!m_Pubdesc->IsSetPub()
1006  || !m_Pubdesc->GetPub().IsSet()
1007  || m_Pubdesc->GetPub().Get().empty()) {
1008  return false;
1009  }
1010 
1011  CPub_equiv::Tdata::iterator pub_it = m_Pubdesc->SetPub().Set().begin();
1012  while (pub_it != m_Pubdesc->SetPub().Set().end()) {
1013  if (m_CurrentType == ePubTypeSub) {
1014  // only keep the Cit-sub pubs
1015  if (!(*pub_it)->IsSub()) {
1016  pub_it = m_Pubdesc->SetPub().Set().erase(pub_it);
1017  } else {
1018  if (m_Unpublished)
1019  {
1020  string title = m_Unpublished->GetTitle();
1021  if (title.empty())
1022  (*pub_it)->SetSub().ResetDescr();
1023  else
1024  (*pub_it)->SetSub().SetDescr(title);
1025  }
1026  ++pub_it;
1027  }
1028  } else if (m_CurrentStatus == 0) {
1029  // only keep unpublished pub
1030  if (!(*pub_it)->IsGen()) {
1031  pub_it = m_Pubdesc->SetPub().Set().erase(pub_it);
1032  } else {
1033  if (m_Unpublished)
1034  {
1035  string title = m_Unpublished->GetTitle();
1036  if (title.empty())
1037  (*pub_it)->SetGen().ResetTitle();
1038  else
1039  (*pub_it)->SetGen().SetTitle(title);
1040  }
1041  ++pub_it;
1042  }
1043  } else {
1044  switch (m_CurrentType) {
1046  if (!s_IsJournalArticle(*pub_it)) {
1047  pub_it = m_Pubdesc->SetPub().Set().erase(pub_it);
1048  } else {
1049  if ((*pub_it)->SetArticle().IsSetIds())
1050  {
1051  EDIT_EACH_ARTICLEID_ON_CITART(id, (*pub_it)->SetArticle())
1052  {
1053  if ((*id)->IsPubmed())
1054  {
1055  if (m_Pmid <= 0)
1056  {
1057  ERASE_ARTICLEID_ON_CITART(id, (*pub_it)->SetArticle());
1058  }
1059  else
1060  {
1061  (*id)->SetPubmed(CPubMedId(ENTREZ_ID_FROM(long, m_Pmid)));
1062  }
1063  }
1064  }
1065  if ((*pub_it)->GetArticle().GetIds().Get().empty())
1066  (*pub_it)->SetArticle().ResetIds();
1067  }
1068  ++pub_it;
1069  }
1070  break;
1071  case ePubTypeBookChapter:
1072  if (!s_IsBookChapter(*pub_it)) {
1073  pub_it = m_Pubdesc->SetPub().Set().erase(pub_it);
1074  } else {
1075  ++pub_it;
1076  }
1077  break;
1078  case ePubTypeProcChapter:
1079  if (!s_IsProcChapter(*pub_it)) {
1080  pub_it = m_Pubdesc->SetPub().Set().erase(pub_it);
1081  } else {
1082  ++pub_it;
1083  }
1084  break;
1085  case ePubTypeBook:
1086  if (!(*pub_it)->IsBook()) {
1087  pub_it = m_Pubdesc->SetPub().Set().erase(pub_it);
1088  } else {
1089  ++pub_it;
1090  }
1091  break;
1092  case ePubTypeThesis:
1093  if (!(*pub_it)->IsMan()) {
1094  pub_it = m_Pubdesc->SetPub().Set().erase(pub_it);
1095  } else {
1096  ++pub_it;
1097  }
1098  break;
1099  case ePubTypeProc:
1100  if (!(*pub_it)->IsProc()) {
1101  pub_it = m_Pubdesc->SetPub().Set().erase(pub_it);
1102  } else {
1103  ++pub_it;
1104  }
1105  break;
1106  case ePubTypePatent:
1107  if (!(*pub_it)->IsPatent()) {
1108  pub_it = m_Pubdesc->SetPub().Set().erase(pub_it);
1109  } else {
1110  ++pub_it;
1111  }
1112  break;
1113  default:
1114  break;
1115  }
1116  }
1117  }
1118 
1119  // add pmid and muid pubs
1121  if (m_Pmid > 0) {
1122  CRef<CPub> new_pub(new CPub());
1123  new_pub->SetPmid().Set(ENTREZ_ID_FROM(long, m_Pmid));
1124  m_Pubdesc->SetPub().Set().push_back(new_pub);
1125  }
1126  if (m_Muid > 0) {
1127  CRef<CPub> new_pub(new CPub());
1128  new_pub->SetMuid(ENTREZ_ID_FROM(long, m_Muid));
1129  m_Pubdesc->SetPub().Set().push_back(new_pub);
1130  }
1131  if (m_SerialNumber > 0) {
1132  CRef<CPub> new_pub(new CPub);
1134  m_Pubdesc->SetPub().Set().push_back(new_pub);
1135  }
1136  }
1137 
1138  // apply status
1139  if (m_CurrentStatus != 0) {
1140  CRef<CPub> pub = x_GetMainPub();
1142  }
1143 
1144  return true;
1145 }
1146 
1147 
1149 {
1150  if (m_Pubdesc)
1151  return m_Pubdesc;
1152 
1153  return CRef<objects::CPubdesc>();
1154 }
1155 
1156 
1157 /*
1158  * Should we show tooltips?
1159  */
1160 
1162 {
1163  return true;
1164 }
1165 
1166 /*
1167  * Get bitmap resources
1168  */
1169 
1170 wxBitmap CPublicationTypePanel::GetBitmapResource( const wxString& name )
1171 {
1172  // Bitmap retrieval
1173 ////@begin CPublicationTypePanel bitmap retrieval
1174  wxUnusedVar(name);
1175  return wxNullBitmap;
1176 ////@end CPublicationTypePanel bitmap retrieval
1177 }
1178 
1179 /*
1180  * Get icon resources
1181  */
1182 
1183 wxIcon CPublicationTypePanel::GetIconResource( const wxString& name )
1184 {
1185  // Icon retrieval
1186 ////@begin CPublicationTypePanel icon retrieval
1187  wxUnusedVar(name);
1188  return wxNullIcon;
1189 ////@end CPublicationTypePanel icon retrieval
1190 }
1191 
1192 
1193 static string s_GetPubTitle(CRef<CPub> pub)
1194 {
1195  string title = "";
1196  if (!pub) {
1197  return title;
1198  }
1199 
1200  switch (pub->Which()) {
1201  case CPub::e_Article:
1202  if (pub->GetArticle().IsSetTitle()) {
1203  title = pub->GetArticle().GetTitle().GetTitle();
1204  }
1205  break;
1206  case CPub::e_Book:
1207  if (pub->GetBook().IsSetTitle()) {
1208  title = pub->GetBook().GetTitle().GetTitle();
1209  }
1210  break;
1211  case CPub::e_Gen:
1212  if (pub->GetGen().IsSetTitle()) {
1213  title = pub->GetGen().GetTitle();
1214  }
1215  break;
1216  case CPub::e_Journal:
1217  if (pub->GetJournal().IsSetTitle()) {
1218  title = pub->GetJournal().GetTitle().GetTitle();
1219  }
1220  break;
1221  case CPub::e_Man:
1222  if (pub->GetMan().IsSetCit() && pub->GetMan().GetCit().IsSetTitle()) {
1223  title = pub->GetMan().GetCit().GetTitle().GetTitle();
1224  }
1225  break;
1226  case CPub::e_Patent:
1227  if (pub->GetPatent().IsSetTitle()) {
1228  title = pub->GetPatent().GetTitle();
1229  }
1230  break;
1231  case CPub::e_Proc:
1232  if (pub->GetProc().IsSetBook() && pub->GetProc().GetBook().IsSetTitle()) {
1233  title = pub->GetProc().GetBook().GetTitle().GetTitle();
1234  }
1235  break;
1236  case CPub::e_Sub:
1237  if (pub->GetSub().IsSetDescr()) {
1238  title = pub->GetSub().GetDescr();
1239  }
1240  break;
1241  default:
1242  break;
1243  }
1244  return title;
1245 }
1246 
1247 
1248 static void s_SetPubTitle(CRef<CPub> pub, string title)
1249 {
1250  if (!pub) {
1251  return;
1252  } else if (pub->IsGen()) {
1253  pub->SetGen().SetTitle(title);
1254  return;
1255  } else if (pub->IsPatent()) {
1256  pub->SetPatent().SetTitle(title);
1257  return;
1258  } else if (pub->IsSub()) {
1259  pub->SetSub().SetDescr(title);
1260  return;
1261  }
1262 
1263  CRef<objects::CTitle::C_E> otitle(new objects::CTitle::C_E());
1264 
1265  switch (pub->Which()) {
1266  case CPub::e_Article:
1267  if (!pub->GetArticle().IsSetTitle() || pub->GetArticle().GetTitle().Get().empty()) {
1268  pub->SetArticle().SetTitle().Set().push_back(otitle);
1269  } else {
1270  otitle = pub->SetArticle().SetTitle().Set().front();
1271  }
1272  break;
1273  case CPub::e_Book:
1274  if (!pub->GetBook().IsSetTitle() || pub->GetBook().GetTitle().Get().empty()) {
1275  pub->SetBook().SetTitle().Set().push_back(otitle);
1276  } else {
1277  otitle = pub->SetBook().SetTitle().Set().front();
1278  }
1279  break;
1280  case CPub::e_Man:
1281  if (!pub->GetMan().IsSetCit() || !pub->GetMan().GetCit().IsSetTitle() || pub->GetMan().GetCit().GetTitle().Get().empty()) {
1282  pub->SetMan().SetCit().SetTitle().Set().push_back(otitle);
1283  } else {
1284  otitle = pub->SetMan().SetCit().SetTitle().Set().front();
1285  }
1286  break;
1287  case CPub::e_Proc:
1288  if (!pub->GetProc().IsSetBook() || !pub->GetProc().GetBook().IsSetTitle() || pub->GetProc().GetBook().GetTitle().Get().empty()) {
1289  pub->SetProc().SetBook().SetTitle().Set().push_back(otitle);
1290  } else {
1291  otitle = pub->SetProc().SetBook().SetTitle().Set().front();
1292  }
1293  break;
1294  default:
1295  return;
1296  break;
1297  }
1298  otitle->SetName(title);
1299 }
1300 
1301 
1302 static void s_SetPubAuthors (CRef<CPub> pub, const CAuth_list& auth_list)
1303 {
1304  if (!pub) {
1305  return;
1306  }
1307 
1308  switch (pub->Which()) {
1309  case CPub::e_Article:
1310  pub->SetArticle().SetAuthors().Assign(auth_list);
1311  break;
1312  case CPub::e_Book:
1313  pub->SetBook().SetAuthors().Assign(auth_list);
1314  break;
1315  case CPub::e_Gen:
1316  pub->SetGen().SetAuthors().Assign(auth_list);
1317  break;
1318  case CPub::e_Man:
1319  pub->SetMan().SetCit().SetAuthors().Assign(auth_list);
1320  break;
1321  case CPub::e_Patent:
1322  pub->SetPatent().SetAuthors().Assign(auth_list);
1323  break;
1324  case CPub::e_Proc:
1325  pub->SetProc().SetBook().SetAuthors().Assign(auth_list);
1326  break;
1327  case CPub::e_Sub:
1328  pub->SetSub().SetAuthors().Assign(auth_list);
1329  break;
1330  default:
1331  break;
1332  }
1333 }
1334 
1335 
1337 {
1338  CRef<objects::CImprint> imprint(new CImprint());
1339 
1340  try {
1341  switch (pub->Which()) {
1342  case CPub::e_Article:
1343  if (pub->GetArticle().IsSetFrom()) {
1344  switch (pub->GetArticle().GetFrom().Which()) {
1345  case objects::CCit_art::C_From::e_Journal:
1346  imprint->Assign(pub->GetArticle().GetFrom().GetJournal().GetImp());
1347  break;
1348  case objects::CCit_art::C_From::e_Book:
1349  imprint->Assign(pub->GetArticle().GetFrom().GetBook().GetImp());
1350  break;
1351  case objects::CCit_art::C_From::e_Proc:
1352  imprint->Assign(pub->GetArticle().GetFrom().GetProc().GetBook().GetImp());
1353  break;
1354  default:
1355  imprint.Reset();
1356  break;
1357  }
1358  } else {
1359  imprint.Reset();
1360  }
1361  break;
1362  case CPub::e_Book:
1363  imprint->Assign(pub->GetBook().GetImp());
1364  break;
1365  case CPub::e_Man:
1366  imprint->Assign(pub->GetMan().GetCit().GetImp());
1367  break;
1368  case CPub::e_Proc:
1369  imprint->Assign(pub->GetProc().GetBook().GetImp());
1370  break;
1371  default:
1372  imprint.Reset();
1373  break;
1374  }
1375  } catch (const CException& e) {
1376  LOG_POST(Error << "In s_GetPubImprint(): " << e.GetMsg());
1377  imprint.Reset();
1378  }
1379  catch (const exception& e) {
1380  LOG_POST(Error << "In s_GetPubImprint(): " << e.what());
1381  imprint.Reset();
1382  }
1383  return imprint;
1384 }
1385 
1386 
1388 {
1389  if (!imprint) {
1390  return;
1391  }
1392  if (!imprint->IsSetDate() || !imprint->GetDate().IsStd()) {
1393  imprint->SetDate().SetStr("?");
1394  }
1395  switch (pub->Which()) {
1396  case CPub::e_Article:
1397  if (pub->GetArticle().IsSetFrom()) {
1398  switch (pub->GetArticle().GetFrom().Which()) {
1399  case objects::CCit_art::C_From::e_Journal:
1400  pub->SetArticle().SetFrom().SetJournal().SetImp(*imprint);
1401  break;
1402  case objects::CCit_art::C_From::e_Book:
1403  pub->SetArticle().SetFrom().SetBook().SetImp(*imprint);
1404  break;
1405  case objects::CCit_art::C_From::e_Proc:
1406  pub->SetArticle().SetFrom().SetProc().SetBook().SetImp(*imprint);
1407  break;
1408  default:
1409  break;
1410  }
1411  }
1412  break;
1413  case CPub::e_Book:
1414  pub->SetBook().SetImp(*imprint);
1415  break;
1416  case CPub::e_Man:
1417  pub->SetMan().SetCit().SetImp(*imprint);
1418  break;
1419  case CPub::e_Proc:
1420  pub->SetProc().SetBook().SetImp(*imprint);
1421  break;
1422  default:
1423  break;
1424  }
1425 }
1426 
1427 
1429 {
1430  if (!pub) {
1431  return;
1432  }
1433  if (s_IsProcChapter(pub)) {
1434  if (locale) {
1435  pub->SetArticle().SetFrom().SetProc().SetMeet(*locale);
1436  } else {
1437  pub->SetArticle().SetFrom().SetProc().ResetMeet();
1438  }
1439  } else if (pub->IsProc()) {
1440  if (locale) {
1441  pub->SetProc().SetMeet(*locale);
1442  } else {
1443  pub->SetProc().ResetMeet();
1444  }
1445  }
1446 }
1447 
1448 
1449 static void s_TransferPubData (CRef<CPub> src_pub, CRef<CPub> dest_pub)
1450 {
1451  if (!src_pub || !dest_pub) {
1452  return;
1453  }
1454 
1455  // special cases
1456  // proc to procchapter
1457  if (src_pub->IsProc() && s_IsProcChapter(dest_pub)) {
1459  proc->Assign(src_pub->GetProc());
1460  dest_pub->SetArticle().SetFrom().SetProc(*proc);
1461  } else if (dest_pub->IsProc() && s_IsProcChapter(src_pub)) {
1463  proc->Assign(src_pub->GetArticle().GetFrom().GetProc());
1464  dest_pub->SetProc(*proc);
1465  }
1466 
1467  // book to bookchapter
1468  if (src_pub->IsBook() && s_IsBookChapter(dest_pub)) {
1469  CRef<CCit_book> book(new CCit_book());
1470  book->Assign(src_pub->GetBook());
1471  dest_pub->SetArticle().SetFrom().SetBook(*book);
1472  } else if (dest_pub->IsBook() && s_IsBookChapter(src_pub)) {
1473  CRef<CCit_book> book(new CCit_book());
1474  book->Assign(src_pub->GetArticle().GetFrom().GetBook());
1475  dest_pub->SetBook(*book);
1476  }
1477 
1478  // default - only transfer authors, title, imprint
1479  if (src_pub->IsSetAuthors()) {
1480  CRef<CAuth_list> authors(new CAuth_list());
1481  authors->Assign(src_pub->GetAuthors());
1482  s_SetPubAuthors(dest_pub, *authors);
1483  }
1484  string title = s_GetPubTitle(src_pub);
1485  if (!NStr::IsBlank(title)) {
1486  s_SetPubTitle(dest_pub, title);
1487  }
1488 
1489  CRef<objects::CImprint> imprint = s_GetPubImprint(src_pub);
1490  if (imprint) {
1491  s_SetPubImprint(dest_pub, imprint);
1492  }
1493  if (dest_pub->IsMan() && !dest_pub->GetMan().IsSetType())
1494  {
1495  dest_pub->SetMan().SetType( CCit_let::eType_thesis );
1496  }
1497 }
1498 
1499 
1501 {
1502  bool rval = true;
1504 
1505  // get authors and affiliations
1506  int author_pos = 0, affil_pos = 0;
1507  for (size_t i = 0; i < m_PubdescDetails->GetPageCount(); ++i) {
1508  CAuthorNamesPanel* auth_panel;
1509  auth_panel = dynamic_cast<CAuthorNamesPanel*>(m_PubdescDetails->GetPage(i));
1510  if (auth_panel) {
1511  rval &= auth_panel->TransferDataFromWindow();
1512  if (author_pos == 0) {
1513  CRef<CAuth_list> authors(new CAuth_list());
1514  authors->Assign(pub->GetAuthors());
1515  auth_panel->PopulateAuthors(*authors);
1516  s_SetPubAuthors(pub, *authors);
1517  } else {
1518  // some pubs have additional authors
1519  if (s_IsProcChapter(pub)) {
1520  // these are the chairpersons
1521  CAuth_list& authors = pub->SetArticle().SetFrom().SetProc().SetBook().SetAuthors();
1522  auth_panel->PopulateAuthors(authors);
1523  } else if (s_IsBookChapter(pub)) {
1524  // these are the book authors
1525  CAuth_list& authors = pub->SetArticle().SetFrom().SetBook().SetAuthors();
1526  auth_panel->PopulateAuthors(authors);
1527  } else if (pub->IsPatent()) {
1528  if (author_pos == 1) {
1529  // these are the applicants
1530  CAuth_list& authors = pub->SetPatent().SetApplicants();
1531  auth_panel->PopulateAuthors(authors);
1532  } else {
1533  // these are the assignees
1534  CAuth_list& authors = pub->SetPatent().SetAssignees();
1535  auth_panel->PopulateAuthors(authors);
1536  }
1537  }
1538  }
1539  author_pos++;
1540  } else {
1541  CAuthorAffiliationPanel *affil_panel = dynamic_cast<CAuthorAffiliationPanel*>(m_PubdescDetails->GetPage(i));
1542  if (affil_panel) {
1543  rval &= affil_panel->TransferDataFromWindow();
1544  CRef<CAffil> affil = affil_panel->GetAffil();
1545  if (affil_pos == 0) {
1546  CRef<CAuth_list> authors(new CAuth_list());
1547  authors->Assign(pub->GetAuthors());
1548  if (affil) {
1549  authors->SetAffil(*affil);
1550  } else {
1551  authors->ResetAffil();
1552  }
1553  s_SetPubAuthors(pub, *authors);
1554  } else {
1555  // some pubs have additional authors
1556  if (s_IsProcChapter(pub)) {
1557  // these are the chairpersons
1558  CAuth_list& authors = pub->SetArticle().SetFrom().SetProc().SetBook().SetAuthors();
1559  if (affil) {
1560  authors.SetAffil(*affil);
1561  } else {
1562  authors.ResetAffil();
1563  }
1564  } else if (s_IsBookChapter(pub)) {
1565  // these are the book authors
1566  CAuth_list& authors = pub->SetArticle().SetFrom().SetBook().SetAuthors();
1567  if (affil) {
1568  authors.SetAffil(*affil);
1569  } else {
1570  authors.ResetAffil();
1571  }
1572  } else if (pub->IsPatent()) {
1573  if (affil_pos == 1) {
1574  // these are the applicants
1575  CAuth_list& authors = pub->SetPatent().SetApplicants();
1576  if (affil) {
1577  authors.SetAffil(*affil);
1578  } else {
1579  authors.ResetAffil();
1580  }
1581  } else {
1582  // these are the assignees
1583  CAuth_list& authors = pub->SetPatent().SetAssignees();
1584  if (affil) {
1585  authors.SetAffil(*affil);
1586  } else {
1587  authors.ResetAffil();
1588  }
1589  }
1590  }
1591  }
1592  affil_pos++;
1593  }
1594  }
1595  }
1596  return rval;
1597 }
1598 
1599 
1601 {
1602  if (!m_PubdescDetails->TransferDataFromWindow()) {
1603  return false;
1604  }
1605  for (size_t i = 0; i < m_PubdescDetails->GetPageCount(); ++i) {
1606  if (!m_PubdescDetails->GetPage(i)->TransferDataFromWindow()) {
1607  return false;
1608  }
1609  }
1610 
1612 
1613  // get Journal info
1614  if (m_JournalPanel) {
1616  return false;
1617  }
1618  // copy to src_pub
1620  pub->SetArticle().SetFrom().SetJournal(*journal);
1621  }
1622 
1623  // patent info
1624  if (m_PatentPanel) {
1626  return false;
1627  }
1628  // copy to pub
1630  pub->SetPatent(*patent);
1631  }
1632 
1633  // citsub info
1634  if (m_CitSubPanel) {
1636  return false;
1637  }
1638  // copy to pub
1640  pub->SetSub(*sub);
1641  }
1642 
1643  // locale, for proc and proc chapter
1644  for (size_t i = 0; i < m_PubdescDetails->GetPageCount(); ++i) {
1645  CLocalePanel *locale_panel = dynamic_cast<CLocalePanel*>(m_PubdescDetails->GetPage(i));
1646  if (locale_panel) {
1647  if (!locale_panel->TransferDataFromWindow()) {
1648  return false;
1649  }
1650  CRef<CMeeting> locale = locale_panel->GetMeeting();
1651  s_SetPubLocale (pub, locale);
1652  }
1653  }
1654 
1655  // get publisher info
1656  if (m_PublisherPanel) {
1658  return false;
1659  }
1660  // copy to src_pub
1661  CRef<CImprint> imprint = s_GetPubImprint (pub);
1662  if (imprint) {
1664  s_SetPubImprint (pub, imprint);
1665  }
1666  }
1667 
1668  if (m_Unpublished)
1669  {
1670  string title = m_Unpublished->GetTitle();
1671  if (title.empty())
1672  {
1673  if (pub->IsGen())
1674  pub->SetGen().ResetTitle();
1675  if (pub->IsSub())
1676  pub->SetSub().ResetDescr();
1677  }
1678  else
1679  {
1680  if (pub->IsGen())
1681  pub->SetGen().SetTitle(title);
1682  if (pub->IsSub())
1683  pub->SetSub().SetDescr(title);
1684  }
1685  }
1686 
1687  // note - collect authors last, otherwise data will be overridden from earlier input
1688  return x_CollectAuthors();
1689 }
1690 
1691 
1692 /*
1693  * wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_UNPUB_INPRESS_PUB
1694  */
1695 
1697 {
1698  // if changing from in-press or published to unpub (or vice-versa),
1699  // need to change format of data, panel to represent
1700  int new_status = m_Status->GetSelection();
1701  if (new_status == m_CurrentStatus)
1702  {
1703  // no change
1704  return;
1705  }
1706 
1707  // find the pub currently holding information
1708  x_CollectDetails();
1709  CRef<objects::CPub> prev_pub = x_GetMainPub();
1710 
1711  m_CurrentStatus = new_status;
1712 
1713  // find/create destination pub
1714  CRef<CPub> dest_pub = x_GetMainPub();
1715  s_ApplyStatusToPub(new_status, dest_pub);
1716  if (prev_pub == dest_pub) {
1717  return;
1718  }
1719 
1720  s_TransferPubData (prev_pub, dest_pub);
1721 
1723 }
1724 
1725 
1726 /*
1727  * wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_PUBCLASS
1728  */
1729 
1730 void CPublicationTypePanel::OnPubclassSelected( wxCommandEvent& event )
1731 {
1732  // find the pub currently holding information
1733  x_CollectDetails();
1734  CRef<objects::CPub> prev_pub = x_GetMainPub();
1735  int new_pub_type = m_PubClass->GetSelection();
1736  // find/create destination pub
1737  m_CurrentType = new_pub_type;
1738  CRef<CPub> dest_pub = x_GetMainPub();
1739  // transfer data from old to new pub
1740  s_TransferPubData (prev_pub, dest_pub);
1742 }
1743 
1744 
1746 {
1747  m_Pubdesc.Reset(new CPubdesc);
1748  m_Pubdesc->Assign(pubdesc);
1750  Refresh();
1751  m_PubdescDetails->ChangeSelection(1);
1752 }
1753 
1754 
1755 void CPublicationTypePanel::ChangeSeqdesc(const objects::CSeqdesc& desc)
1756 {
1757  SetPub(desc.GetPub());
1759  if (m_JournalPanel) {
1763  }
1764 }
1765 
1766 
1767 void CPublicationTypePanel::UpdateSeqdesc(objects::CSeqdesc& desc)
1768 {
1769  if (m_JournalPanel) {
1771  }
1772 
1773  if (TransferDataFromWindow()) {
1775  desc.SetPub(*pub);
1776  } else {
1777  desc.Reset();
1778  }
1779  if (m_JournalPanel) {
1781  }
1782 }
1783 
1785 {
1786  if (m_PubdescDetails)
1787  {
1788  CImportExportAccess* window = dynamic_cast<CImportExportAccess*>(m_PubdescDetails->GetCurrentPage());
1789  if (window)
1790  return window->IsImportEnabled();
1791  }
1792  return true;
1793 }
1794 
1796 {
1797  if (m_PubdescDetails)
1798  {
1799  CImportExportAccess* window = dynamic_cast<CImportExportAccess*>(m_PubdescDetails->GetCurrentPage());
1800  if (window)
1801  return window->IsExportEnabled();
1802  }
1803  return true;
1804 }
1805 
1807 {
1808  if (m_PubdescDetails)
1809  {
1810  CImportExportAccess* window = dynamic_cast<CImportExportAccess*>(m_PubdescDetails->GetCurrentPage());
1811  if (window)
1812  return window->OnExport();
1813  }
1814 
1815  if (!TransferDataFromWindow())
1816  return CRef<CSerialObject>(NULL);
1817 
1818  CRef<CSerialObject> so((CSerialObject*)(new objects::CPubdesc));
1819  so->Assign(*m_Pubdesc);
1820  return so;
1821 }
1822 
1824 {
1825  if (m_PubdescDetails)
1826  {
1827  CImportExportAccess* window = dynamic_cast<CImportExportAccess*>(m_PubdescDetails->GetCurrentPage());
1828  if (window)
1829  {
1830  window->OnImport(istr);
1831  return;
1832  }
1833  }
1834 
1835  CRef<objects::CPubdesc> pub(new objects::CPubdesc);
1836  istr >> MSerial_AsnText >> *pub;
1837  SetPub(*pub);
1838 }
1839 
1840 void CPublicationTypePanel::OnDoiLookup( wxCommandEvent& event )
1841 {
1842  if (!m_PmidCtrl)
1843  return;
1844  string doi = m_PmidCtrl->GetValue().ToStdString();
1846 
1847  TEntrezId pmid = ZERO_ENTREZ_ID;
1848  TIntId converted_id = NStr::StringToInt8(doi, NStr::fConvErr_NoThrow);
1849  pmid = ENTREZ_ID_FROM(TIntId, converted_id);
1850 
1851  if (NStr::StartsWith(doi, "PMC"))
1852  {
1853  CPMCIDSearch converter;
1854  CPMCIDSearch::TResults results;
1855  vector<string> ids;
1856  ids.push_back(doi);
1857  if (converter.DoPMCIDSearch(ids, results))
1859  else
1860  wxMessageBox(wxT("PMC ID not found"), wxT("Error"), wxOK | wxICON_ERROR, NULL);
1861  }
1862 
1863  CRef<CPubdesc> pubdesc;
1864 
1865 
1866  if (pmid > ZERO_ENTREZ_ID) {
1867  pubdesc = GetPubdescFromEntrezById(pmid);
1868  if (!pubdesc)
1869  wxMessageBox(wxT("No article found"), wxT("Error"), wxOK | wxICON_ERROR, NULL);
1870  }
1871  else {
1872  pair<CRef<CPubdesc>, string> pubdesc_str = CDoiLookup::GetPubFromCrossRef(doi);
1873  pubdesc = pubdesc_str.first;
1874  if (!pubdesc) {
1875  wxMessageBox(wxT("Problem resolving DOI \n") + wxString(pubdesc_str.second), wxT("Error"), wxOK | wxICON_ERROR, NULL);
1876  }
1877  else if (NStr::EqualNocase(pubdesc_str.second, "Failed ISOJTA lookup")) {
1878  wxMessageBox(wxT("Failed to look up journal title abbreviation possibly due to service failure"), wxT("Warning"), wxOK | wxICON_WARNING, NULL);
1879  }
1880  }
1881 
1882  if (pubdesc)
1883  SetPub(*pubdesc);
1884 }
1885 
1887 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Utility macros and typedefs for exploring NCBI objects from biblio.asn.
#define FOR_EACH_ARTICLEID_ON_CITART(Itr, Var)
#define EDIT_EACH_ARTICLEID_ON_CITART(Itr, Var)
#define ERASE_ARTICLEID_ON_CITART(Itr, Var)
@Auth_list.hpp User-defined methods of the data storage class.
Definition: Auth_list.hpp:57
CRef< objects::CAffil > GetAffil()
void PopulateAuthors(objects::CAuth_list &auth_list)
virtual bool TransferDataFromWindow()
CRef< objects::CCit_sub > GetCit_sub() const
virtual bool TransferDataFromWindow()
static pair< CRef< objects::CPubdesc >, string > GetPubFromCrossRef(const string &doi)
Definition: doi_lookup.cpp:806
virtual bool IsImportEnabled(void)
virtual CRef< CSerialObject > OnExport(void)
virtual bool IsExportEnabled(void)
virtual void OnImport(CNcbiIfstream &istr)
CImprint –.
Definition: Imprint.hpp:66
bool TransferDataFromWindow()
CRef< objects::CCit_jour > GetCit_jour() const
void SetFinalValidation(bool val)
CRef< objects::CMeeting > GetMeeting() const
virtual bool TransferDataFromWindow()
bool DoPMCIDSearch(const vector< string > &query_ids, TResults &results)
vector< long > TResults
virtual bool TransferDataFromWindow()
CRef< objects::CCit_pat > GetCit_pat(void) const
Definition: Pub.hpp:56
const CAuth_list & GetAuthors(void) const
Definition: Pub.cpp:178
bool IsSetAuthors(void) const
Definition: Pub.cpp:152
@Pubdesc.hpp User-defined methods of the data storage class.
Definition: Pubdesc.hpp:54
void Init()
Initialises member variables.
void x_CreatePubControls(CRef< objects::CPub > pub)
virtual void ChangeSeqdesc(const objects::CSeqdesc &desc)
void OnDoiLookup(wxCommandEvent &event)
static bool ShowToolTips()
Should we show tooltips?
bool Create(wxWindow *parent, wxWindowID id=10018, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 400), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
virtual void OnImport(CNcbiIfstream &istr)
void x_CreateProcChapterControls(objects::CCit_art &art)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnPubclassSelected(wxCommandEvent &event)
wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_PUBCLASS
void x_CreateSubControls(objects::CCit_sub &sub)
CRef< objects::CPubdesc > m_Pubdesc
void SetPub(const objects::CPubdesc &pubdesc)
void x_SetStatusAndClass(CRef< objects::CPub > pub)
void x_SetStatus(const objects::CImprint &imprint)
virtual bool IsImportEnabled(void)
CUnpublishedPanel * m_Unpublished
virtual bool IsExportEnabled(void)
void x_CreateThesisControls(objects::CCit_let &let)
void x_CreateProcControls(objects::CCit_proc &proc)
void OnUnpubInpressPubSelected(wxCommandEvent &event)
wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_UNPUB_INPRESS_PUB
void x_CreatePatentControls(objects::CCit_pat &pat)
void x_CreateBookChapterControls(objects::CCit_art &art)
CPublisherPanel * m_PublisherPanel
virtual void UpdateSeqdesc(objects::CSeqdesc &desc)
void x_CreateUnpubControls(objects::CCit_gen &cit_gen)
CRef< CPub > x_PutMainPubFirst(int pubtype, int status)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
virtual CRef< CSerialObject > OnExport(void)
void x_CreateBookControls(objects::CCit_book &book, bool is_chapter)
CRef< objects::CPubdesc > GetPubdesc() const
CRef< objects::CPub > x_GetMainPub(void)
void x_CreateJournalArticleControls(objects::CCit_art &art)
void CreateControls()
Creates the controls and sizers.
void PopulatePublisherFields(objects::CImprint &imprint)
virtual bool TransferDataFromWindow()
Base class for all serializable objects.
Definition: serialbase.hpp:150
const string & GetTitle(C_E::E_Choice type=C_E::e_not_set) const
If the internal list contains a title (of the specified type, if given), returns the corresponding st...
Definition: Title.cpp:56
#define ID_TREEBOOK
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
static const char * proc
Definition: stats.c:21
static char tmp[3200]
Definition: utf8.c:42
SStrictId_Entrez::TId TEntrezId
TEntrezId type for entrez ids which require the same strictness as TGi.
Definition: ncbimisc.hpp:1041
#define ENTREZ_ID_TO(T, entrez_id)
Definition: ncbimisc.hpp:1097
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
Int8 TIntId
Definition: ncbimisc.hpp:999
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
Definition: ncbimisc.hpp:822
#define ENTREZ_ID_FROM(T, value)
Definition: ncbimisc.hpp:1098
#define ZERO_ENTREZ_ID
Definition: ncbimisc.hpp:1102
#define NULL
Definition: ncbistd.hpp:225
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
Definition: ncbidiag.hpp:226
void Error(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1197
const string & GetMsg(void) const
Get message string.
Definition: ncbiexpt.cpp:461
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
Definition: ncbiexpt.cpp:342
TPrim & Set(void)
Definition: serialbase.hpp:351
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define MSerial_AsnText
I/O stream manipulators –.
Definition: serialbase.hpp:696
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
Definition: ncbistre.hpp:439
#define kEmptyStr
Definition: ncbistr.hpp:123
static Int8 StringToInt8(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to Int8.
Definition: ncbistr.cpp:793
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:106
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string (in-place)
Definition: ncbistr.cpp:3201
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5412
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
Definition: ncbistr.hpp:5353
@ fConvErr_NoThrow
Do not throw an exception on error.
Definition: ncbistr.hpp:285
bool IsProc(void) const
Check if variant Proc is selected.
Definition: Cit_art_.hpp:507
const TDescr & GetDescr(void) const
Get the Descr member data.
Definition: Cit_sub_.hpp:476
const TTitle & GetTitle(void) const
Get the Title member data.
Definition: Cit_book_.hpp:296
void SetBook(TBook &value)
Assign a value to Book data member.
Definition: Cit_proc_.cpp:61
bool IsSetDescr(void) const
description of changes for public view Check if a value has been assigned to Descr data member.
Definition: Cit_sub_.hpp:464
const TCit & GetCit(void) const
Get the Cit member data.
Definition: Cit_let_.hpp:267
const TBook & GetBook(void) const
Get the Book member data.
Definition: Cit_proc_.hpp:214
void SetTitle(TTitle &value)
Assign a value to Title data member.
Definition: Cit_art_.cpp:210
const TJournal & GetJournal(void) const
Get the variant data.
Definition: Cit_art_.cpp:111
void SetAuthors(TAuthors &value)
Assign a value to Authors data member.
Definition: Cit_pat_.cpp:68
bool IsSetTitle(void) const
title of journal Check if a value has been assigned to Title data member.
Definition: Cit_jour_.hpp:201
bool IsSetPrepub(void) const
Check if a value has been assigned to Prepub data member.
Definition: Imprint_.hpp:1080
const TFrom & GetFrom(void) const
Get the From member data.
Definition: Cit_art_.hpp:567
bool IsSetTitle(void) const
Title of book Check if a value has been assigned to Title data member.
Definition: Cit_book_.hpp:284
void SetTitle(TTitle &value)
Assign a value to Title data member.
Definition: Cit_book_.cpp:62
bool IsSetTitle(void) const
title of paper (ANSI requires) Check if a value has been assigned to Title data member.
Definition: Cit_art_.hpp:513
const TTitle & GetTitle(void) const
Get the Title member data.
Definition: Cit_art_.hpp:525
void SetFrom(TFrom &value)
Assign a value to From data member.
Definition: Cit_art_.cpp:248
void SetAffil(TAffil &value)
Assign a value to Affil data member.
Definition: Auth_list_.cpp:160
bool IsSetFrom(void) const
Check if a value has been assigned to From data member.
Definition: Cit_art_.hpp:555
void SetAuthors(TAuthors &value)
Assign a value to Authors data member.
Definition: Cit_art_.cpp:227
void SetSerial_number(TSerial_number value)
Assign a value to Serial_number data member.
Definition: Cit_gen_.hpp:902
TPrepub GetPrepub(void) const
Get the Prepub member data.
Definition: Imprint_.hpp:1099
bool IsSetPubstatus(void) const
current status of this publication Check if a value has been assigned to Pubstatus data member.
Definition: Imprint_.hpp:1195
void SetAuthors(TAuthors &value)
Assign a value to Authors data member.
Definition: Cit_sub_.cpp:74
void ResetPrepub(void)
Reset Prepub data member.
Definition: Imprint_.hpp:1092
const TProc & GetProc(void) const
Get the variant data.
Definition: Cit_art_.cpp:155
E_Choice Which(void) const
Which variant is currently selected.
Definition: Cit_art_.hpp:466
list< CRef< CArticleId > > Tdata
const TTitle & GetTitle(void) const
Get the Title member data.
Definition: Cit_gen_.hpp:933
void SetImp(TImp &value)
Assign a value to Imp data member.
Definition: Cit_book_.cpp:107
void SetCit(TCit &value)
Assign a value to Cit data member.
Definition: Cit_let_.cpp:70
void SetDescr(const TDescr &value)
Assign a value to Descr data member.
Definition: Cit_sub_.hpp:485
bool IsSetTitle(void) const
eg.
Definition: Cit_gen_.hpp:921
void SetAuthors(TAuthors &value)
Assign a value to Authors data member.
Definition: Cit_book_.cpp:93
void SetType(TType value)
Assign a value to Type data member.
Definition: Cit_let_.hpp:360
void SetTitle(const TTitle &value)
Assign a value to Title data member.
Definition: Cit_gen_.hpp:942
bool IsSetTitle(void) const
Check if a value has been assigned to Title data member.
Definition: Cit_pat_.hpp:656
bool IsBook(void) const
Check if variant Book is selected.
Definition: Cit_art_.hpp:501
void ResetMeet(void)
Reset Meet data member.
Definition: Cit_proc_.cpp:66
const TImp & GetImp(void) const
Get the Imp member data.
Definition: Cit_jour_.hpp:243
void SetTitle(const TTitle &value)
Assign a value to Title data member.
Definition: Cit_pat_.hpp:677
bool IsSetBook(void) const
citation to meeting Check if a value has been assigned to Book data member.
Definition: Cit_proc_.hpp:202
bool IsJournal(void) const
Check if variant Journal is selected.
Definition: Cit_art_.hpp:495
bool IsSetCit(void) const
same fields as a book Check if a value has been assigned to Cit data member.
Definition: Cit_let_.hpp:255
void ResetAffil(void)
Reset Affil data member.
Definition: Auth_list_.cpp:155
void SetPrepub(TPrepub value)
Assign a value to Prepub data member.
Definition: Imprint_.hpp:1108
void SetMeet(TMeet &value)
Assign a value to Meet data member.
Definition: Cit_proc_.cpp:75
const TTitle & GetTitle(void) const
Get the Title member data.
Definition: Cit_jour_.hpp:213
const TImp & GetImp(void) const
Get the Imp member data.
Definition: Cit_book_.hpp:377
const TTitle & GetTitle(void) const
Get the Title member data.
Definition: Cit_pat_.hpp:668
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
Definition: Cit_let_.hpp:332
const Tdata & Get(void) const
Get the member data.
Definition: Title_.hpp:781
void SetAuthors(TAuthors &value)
Assign a value to Authors data member.
Definition: Cit_gen_.cpp:64
TPubstatus GetPubstatus(void) const
Get the Pubstatus member data.
Definition: Imprint_.hpp:1214
const TBook & GetBook(void) const
Get the variant data.
Definition: Cit_art_.cpp:133
@ ePubStatus_aheadofprint
epublish, but will be followed by print
Definition: PubStatus_.hpp:75
@ ePrepub_in_press
accepted, not published
Definition: Imprint_.hpp:96
TProc & SetProc(void)
Select the variant.
Definition: Pub_.cpp:305
TPmid & SetPmid(void)
Select the variant.
Definition: Pub_.hpp:690
bool IsBook(void) const
Check if variant Book is selected.
Definition: Pub_.hpp:641
list< CRef< CPub > > Tdata
Definition: Pub_equiv_.hpp:90
const TMan & GetMan(void) const
Get the variant data.
Definition: Pub_.cpp:365
TMuid & SetMuid(void)
Select the variant.
Definition: Pub_.hpp:615
TBook & SetBook(void)
Select the variant.
Definition: Pub_.cpp:283
const TArticle & GetArticle(void) const
Get the variant data.
Definition: Pub_.cpp:233
const TJournal & GetJournal(void) const
Get the variant data.
Definition: Pub_.cpp:255
const TSub & GetSub(void) const
Get the variant data.
Definition: Pub_.cpp:189
const TPatent & GetPatent(void) const
Get the variant data.
Definition: Pub_.cpp:321
const TProc & GetProc(void) const
Get the variant data.
Definition: Pub_.cpp:299
E_Choice Which(void) const
Which variant is currently selected.
Definition: Pub_.hpp:555
TMan & SetMan(void)
Select the variant.
Definition: Pub_.cpp:371
bool IsProc(void) const
Check if variant Proc is selected.
Definition: Pub_.hpp:647
TSub & SetSub(void)
Select the variant.
Definition: Pub_.cpp:195
bool IsSub(void) const
Check if variant Sub is selected.
Definition: Pub_.hpp:590
TGen & SetGen(void)
Select the variant.
Definition: Pub_.cpp:173
const TGen & GetGen(void) const
Get the variant data.
Definition: Pub_.cpp:167
TPatent & SetPatent(void)
Select the variant.
Definition: Pub_.cpp:327
bool IsPatent(void) const
Check if variant Patent is selected.
Definition: Pub_.hpp:653
bool IsArticle(void) const
Check if variant Article is selected.
Definition: Pub_.hpp:629
TArticle & SetArticle(void)
Select the variant.
Definition: Pub_.cpp:239
bool IsGen(void) const
Check if variant Gen is selected.
Definition: Pub_.hpp:584
const TBook & GetBook(void) const
Get the variant data.
Definition: Pub_.cpp:277
bool IsMan(void) const
Check if variant Man is selected.
Definition: Pub_.hpp:665
@ e_Pmid
PubMedId.
Definition: Pub_.hpp:114
@ e_Article
Definition: Pub_.hpp:106
@ e_Book
Definition: Pub_.hpp:108
@ e_Gen
general or generic unparsed
Definition: Pub_.hpp:102
@ e_Journal
Definition: Pub_.hpp:107
@ e_Patent
Definition: Pub_.hpp:110
@ e_Muid
medline uid
Definition: Pub_.hpp:105
@ e_Proc
proceedings of a meeting
Definition: Pub_.hpp:109
@ e_Man
manuscript, thesis, or letter
Definition: Pub_.hpp:112
@ e_Sub
submission
Definition: Pub_.hpp:103
CRef< objects::CPubdesc > GetPubdescFromEntrezById(TEntrezId id)
Definition: utilities.cpp:78
END_EVENT_TABLE()
int i
#define wxT(x)
Definition: muParser.cpp:41
double value_type
The numeric datatype used by the parser.
Definition: muParserDef.h:228
const struct ncbi::grid::netcache::search::fields::SIZE size
Format
Definition: njn_ioutil.hpp:52
User-defined methods of the data storage class.
static char * locale
Definition: pcregrep.c:149
API (CPMCIDSearch) for looking up PubMed IDs based on other types of IDs.
USING_SCOPE(objects)
static string s_GetPubTitle(CRef< CPub > pub)
static bool s_IsProcChapter(CRef< CPub > pub)
static void s_SetPubLocale(CRef< CPub > pub, CRef< CMeeting > locale)
static bool s_IsBookChapter(CRef< CPub > pub)
static CRef< objects::CImprint > s_GetPubImprint(CRef< CPub > pub)
static void s_TransferPubData(CRef< CPub > src_pub, CRef< CPub > dest_pub)
void s_ApplyStatusToPub(int status, CRef< CPub > pub)
static bool s_IsJournalArticle(CRef< CPub > pub)
static void s_SetPubImprint(CRef< CPub > pub, CRef< objects::CImprint >)
static void s_SetPubTitle(CRef< CPub > pub, string title)
static bool s_IsOnlySetSerialNumber(const CCit_gen &gen)
static void s_SetPubAuthors(CRef< CPub > pub, const CAuth_list &auth_list)
#define ID_DOI_PMID
#define ID_DOI_LOOKUP
#define ID_PUBCLASS
#define ID_UNPUB_INPRESS_PUB
CRef< CPub > journal(ParserPtr pp, char *bptr, char *eptr, CRef< CAuth_list > &auth_list, CRef< CTitle::C_E > &title, bool has_muid, CRef< CCit_art > &cit_art, Int4 er)
Definition: ref.cpp:1457
Modified on Fri May 24 14:50:54 2024 by modify_doxy.py rev. 669887