6 #include "otsdaq/ConfigurationInterface/ConfigurationInterface.h"
7 #include "otsdaq/ConfigurationInterface/ConfigurationManagerRW.h"
17 void ImportSystemAliasTableGroups(
int argc,
char* argv[])
19 __COUT__ <<
"=================================================\n";
20 __COUT__ <<
"=================================================\n";
21 __COUT__ <<
"=================================================\n";
22 __COUT__ <<
"Importing External System Aliases!" << std::endl;
24 std::string prependBaseName =
"Imported";
25 const std::string groupAliasesTableName =
26 ConfigurationManager::GROUP_ALIASES_TABLE_NAME;
27 const std::string versionAliasesTableName =
28 ConfigurationManager::VERSION_ALIASES_TABLE_NAME;
30 std::cout <<
"\n\nusage: Two arguments:\n\n\t otsdaq_import_system_aliases "
31 "<path_to_import_database_folder> <path_to_active_groups_file> "
32 "<import_prepend_base_name (optional)> \n\n"
33 <<
"\t\t Default values: \n\t\t\timport_prepend_base_name = \""
34 << prependBaseName <<
"\" "
36 <<
"\t\tfor example:\n\n"
37 <<
"\t\t\totsdaq_import_system_aliases "
38 "~/databaseToImport/filesystemdb/test_db "
39 "~/UserDataToImport/ServiceData/ActiveTableGroups.cfg"
42 std::cout <<
"\n\n\tExample active groups file content:\n\n"
43 <<
"testContext\n2\nTableEditWizBackbone\n3\ndefaultConfig\n1\n\n"
46 std::cout <<
"\n\nNote: This assumes artdaq db file type interface. "
47 <<
"The current database/ will be backed up to database_<linuxtime>/ "
48 <<
"before importing the active groups.\n\n"
52 for(
int i = 0; i < argc; i++)
53 std::cout <<
"argv[" << i <<
"] = " << argv[i] << std::endl;
57 __COUT__ <<
"Must provide at least two parameters (the database and active "
58 "groups files for the import).\n\n\n"
64 while(strlen(argv[1]) && argv[1][strlen(argv[1]) - 1] ==
'/')
65 argv[1][strlen(argv[1]) - 1] =
'\0';
68 std::string pathToImportDatabase = argv[1];
69 if(pathToImportDatabase.size() &&
70 (pathToImportDatabase[0] ==
'h' || pathToImportDatabase[0] ==
'-'))
73 <<
"Recognized parameter 1. as a 'help' option. Usage was printed. Exiting."
78 std::string pathToImportActiveGroups =
"";
80 pathToImportActiveGroups = argv[2];
82 prependBaseName = argv[3];
84 __COUTV__(pathToImportDatabase);
85 __COUTV__(pathToImportActiveGroups);
86 __COUTV__(prependBaseName);
94 setenv(
"CONFIGURATION_TYPE",
"File", 1);
95 setenv(
"CONFIGURATION_DATA_PATH",
96 (std::string(__ENV__(
"USER_DATA")) +
"/ConfigurationDataExamples").c_str(),
99 "TABLE_INFO_PATH", (std::string(__ENV__(
"USER_DATA")) +
"/TableInfo").c_str(), 1);
103 setenv(
"SERVICE_DATA_PATH",
104 (std::string(__ENV__(
"USER_DATA")) +
"/ServiceData").c_str(),
109 setenv(
"OTSDAQ_LIB", (std::string(__ENV__(
"USER_DATA")) +
"/").c_str(), 1);
110 setenv(
"OTSDAQ_UTILITIES_LIB", (std::string(__ENV__(
"USER_DATA")) +
"/").c_str(), 1);
113 setenv(
"OTS_MAIN_PORT",
"2015", 1);
116 setenv(
"XDAQ_CONFIGURATION_DATA_PATH",
117 (std::string(__ENV__(
"USER_DATA")) +
"/XDAQConfigurations").c_str(),
119 setenv(
"XDAQ_CONFIGURATION_XML",
"otsConfigurationNoRU_CMake", 1);
184 std::map<std::string ,
186 originalGroupAliasMap;
192 std::map<std::string ,
194 originalTableAliasMap;
200 std::map< std::pair<std::string, TableGroupKey>,
207 __COUT__ <<
"Getting started..." << std::endl;
210 bool importedDbInPlace =
false;
213 std::string accumulatedWarnings;
216 ConfigurationManager::LoadGroupType::ALL_TYPES,
217 &accumulatedWarnings);
219 __COUT__ <<
"Done Loading active groups: \n" << accumulatedWarnings << std::endl;
222 __COUT__ <<
"Configuration manager initialized." << __E__;
224 std::string nowTime = std::to_string(time(0));
225 std::string currentDir = __ENV__(
"ARTDAQ_DATABASE_URI");
227 if(currentDir.find(
"filesystemdb://") != 0)
229 __SS__ <<
"filesystemdb:// was not found in $ARTDAQ_DATABASE_URI!" << std::endl;
230 __COUT_ERR__ <<
"\n" << ss.str();
234 currentDir = currentDir.substr(std::string(
"filesystemdb://").length());
235 while(currentDir.length() &&
236 currentDir[currentDir.length() - 1] ==
'/')
237 currentDir = currentDir.substr(0, currentDir.length() - 1);
239 __COUTV__(currentDir);
241 std::string backupDir = currentDir +
"_" + nowTime;
242 std::string importDir = pathToImportDatabase +
"_" + nowTime;
243 std::string tmpCurrentDir = currentDir +
"_tmp_" + nowTime;
247 std::map<std::string ,
249 existingTableAliases = cfgMgr->ConfigurationManager::getVersionAliases();
250 std::map<std::string , std::pair<std::string ,
TableGroupKey>>
271 __COUT__ <<
"Backing up current database at '" << currentDir <<
"' to '"
272 << backupDir <<
"'" << __E__;
273 std::system((
"cp -r " + currentDir +
" " + backupDir).c_str());
275 __COUT__ <<
"Backing up current database at '" << pathToImportDatabase <<
"' to '"
276 << importDir <<
"'" << __E__;
277 std::system((
"cp -r " + pathToImportDatabase +
" " + importDir).c_str());
281 __COUT__ <<
"Swap to import-db" << std::endl;
282 if(rename(currentDir.c_str(), tmpCurrentDir.c_str()) < 0)
284 __SS__ <<
"Problem!" << std::endl;
287 if(rename(importDir.c_str(), currentDir.c_str()) < 0)
289 __SS__ <<
"Problem!" << std::endl;
292 importedDbInPlace =
true;
301 std::map<std::string, std::pair<std::string, TableGroupKey>> activeGroupsMap =
304 for(
const auto& activeGroup : activeGroupsMap)
306 if(activeGroup.second.second.isInvalid())
308 if(activeGroup.second.first ==
"")
311 __COUTV__(activeGroup.second.first);
312 __COUTV__(activeGroup.second.second);
315 std::pair<std::pair<std::string, TableGroupKey>,
TableGroupKey>(
316 std::pair<std::string, TableGroupKey>(activeGroup.second.first,
317 activeGroup.second.second),
322 std::map<std::string, TableVersion> activeVersions = cfgMgr->
getActiveVersions();
323 if(activeVersions.find(groupAliasesTableName) == activeVersions.end())
325 __SS__ <<
"\nActive version of " << groupAliasesTableName <<
" missing! "
326 << groupAliasesTableName
327 <<
" is a required member of the Backbone configuration group."
328 <<
"\n\nLikely you need to activate a valid Backbone group."
332 if(activeVersions.find(versionAliasesTableName) == activeVersions.end())
334 __SS__ <<
"\nActive version of " << versionAliasesTableName <<
" missing! "
335 << versionAliasesTableName
336 <<
" is a required member of the Backbone configuration group."
337 <<
"\n\nLikely you need to activate a valid Backbone group."
342 std::vector<std::pair<std::string, ConfigurationTree>> aliasNodePairs =
344 std::string aliasName;
345 for(
auto& aliasPair : aliasNodePairs)
347 if(
TableGroupKey(aliasPair.second.getNode(
"GroupKey").getValueAsString())
350 if(aliasPair.second.getNode(
"GroupName").getValueAsString() ==
"")
353 aliasName = aliasPair.second.getNode(
"GroupKeyAlias").getValueAsString();
357 if(aliasName[0] >=
'a' && aliasName[0] <=
'z')
359 aliasName = prependBaseName + aliasName;
360 __COUTV__(aliasName);
361 __COUTV__(aliasPair.second.getNode(
"GroupName").getValueAsString());
362 __COUTV__(aliasPair.second.getNode(
"GroupKey").getValueAsString());
366 if(existingGroupAliases.find(aliasName) != existingGroupAliases.end())
368 __SS__ <<
"Conflicting group alias '" << aliasName <<
"' found!" << __E__;
373 std::pair<std::pair<std::string, TableGroupKey>,
TableGroupKey>(
374 std::pair<std::string, TableGroupKey>(
375 aliasPair.second.getNode(
"GroupName").getValueAsString(),
377 aliasPair.second.getNode(
"GroupKey").getValueAsString())),
380 originalGroupAliasMap[aliasName] = std::pair<std::string, TableGroupKey>(
381 aliasPair.second.getNode(
"GroupName").getValueAsString(),
382 TableGroupKey(aliasPair.second.getNode(
"GroupKey").getValueAsString()));
386 for(
auto& aliasPair : aliasNodePairs)
388 if(
TableVersion(aliasPair.second.getNode(
"Version").getValueAsString())
391 if(aliasPair.second.getNode(
"TableName").getValueAsString() ==
"")
393 aliasName = aliasPair.second.getNode(
"VersionAlias").getValueAsString();
397 if(aliasName[0] >=
'a' && aliasName[0] <=
'z')
399 aliasName = prependBaseName + aliasName;
400 __COUTV__(aliasPair.second.getNode(
"TableName").getValueAsString());
401 __COUTV__(aliasName);
402 __COUTV__(aliasPair.second.getNode(
"Version").getValueAsString());
406 if(existingTableAliases.find(aliasName) != existingTableAliases.end())
408 __SS__ <<
"Conflicting table version alias '" << aliasName <<
"' found!"
413 originalTableAliasMap[aliasName] = std::pair<std::string, TableVersion>(
414 aliasPair.second.getNode(
"TableName").getValueAsString(),
415 TableVersion(aliasPair.second.getNode(
"Version").getValueAsString()));
418 catch(
const std::runtime_error& e)
420 __COUT_ERR__ <<
"There was a fatal error: " << e.what() << __E__;
422 __COUT__ << std::endl;
423 __COUT__ << std::endl;
424 __COUT__ <<
"Run the following to return to your previous database structure:"
426 __COUT__ <<
"\t otsdaq_flatten_system_aliases -1 " << backupDir <<
"\n\n"
428 __COUT__ << std::endl;
429 __COUT__ << std::endl;
436 __COUT__ << std::endl;
437 __COUT__ << std::endl;
438 __COUT__ <<
"Identified groups:" << std::endl;
439 for(
auto& group : groupSet)
440 __COUT__ <<
"\t" << group.first.first <<
" " << group.first.second << std::endl;
441 __COUT__ << std::endl;
442 __COUT__ << std::endl;
444 __COUT__ <<
"Identified group aliases:" << std::endl;
445 for(
auto& groupAlias : originalGroupAliasMap)
446 __COUT__ <<
"\t" << groupAlias.first <<
" ==> " << groupAlias.second.first <<
"-"
447 << groupAlias.second.second << std::endl;
448 __COUT__ << std::endl;
449 __COUT__ << std::endl;
455 ConfigurationInterface::CONFIGURATION_MODE::ARTDAQ_DATABASE);
462 std::string accumulateErrors =
"";
465 std::map<std::string, TableVersion> memberMap;
466 std::map<std::string , std::string > groupAliases;
467 std::string groupComment;
468 std::string groupAuthor;
469 std::string groupCreateTime;
470 time_t groupCreateTime_t;
471 TableBase* groupMetadataTable = cfgMgr->getMetadataTable();
473 __COUT__ <<
"Proceeding with handling of identified groups..." << __E__;
476 for(
auto& groupPair : groupSet)
485 __COUTV__(importedDbInPlace);
487 if(!importedDbInPlace)
489 __COUT__ <<
"Swap to import-db" << std::endl;
490 if(rename(currentDir.c_str(), tmpCurrentDir.c_str()) < 0)
492 __SS__ <<
"Problem!" << std::endl;
495 if(rename(importDir.c_str(), currentDir.c_str()) < 0)
497 __SS__ <<
"Problem!" << std::endl;
500 importedDbInPlace =
true;
506 __COUT__ <<
"****************************" << std::endl;
507 __COUT__ <<
"Loading members for " << groupPair.first.first <<
"("
508 << groupPair.first.second <<
")" << std::endl;
516 groupPair.first.second,
528 catch(std::runtime_error& e)
530 __COUT__ <<
"Error was caught loading members for " << groupPair.first.first
531 <<
"(" << groupPair.first.second <<
")" << std::endl;
532 __COUT__ << e.what() << std::endl;
537 __COUT__ <<
"Error was caught loading members for " << groupPair.first.first
538 <<
"(" << groupPair.first.second <<
")" << std::endl;
555 std::pair<std::pair<std::string, TableGroupKey>, std::string>(
556 std::pair<std::string, TableGroupKey>(groupPair.first.first,
557 groupPair.first.second),
558 "Error caught loading the group."));
563 if(importedDbInPlace)
565 __COUT__ <<
"Swap to current-db" << std::endl;
566 if(rename(currentDir.c_str(), importDir.c_str()) < 0)
568 __SS__ <<
"Problem!" << std::endl;
571 if(rename(tmpCurrentDir.c_str(), currentDir.c_str()) < 0)
573 __SS__ <<
"Problem!" << std::endl;
576 importedDbInPlace =
false;
584 for(
auto& memberPair : memberMap)
586 __COUT__ << memberPair.first <<
":v" << memberPair.second << std::endl;
590 if(newTableVersionMap.find(std::pair<std::string, TableVersion>(
591 memberPair.first, memberPair.second)) != newTableVersionMap.end())
593 __COUT__ <<
"Table was already modified!" << std::endl;
595 newTableVersionMap[std::pair<std::string, TableVersion>(
596 memberPair.first, memberPair.second)];
597 __COUT__ <<
"\t to...\t" << memberPair.first <<
":v"
598 << memberPair.second << std::endl;
604 config = cfgMgr->getTableByName(memberPair.first);
605 cfgView = config->getViewP();
609 __COUTV__(newVersion);
611 theInterface_->saveActiveVersion(config);
620 newTableVersionMap.insert(
621 std::pair<std::pair<std::string, TableVersion>,
TableVersion>(
622 std::pair<std::string, TableVersion>(memberPair.first,
626 memberPair.second = newVersion;
628 __COUT__ <<
"\t to...\t" << memberPair.first <<
":v" << memberPair.second
632 __COUT__ <<
"Member map completed" << __E__;
639 __COUTV__(groupComment);
640 __COUTV__(groupAuthor);
641 __COUTV__(groupCreateTime);
642 sscanf(groupCreateTime.c_str(),
"%ld", &groupCreateTime_t);
643 __COUTV__(groupCreateTime_t);
647 while(groupMetadataTable->getViewP()->getNumberOfRows() > 1)
648 groupMetadataTable->getViewP()->
deleteRow(0);
649 if(groupMetadataTable->getViewP()->getNumberOfRows() == 0)
650 groupMetadataTable->getViewP()->
addRow();
654 groupMetadataTable->getViewP()->
setValue(
656 groupAliases,
"," ,
":" ),
658 ConfigurationManager::METADATA_COL_ALIASES);
659 groupMetadataTable->getViewP()->
setValue(
660 groupComment, 0, ConfigurationManager::METADATA_COL_COMMENT);
661 groupMetadataTable->getViewP()->
setValue(
662 groupAuthor, 0, ConfigurationManager::METADATA_COL_AUTHOR);
663 groupMetadataTable->getViewP()->
setValue(
664 groupCreateTime_t, 0, ConfigurationManager::METADATA_COL_TIMESTAMP);
669 __COUTV__(newVersion);
670 groupMetadataTable->getViewP()->
setVersion(newVersion);
671 theInterface_->saveActiveVersion(groupMetadataTable);
685 theInterface_->saveTableGroup(
690 groupPair.second = newKey;
692 catch(std::runtime_error& e)
694 __COUT__ <<
"Error was caught saving group " << groupPair.first.first <<
" ("
695 << groupPair.first.second <<
") " << std::endl;
696 __COUT__ << e.what() << std::endl;
699 std::pair<std::pair<std::string, TableGroupKey>, std::string>(
700 std::pair<std::string, TableGroupKey>(groupPair.first.first,
701 groupPair.first.second),
702 "Error caught saving the group."));
706 __COUT__ <<
"Error was caught saving group " << groupPair.first.first <<
" ("
707 << groupPair.first.second <<
") " << std::endl;
710 std::pair<std::pair<std::string, TableGroupKey>, std::string>(
711 std::pair<std::string, TableGroupKey>(groupPair.first.first,
712 groupPair.first.second),
713 "Error caught saving the group."));
721 __COUT__ <<
"Completed group and table saving for " << count <<
" groups." << __E__;
722 __COUT__ <<
"Created tables:" << std::endl;
723 for(
auto& tablePair : newTableVersionMap)
724 __COUT__ <<
"\t" << tablePair.first.first <<
"-v" << tablePair.first.second
725 <<
" ==> " << tablePair.second << std::endl;
726 __COUT__ << std::endl;
727 __COUT__ << std::endl;
728 __COUT__ <<
"Created groups:" << std::endl;
729 for(
auto& group : groupSet)
730 __COUT__ <<
"\t" << group.first.first <<
"(" << group.first.second <<
") ==> "
731 << group.second << std::endl;
735 if(importedDbInPlace)
737 __COUT__ <<
"Swap to current-db" << std::endl;
738 if(rename(currentDir.c_str(), importDir.c_str()) < 0)
740 __SS__ <<
"Problem!" << std::endl;
743 if(rename(tmpCurrentDir.c_str(), currentDir.c_str()) < 0)
745 __SS__ <<
"Problem!" << std::endl;
748 importedDbInPlace =
false;
753 FILE* fp = fopen((currentDir +
"/README_otsdaq_import.txt").c_str(),
"a");
756 __COUT__ <<
"\tError opening README file!" << std::endl;
764 timeinfo = localtime(&rawtime);
765 strftime(buffer, 200,
"%b %d, %Y %I:%M:%S%p %Z", timeinfo);
768 "This database...\t %s \t received an import from...\t %s \t at this "
769 "time \t %lu \t %s\n\n",
771 pathToImportDatabase.c_str(),
791 __COUT__ <<
"Modifying the active Backbone table to reflect new table versions and "
800 std::string activeBackboneGroupName =
801 cfgMgr->getActiveGroupName(ConfigurationManager::GroupType::BACKBONE_TYPE);
803 activeBackboneGroupName,
804 cfgMgr->getActiveGroupKey(ConfigurationManager::GroupType::BACKBONE_TYPE),
813 if(activeMap.find(groupAliasesTableName) != activeMap.end())
815 __COUT__ <<
"\n\nModifying " << groupAliasesTableName << std::endl;
816 config = cfgMgr->getTableByName(groupAliasesTableName);
817 cfgView = config->getViewP();
819 unsigned int col0 = cfgView->
findCol(
"GroupKeyAlias");
820 unsigned int col1 = cfgView->
findCol(
"GroupName");
821 unsigned int col2 = cfgView->
findCol(
"GroupKey");
829 for(
auto& aliasPair : originalGroupAliasMap)
831 auto groupIt = groupSet.find(std::pair<std::string, TableGroupKey>(
832 aliasPair.second.first, aliasPair.second.second));
834 if(groupIt == groupSet.end())
837 <<
"Error! Could not find the new entry for the original group "
838 << aliasPair.second.first <<
"(" << aliasPair.second.second <<
")"
842 row = cfgView->
addRow(
"import_aliases",
true );
843 cfgView->
setValue(aliasPair.first, row, col0);
844 cfgView->
setValue(aliasPair.second.first, row, col1);
845 cfgView->
setValue(groupIt->second.toString(), row, col2);
852 if(activeMap.find(versionAliasesTableName) != activeMap.end())
854 __COUT__ <<
"\n\nModifying " << versionAliasesTableName << std::endl;
855 config = cfgMgr->getTableByName(versionAliasesTableName);
856 cfgView = config->getViewP();
857 unsigned int col0 = cfgView->
findCol(
"VersionAlias");
858 unsigned int col1 = cfgView->
findCol(
"TableName");
859 unsigned int col2 = cfgView->
findCol(
"Version");
868 for(
auto& aliasPair : originalTableAliasMap)
871 newTableVersionMap.find(std::pair<std::string, TableVersion>(
872 aliasPair.second.first, aliasPair.second.second));
874 if(tableIt == newTableVersionMap.end())
877 <<
"Error! Could not find the new entry for the original table "
878 << aliasPair.second.first <<
"(" << aliasPair.second.second <<
")"
882 row = cfgView->
addRow(
"import_aliases",
true );
883 cfgView->
setValue(aliasPair.first, row, col0);
884 cfgView->
setValue(aliasPair.second.first, row, col1);
885 cfgView->
setValue(tableIt->second.toString(), row, col2);
894 config = cfgMgr->getTableByName(groupAliasesTableName);
895 cfgView = config->getViewP();
898 __COUTV__(newVersion);
900 theInterface_->saveActiveVersion(config);
902 memberMap[groupAliasesTableName] = newVersion;
905 __COUT__ <<
"\t to...\t" << groupAliasesTableName <<
":v"
906 << memberMap[groupAliasesTableName] << std::endl;
908 __COUT__ << versionAliasesTableName <<
":v" << memberMap[versionAliasesTableName]
911 config = cfgMgr->getTableByName(versionAliasesTableName);
912 cfgView = config->getViewP();
915 __COUTV__(newVersion);
917 theInterface_->saveActiveVersion(config);
919 memberMap[versionAliasesTableName] =
922 __COUT__ <<
"\t to...\t" << versionAliasesTableName <<
":v"
923 << memberMap[versionAliasesTableName] << std::endl;
925 __COUT__ <<
"Backbone member map completed" << __E__;
934 theInterface_->saveTableGroup(
938 std::string renameFile =
943 <<
"' to ... '" << renameFile <<
"'" << std::endl;
949 catch(
const std::runtime_error& e)
951 __COUT_ERR__ <<
"There was a fatal error during backbone modification: "
952 << e.what() << __E__;
959 std::cout <<
"\n\n" << __COUT_HDR_FL__ <<
"Resulting Groups:" << std::endl;
960 for(
const auto& group : groupSet)
961 __COUT__ <<
"\t" << group.first.first <<
": " << group.first.second <<
" => "
962 << group.second << std::endl;
963 std::cout <<
"\n\n" << __COUT_HDR_FL__ <<
"Resulting Groups end." << std::endl;
967 __COUT__ <<
"End of Importing Active Table Groups!\n\n\n" << std::endl;
969 __COUT__ <<
"****************************" << std::endl;
970 __COUT__ <<
"There were " << groupSet.size() <<
" groups considered, and there were "
971 << groupErrors.size() <<
" errors found handling those groups." << std::endl;
972 __COUT__ <<
"The following errors were found handling the groups:" << std::endl;
973 for(
auto& groupErr : groupErrors)
974 __COUT__ <<
"\t" << groupErr.first.first <<
" " << groupErr.first.second <<
": \t"
975 << groupErr.second << std::endl;
976 __COUT__ <<
"End of errors.\n\n" << std::endl;
978 __COUT__ <<
"Run the following to return to your previous database structure:"
980 __COUT__ <<
"\t otsdaq_flatten_system_aliases -1 " << backupDir <<
"\n\n"
986 int main(
int argc,
char* argv[])
988 ImportSystemAliasTableGroups(argc, argv);
virtual TableGroupKey findLatestGroupKey(const std::string &) const
otsdaq_database_migrate and otsdaq_import_system_aliases to compile
virtual TableVersion findLatestVersion(const TableBase *configuration) const =0
return INVALID if no existing versions
void loadTableGroup(const std::string &tableGroupName, const TableGroupKey &tableGroupKey, bool doActivate=false, std::map< std::string, TableVersion > *groupMembers=0, ProgressBar *progressBar=0, std::string *accumulateWarnings=0, std::string *groupComment=0, std::string *groupAuthor=0, std::string *groupCreateTime=0, bool doNotLoadMember=false, std::string *groupTypeString=0, std::map< std::string, std::string > *groupAliases=0, ConfigurationManager::LoadGroupType onlyLoadIfBackboneOrContext=ConfigurationManager::LoadGroupType::ALL_TYPES, bool ignoreVersionTracking=false)
void restoreActiveTableGroups(bool throwErrors=false, const std::string &pathToActiveGroupsFile="", ConfigurationManager::LoadGroupType onlyLoadIfBackboneOrContext=ConfigurationManager::LoadGroupType::ALL_TYPES, std::string *accumulatedWarnings=0)
std::map< std::string, std::pair< std::string, TableGroupKey > > getActiveTableGroups(void) const
std::map< std::string, TableVersion > getActiveVersions(void) const
getActiveVersions
ConfigurationTree getNode(const std::string &nodeString, bool doNotThrowOnBrokenUIDLinks=false) const
"root/parent/parent/"
static const std::string ACTIVE_GROUPS_FILENAME
added env check for otsdaq_flatten_active_to_version to function
std::map< std::string, std::pair< std::string, TableGroupKey > > getActiveGroupAliases(void)
void activateTableGroup(const std::string &tableGroupName, TableGroupKey tableGroupKey, std::string *accumulatedTreeErrors=0, std::string *groupTypeString=0)
modifiers of table groups
std::vector< std::pair< std::string, ConfigurationTree > > getChildren(std::map< std::string, std::string > filterMap=std::map< std::string, std::string >(), bool byPriority=false, bool onlyStatusTrue=false) const
const std::string & getTableName(void) const
Getters.
const TableVersion & getViewVersion(void) const
always the active one
static TableGroupKey getNextKey(const TableGroupKey &key=TableGroupKey())
bool isInvalid(void) const
isInvalid
static std::string getFullGroupString(const std::string &groupName, const TableGroupKey &key, const std::string &preKey="_v", const std::string &postKey="")
bool isInvalid(void) const
isInvalid
static TableVersion getNextVersion(const TableVersion &version=TableVersion())
void setVersion(const T &version)
< in included .icc source
unsigned int findCol(const std::string &name) const
void setValue(const T &value, unsigned int row, unsigned int col)
< in included .icc source
unsigned int addRow(const std::string &author="", unsigned char incrementUniqueData=false, const std::string &baseNameAutoUID="", unsigned int rowToAdd=(unsigned int) -1, std::string childLinkIndex="", std::string groupId="")
static std::string mapToString(const std::map< std::string, T > &mapToReturn, const std::string &primaryDelimeter=", ", const std::string &secondaryDelimeter=": ")