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),
835 const std::set<TableGroupKey>& sortedKeys = groupInfo.keys_;
839 __COUTT__ <<
"Active groups: "
841 __COUTT__ <<
"Active tables: "
847 sortedKeys.find(groupKey) == sortedKeys.end() ||
848 sortedKeys.size() < 2))
851 if(!groupKey.
isInvalid() || sortedKeys.size() == 0)
854 std::string accumulatedWarnings;
855 __COUTT__ <<
"Attempting full table refresh (assuming cache not yet "
860 &accumulatedWarnings,
865 __COUTT__ <<
"After full table refresh (assuming cache not yet "
866 "established) so ignoring these errors: "
867 << accumulatedWarnings << __E__;
872 const std::set<TableGroupKey>& sortedKeys2 = groupInfo2.keys_;
874 if(sortedKeys2.find(groupKey) == sortedKeys2.end())
876 __SS__ <<
"Group key " << groupKey <<
" was not found for group '"
877 << groupName <<
"!'" << __E__;
878 ss <<
"Her are the found " << sortedKeys2.size() <<
" '" << groupName
879 <<
"' keys: " << __E__;
880 for(
auto& keyInOrder : sortedKeys2)
881 ss <<
"\t" << keyInOrder << __E__;
882 __COUT_WARN__ <<
"\n" << ss.str() << __E__;
884 SpanToXML(sortedKeys2, xmlOut);
888 if(sortedKeys.size())
889 groupKey = *sortedKeys.rbegin();
891 <<
"Group key requested was invalid or not found, going with latest "
892 << groupKey << __E__;
895 SpanToXML(sortedKeys, xmlOut);
935 SpanToXML(sortedKeys, xmlOut);
941 <<
"There are no active tables. Attempting to initialize active groups."
944 std::string tmpAccumulateWarnings;
947 &tmpAccumulateWarnings);
948 __COUTT__ <<
"Now Active tables: "
950 __COUTT__ <<
"Ingoring warnings during init of active groups: "
951 << tmpAccumulateWarnings << __E__;
955 xmlOut.addTextElementToData(
"TableGroupName", groupName);
956 xmlOut.addTextElementToData(
"TableGroupKey", groupKey.
toString());
958 parentEl = xmlOut.addTextElementToData(
"TableGroupMembers",
"");
962 std::map<std::string , std::string > groupMemberAliases;
964 __COUT__ <<
"groupName=" << groupName << __E__;
965 __COUT__ <<
"groupKey=" << groupKey << __E__;
967 const std::map<std::string, TableInfo>& allTableInfo = cfgMgr->
getAllTableInfo();
968 std::map<std::string, TableInfo>::const_iterator it;
974 std::string groupAuthor, groupComment, groupCreationTime, groupTypeString;
975 std::string accumulateTreeErrors;
977 __COUTV__(ignoreWarnings);
984 &accumulateTreeErrors,
990 &groupMemberAliases);
992 if(accumulateTreeErrors !=
"")
994 __COUTV__(accumulateTreeErrors);
995 xmlOut.addTextElementToData(
"TreeErrors", accumulateTreeErrors);
998 xmlOut.addTextElementToData(
"TableGroupAuthor", groupAuthor);
999 xmlOut.addTextElementToData(
"TableGroupComment", groupComment);
1000 xmlOut.addTextElementToData(
"TableGroupCreationTime", groupCreationTime);
1001 xmlOut.addTextElementToData(
"TableGroupType", groupTypeString);
1003 catch(
const std::runtime_error& e)
1005 __SS__ <<
"Table group \"" + groupName +
"(" + groupKey.
toString() +
")" +
1006 "\" members can not be loaded!\n\n" + e.what()
1008 __COUT_ERR__ << ss.str();
1009 xmlOut.addTextElementToData(
"Error", ss.str());
1014 __SS__ <<
"Table group \"" + groupName +
"(" + groupKey.
toString() +
")" +
1015 "\" members can not be loaded!"
1021 catch(
const std::exception& e)
1023 ss <<
"Exception message: " << e.what();
1028 __COUT_ERR__ << ss.str();
1029 xmlOut.addTextElementToData(
"Error", ss.str());
1035 std::map<std::string, std::map<std::string, TableVersion>> versionAliases =
1038 __COUT__ <<
"# of table version aliases: " << versionAliases.size() << __E__;
1041 for(
auto& memberPair : memberMap)
1046 if(groupMemberAliases.find(memberPair.first) != groupMemberAliases.end())
1049 ConfigurationManager::ALIAS_VERSION_PREAMBLE +
1050 groupMemberAliases[memberPair.first],
1054 "MemberVersion", memberPair.second.toString(), parentEl);
1056 it = allTableInfo.find(memberPair.first);
1057 if(it == allTableInfo.end())
1060 xmlOut.addTextElementToData(
1061 "Error",
"Table \"" + memberPair.first +
"\" can not be retrieved!");
1066 "MemberComment", it->second.tablePtr_->getView().getComment(), parentEl);
1068 if(versionAliases.find(it->first) != versionAliases.end())
1069 for(
auto& aliasVersion : versionAliases[it->first])
1071 "TableExistingVersion",
1072 ConfigurationManager::ALIAS_VERSION_PREAMBLE + aliasVersion.first,
1075 vSpanToXML(it->second.versions_, xmlOut, configEl);
1157 catch(std::runtime_error& e)
1159 __SS__ << (
"Error getting table group!\n\n" + std::string(e.what())) << __E__;
1160 __COUT_ERR__ <<
"\n" << ss.str();
1161 xmlOut.addTextElementToData(
"Error", ss.str());
1165 __SS__ << (
"Error getting table group!\n\n") << __E__;
1170 catch(
const std::exception& e)
1172 ss <<
"Exception message: " << e.what();
1177 __COUT_ERR__ <<
"\n" << ss.str();
1178 xmlOut.addTextElementToData(
"Error", ss.str());
1182 bool ConfigurationSupervisorBase::handleAddDesktopIconXML(
1185 const std::string& iconCaption,
1186 const std::string& iconAltText,
1187 const std::string& iconFolderPath,
1188 const std::string& iconImageURL,
1189 const std::string& iconWindowURL,
1190 const std::string& iconPermissions,
1191 std::string windowLinkedApp ,
1192 unsigned int windowLinkedAppLID ,
1193 bool enforceOneWindowInstance ,
1194 const std::string& windowParameters )
1199 const std::string& author = cfgMgr->
getUsername();
1202 __COUTV__(iconCaption);
1203 __COUTV__(iconAltText);
1204 __COUTV__(iconFolderPath);
1205 __COUTV__(iconImageURL);
1206 __COUTV__(iconWindowURL);
1207 __COUTV__(iconPermissions);
1208 __COUTV__(windowLinkedApp);
1209 __COUTV__(windowLinkedAppLID);
1210 __COUTV__(enforceOneWindowInstance);
1212 __COUTV__(windowParameters);
1227 ConfigurationManager::LoadGroupType::
1228 ONLY_BACKBONE_OR_CONTEXT_TYPES
1231 const std::string backboneGroupName =
1232 cfgMgr->getActiveGroupName(ConfigurationManager::GroupType::BACKBONE_TYPE);
1234 GroupEditStruct contextGroupEdit(ConfigurationManager::GroupType::CONTEXT_TYPE,
1245 DesktopIconTable::ICON_TABLE,
true );
1246 TableEditStruct& parameterTable = contextGroupEdit.getTableEditStruct(
1247 DesktopIconTable::PARAMETER_TABLE,
true );
1249 ConfigurationManager::XDAQ_APPLICATION_TABLE_NAME);
1255 std::string iconUID =
"";
1258 for(
unsigned int i = 0; i < decodedCaption.size(); ++i)
1259 if((decodedCaption[i] >=
'a' && decodedCaption[i] <=
'z') ||
1260 (decodedCaption[i] >=
'A' && decodedCaption[i] <=
'Z') ||
1261 (decodedCaption[i] >=
'0' && decodedCaption[i] <=
'9'))
1262 iconUID += decodedCaption[i];
1265 row = iconTable.tableView_->
addRow(
1266 author,
true ,
"generatedIcon" + iconUID);
1268 iconTable.tableView_->getDataView()[row][iconTable.tableView_->
getColUID()];
1281 iconTable.tableView_->
findCol(DesktopIconTable::COL_CAPTION));
1286 iconTable.tableView_->
findCol(DesktopIconTable::COL_ALTERNATE_TEXT));
1289 enforceOneWindowInstance ?
"1" :
"0",
1291 iconTable.tableView_->
findCol(DesktopIconTable::COL_FORCE_ONLY_ONE_INSTANCE));
1296 iconTable.tableView_->
findCol(DesktopIconTable::COL_PERMISSIONS));
1301 iconTable.tableView_->
findCol(DesktopIconTable::COL_IMAGE_URL));
1306 iconTable.tableView_->
findCol(DesktopIconTable::COL_WINDOW_CONTENT_URL));
1311 iconTable.tableView_->
findCol(DesktopIconTable::COL_FOLDER_PATH));
1314 if(windowLinkedAppLID > 0)
1316 __COUTV__(windowLinkedAppLID);
1318 int appRow = appTable.tableView_->
findRow(
1319 appTable.tableView_->
findCol(XDAQContextTable::colApplication_.colId_),
1320 windowLinkedAppLID);
1323 ->getDataView()[appRow][appTable.tableView_->
getColUID()];
1324 __COUT__ <<
"Found app by LID: " << windowLinkedApp << __E__;
1327 if(windowLinkedApp !=
"" && windowLinkedApp !=
"undefined" &&
1328 windowLinkedApp != TableViewColumnInfo::DATATYPE_STRING_DEFAULT)
1333 __COUTV__(windowLinkedApp);
1335 if(!windowLinkedAppLID)
1341 appTable.tableView_->
getColUID(), windowLinkedApp);
1343 catch(
const std::runtime_error& e)
1348 int appRow = appTable.tableView_->
findRow(
1350 XDAQContextTable::colApplication_.colClass_),
1354 ->getDataView()[appRow][appTable.tableView_->
getColUID()];
1359 __SS__ <<
"Failed to create an icon linking to app '"
1361 <<
".' The following error occurred: " << e.what()
1363 appTable.tableView_->print(ss);
1368 __COUTV__(windowLinkedApp);
1371 ConfigurationManager::XDAQ_APPLICATION_TABLE_NAME,
1373 iconTable.tableView_->
findCol(DesktopIconTable::COL_APP_LINK));
1377 iconTable.tableView_->
findCol(DesktopIconTable::COL_APP_LINK_UID));
1381 std::map<std::string, std::string> parameters;
1383 __COUTV__(windowParameters);
1387 if(parameters.size())
1391 DesktopIconTable::PARAMETER_TABLE,
1393 iconTable.tableView_->
findCol(DesktopIconTable::COL_PARAMETER_LINK));
1396 iconUID +
"_Parameters",
1398 iconTable.tableView_->
findCol(DesktopIconTable::COL_PARAMETER_LINK_GID));
1402 unsigned int gidCol =
1403 parameterTable.tableView_->
findCol(DesktopIconTable::COL_PARAMETER_GID);
1406 std::vector<
unsigned int > rowsInGroup =
1408 gidCol, iconUID +
"_Parameters" );
1413 for(
unsigned int r = rowsInGroup.size() - 1; r < rowsInGroup.size(); --r)
1417 iconUID +
"_Parameters" ,
1421 for(
const auto& parameter : parameters)
1424 row = parameterTable.tableView_->
addRow(
1425 author,
true ,
"generatedParameter");
1432 iconUID +
"_Parameters", row, gidCol);
1437 parameterTable.tableView_->
findCol(
1438 DesktopIconTable::COL_PARAMETER_KEY));
1443 parameterTable.tableView_->
findCol(
1444 DesktopIconTable::COL_PARAMETER_VALUE));
1447 std::stringstream ss;
1448 parameterTable.tableView_->print(ss);
1449 __COUT__ << ss.str();
1451 parameterTable.tableView_
1456 std::stringstream ss;
1457 iconTable.tableView_->print(ss);
1458 __COUT__ << ss.str();
1460 iconTable.tableView_->
init();
1464 __COUT__ <<
"Icon table errors while saving. Erasing all newly "
1465 "created table versions."
1471 __COUT__ <<
"Edits complete for new desktop icon, now making persistent tables."
1485 bool foundEquivalentContextKey;
1487 bool foundEquivalentBackboneKey;
1489 contextGroupEdit.saveChanges(contextGroupEdit.originalGroupName_,
1491 &foundEquivalentContextKey,
1496 &foundEquivalentBackboneKey);
1498 xmlOut.addTextElementToData(
"contextGroupName", contextGroupEdit.originalGroupName_);
1499 xmlOut.addTextElementToData(
"contextGroupKey", newContextKey.
toString());
1501 xmlOut.addTextElementToData(
"backboneGroupName", backboneGroupName);
1502 xmlOut.addTextElementToData(
"backboneGroupKey", newBackboneKey.
toString());
1513 std::map<std::string, TableVersion> contextGroupMembers;
1514 std::map<std::string, TableVersion> backboneGroupMembers;
1516 std::map<std::string, TableVersion> activeTables =
1518 for(
auto& table : cfgMgr->getContextMemberNames())
1521 __COUT__ << table <<
" v" << activeTables.at(table) << __E__;
1522 contextGroupMembers[table] = activeTables.at(table);
1527 <<
"Error! Could not find Context member table '" << table
1528 <<
".' All Context members must be present to add a desktop icon."
1532 for(
auto& table : cfgMgr->getBackboneMemberNames())
1535 __COUT__ << table <<
" v" << activeTables.at(table) << __E__;
1536 backboneGroupMembers[table] = activeTables.at(table);
1540 __SS__ <<
"Error! Could not find Backbone member table '" << table
1541 <<
".' All Backbone members must be present to add a desktop "
1548 const std::string contextGroupName =
1549 cfgMgr->getActiveGroupName(ConfigurationManager::GroupType::CONTEXT_TYPE);
1551 cfgMgr->getActiveGroupKey(ConfigurationManager::GroupType::CONTEXT_TYPE);
1552 const std::string backboneGroupName =
1553 cfgMgr->getActiveGroupName(ConfigurationManager::GroupType::BACKBONE_TYPE);
1555 cfgMgr->getActiveGroupKey(ConfigurationManager::GroupType::BACKBONE_TYPE);
1557 __COUTV__(contextGroupName);
1558 __COUTV__(originalContextGroupKey);
1559 __COUTV__(backboneGroupName);
1560 __COUTV__(originalBackboneGroupKey);
1562 if(contextGroupName ==
"" || originalContextGroupKey.
isInvalid())
1564 __SS__ <<
"Error! No active Context group found. "
1565 "There must be an active Context group to add a Desktop Icon."
1581 TableEditStruct appTable(ConfigurationManager::XDAQ_APPLICATION_TABLE_NAME,
1588 std::string iconUID;
1591 row = iconTable.tableView_->
addRow(
1592 author,
true ,
"generatedIcon");
1593 iconUID = iconTable.tableView_
1594 ->getDataView()[row][iconTable.tableView_->
getColUID()];
1607 iconTable.tableView_->
findCol(DesktopIconTable::COL_CAPTION));
1612 iconTable.tableView_->
findCol(DesktopIconTable::COL_ALTERNATE_TEXT));
1615 enforceOneWindowInstance ?
"1" :
"0",
1617 iconTable.tableView_->
findCol(
1618 DesktopIconTable::COL_FORCE_ONLY_ONE_INSTANCE));
1623 iconTable.tableView_->
findCol(DesktopIconTable::COL_PERMISSIONS));
1628 iconTable.tableView_->
findCol(DesktopIconTable::COL_IMAGE_URL));
1633 iconTable.tableView_->
findCol(DesktopIconTable::COL_WINDOW_CONTENT_URL));
1638 iconTable.tableView_->
findCol(DesktopIconTable::COL_FOLDER_PATH));
1641 if(windowLinkedAppLID > 0)
1643 __COUTV__(windowLinkedAppLID);
1645 int appRow = appTable.tableView_->
findRow(
1647 XDAQContextTable::colApplication_.colId_),
1648 windowLinkedAppLID);
1651 ->getDataView()[appRow][appTable.tableView_->
getColUID()];
1652 __COUT__ <<
"Found app by LID: " << windowLinkedApp << __E__;
1655 if(windowLinkedApp !=
"" && windowLinkedApp !=
"undefined" &&
1656 windowLinkedApp != TableViewColumnInfo::DATATYPE_STRING_DEFAULT)
1661 __COUTV__(windowLinkedApp);
1663 if(!windowLinkedAppLID)
1668 appTable.tableView_->
getColUID(), windowLinkedApp);
1670 catch(
const std::runtime_error& e)
1675 int appRow = appTable.tableView_->
findRow(
1677 XDAQContextTable::colApplication_.colClass_),
1681 ->getDataView()[appRow]
1687 __SS__ <<
"Failed to create an icon linking to app '"
1689 <<
".' The following error occurred: " << e.what()
1695 __COUTV__(windowLinkedApp);
1698 ConfigurationManager::XDAQ_APPLICATION_TABLE_NAME,
1700 iconTable.tableView_->
findCol(DesktopIconTable::COL_APP_LINK));
1704 iconTable.tableView_->
findCol(DesktopIconTable::COL_APP_LINK_UID));
1708 std::map<std::string, std::string> parameters;
1710 __COUTV__(windowParameters);
1714 if(parameters.size())
1718 DesktopIconTable::PARAMETER_TABLE,
1720 iconTable.tableView_->
findCol(DesktopIconTable::COL_PARAMETER_LINK));
1723 iconUID +
"_Parameters",
1725 iconTable.tableView_->
findCol(
1726 DesktopIconTable::COL_PARAMETER_LINK_GID));
1730 for(
const auto& parameter : parameters)
1733 row = parameterTable.tableView_->
addRow(
1734 author,
true ,
"generatedParameter");
1741 iconUID +
"_Parameters",
1743 parameterTable.tableView_->
findCol(
1744 DesktopIconTable::COL_PARAMETER_GID));
1749 parameterTable.tableView_->
findCol(
1750 DesktopIconTable::COL_PARAMETER_KEY));
1755 parameterTable.tableView_->
findCol(
1756 DesktopIconTable::COL_PARAMETER_VALUE));
1759 std::stringstream ss;
1760 parameterTable.tableView_->print(ss);
1761 __COUT__ << ss.str();
1763 parameterTable.tableView_
1768 std::stringstream ss;
1769 iconTable.tableView_->print(ss);
1770 __COUT__ << ss.str();
1772 iconTable.tableView_->
init();
1776 __COUT__ <<
"Icon table errors while saving. Erasing all newly "
1777 "created table versions."
1781 __COUT__ <<
"Erasing temporary version " << iconTable.tableName_ <<
"-v"
1782 << iconTable.temporaryVersion_ << __E__;
1785 iconTable.temporaryVersion_);
1789 .createdTemporaryVersion_)
1791 __COUT__ <<
"Erasing temporary version " << parameterTable.tableName_
1792 <<
"-v" << parameterTable.temporaryVersion_ << __E__;
1795 parameterTable.temporaryVersion_);
1800 __COUT__ <<
"Erasing temporary version " << appTable.tableName_ <<
"-v"
1801 << appTable.temporaryVersion_ << __E__;
1804 appTable.temporaryVersion_);
1810 __COUT__ <<
"Edits complete for new desktop icon, now making persistent tables."
1823 __COUT__ <<
"Original version is " << iconTable.tableName_ <<
"-v"
1824 << iconTable.originalVersion_ << __E__;
1825 __COUT__ <<
"Original version is " << parameterTable.tableName_ <<
"-v"
1826 << parameterTable.originalVersion_ << __E__;
1828 contextGroupMembers[DesktopIconTable::ICON_TABLE] =
1832 iconTable.tableName_,
1833 iconTable.originalVersion_,
1836 iconTable.temporaryVersion_,
1838 contextGroupMembers[DesktopIconTable::PARAMETER_TABLE] =
1842 parameterTable.tableName_,
1843 parameterTable.originalVersion_,
1846 parameterTable.temporaryVersion_,
1849 __COUT__ <<
"Temporary target version is " << iconTable.tableName_ <<
"-v"
1850 << contextGroupMembers[DesktopIconTable::ICON_TABLE] <<
"-v"
1851 << iconTable.temporaryVersion_ << __E__;
1852 __COUT__ <<
"Temporary target version is " << parameterTable.tableName_ <<
"-v"
1853 << contextGroupMembers[DesktopIconTable::PARAMETER_TABLE] <<
"-v"
1854 << parameterTable.temporaryVersion_ << __E__;
1856 contextGroupMembers[DesktopIconTable::ICON_TABLE] =
1860 iconTable.tableName_,
1861 iconTable.originalVersion_,
1864 iconTable.temporaryVersion_,
1867 contextGroupMembers[DesktopIconTable::PARAMETER_TABLE] =
1871 parameterTable.tableName_,
1872 parameterTable.originalVersion_,
1875 parameterTable.temporaryVersion_,
1879 __COUT__ <<
"Final target version is " << iconTable.tableName_ <<
"-v"
1880 << contextGroupMembers[DesktopIconTable::ICON_TABLE] << __E__;
1881 __COUT__ <<
"Final target version is " << parameterTable.tableName_ <<
"-v"
1882 << contextGroupMembers[DesktopIconTable::PARAMETER_TABLE] << __E__;
1884 for(
auto& table : contextGroupMembers)
1886 __COUT__ << table.first <<
" v" << table.second << __E__;
1889 __COUT__ <<
"Checking for duplicate Context groups..." << __E__;
1895 __COUT__ <<
"Found equivalent group key (" << newContextKey <<
") for "
1896 << contextGroupName <<
"." << __E__;
1897 xmlOut.addTextElementToData(contextGroupName +
"_foundEquivalentKey",
1904 __COUT__ <<
"Saved new Context group key (" << newContextKey <<
") for "
1905 << contextGroupName <<
"." << __E__;
1908 xmlOut.addTextElementToData(
"contextGroupName", contextGroupName);
1909 xmlOut.addTextElementToData(
"contextGroupKey", newContextKey.
toString());
1913 __COUT__ <<
"Original version is " << iconTable.tableName_ <<
"-v"
1914 << iconTable.originalVersion_ << __E__;
1915 __COUT__ <<
"Original version is " << parameterTable.tableName_ <<
"-v"
1916 << parameterTable.originalVersion_ << __E__;
1918 bool groupAliasChange =
false;
1919 bool tableAliasChange =
false;
1925 cfgMgr->getTableByName(ConfigurationManager::GROUP_ALIASES_TABLE_NAME);
1927 backboneGroupMembers[ConfigurationManager::GROUP_ALIASES_TABLE_NAME];
1932 unsigned int row = 0;
1934 std::vector<std::pair<std::string, ConfigurationTree>> aliasNodePairs =
1935 cfgMgr->
getNode(ConfigurationManager::GROUP_ALIASES_TABLE_NAME)
1937 std::string groupName, groupKey;
1938 for(
auto& aliasNodePair : aliasNodePairs)
1940 groupName = aliasNodePair.second.getNode(
"GroupName").getValueAsString();
1941 groupKey = aliasNodePair.second.getNode(
"GroupKey").getValueAsString();
1943 __COUT__ <<
"Group Alias: " << aliasNodePair.first <<
" => " << groupName
1944 <<
"(" << groupKey <<
"); row=" << row << __E__;
1946 if(groupName == contextGroupName &&
1949 __COUT__ <<
"Found alias! Changing group key." << __E__;
1951 groupAliasChange =
true;
1960 if(groupAliasChange)
1962 std::stringstream ss;
1963 tableView->print(ss);
1964 __COUT__ << ss.str();
1967 backboneGroupMembers[ConfigurationManager::GROUP_ALIASES_TABLE_NAME] =
1979 __COUT__ <<
"Original version is " << table->
getTableName() <<
"-v"
1980 << originalVersion <<
" and new version is v"
1981 << backboneGroupMembers
1982 [ConfigurationManager::GROUP_ALIASES_TABLE_NAME]
1991 cfgMgr->getTableByName(ConfigurationManager::VERSION_ALIASES_TABLE_NAME);
1993 backboneGroupMembers[ConfigurationManager::VERSION_ALIASES_TABLE_NAME];
1998 unsigned int row = 0;
2000 std::vector<std::pair<std::string, ConfigurationTree>> aliasNodePairs =
2001 cfgMgr->
getNode(ConfigurationManager::VERSION_ALIASES_TABLE_NAME)
2003 std::string tableName, tableVersion;
2004 for(
auto& aliasNodePair : aliasNodePairs)
2006 tableName = aliasNodePair.second.getNode(
"TableName").getValueAsString();
2007 tableVersion = aliasNodePair.second.getNode(
"Version").getValueAsString();
2009 __COUT__ <<
"Table Alias: " << aliasNodePair.first <<
" => " << tableName
2010 <<
"-v" << tableVersion <<
"" << __E__;
2012 if(tableName == DesktopIconTable::ICON_TABLE &&
2013 TableVersion(tableVersion) == iconTable.originalVersion_)
2015 __COUT__ <<
"Found alias! Changing icon table version alias."
2018 tableAliasChange =
true;
2021 contextGroupMembers[DesktopIconTable::ICON_TABLE].toString(),
2023 tableView->
findCol(
"Version"));
2025 else if(tableName == DesktopIconTable::PARAMETER_TABLE &&
2026 TableVersion(tableVersion) == parameterTable.originalVersion_)
2029 <<
"Found alias! Changing icon parameter table version alias."
2032 tableAliasChange =
true;
2035 contextGroupMembers[DesktopIconTable::PARAMETER_TABLE].toString(),
2037 tableView->
findCol(
"Version"));
2043 if(tableAliasChange)
2045 std::stringstream ss;
2046 tableView->print(ss);
2047 __COUT__ << ss.str();
2050 backboneGroupMembers[ConfigurationManager::VERSION_ALIASES_TABLE_NAME] =
2062 __COUT__ <<
"Original version is " << table->
getTableName() <<
"-v"
2063 << originalVersion <<
" and new version is v"
2064 << backboneGroupMembers
2065 [ConfigurationManager::VERSION_ALIASES_TABLE_NAME]
2072 if(groupAliasChange || tableAliasChange)
2074 for(
auto& table : backboneGroupMembers)
2076 __COUT__ << table.first <<
" v" << table.second << __E__;
2080 __COUT__ <<
"Checking for duplicate Backbone groups..." << __E__;
2086 __COUT__ <<
"Found equivalent group key (" << newBackboneKey <<
") for "
2087 << backboneGroupName <<
"." << __E__;
2088 xmlOut.addTextElementToData(backboneGroupName +
"_foundEquivalentKey",
2095 __COUT__ <<
"Saved new Backbone group key (" << newBackboneKey <<
") for "
2096 << backboneGroupName <<
"." << __E__;
2099 xmlOut.addTextElementToData(
"backboneGroupName", backboneGroupName);
2100 xmlOut.addTextElementToData(
"backboneGroupKey", newBackboneKey.
toString());
2103 __COUT__ <<
"Activating Context group key (" << newContextKey <<
") for "
2104 << contextGroupName <<
"." << __E__;
2105 __COUT__ <<
"Activating Backbone group key (" << newBackboneKey <<
") for "
2106 << backboneGroupName <<
"." << __E__;
2113 ConfigurationManager::LoadGroupType::ALL_TYPES
2125 catch(std::runtime_error& e)
2127 __SS__ <<
"Error adding Desktop Icon!\n\n " << e.what() << __E__;
2128 __COUT__ <<
"\n" << ss.str() << __E__;
2129 xmlOut.addTextElementToData(
"Error", ss.str());
2134 __SS__ <<
"Error adding Desktop Icon!" << __E__;
2139 catch(
const std::exception& e)
2141 ss <<
"Exception message: " << e.what();
2146 __COUT__ <<
"\n" << ss.str() << __E__;
2147 xmlOut.addTextElementToData(
"Error", ss.str());
2152 void ConfigurationSupervisorBase::recursiveCopyTreeUIDNode(
2155 std::map<std::string /*modified table*/, TableVersion /* modified version */>&
2157 const unsigned int startingDepth,
2158 const unsigned int depth,
2159 const unsigned int numberOfInstances,
2161 const std::string& uidToCopy)
2164 __COUTV__(startingDepth);
2166 __COUTV__(numberOfInstances);
2187 unsigned int col = cfgView->
getColUID();
2188 unsigned int row = cfgView->
findRow(col, uidToCopy);
2190 __COUT__ <<
"Copying " << cfgView->getTableName() <<
" v" << cfgView->getVersion()
2191 <<
" row=" << row <<
" record=" << uidToCopy
2192 <<
" instances=" << numberOfInstances << __E__;
2209 std::string tableName =
"secondary";
2212 TableBase* table = cfgMgr->getTableByName(tableName);
2215 table->setActiveView(version);
2219 if(version.isTemporaryVersion())
2222 __COUT__ <<
"Failed to find stored version, so attempting to "
2224 << tableName <<
" v" << version << __E__;
2228 __COUT__ << tableName <<
" active version is " << table->
getViewVersion() << __E__;
2232 __SS__ <<
"Target table version (" << version
2233 <<
") is not the currently active version (" << table->
getViewVersion()
2234 <<
"). Try refreshing the tree." << __E__;
2249 __COUT__ <<
"Created temporary version " << temporaryVersion << __E__;
2262 __COUT__ <<
"Caught error while editing. Erasing temporary version." << __E__;
2263 table->eraseView(temporaryVersion);
2277 catch(std::runtime_error& e)
2279 __SS__ << (
"Error copying tree target '" + uidToCopy +
"' at depth " +
2280 std::to_string(startingDepth - depth) +
" in table '" +
2281 cfgView->getTableName() +
".' " + std::string(e.what()))
2283 __COUT__ <<
"\n" << ss.str() << __E__;
2284 xmlOut.addTextElementToData(
"Error", ss.str());
2288 __SS__ << (
"Error copying tree target '" + uidToCopy +
"' at depth " +
2289 std::to_string(startingDepth - depth) +
" in table '" +
2290 cfgView->getTableName() +
".' ")
2296 catch(
const std::exception& e)
2298 ss <<
"Exception message: " << e.what();
2303 __COUT__ <<
"\n" << ss.str() << __E__;
2304 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 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)
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 GroupInfo & getGroupInfo(const std::string &groupName)
public group cache handling
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 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
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