1 #include "otsdaq/CoreSupervisors/ConfigurationSupervisorBase.h"
2 #include "otsdaq/TablePlugins/XDAQContextTable/XDAQContextTable.h"
11 std::map<std::string , std::pair<std::string ,
TableGroupKey>>
14 for(
auto& type : activeGroupMap)
16 xmlOut.addTextElementToData(type.first +
"-ActiveGroupName", type.second.first);
17 xmlOut.addTextElementToData(type.first +
"-ActiveGroupKey",
18 type.second.second.toString());
25 std::string groupAliasesTableName =
26 ConfigurationManager::GROUP_ALIASES_TABLE_NAME;
27 if(activeVersions.find(groupAliasesTableName) != activeVersions.end())
30 std::vector<std::pair<std::string, ConfigurationTree>> aliasNodePairs =
33 std::string groupName, groupKey, groupComment, groupType;
34 std::string activeGroupName, activeGroupKey;
35 for(
auto& type : activeGroupMap)
37 activeGroupName = type.second.first;
38 activeGroupKey = type.second.second.toString();
39 for(
auto& aliasNodePair : aliasNodePairs)
42 aliasNodePair.second.getNode(
"GroupName").getValueAsString();
44 aliasNodePair.second.getNode(
"GroupKey").getValueAsString();
45 if(groupName == activeGroupName && groupKey == activeGroupKey)
47 xmlOut.addTextElementToData(type.first +
"-ActiveGroupAlias",
58 __COUT__ <<
"Ignoring failure getting alias for active groups" << __E__;
62 xmlOut.addTextElementToData(
64 ConfigurationInterface::isVersionTrackingEnabled() ?
"ON" :
"OFF");
66 xmlOut.addTextElementToData(
"configUsername", username);
80 const std::string& tableName,
83 const std::string& data,
84 const int& dataOffset,
85 const std::string& author,
86 const std::string& comment,
88 bool lookForEquivalent)
112 TableBase* table = cfgMgr->getTableByName(tableName);
121 table->getMockupViewP()->getNumberOfColumns() ||
122 table->getViewP()->getSourceColumnMismatch() != 0)
124 __COUT__ <<
"table->getViewP()->getNumberOfColumns() "
125 << table->getViewP()->getNumberOfColumns() << __E__;
126 __COUT__ <<
"table->getMockupViewP()->getNumberOfColumns() "
127 << table->getMockupViewP()->getNumberOfColumns() << __E__;
128 __COUT__ <<
"table->getViewP()->getSourceColumnMismatch() "
129 << table->getViewP()->getSourceColumnMismatch() << __E__;
131 <<
"Source view v" << version
132 <<
" has a mismatch in the number of columns, so using mockup as source."
138 bool ignoreDuplicates =
false;
140 table->getViewP()->getSourceColumnNames().size() !=
143 __COUT__ <<
"table->getViewP()->getNumberOfColumns() "
144 << table->getViewP()->getNumberOfColumns() << __E__;
145 __COUTV__(table->getViewP()->getSourceColumnNames().size());
147 <<
"Source view v" << version
148 <<
" has a mismatch in the number of columns, so forcing new version saved."
150 ignoreDuplicates =
true;
156 __COUT__ <<
"\t\ttemporaryVersion: " << temporaryVersion << __E__;
169 __COUT__ <<
"Data was the same, but columns have changed!" << __E__;
170 __COUTV__(sourceTableAsIs);
171 __COUTV__(lookForEquivalent);
175 __COUT__ <<
"Table comment was set to:\n\t" << cfgView->getComment() << __E__;
179 __COUT__ <<
"Caught error while editing. Erasing temporary version." << __E__;
180 table->eraseView(temporaryVersion);
191 ConfigurationInterface::isVersionTrackingEnabled())
198 __SS__ <<
"No rows were modified! No reason to fill a view with same content."
200 __COUT_ERR__ <<
"\n" << ss.str();
202 table->eraseView(temporaryVersion);
206 __COUT__ <<
"This was interpreted as an attempt to create a blank table."
209 __COUT__ <<
"This was interpreted as an attempt to make a persistent "
210 "version of the scratch table."
215 __THROW__(ss.str() +
"impossible!");
220 __COUT__ <<
"Allowing the static data because this is converting from "
221 "temporary to persistent version."
224 else if(retVal < 0 && !ConfigurationInterface::isVersionTrackingEnabled())
226 __COUT__ <<
"Allowing the static data because version tracking is OFF." << __E__;
230 __SS__ <<
"This should not be possible! Fatal error." << __E__;
232 table->eraseView(temporaryVersion);
246 lookForEquivalent || sourceTableAsIs );
248 if(ignoreDuplicates && sourceTableAsIs)
250 table = cfgMgr->getTableByName(tableName);
251 table->eraseView(newVersion);
254 catch(std::runtime_error& e)
256 __SS__ <<
"Error saving new table!\n\n " << e.what() << __E__;
257 __COUT__ <<
"\n" << ss.str() << __E__;
258 xmlOut.addTextElementToData(
"Error", ss.str());
262 __SS__ <<
"Error saving new table!" << __E__;
267 catch(
const std::exception& e)
269 ss <<
"Exception message: " << e.what();
274 __COUT__ <<
"\n" << ss.str() << __E__;
275 xmlOut.addTextElementToData(
"Error", ss.str());
286 const std::string& tableName,
291 bool ignoreDuplicates,
292 bool lookForEquivalent)
294 bool foundEquivalent;
300 temporaryModifiedVersion,
305 xmlOut.addTextElementToData(
"savedName", tableName);
306 xmlOut.addTextElementToData(
"savedVersion", newAssignedVersion.
toString());
310 xmlOut.addTextElementToData(
"foundEquivalentVersion",
"1");
311 xmlOut.addTextElementToData(tableName +
"_foundEquivalentVersion",
"1");
313 return newAssignedVersion;
338 const std::string& groupName,
339 const std::string& tableList,
340 bool allowDuplicates,
342 const std::string& groupComment,
343 bool lookForEquivalent)
346 __COUTT__ <<
"handleCreateTableGroupXML start runtime=" << cfgMgr->runTimeSeconds()
349 xmlOut.addTextElementToData(
"AttemptedNewGroupName", groupName);
353 std::string accumulatedWarnings;
354 const std::map<std::string, TableInfo>& allTableInfo =
356 if(!allTableInfo.size())
358 &accumulatedWarnings,
364 __COUT_WARN__ <<
"Ignoring these errors: " << accumulatedWarnings << __E__;
367 __COUTT__ <<
"handleCreateTableGroupXML loaded runtime=" << cfgMgr->runTimeSeconds()
370 std::map<std::string ,
379 std::map<std::string , std::string > memberTableAliases;
381 std::string name, versionStr, alias;
383 auto c = tableList.find(
',', 0);
386 while(c < tableList.length())
389 name = tableList.substr(i, c - i);
391 c = tableList.find(
',', i);
392 if(c == std::string::npos)
394 __SS__ <<
"Incomplete Table Name-Version pair!" << __E__;
395 __COUT_ERR__ <<
"\n" << ss.str();
396 xmlOut.addTextElementToData(
"Error", ss.str());
400 versionStr = tableList.substr(i, c - i);
402 c = tableList.find(
',', i);
408 if(versionStr.find(ConfigurationManager::ALIAS_VERSION_PREAMBLE) == 0)
411 versionStr.substr(ConfigurationManager::ALIAS_VERSION_PREAMBLE.size());
413 __COUT__ <<
"Found alias " << name <<
" " << versionStr << __E__;
416 if(versionAliases.find(name) != versionAliases.end() &&
417 versionAliases[name].find(alias) != versionAliases[name].end())
419 version = versionAliases[name][alias];
420 __COUT__ << name <<
" version alias '" << alias
421 <<
"'translated to: " << version << __E__;
423 memberTableAliases[name] = alias;
427 __SS__ <<
"version alias '"
428 << versionStr.substr(
429 ConfigurationManager::ALIAS_VERSION_PREAMBLE.size())
430 <<
"' was not found in active version aliases! Please check your "
433 __COUT_ERR__ <<
"\n" << ss.str();
434 xmlOut.addTextElementToData(
"Error", ss.str());
443 __SS__ <<
"Groups can not be created using temporary member tables. "
444 <<
"Table member '" << name <<
"' with temporary version '" << version
445 <<
"' is illegal." << __E__;
446 xmlOut.addTextElementToData(
"Error", ss.str());
451 if(allTableInfo.find(name) == allTableInfo.end())
453 __SS__ <<
"Groups can not be created using mock-up member tables of "
455 <<
"Table member '" << name <<
"' is not defined." << __E__;
456 xmlOut.addTextElementToData(
"Error", ss.str());
463 TableBase* table = cfgMgr->getTableByName(name);
466 __COUT__ <<
"\t\ttemporaryVersion: " << temporaryVersion << __E__;
469 __COUT__ <<
"Creating version from mock-up for name: " << name
470 <<
" inputVersionStr: " << versionStr << __E__;
474 ->setComment(
"Auto-generated from mock-up.");
488 __COUT__ <<
"Using mockup version: " << version << __E__;
492 groupMembers[name] = version;
495 __COUTT__ <<
"handleCreateTableGroupXML tables saved runtime="
496 << cfgMgr->runTimeSeconds() << __E__;
502 __COUT__ <<
"Checking for duplicate groups..." << __E__;
506 cfgMgr->
findTableGroup(groupName, groupMembers, memberTableAliases);
507 __COUTT__ <<
"handleCreateTableGroupXML group duplicates checked runtime="
508 << cfgMgr->runTimeSeconds() << __E__;
512 xmlOut.addTextElementToData(
"TableGroupName", groupName);
513 xmlOut.addTextElementToData(
"TableGroupKey", foundKey.
toString());
515 if(lookForEquivalent)
517 __COUT__ <<
"Found equivalent group key (" << foundKey <<
") for "
518 << groupName <<
"." << __E__;
520 xmlOut.addTextElementToData(
"foundEquivalentKey",
"1");
533 __COUT__ <<
"Treating duplicate group as error." << __E__;
534 __SS__ << (
"Failed to create table group: " + groupName +
535 ". It is a duplicate of an existing group key (" +
537 __COUT_ERR__ << ss.str() << __E__;
538 xmlOut.addTextElementToData(
"Error", ss.str());
543 __COUT__ <<
"Check for duplicate groups complete." << __E__;
547 __COUT_WARN__ <<
"Ignoring errors looking for duplicate groups! Proceeding "
548 "with new group creation."
558 std::string accumulateErrors =
"";
559 for(
auto& groupMemberPair : groupMembers)
562 cfgMgr->getTableByName(groupMemberPair.first)->getViewP();
564 cfgViewPtr->getSourceColumnMismatch() !=
568 __SS__ <<
"\n\nThere were errors found in loading a member table "
569 << groupMemberPair.first <<
":v" << cfgViewPtr->getVersion()
570 <<
". Please see the details below:\n\n"
571 << cfgViewPtr->getMismatchColumnInfo();
573 __COUT_ERR__ <<
"\n" << ss.str();
574 xmlOut.addTextElementToData(
"Error", ss.str());
579 catch(std::runtime_error& e)
581 __SS__ <<
"Failed to create table group: " << groupName
582 <<
".\nThere were problems loading the chosen members:\n\n"
583 << e.what() << __E__;
584 __COUT_ERR__ <<
"\n" << ss.str();
585 xmlOut.addTextElementToData(
"Error", ss.str());
590 __SS__ <<
"Failed to create table group: " << groupName << __E__;
595 catch(
const std::exception& e)
597 ss <<
"Exception message: " << e.what();
602 __COUT_ERR__ <<
"\n" << ss.str();
603 xmlOut.addTextElementToData(
"Error", ss.str());
607 __COUTT__ <<
"handleCreateTableGroupXML group members init checked runtime="
608 << cfgMgr->runTimeSeconds() << __E__;
611 std::string accumulateTreeErrs;
612 cfgMgr->
getChildren(&groupMembers, &accumulateTreeErrs);
613 if(accumulateTreeErrs !=
"")
615 __COUT_WARN__ <<
"\n" << accumulateTreeErrs << __E__;
618 xmlOut.addTextElementToData(
"TreeErrors", accumulateTreeErrs);
623 __COUTT__ <<
"handleCreateTableGroupXML tree checked runtime="
624 << cfgMgr->runTimeSeconds() << __E__;
629 __COUT__ <<
"Saving new group..." << __E__;
631 groupName, groupMembers, groupComment, &memberTableAliases);
633 catch(std::runtime_error& e)
635 __SS__ <<
"Failed to create table group: " << groupName << __E__;
636 ss <<
"\n\n" << e.what() << __E__;
637 __COUT_ERR__ << ss.str();
638 xmlOut.addTextElementToData(
"Error", ss.str());
643 __SS__ <<
"Failed to create table group: " << groupName << __E__;
648 catch(
const std::exception& e)
650 ss <<
"Exception message: " << e.what();
655 __COUT_ERR__ << ss.str();
656 xmlOut.addTextElementToData(
"Error", ss.str());
660 __COUTT__ <<
"handleCreateTableGroupXML group saved runtime="
661 << cfgMgr->runTimeSeconds() << __E__;
664 __COUT__ <<
"Loading new table group..." << __E__;
666 xmlOut, cfgMgr, groupName, newKey, ignoreWarnings,
true );
668 __COUTT__ <<
"handleCreateTableGroupXML end runtime=" << cfgMgr->runTimeSeconds()
672 catch(std::runtime_error& e)
674 __SS__ <<
"Error saving table group!\n\n " << e.what() << __E__;
675 __COUT_ERR__ <<
"\n" << ss.str() << __E__;
676 xmlOut.addTextElementToData(
"Error", ss.str());
680 __SS__ <<
"Error saving table group!" << __E__;
685 catch(
const std::exception& e)
687 ss <<
"Exception message: " << e.what();
692 __COUT_ERR__ <<
"\n" << ss.str() << __E__;
693 xmlOut.addTextElementToData(
"Error", ss.str());
724 const std::string& groupName,
726 bool ignoreWarnings ,
731 xercesc::DOMElement *parentEl, *configEl;
754 __COUTTV__(cacheOnly);
758 auto SpanToXML = [](
auto const& sortedKeys,
auto& xmlOut) {
760 size_t lo = -1, hi = -1;
761 for(
auto& keyInOrder : sortedKeys)
765 hi = lo = keyInOrder.key();
768 else if(hi + 1 == keyInOrder.key())
770 hi = keyInOrder.key();
776 xmlOut.addNumberElementToData(
"HistoricalTableGroupKey", lo);
778 xmlOut.addTextElementToData(
779 "HistoricalTableGroupKey",
780 "_" + std::to_string(lo) +
"_" + std::to_string(hi));
781 hi = lo = keyInOrder.key();
787 xmlOut.addNumberElementToData(
"HistoricalTableGroupKey", lo);
789 xmlOut.addTextElementToData(
790 "HistoricalTableGroupKey",
791 "_" + std::to_string(lo) +
"_" + std::to_string(hi));
794 auto vSpanToXML = [](
auto const& sortedKeys,
auto& xmlOut,
auto& configEl) {
796 size_t lo = -1, hi = -1;
797 for(
auto& keyInOrder : sortedKeys)
801 hi = lo = keyInOrder.version();
804 else if(hi + 1 == keyInOrder.version())
806 hi = keyInOrder.version();
812 xmlOut.addNumberElementToParent(
"TableExistingVersion", lo, configEl);
815 "TableExistingVersion",
816 "_" + std::to_string(lo) +
"_" + std::to_string(hi),
818 hi = lo = keyInOrder.version();
824 xmlOut.addNumberElementToParent(
"TableExistingVersion", lo, configEl);
827 "TableExistingVersion",
828 "_" + std::to_string(lo) +
"_" + std::to_string(hi),
836 const std::set<TableGroupKey>& sortedKeys = groupInfo.getKeys();
840 __COUTT__ <<
"Active groups: "
842 __COUTT__ <<
"Active tables: "
848 sortedKeys.find(groupKey) == sortedKeys.end() ||
849 sortedKeys.size() < 2))
852 if(!groupKey.
isInvalid() || sortedKeys.size() == 0)
855 std::string accumulatedWarnings;
856 __COUTT__ <<
"Attempting full table refresh (assuming cache not yet "
861 &accumulatedWarnings,
866 __COUTT__ <<
"After full table refresh (assuming cache not yet "
867 "established) so ignoring these errors: "
868 << accumulatedWarnings << __E__;
873 const std::set<TableGroupKey>& sortedKeys2 =
874 groupInfo2.getKeys();
876 if(sortedKeys2.find(groupKey) == sortedKeys2.end())
878 __SS__ <<
"Group key " << groupKey <<
" was not found for group '"
879 << groupName <<
"!'" << __E__;
880 ss <<
"Her are the found " << sortedKeys2.size() <<
" '" << groupName
881 <<
"' keys: " << __E__;
882 for(
auto& keyInOrder : sortedKeys2)
883 ss <<
"\t" << keyInOrder << __E__;
884 __COUT_WARN__ <<
"\n" << ss.str() << __E__;
886 SpanToXML(sortedKeys2, xmlOut);
890 if(sortedKeys.size())
891 groupKey = *sortedKeys.rbegin();
893 <<
"Group key requested was invalid or not found, going with latest "
894 << groupKey << __E__;
897 SpanToXML(sortedKeys, xmlOut);
937 SpanToXML(sortedKeys, xmlOut);
943 <<
"There are no active tables. Attempting to initialize active groups."
946 std::string tmpAccumulateWarnings;
949 &tmpAccumulateWarnings);
950 __COUTT__ <<
"Now Active tables: "
952 __COUTT__ <<
"Ingoring warnings during init of active groups: "
953 << tmpAccumulateWarnings << __E__;
957 xmlOut.addTextElementToData(
"TableGroupName", groupName);
958 xmlOut.addTextElementToData(
"TableGroupKey", groupKey.
toString());
960 parentEl = xmlOut.addTextElementToData(
"TableGroupMembers",
"");
964 std::map<std::string , std::string > groupMemberAliases;
966 __COUT__ <<
"groupName=" << groupName << __E__;
967 __COUT__ <<
"groupKey=" << groupKey << __E__;
969 const std::map<std::string, TableInfo>& allTableInfo = cfgMgr->
getAllTableInfo();
970 std::map<std::string, TableInfo>::const_iterator it;
976 std::string groupAuthor, groupComment, groupCreationTime, groupTypeString;
977 std::string accumulateTreeErrors;
979 __COUTV__(ignoreWarnings);
986 &accumulateTreeErrors,
992 &groupMemberAliases);
994 if(accumulateTreeErrors !=
"")
996 __COUTV__(accumulateTreeErrors);
997 xmlOut.addTextElementToData(
"TreeErrors", accumulateTreeErrors);
1000 xmlOut.addTextElementToData(
"TableGroupAuthor", groupAuthor);
1001 xmlOut.addTextElementToData(
"TableGroupComment", groupComment);
1002 xmlOut.addTextElementToData(
"TableGroupCreationTime", groupCreationTime);
1003 xmlOut.addTextElementToData(
"TableGroupType", groupTypeString);
1005 catch(
const std::runtime_error& e)
1007 __SS__ <<
"Table group \"" + groupName +
"(" + groupKey.
toString() +
")" +
1008 "\" members can not be loaded!\n\n" + e.what()
1010 __COUT_ERR__ << ss.str();
1011 xmlOut.addTextElementToData(
"Error", ss.str());
1016 __SS__ <<
"Table group \"" + groupName +
"(" + groupKey.
toString() +
")" +
1017 "\" members can not be loaded!"
1023 catch(
const std::exception& e)
1025 ss <<
"Exception message: " << e.what();
1030 __COUT_ERR__ << ss.str();
1031 xmlOut.addTextElementToData(
"Error", ss.str());
1037 std::map<std::string, std::map<std::string, TableVersion>> versionAliases =
1040 __COUT__ <<
"# of table version aliases: " << versionAliases.size() << __E__;
1043 for(
auto& memberPair : memberMap)
1048 if(groupMemberAliases.find(memberPair.first) != groupMemberAliases.end())
1051 ConfigurationManager::ALIAS_VERSION_PREAMBLE +
1052 groupMemberAliases[memberPair.first],
1056 "MemberVersion", memberPair.second.toString(), parentEl);
1058 it = allTableInfo.find(memberPair.first);
1059 if(it == allTableInfo.end())
1062 xmlOut.addTextElementToData(
1063 "Error",
"Table \"" + memberPair.first +
"\" can not be retrieved!");
1068 "MemberComment", it->second.tablePtr_->getView().getComment(), parentEl);
1070 if(versionAliases.find(it->first) != versionAliases.end())
1071 for(
auto& aliasVersion : versionAliases[it->first])
1073 "TableExistingVersion",
1074 ConfigurationManager::ALIAS_VERSION_PREAMBLE + aliasVersion.first,
1077 vSpanToXML(it->second.versions_, xmlOut, configEl);
1159 catch(std::runtime_error& e)
1161 __SS__ << (
"Error getting table group!\n\n" + std::string(e.what())) << __E__;
1162 __COUT_ERR__ <<
"\n" << ss.str();
1163 xmlOut.addTextElementToData(
"Error", ss.str());
1167 __SS__ << (
"Error getting table group!\n\n") << __E__;
1172 catch(
const std::exception& e)
1174 ss <<
"Exception message: " << e.what();
1179 __COUT_ERR__ <<
"\n" << ss.str();
1180 xmlOut.addTextElementToData(
"Error", ss.str());
1184 bool ConfigurationSupervisorBase::handleAddDesktopIconXML(
1187 const std::string& iconCaption,
1188 const std::string& iconAltText,
1189 const std::string& iconFolderPath,
1190 const std::string& iconImageURL,
1191 const std::string& iconWindowURL,
1192 const std::string& iconPermissions,
1193 std::string windowLinkedApp ,
1194 unsigned int windowLinkedAppLID ,
1195 bool enforceOneWindowInstance ,
1196 const std::string& windowParameters )
1201 const std::string& author = cfgMgr->
getUsername();
1204 __COUTV__(iconCaption);
1205 __COUTV__(iconAltText);
1206 __COUTV__(iconFolderPath);
1207 __COUTV__(iconImageURL);
1208 __COUTV__(iconWindowURL);
1209 __COUTV__(iconPermissions);
1210 __COUTV__(windowLinkedApp);
1211 __COUTV__(windowLinkedAppLID);
1212 __COUTV__(enforceOneWindowInstance);
1214 __COUTV__(windowParameters);
1229 ConfigurationManager::LoadGroupType::
1230 ONLY_BACKBONE_OR_CONTEXT_TYPES
1233 const std::string backboneGroupName =
1234 cfgMgr->getActiveGroupName(ConfigurationManager::GroupType::BACKBONE_TYPE);
1236 GroupEditStruct contextGroupEdit(ConfigurationManager::GroupType::CONTEXT_TYPE,
1247 DesktopIconTable::ICON_TABLE,
true );
1248 TableEditStruct& parameterTable = contextGroupEdit.getTableEditStruct(
1249 DesktopIconTable::PARAMETER_TABLE,
true );
1251 ConfigurationManager::XDAQ_APPLICATION_TABLE_NAME);
1257 std::string iconUID =
"";
1260 for(
unsigned int i = 0; i < decodedCaption.size(); ++i)
1261 if((decodedCaption[i] >=
'a' && decodedCaption[i] <=
'z') ||
1262 (decodedCaption[i] >=
'A' && decodedCaption[i] <=
'Z') ||
1263 (decodedCaption[i] >=
'0' && decodedCaption[i] <=
'9'))
1264 iconUID += decodedCaption[i];
1267 row = iconTable.tableView_->
addRow(
1268 author,
true ,
"generatedIcon" + iconUID);
1270 iconTable.tableView_->getDataView()[row][iconTable.tableView_->
getColUID()];
1283 iconTable.tableView_->
findCol(DesktopIconTable::COL_CAPTION));
1288 iconTable.tableView_->
findCol(DesktopIconTable::COL_ALTERNATE_TEXT));
1291 enforceOneWindowInstance ?
"1" :
"0",
1293 iconTable.tableView_->
findCol(DesktopIconTable::COL_FORCE_ONLY_ONE_INSTANCE));
1298 iconTable.tableView_->
findCol(DesktopIconTable::COL_PERMISSIONS));
1303 iconTable.tableView_->
findCol(DesktopIconTable::COL_IMAGE_URL));
1308 iconTable.tableView_->
findCol(DesktopIconTable::COL_WINDOW_CONTENT_URL));
1313 iconTable.tableView_->
findCol(DesktopIconTable::COL_FOLDER_PATH));
1316 if(windowLinkedAppLID > 0)
1318 __COUTV__(windowLinkedAppLID);
1320 int appRow = appTable.tableView_->
findRow(
1321 appTable.tableView_->
findCol(XDAQContextTable::colApplication_.colId_),
1322 windowLinkedAppLID);
1325 ->getDataView()[appRow][appTable.tableView_->
getColUID()];
1326 __COUT__ <<
"Found app by LID: " << windowLinkedApp << __E__;
1329 if(windowLinkedApp !=
"" && windowLinkedApp !=
"undefined" &&
1330 windowLinkedApp != TableViewColumnInfo::DATATYPE_STRING_DEFAULT)
1335 __COUTV__(windowLinkedApp);
1337 if(!windowLinkedAppLID)
1343 appTable.tableView_->
getColUID(), windowLinkedApp);
1345 catch(
const std::runtime_error& e)
1350 int appRow = appTable.tableView_->
findRow(
1352 XDAQContextTable::colApplication_.colClass_),
1356 ->getDataView()[appRow][appTable.tableView_->
getColUID()];
1362 <<
"Failed to create an icon linking to XDAQ Supervisor app '"
1364 <<
".' Please make sure the Supervisor exists in the "
1365 << ConfigurationManager::XDAQ_APPLICATION_TABLE_NAME
1367 <<
"\n\nThe following error occurred: " << e.what() << __E__;
1368 appTable.tableView_->print(ss);
1373 __COUTV__(windowLinkedApp);
1376 ConfigurationManager::XDAQ_APPLICATION_TABLE_NAME,
1378 iconTable.tableView_->
findCol(DesktopIconTable::COL_APP_LINK));
1382 iconTable.tableView_->
findCol(DesktopIconTable::COL_APP_LINK_UID));
1386 std::map<std::string, std::string> parameters;
1388 __COUTV__(windowParameters);
1392 if(parameters.size())
1396 DesktopIconTable::PARAMETER_TABLE,
1398 iconTable.tableView_->
findCol(DesktopIconTable::COL_PARAMETER_LINK));
1401 iconUID +
"_Parameters",
1403 iconTable.tableView_->
findCol(DesktopIconTable::COL_PARAMETER_LINK_GID));
1407 unsigned int gidCol =
1408 parameterTable.tableView_->
findCol(DesktopIconTable::COL_PARAMETER_GID);
1411 std::vector<
unsigned int > rowsInGroup =
1413 gidCol, iconUID +
"_Parameters" );
1418 for(
unsigned int r = rowsInGroup.size() - 1; r < rowsInGroup.size(); --r)
1422 iconUID +
"_Parameters" ,
1426 for(
const auto& parameter : parameters)
1429 row = parameterTable.tableView_->
addRow(
1430 author,
true ,
"generatedParameter");
1437 iconUID +
"_Parameters", row, gidCol);
1442 parameterTable.tableView_->
findCol(
1443 DesktopIconTable::COL_PARAMETER_KEY));
1448 parameterTable.tableView_->
findCol(
1449 DesktopIconTable::COL_PARAMETER_VALUE));
1452 std::stringstream ss;
1453 parameterTable.tableView_->print(ss);
1454 __COUT__ << ss.str();
1456 parameterTable.tableView_
1461 std::stringstream ss;
1462 iconTable.tableView_->print(ss);
1463 __COUT__ << ss.str();
1465 iconTable.tableView_->
init();
1469 __COUT__ <<
"Icon table errors while saving. Erasing all newly "
1470 "created table versions."
1476 __COUT__ <<
"Edits complete for new desktop icon, now making persistent tables."
1490 bool foundEquivalentContextKey;
1492 bool foundEquivalentBackboneKey;
1494 contextGroupEdit.saveChanges(contextGroupEdit.originalGroupName_,
1496 &foundEquivalentContextKey,
1501 &foundEquivalentBackboneKey);
1503 xmlOut.addTextElementToData(
"contextGroupName", contextGroupEdit.originalGroupName_);
1504 xmlOut.addTextElementToData(
"contextGroupKey", newContextKey.
toString());
1506 xmlOut.addTextElementToData(
"backboneGroupName", backboneGroupName);
1507 xmlOut.addTextElementToData(
"backboneGroupKey", newBackboneKey.
toString());
1518 std::map<std::string, TableVersion> contextGroupMembers;
1519 std::map<std::string, TableVersion> backboneGroupMembers;
1521 std::map<std::string, TableVersion> activeTables =
1523 for(
auto& table : cfgMgr->getContextMemberNames())
1526 __COUT__ << table <<
" v" << activeTables.at(table) << __E__;
1527 contextGroupMembers[table] = activeTables.at(table);
1532 <<
"Error! Could not find Context member table '" << table
1533 <<
".' All Context members must be present to add a desktop icon."
1537 for(
auto& table : cfgMgr->getBackboneMemberNames())
1540 __COUT__ << table <<
" v" << activeTables.at(table) << __E__;
1541 backboneGroupMembers[table] = activeTables.at(table);
1545 __SS__ <<
"Error! Could not find Backbone member table '" << table
1546 <<
".' All Backbone members must be present to add a desktop "
1553 const std::string contextGroupName =
1554 cfgMgr->getActiveGroupName(ConfigurationManager::GroupType::CONTEXT_TYPE);
1556 cfgMgr->getActiveGroupKey(ConfigurationManager::GroupType::CONTEXT_TYPE);
1557 const std::string backboneGroupName =
1558 cfgMgr->getActiveGroupName(ConfigurationManager::GroupType::BACKBONE_TYPE);
1560 cfgMgr->getActiveGroupKey(ConfigurationManager::GroupType::BACKBONE_TYPE);
1562 __COUTV__(contextGroupName);
1563 __COUTV__(originalContextGroupKey);
1564 __COUTV__(backboneGroupName);
1565 __COUTV__(originalBackboneGroupKey);
1567 if(contextGroupName ==
"" || originalContextGroupKey.
isInvalid())
1569 __SS__ <<
"Error! No active Context group found. "
1570 "There must be an active Context group to add a Desktop Icon."
1586 TableEditStruct appTable(ConfigurationManager::XDAQ_APPLICATION_TABLE_NAME,
1593 std::string iconUID;
1596 row = iconTable.tableView_->
addRow(
1597 author,
true ,
"generatedIcon");
1598 iconUID = iconTable.tableView_
1599 ->getDataView()[row][iconTable.tableView_->
getColUID()];
1612 iconTable.tableView_->
findCol(DesktopIconTable::COL_CAPTION));
1617 iconTable.tableView_->
findCol(DesktopIconTable::COL_ALTERNATE_TEXT));
1620 enforceOneWindowInstance ?
"1" :
"0",
1622 iconTable.tableView_->
findCol(
1623 DesktopIconTable::COL_FORCE_ONLY_ONE_INSTANCE));
1628 iconTable.tableView_->
findCol(DesktopIconTable::COL_PERMISSIONS));
1633 iconTable.tableView_->
findCol(DesktopIconTable::COL_IMAGE_URL));
1638 iconTable.tableView_->
findCol(DesktopIconTable::COL_WINDOW_CONTENT_URL));
1643 iconTable.tableView_->
findCol(DesktopIconTable::COL_FOLDER_PATH));
1646 if(windowLinkedAppLID > 0)
1648 __COUTV__(windowLinkedAppLID);
1650 int appRow = appTable.tableView_->
findRow(
1652 XDAQContextTable::colApplication_.colId_),
1653 windowLinkedAppLID);
1656 ->getDataView()[appRow][appTable.tableView_->
getColUID()];
1657 __COUT__ <<
"Found app by LID: " << windowLinkedApp << __E__;
1660 if(windowLinkedApp !=
"" && windowLinkedApp !=
"undefined" &&
1661 windowLinkedApp != TableViewColumnInfo::DATATYPE_STRING_DEFAULT)
1666 __COUTV__(windowLinkedApp);
1668 if(!windowLinkedAppLID)
1673 appTable.tableView_->
getColUID(), windowLinkedApp);
1675 catch(
const std::runtime_error& e)
1680 int appRow = appTable.tableView_->
findRow(
1682 XDAQContextTable::colApplication_.colClass_),
1686 ->getDataView()[appRow]
1692 __SS__ <<
"Failed to create an icon linking to app '"
1694 <<
".' The following error occurred: " << e.what()
1700 __COUTV__(windowLinkedApp);
1703 ConfigurationManager::XDAQ_APPLICATION_TABLE_NAME,
1705 iconTable.tableView_->
findCol(DesktopIconTable::COL_APP_LINK));
1709 iconTable.tableView_->
findCol(DesktopIconTable::COL_APP_LINK_UID));
1713 std::map<std::string, std::string> parameters;
1715 __COUTV__(windowParameters);
1719 if(parameters.size())
1723 DesktopIconTable::PARAMETER_TABLE,
1725 iconTable.tableView_->
findCol(DesktopIconTable::COL_PARAMETER_LINK));
1728 iconUID +
"_Parameters",
1730 iconTable.tableView_->
findCol(
1731 DesktopIconTable::COL_PARAMETER_LINK_GID));
1735 for(
const auto& parameter : parameters)
1738 row = parameterTable.tableView_->
addRow(
1739 author,
true ,
"generatedParameter");
1746 iconUID +
"_Parameters",
1748 parameterTable.tableView_->
findCol(
1749 DesktopIconTable::COL_PARAMETER_GID));
1754 parameterTable.tableView_->
findCol(
1755 DesktopIconTable::COL_PARAMETER_KEY));
1760 parameterTable.tableView_->
findCol(
1761 DesktopIconTable::COL_PARAMETER_VALUE));
1764 std::stringstream ss;
1765 parameterTable.tableView_->print(ss);
1766 __COUT__ << ss.str();
1768 parameterTable.tableView_
1773 std::stringstream ss;
1774 iconTable.tableView_->print(ss);
1775 __COUT__ << ss.str();
1777 iconTable.tableView_->
init();
1781 __COUT__ <<
"Icon table errors while saving. Erasing all newly "
1782 "created table versions."
1786 __COUT__ <<
"Erasing temporary version " << iconTable.tableName_ <<
"-v"
1787 << iconTable.temporaryVersion_ << __E__;
1790 iconTable.temporaryVersion_);
1794 .createdTemporaryVersion_)
1796 __COUT__ <<
"Erasing temporary version " << parameterTable.tableName_
1797 <<
"-v" << parameterTable.temporaryVersion_ << __E__;
1800 parameterTable.temporaryVersion_);
1805 __COUT__ <<
"Erasing temporary version " << appTable.tableName_ <<
"-v"
1806 << appTable.temporaryVersion_ << __E__;
1809 appTable.temporaryVersion_);
1815 __COUT__ <<
"Edits complete for new desktop icon, now making persistent tables."
1828 __COUT__ <<
"Original version is " << iconTable.tableName_ <<
"-v"
1829 << iconTable.originalVersion_ << __E__;
1830 __COUT__ <<
"Original version is " << parameterTable.tableName_ <<
"-v"
1831 << parameterTable.originalVersion_ << __E__;
1833 contextGroupMembers[DesktopIconTable::ICON_TABLE] =
1837 iconTable.tableName_,
1838 iconTable.originalVersion_,
1841 iconTable.temporaryVersion_,
1843 contextGroupMembers[DesktopIconTable::PARAMETER_TABLE] =
1847 parameterTable.tableName_,
1848 parameterTable.originalVersion_,
1851 parameterTable.temporaryVersion_,
1854 __COUT__ <<
"Temporary target version is " << iconTable.tableName_ <<
"-v"
1855 << contextGroupMembers[DesktopIconTable::ICON_TABLE] <<
"-v"
1856 << iconTable.temporaryVersion_ << __E__;
1857 __COUT__ <<
"Temporary target version is " << parameterTable.tableName_ <<
"-v"
1858 << contextGroupMembers[DesktopIconTable::PARAMETER_TABLE] <<
"-v"
1859 << parameterTable.temporaryVersion_ << __E__;
1861 contextGroupMembers[DesktopIconTable::ICON_TABLE] =
1865 iconTable.tableName_,
1866 iconTable.originalVersion_,
1869 iconTable.temporaryVersion_,
1872 contextGroupMembers[DesktopIconTable::PARAMETER_TABLE] =
1876 parameterTable.tableName_,
1877 parameterTable.originalVersion_,
1880 parameterTable.temporaryVersion_,
1884 __COUT__ <<
"Final target version is " << iconTable.tableName_ <<
"-v"
1885 << contextGroupMembers[DesktopIconTable::ICON_TABLE] << __E__;
1886 __COUT__ <<
"Final target version is " << parameterTable.tableName_ <<
"-v"
1887 << contextGroupMembers[DesktopIconTable::PARAMETER_TABLE] << __E__;
1889 for(
auto& table : contextGroupMembers)
1891 __COUT__ << table.first <<
" v" << table.second << __E__;
1894 __COUT__ <<
"Checking for duplicate Context groups..." << __E__;
1900 __COUT__ <<
"Found equivalent group key (" << newContextKey <<
") for "
1901 << contextGroupName <<
"." << __E__;
1902 xmlOut.addTextElementToData(contextGroupName +
"_foundEquivalentKey",
1909 __COUT__ <<
"Saved new Context group key (" << newContextKey <<
") for "
1910 << contextGroupName <<
"." << __E__;
1913 xmlOut.addTextElementToData(
"contextGroupName", contextGroupName);
1914 xmlOut.addTextElementToData(
"contextGroupKey", newContextKey.
toString());
1918 __COUT__ <<
"Original version is " << iconTable.tableName_ <<
"-v"
1919 << iconTable.originalVersion_ << __E__;
1920 __COUT__ <<
"Original version is " << parameterTable.tableName_ <<
"-v"
1921 << parameterTable.originalVersion_ << __E__;
1923 bool groupAliasChange =
false;
1924 bool tableAliasChange =
false;
1930 cfgMgr->getTableByName(ConfigurationManager::GROUP_ALIASES_TABLE_NAME);
1932 backboneGroupMembers[ConfigurationManager::GROUP_ALIASES_TABLE_NAME];
1937 unsigned int row = 0;
1939 std::vector<std::pair<std::string, ConfigurationTree>> aliasNodePairs =
1940 cfgMgr->
getNode(ConfigurationManager::GROUP_ALIASES_TABLE_NAME)
1942 std::string groupName, groupKey;
1943 for(
auto& aliasNodePair : aliasNodePairs)
1945 groupName = aliasNodePair.second.getNode(
"GroupName").getValueAsString();
1946 groupKey = aliasNodePair.second.getNode(
"GroupKey").getValueAsString();
1948 __COUT__ <<
"Group Alias: " << aliasNodePair.first <<
" => " << groupName
1949 <<
"(" << groupKey <<
"); row=" << row << __E__;
1951 if(groupName == contextGroupName &&
1954 __COUT__ <<
"Found alias! Changing group key." << __E__;
1956 groupAliasChange =
true;
1965 if(groupAliasChange)
1967 std::stringstream ss;
1968 tableView->print(ss);
1969 __COUT__ << ss.str();
1972 backboneGroupMembers[ConfigurationManager::GROUP_ALIASES_TABLE_NAME] =
1984 __COUT__ <<
"Original version is " << table->
getTableName() <<
"-v"
1985 << originalVersion <<
" and new version is v"
1986 << backboneGroupMembers
1987 [ConfigurationManager::GROUP_ALIASES_TABLE_NAME]
1996 cfgMgr->getTableByName(ConfigurationManager::VERSION_ALIASES_TABLE_NAME);
1998 backboneGroupMembers[ConfigurationManager::VERSION_ALIASES_TABLE_NAME];
2003 unsigned int row = 0;
2005 std::vector<std::pair<std::string, ConfigurationTree>> aliasNodePairs =
2006 cfgMgr->
getNode(ConfigurationManager::VERSION_ALIASES_TABLE_NAME)
2008 std::string tableName, tableVersion;
2009 for(
auto& aliasNodePair : aliasNodePairs)
2011 tableName = aliasNodePair.second.getNode(
"TableName").getValueAsString();
2012 tableVersion = aliasNodePair.second.getNode(
"Version").getValueAsString();
2014 __COUT__ <<
"Table Alias: " << aliasNodePair.first <<
" => " << tableName
2015 <<
"-v" << tableVersion <<
"" << __E__;
2017 if(tableName == DesktopIconTable::ICON_TABLE &&
2018 TableVersion(tableVersion) == iconTable.originalVersion_)
2020 __COUT__ <<
"Found alias! Changing icon table version alias."
2023 tableAliasChange =
true;
2026 contextGroupMembers[DesktopIconTable::ICON_TABLE].toString(),
2028 tableView->
findCol(
"Version"));
2030 else if(tableName == DesktopIconTable::PARAMETER_TABLE &&
2031 TableVersion(tableVersion) == parameterTable.originalVersion_)
2034 <<
"Found alias! Changing icon parameter table version alias."
2037 tableAliasChange =
true;
2040 contextGroupMembers[DesktopIconTable::PARAMETER_TABLE].toString(),
2042 tableView->
findCol(
"Version"));
2048 if(tableAliasChange)
2050 std::stringstream ss;
2051 tableView->print(ss);
2052 __COUT__ << ss.str();
2055 backboneGroupMembers[ConfigurationManager::VERSION_ALIASES_TABLE_NAME] =
2067 __COUT__ <<
"Original version is " << table->
getTableName() <<
"-v"
2068 << originalVersion <<
" and new version is v"
2069 << backboneGroupMembers
2070 [ConfigurationManager::VERSION_ALIASES_TABLE_NAME]
2077 if(groupAliasChange || tableAliasChange)
2079 for(
auto& table : backboneGroupMembers)
2081 __COUT__ << table.first <<
" v" << table.second << __E__;
2085 __COUT__ <<
"Checking for duplicate Backbone groups..." << __E__;
2091 __COUT__ <<
"Found equivalent group key (" << newBackboneKey <<
") for "
2092 << backboneGroupName <<
"." << __E__;
2093 xmlOut.addTextElementToData(backboneGroupName +
"_foundEquivalentKey",
2100 __COUT__ <<
"Saved new Backbone group key (" << newBackboneKey <<
") for "
2101 << backboneGroupName <<
"." << __E__;
2104 xmlOut.addTextElementToData(
"backboneGroupName", backboneGroupName);
2105 xmlOut.addTextElementToData(
"backboneGroupKey", newBackboneKey.
toString());
2108 __COUT__ <<
"Activating Context group key (" << newContextKey <<
") for "
2109 << contextGroupName <<
"." << __E__;
2110 __COUT__ <<
"Activating Backbone group key (" << newBackboneKey <<
") for "
2111 << backboneGroupName <<
"." << __E__;
2118 ConfigurationManager::LoadGroupType::ALL_TYPES
2130 catch(std::runtime_error& e)
2132 __SS__ <<
"Error adding Desktop Icon!\n\n " << e.what() << __E__;
2133 __COUT__ <<
"\n" << ss.str() << __E__;
2134 xmlOut.addTextElementToData(
"Error", ss.str());
2139 __SS__ <<
"Error adding Desktop Icon!" << __E__;
2144 catch(
const std::exception& e)
2146 ss <<
"Exception message: " << e.what();
2151 __COUT__ <<
"\n" << ss.str() << __E__;
2152 xmlOut.addTextElementToData(
"Error", ss.str());
2157 void ConfigurationSupervisorBase::recursiveCopyTreeUIDNode(
2160 std::map<std::string /*modified table*/, TableVersion /* modified version */>&
2162 const unsigned int startingDepth,
2163 const unsigned int depth,
2164 const unsigned int numberOfInstances,
2166 const std::string& uidToCopy)
2169 __COUTV__(startingDepth);
2171 __COUTV__(numberOfInstances);
2192 unsigned int col = cfgView->
getColUID();
2193 unsigned int row = cfgView->
findRow(col, uidToCopy);
2195 __COUT__ <<
"Copying " << cfgView->getTableName() <<
" v" << cfgView->getVersion()
2196 <<
" row=" << row <<
" record=" << uidToCopy
2197 <<
" instances=" << numberOfInstances << __E__;
2214 std::string tableName =
"secondary";
2217 TableBase* table = cfgMgr->getTableByName(tableName);
2220 table->setActiveView(version);
2224 if(version.isTemporaryVersion())
2227 __COUT__ <<
"Failed to find stored version, so attempting to "
2229 << tableName <<
" v" << version << __E__;
2233 __COUT__ << tableName <<
" active version is " << table->
getViewVersion() << __E__;
2237 __SS__ <<
"Target table version (" << version
2238 <<
") is not the currently active version (" << table->
getViewVersion()
2239 <<
"). Try refreshing the tree." << __E__;
2254 __COUT__ <<
"Created temporary version " << temporaryVersion << __E__;
2267 __COUT__ <<
"Caught error while editing. Erasing temporary version." << __E__;
2268 table->eraseView(temporaryVersion);
2282 catch(std::runtime_error& e)
2284 __SS__ << (
"Error copying tree target '" + uidToCopy +
"' at depth " +
2285 std::to_string(startingDepth - depth) +
" in table '" +
2286 cfgView->getTableName() +
".' " + std::string(e.what()))
2288 __COUT__ <<
"\n" << ss.str() << __E__;
2289 xmlOut.addTextElementToData(
"Error", ss.str());
2293 __SS__ << (
"Error copying tree target '" + uidToCopy +
"' at depth " +
2294 std::to_string(startingDepth - depth) +
" in table '" +
2295 cfgView->getTableName() +
".' ")
2301 catch(
const std::exception& e)
2303 ss <<
"Exception message: " << e.what();
2308 __COUT__ <<
"\n" << ss.str() << __E__;
2309 xmlOut.addTextElementToData(
"Error", ss.str());
TableGroupKey findTableGroup(const std::string &groupName, const std::map< std::string, TableVersion > &groupMembers, const std::map< std::string, std::string > &groupAliases=std::map< std::string, std::string >())
const GroupInfo & getGroupInfo(const std::string &groupName, bool attemptToReloadKeys=false)
public group cache handling
const std::map< std::string, TableInfo > & getAllTableInfo(bool refresh=false, std::string *accumulatedWarnings=0, const std::string &errorFilterName="", bool getGroupKeys=false, bool getGroupInfo=false, bool initializeActiveGroups=false)
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 groupTypeToLoad=ConfigurationManager::LoadGroupType::ALL_TYPES, bool ignoreVersionTracking=false)
TableGroupKey saveNewTableGroup(const std::string &groupName, std::map< std::string, TableVersion > &groupMembers, const std::string &groupComment=TableViewColumnInfo::DATATYPE_COMMENT_DEFAULT, std::map< std::string, std::string > *groupAliases=0)
modifiers of a table group based on alias, e.g. "Physics"
void activateTableGroup(const std::string &tableGroupName, TableGroupKey tableGroupKey, std::string *accumulatedTreeErrors=0, std::string *groupTypeString=0)
modifiers of table groups
TableVersion saveModifiedVersion(const std::string &tableName, TableVersion originalVersion, bool makeTemporary, TableBase *config, TableVersion temporaryModifiedVersion, bool ignoreDuplicates=false, bool lookForEquivalent=false, bool *foundEquivalent=nullptr)
const std::string & getUsername(void) const
Getters.
std::map< std::string, std::map< std::string, TableVersion > > getVersionAliases(void) const
void eraseTemporaryVersion(const std::string &tableName, TableVersion targetVersion=TableVersion())
TableBase * getVersionedTableByName(const std::string &tableName, TableVersion version, bool looseColumnMatching=false, std::string *accumulatedErrors=0, bool getRawData=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
void loadMemberMap(const std::map< std::string, TableVersion > &memberMap, std::string *accumulateWarnings=0)
std::map< std::string, TableVersion > getActiveVersions(void) const
getActiveVersions
ConfigurationTree getNode(const std::string &nodeString, bool doNotThrowOnBrokenUIDLinks=false) const
"root/parent/parent/"
void init(std::string *accumulatedErrors=0, bool initForWriteAccess=false, std::string *accumulatedWarnings=0)
std::vector< std::pair< std::string, ConfigurationTree > > getChildren(std::map< std::string, TableVersion > *memberMap=0, std::string *accumulatedTreeErrors=0) const
static void getConfigurationStatusXML(HttpXmlDocument &xmlOut, ConfigurationManagerRW *cfgMgr, const std::string &username)
getConfigurationStatusXML
static void handleGetTableGroupXML(HttpXmlDocument &xmlOut, ConfigurationManagerRW *cfgMgr, const std::string &groupName, TableGroupKey groupKey, bool ignoreWarnings=false, bool cacheOnly=false)
static TableVersion saveModifiedVersionXML(HttpXmlDocument &xmlOut, ConfigurationManagerRW *cfgMgr, const std::string &tableName, TableVersion originalVersion, bool makeTemporary, TableBase *config, TableVersion temporaryModifiedVersion, bool ignoreDuplicates=false, bool lookForEquivalent=false)
static void handleCreateTableXML(HttpXmlDocument &xmlOut, ConfigurationManagerRW *cfgMgr, const std::string &tableName, TableVersion version, bool makeTemporary, const std::string &data, const int &dataOffset, const std::string &author, const std::string &comment, bool sourceTableAsIs, bool lookForEquivalent)
static void handleCreateTableGroupXML(HttpXmlDocument &xmlOut, ConfigurationManagerRW *cfgMgr, const std::string &groupName, const std::string &configList, bool allowDuplicates=false, bool ignoreWarnings=false, const std::string &groupComment="", bool lookForEquivalent=false)
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.
TableVersion createTemporaryView(TableVersion sourceViewVersion=TableVersion(), TableVersion destTemporaryViewVersion=TableVersion::getNextTemporaryVersion())
source of -1, from MockUp, else from valid view version
TableView * getTemporaryView(TableVersion temporaryVersion)
const TableVersion & getViewVersion(void) const
always the active one
std::string toString(void) const
toString
bool isInvalid(void) const
isInvalid
bool isMockupVersion(void) const
std::string toString(void) const
toString
bool isInvalid(void) const
isInvalid
bool isScratchVersion(void) const
bool isTemporaryVersion(void) const
unsigned int findRow(unsigned int col, const T &value, unsigned int offsetRow=0, bool doNotThrow=false) const
< in included .icc source
void setValueAsString(const std::string &value, unsigned int row, unsigned int col)
unsigned int getColStatus(void) const
bool removeRowFromGroup(const unsigned int &row, const unsigned int &col, const std::string &groupID, bool deleteRowIfNoGroupLeft=false)
unsigned int copyRows(const std::string &author, const TableView &src, unsigned int srcOffsetRow=0, unsigned int srcRowsToCopy=(unsigned int) -1, unsigned int destOffsetRow=(unsigned int) -1, unsigned char generateUniqueDataColumns=false, const std::string &baseNameAutoUID="")
std::vector< unsigned int > getGroupRows(const unsigned int groupIdCol, const std::string &groupID, bool onlyStatusTrue=false, bool orderedByPriority=false) const
unsigned int getDataColumnSize(void) const
getDataColumnSize
unsigned int getColUID(void) const
bool setURIEncodedValue(const std::string &value, const unsigned int &row, const unsigned int &col, const std::string &author="")
int fillFromEncodedCSV(const std::string &data, const int &dataOffset=0, const std::string &author="")
unsigned int findCol(const std::string &name) const
void setURIEncodedComment(const std::string &uriComment)
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="")
xercesc::DOMElement * addTextElementToParent(const std::string &childName, const std::string &childText, xercesc::DOMElement *parent)
static std::string setToString(const std::set< T > &setToReturn, const std::string &delimeter=", ")
setToString ~
static std::string vectorToString(const std::vector< T > &setToReturn, const std::string &delimeter=", ")
vectorToString ~
static std::string mapToString(const std::map< std::string, T > &mapToReturn, const std::string &primaryDelimeter=", ", const std::string &secondaryDelimeter=": ")
static void getMapFromString(const std::string &inputString, std::map< S, T > &mapToReturn, const std::set< char > &pairPairDelimiter={',', '|', '&'}, const std::set< char > &nameValueDelimiter={'=', ':'}, const std::set< char > &whitespace={' ', '\t', '\n', '\r'})
getMapFromString ~
static std::string decodeURIComponent(const std::string &data)
TableBase * table_
everything needed for editing a table
bool createdTemporaryVersion_
indicates if temp version was created here