NCBI C++ ToolKit
entrez_search_tool.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_SERVICES___ENTREZ_SEARCH_TOOL_HPP
2 #define GUI_SERVICES___ENTREZ_SEARCH_TOOL_HPP
3 
4 /* $Id: entrez_search_tool.hpp 33516 2015-08-06 18:34:36Z evgeniev $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Andrey Yazhuk
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbistd.hpp>
36 
40 
41 
42 class wxTextCtrl;
43 class wxChoice;
44 
46 
47 
48 /** @addtogroup GUI_PKG_SEQUENCE
49  *
50  * @{
51  */
52 
53 
54 ///////////////////////////////////////////////////////////////////////////////
55 /// CEntrezSearchTool
57 {
58 public:
60 
61  /// @name IUITool implementation
62  /// @{
63  virtual IUITool* Clone() const;
64  virtual string GetName() const;
65  virtual string GetDescription() const;
66  /// @}
67 
68  /// @name IDMSearchTool implementation
69  /// @{
71  virtual bool IsCompatible(IDataMiningContext* context);
72  /// @}
73 
74  void GetDbNames(vector<string>& name);
75 
76  /// @name IExtension implementation
77  /// @{
78  virtual string GetExtensionIdentifier() const;
79  virtual string GetExtensionLabel() const;
80  /// @}
81 
82 protected:
83  /// implementing CSearchToolBase pure virtual function
85 };
86 
87 
88 ///////////////////////////////////////////////////////////////////////////////
89 /// CEntrezSearchTool
91  public CObject,
92  public IDMSearchQuery
93 {
94 public:
95  CEntrezSearchQuery(const string& terms, const string& db_name);
96 
97  string GetTerms() const { return m_Terms; }
98  string GetDbName() const { return m_DbName; }
99 
100  virtual string ToString() const { return m_Terms + " at " + m_DbName; }
101 protected:
102  string m_Terms;
103  string m_DbName;
104 };
105 
106 
107 ///////////////////////////////////////////////////////////////////////////////
108 /// CTestSearchForm
109 
111 {
112 public:
115 
116  virtual void SetDictionary(list<string>* /*ddd*/) {}
117  virtual void SetMainValue(string /*val*/) {}
118 
119  /// @name IDMSearchForm implementation
120  /// @{
121  virtual void Create();
122  virtual void Init();
123  virtual void Update();
124 
126 
127  virtual wxSizer * GetWidget(wxWindow * parent);
128 
129  virtual void UpdateContexts();
130 
131 protected:
132  virtual void x_LoadSettings(CGuiRegistry::TReadView& view);
133  virtual void x_SaveSettings(CGuiRegistry::TReadWriteView& view) const;
134 
136 
137 protected:
139  typedef pair<string, string> TStrPair;
140  typedef vector<TStrPair> TNamePairs;
141 
142  TNamePairs m_DbNames; /// Entrez db names
143  string m_CurrDbName; /// techical name
144  wxChoice* m_DbCombo;
145 };
146 
147 
148 ///////////////////////////////////////////////////////////////////////////////
149 /// CEntrezSearchJob
150 ///
152 {
153 public:
154  typedef pair<const char*, const char*> TPair;
155 
157 
158 protected:
159  /// @name CSearchJobBase overridables
160  /// @{
161  virtual bool x_ValidateParams();
162  virtual EJobState x_DoSearch();
163 
164  virtual CObjectListTableModel* x_GetNewOLTModel() const;
165  /// @}
166 
167  /// Adds an additional child node, indicating the release type (RefSeq or GenBank)
168  void SetReleaseType(xml::node& ds);
169 protected:
171 };
172 
173 
174 
175 /* @} */
176 
178 
179 
180 /*
181  * ===========================================================================
182  * ===========================================================================
183  */
184 
185 #endif // GUI_SERVICES___ENTREZ_SEARCH_TOOL_HPP
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" ) ...
virtual void x_LoadSettings(CGuiRegistry::TReadView &view)
virtual string GetName() const
returns unique name of the method that is used in UI to identify it
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:970
virtual IUITool * Clone() const
CEntrezSearchJob(CEntrezSearchQuery &query)
CEntrezSearchJob.
pair< const char *, const char * > TPair
CSearchToolBase.
void GetDbNames(vector< string > &name)
string GetDbName() const
IDMSearchQuery - abstract data mining query.
string GetTerms() const
virtual CObjectListTableModel * x_GetNewOLTModel() const
factory method creating new column handler for CObjectListWidget
virtual wxSizer * GetWidget(wxWindow *parent)
return a widget associated with the form; the form controls the lifetime of the widget (do not delete...
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:101
EJobState
Job states (describe FSM)
Definition: app_job.hpp:86
IDMSearchTool * x_GetTool(void)
IUITool represents an abstract algorithm that is bound to a UI component.
Definition: ui_tool.hpp:58
CEntrezSearchTool.
virtual CIRef< IDMSearchQuery > ConstructQuery()
static string query
virtual void x_SaveSettings(CGuiRegistry::TReadWriteView &view) const
virtual void UpdateContexts()
updates m_ContextCombo
CSearchFormBase.
virtual string GetDescription() const
returns a detailed description of the method that is used in UI
CTestSearchForm.
virtual CIRef< IDMSearchForm > CreateSearchForm()
factory method for creating a form representing the tool
virtual bool x_ValidateParams()
returns true if Job params are correct, implement in derived classes
vector< TStrPair > TNamePairs
CRef< CEntrezSearchQuery > m_Query
The xml::node class is used to hold information about one XML node.
Definition: node.hpp:106
virtual EJobState x_DoSearch()
performs searching, assuming that params are correct; Implement in derived classes ...
IDataMiningContext IDataMiningContext represents an abstract context for a Search.
virtual void SetMainValue(string)
CObjectListTableModel.
virtual string ToString() const
Prepare a string representation of a query (for logging and debugging)
IDMSearchTool interface representing a single search tool in Data Mining Service. ...
CEntrezSearchTool.
CEntrezSearchTool()
IDMSearchTool.
CRef –.
Definition: ncbiobj.hpp:616
virtual bool IsCompatible(IDataMiningContext *context)
retuns true if the tool is compatible with the provided Search Context
CObject –.
Definition: ncbiobj.hpp:180
CEntrezSearchQuery(const string &terms, const string &db_name)
CEntrezSearchTool.
string m_CurrDbName
Entrez db names.
CRef< CEntrezSearchTool > m_Tool
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
pair< string, string > TStrPair
virtual CRef< CSearchJobBase > x_CreateJob(IDMSearchQuery &query)
implementing CSearchToolBase pure virtual function
void SetReleaseType(xml::node &ds)
Adds an additional child node, indicating the release type (RefSeq or GenBank)
virtual void SetDictionary(list< string > *)
CSearchJobBase.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:98
CEntrezSearchJob.
wxChoice * m_DbCombo
techical name
Modified on Mon Jan 23 17:05:14 2017 by modify_doxy.py rev. 506947