85 LOG_POST(
Info <<
"Finished initializing Data Source Service");
97 LOG_POST(
Info <<
"Registered data source type \"" << name <<
"\"");
110 for(
size_t j = 0; ! found && j <
m_DataSources.size(); j++ ) {
112 found = (&ds.
GetType() == &ds_type);
116 LOG_POST(
Info <<
"Creating default Data Source for type \"" <<
124 string help_id = ds->GetDescr().GetHelpId();
125 if( help_id.empty() ){
126 help_id =
"DefaultUIDS";
128 string reg_path =
m_RegPath +
"." + help_id;
147 fileManager->LoadRegisteredManagers();
163 LOG_POST(
Info <<
"Registered data load manager \"" << name <<
"\"");
214 TUIDataSourceVec::iterator it =
218 string msg =
"Data Source " + ds_name +
" is already registered";
222 LOG_POST(
Info <<
"Registered data source \"" << ds_name <<
"\"");
238 if(ds_type->GetDescr().GetLabel() ==
label) {
257 if(ds->GetDescr().GetLabel() ==
label) {
272 const string& ds_name,
const string& what)
277 static const char*
kOpenErr =
"Failed to open datasource ";
278 static const char*
kCloseErr =
"Failed to close datasource ";
295 catch(std::exception& e) {
323 catch(std::exception& e) {
CFileLoadManager CFileLoadManager - a Loader Manager implementing "File" option in "Open" dialog.
CGCAssemblyLoadManager - Load Manager that loads genome collection assembly.
CProjectLoadManager -Load Manager that loads both Projects and Workspaces.
TDataSourceTypeVec m_DataSourceTypes
virtual void SaveSettings() const
virtual void ShutDownService()
vector< TUIToolManagerRef > TUIToolManagerVec
TUIToolManagerVec m_LoadManagers
virtual TUIDataSourceTypeRef GetUIDataSourceTypeByLabel(const string &label)
finds a Data Source Type by its UI label
virtual void AddDataSource(IUIDataSource &data_source)
registers a new data source
void x_InitDefaultDataSources()
CIRef< IUIDataSource > TUIDataSourceRef
virtual void GetLoadManagers(TUIToolManagerVec &managers)
retrieve Load Managers (both system Managers the Data Sources Managers)
void x_CloseDataSources()
virtual void LoadSettings()
IServiceLocator * m_SrvLocator
virtual void GetDataSources(TUIDataSourceVec &data_sources)
retrieve Data Sources registered in the application
virtual void GetDataSourceTypes(TDataSourceTypeVec &type_vec)
virtual void InitService()
CIRef< IUIDataSourceType > TUIDataSourceTypeRef
vector< TUIDataSourceTypeRef > TDataSourceTypeVec
vector< TUIDataSourceRef > TUIDataSourceVec
void x_InitDataSourceTypes()
virtual void SetRegistryPath(const string &path)
virtual void x_OpenDataSources()
virtual TUIDataSourceRef GetUIDataSourceByLabel(const string &label)
finds a Data Source by its UI label
virtual void SetServiceLocator(IServiceLocator *locator)
IExtension * m_OptionsDlgPage
void x_InitLoadManagers()
CIRef< IUIToolManager > TUIToolManagerRef
TUIDataSourceVec m_DataSources
CUIDataSourceService()
CUIDataSourceService.
IRegSettings An interface for objects that save / restore settings using CGuiRegistry.
virtual void SetRegistryPath(const string &path)=0
IServiceLocator - an abstract mechanism for locating services.
IUIDataSourceType - defines a type of a Data Source, can serve as a Data Source factory.
IUIDataSource - an interface representing a Data Source.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
void Info(CExceptionArgs_Base &args)
void Consumer_SetLocator(T *obj, IServiceLocator *locator)
virtual IUIDataSource * CreateDataSource()=0
factory method; create an Data Source instance
virtual bool AutoCreateDefaultDataSource()=0
returns "true" if this type needs to create a default instance of the Data Source at start-up
virtual bool IsOpen()=0
a Data source needs to be open before use and closed after.
virtual IUIDataSourceType & GetType() const =0
#define EXT_POINT__OPTIONS_DLG_EXTENSION
An extension point for dialog panels that are shown in the "Options" dialog.
virtual bool Open()=0
Prepares Data Source for use, any initialization that can be potentially time-consuming or may requir...
virtual const IUIObject & GetDescr()=0
returns UI description of the type (label, icon etc.)
virtual const IUIObject & GetDescr()=0
returns UI description of the object (label, icon etc.)
void GetExtensionAsInterface(const string &ext_point_id, vector< CIRef< I > > &interfaces)
GetExtensionAsInterface() is a helper function that extracts all extensions implementing the specifie...
static CIRef< IExtensionRegistry > GetInstance()
provides access to the Singleton
virtual const string & GetLabel() const =0
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static const char label[]
static const char * prefix[]
static const char * kCloseErr
static const char * kOpenErr
static void sReportDSExceptionToLog(const string &prefix, const string &ds_name, const string &what)