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__;
164 retVal = sourceTableAsIs ? 0 : cfgView->
fillFromCSV(data, dataOffset, author);
168 __COUT__ <<
"Data was the same, but columns have changed!" << __E__;
169 __COUTV__(sourceTableAsIs);
170 __COUTV__(lookForEquivalent);
174 __COUT__ <<
"Table comment was set to:\n\t" << cfgView->getComment() << __E__;
178 __COUT__ <<
"Caught error while editing. Erasing temporary version." << __E__;
179 table->eraseView(temporaryVersion);
190 ConfigurationInterface::isVersionTrackingEnabled())
197 __SS__ <<
"No rows were modified! No reason to fill a view with same content."
199 __COUT_ERR__ <<
"\n" << ss.str();
201 table->eraseView(temporaryVersion);
205 __COUT__ <<
"This was interpreted as an attempt to create a blank table."
208 __COUT__ <<
"This was interpreted as an attempt to make a persistent "
209 "version of the scratch table."
214 __THROW__(ss.str() +
"impossible!");
219 __COUT__ <<
"Allowing the static data because this is converting from "
220 "temporary to persistent version."
223 else if(retVal < 0 && !ConfigurationInterface::isVersionTrackingEnabled())
225 __COUT__ <<
"Allowing the static data because version tracking is OFF." << __E__;
229 __SS__ <<
"This should not be possible! Fatal error." << __E__;
231 table->eraseView(temporaryVersion);
245 lookForEquivalent || sourceTableAsIs );
247 if(ignoreDuplicates && sourceTableAsIs)
249 table = cfgMgr->getTableByName(tableName);
250 table->eraseView(newVersion);
253 catch(std::runtime_error& e)
255 __SS__ <<
"Error saving new table!\n\n " << e.what() << __E__;
256 __COUT__ <<
"\n" << ss.str() << __E__;
257 xmlOut.addTextElementToData(
"Error", ss.str());
261 __SS__ <<
"Error saving new table!" << __E__;
266 catch(
const std::exception& e)
268 ss <<
"Exception message: " << e.what();
273 __COUT__ <<
"\n" << ss.str() << __E__;
274 xmlOut.addTextElementToData(
"Error", ss.str());
285 const std::string& tableName,
290 bool ignoreDuplicates,
291 bool lookForEquivalent)
293 bool foundEquivalent;
299 temporaryModifiedVersion,
304 xmlOut.addTextElementToData(
"savedName", tableName);
305 xmlOut.addTextElementToData(
"savedVersion", newAssignedVersion.
toString());
309 xmlOut.addTextElementToData(
"foundEquivalentVersion",
"1");
310 xmlOut.addTextElementToData(tableName +
"_foundEquivalentVersion",
"1");
312 return newAssignedVersion;
337 const std::string& groupName,
338 const std::string& tableList,
339 bool allowDuplicates,
341 const std::string& groupComment,
342 bool lookForEquivalent)
345 __COUTT__ <<
"handleCreateTableGroupXML start runtime=" << cfgMgr->runTimeSeconds()
348 xmlOut.addTextElementToData(
"AttemptedNewGroupName", groupName);
352 std::string accumulatedWarnings;
353 const std::map<std::string, TableInfo>& allTableInfo =
355 &accumulatedWarnings,
360 __COUT_WARN__ <<
"Ignoring these errors: " << accumulatedWarnings << __E__;
363 __COUTT__ <<
"handleCreateTableGroupXML loaded runtime=" << cfgMgr->runTimeSeconds()
366 std::map<std::string ,
375 std::map<std::string , std::string > memberTableAliases;
377 std::string name, versionStr, alias;
379 auto c = tableList.find(
',', 0);
382 while(c < tableList.length())
385 name = tableList.substr(i, c - i);
387 c = tableList.find(
',', i);
388 if(c == std::string::npos)
390 __SS__ <<
"Incomplete Table Name-Version pair!" << __E__;
391 __COUT_ERR__ <<
"\n" << ss.str();
392 xmlOut.addTextElementToData(
"Error", ss.str());
396 versionStr = tableList.substr(i, c - i);
398 c = tableList.find(
',', i);
404 if(versionStr.find(ConfigurationManager::ALIAS_VERSION_PREAMBLE) == 0)
407 versionStr.substr(ConfigurationManager::ALIAS_VERSION_PREAMBLE.size());
409 __COUT__ <<
"Found alias " << name <<
" " << versionStr << __E__;
412 if(versionAliases.find(name) != versionAliases.end() &&
413 versionAliases[name].find(alias) != versionAliases[name].end())
415 version = versionAliases[name][alias];
416 __COUT__ << name <<
" version alias '" << alias
417 <<
"'translated to: " << version << __E__;
419 memberTableAliases[name] = alias;
423 __SS__ <<
"version alias '"
424 << versionStr.substr(
425 ConfigurationManager::ALIAS_VERSION_PREAMBLE.size())
426 <<
"' was not found in active version aliases!" << __E__;
427 __COUT_ERR__ <<
"\n" << ss.str();
428 xmlOut.addTextElementToData(
"Error", ss.str());
437 __SS__ <<
"Groups can not be created using temporary member tables. "
438 <<
"Table member '" << name <<
"' with temporary version '" << version
439 <<
"' is illegal." << __E__;
440 xmlOut.addTextElementToData(
"Error", ss.str());
445 if(allTableInfo.find(name) == allTableInfo.end())
447 __SS__ <<
"Groups can not be created using mock-up member tables of "
449 <<
"Table member '" << name <<
"' is not defined." << __E__;
450 xmlOut.addTextElementToData(
"Error", ss.str());
457 TableBase* table = cfgMgr->getTableByName(name);
460 __COUT__ <<
"\t\ttemporaryVersion: " << temporaryVersion << __E__;
463 __COUT__ <<
"Creating version from mock-up for name: " << name
464 <<
" inputVersionStr: " << versionStr << __E__;
468 ->setComment(
"Auto-generated from mock-up.");
482 __COUT__ <<
"Using mockup version: " << version << __E__;
486 groupMembers[name] = version;
489 __COUTT__ <<
"handleCreateTableGroupXML tables saved runtime="
490 << cfgMgr->runTimeSeconds() << __E__;
496 __COUT__ <<
"Checking for duplicate groups..." << __E__;
500 cfgMgr->
findTableGroup(groupName, groupMembers, memberTableAliases);
501 __COUTT__ <<
"handleCreateTableGroupXML group duplicates checked runtime="
502 << cfgMgr->runTimeSeconds() << __E__;
506 xmlOut.addTextElementToData(
"TableGroupName", groupName);
507 xmlOut.addTextElementToData(
"TableGroupKey", foundKey.
toString());
509 if(lookForEquivalent)
511 __COUT__ <<
"Found equivalent group key (" << foundKey <<
") for "
512 << groupName <<
"." << __E__;
514 xmlOut.addTextElementToData(
"foundEquivalentKey",
"1");
518 xmlOut, cfgMgr, groupName, foundKey, ignoreWarnings);
523 __COUT__ <<
"Treating duplicate group as error." << __E__;
524 __SS__ << (
"Failed to create table group: " + groupName +
525 ". It is a duplicate of an existing group key (" +
527 __COUT_ERR__ << ss.str() << __E__;
528 xmlOut.addTextElementToData(
"Error", ss.str());
533 __COUT__ <<
"Check for duplicate groups complete." << __E__;
537 __COUT_WARN__ <<
"Ignoring errors looking for duplicate groups! Proceeding "
538 "with new group creation."
548 std::string accumulateErrors =
"";
549 for(
auto& groupMemberPair : groupMembers)
552 cfgMgr->getTableByName(groupMemberPair.first)->getViewP();
554 cfgViewPtr->getSourceColumnMismatch() !=
558 __SS__ <<
"\n\nThere were errors found in loading a member table "
559 << groupMemberPair.first <<
":v" << cfgViewPtr->getVersion()
560 <<
". Please see the details below:\n\n"
561 << cfgViewPtr->getMismatchColumnInfo();
563 __COUT_ERR__ <<
"\n" << ss.str();
564 xmlOut.addTextElementToData(
"Error", ss.str());
569 catch(std::runtime_error& e)
571 __SS__ <<
"Failed to create table group: " << groupName
572 <<
".\nThere were problems loading the chosen members:\n\n"
573 << e.what() << __E__;
574 __COUT_ERR__ <<
"\n" << ss.str();
575 xmlOut.addTextElementToData(
"Error", ss.str());
580 __SS__ <<
"Failed to create table group: " << groupName << __E__;
585 catch(
const std::exception& e)
587 ss <<
"Exception message: " << e.what();
592 __COUT_ERR__ <<
"\n" << ss.str();
593 xmlOut.addTextElementToData(
"Error", ss.str());
597 __COUTT__ <<
"handleCreateTableGroupXML group members init checked runtime="
598 << cfgMgr->runTimeSeconds() << __E__;
601 std::string accumulateTreeErrs;
602 cfgMgr->
getChildren(&groupMembers, &accumulateTreeErrs);
603 if(accumulateTreeErrs !=
"")
605 __COUT_WARN__ <<
"\n" << accumulateTreeErrs << __E__;
608 xmlOut.addTextElementToData(
"TreeErrors", accumulateTreeErrs);
613 __COUTT__ <<
"handleCreateTableGroupXML tree checked runtime="
614 << cfgMgr->runTimeSeconds() << __E__;
619 __COUT__ <<
"Saving new group..." << __E__;
621 groupName, groupMembers, groupComment, &memberTableAliases);
623 catch(std::runtime_error& e)
625 __SS__ <<
"Failed to create table group: " << groupName << __E__;
626 ss <<
"\n\n" << e.what() << __E__;
627 __COUT_ERR__ << ss.str();
628 xmlOut.addTextElementToData(
"Error", ss.str());
633 __SS__ <<
"Failed to create table group: " << groupName << __E__;
638 catch(
const std::exception& e)
640 ss <<
"Exception message: " << e.what();
645 __COUT_ERR__ << ss.str();
646 xmlOut.addTextElementToData(
"Error", ss.str());
650 __COUTT__ <<
"handleCreateTableGroupXML group saved runtime="
651 << cfgMgr->runTimeSeconds() << __E__;
654 __COUT__ <<
"Loading new table group..." << __E__;
657 __COUTT__ <<
"handleCreateTableGroupXML end runtime=" << cfgMgr->runTimeSeconds()
661 catch(std::runtime_error& e)
663 __SS__ <<
"Error saving table group!\n\n " << e.what() << __E__;
664 __COUT_ERR__ <<
"\n" << ss.str() << __E__;
665 xmlOut.addTextElementToData(
"Error", ss.str());
669 __SS__ <<
"Error saving table group!" << __E__;
674 catch(
const std::exception& e)
676 ss <<
"Exception message: " << e.what();
681 __COUT_ERR__ <<
"\n" << ss.str() << __E__;
682 xmlOut.addTextElementToData(
"Error", ss.str());
710 const std::string& groupName,
716 xercesc::DOMElement *parentEl, *configEl;
741 const std::set<TableGroupKey>& sortedKeys = groupInfo.keys_;
745 __COUTT__ <<
"Active groups: "
747 __COUTT__ <<
"Active tables: "
751 sortedKeys.find(groupKey) == sortedKeys.end())
754 if(!groupKey.
isInvalid() || sortedKeys.size() == 0)
757 std::string accumulatedWarnings;
758 __COUTT__ <<
"Attempting full table refresh (assuming cache not yet "
763 &accumulatedWarnings,
768 __COUTT__ <<
"After full table refresh (assuming cache not yet "
769 "established) so ignoring these errors: "
770 << accumulatedWarnings << __E__;
775 const std::set<TableGroupKey>& sortedKeys2 = groupInfo2.keys_;
777 if(sortedKeys2.find(groupKey) == sortedKeys2.end())
779 __SS__ <<
"Group key " << groupKey <<
" was not found for group '"
780 << groupName <<
"!'" << __E__;
781 ss <<
"Her are the found " << sortedKeys2.size() <<
" '" << groupName
782 <<
"' keys: " << __E__;
783 for(
auto& keyInOrder : sortedKeys2)
784 ss <<
"\t" << keyInOrder << __E__;
785 __COUT_WARN__ <<
"\n" << ss.str() << __E__;
788 for(
auto& keyInOrder : sortedKeys2)
789 xmlOut.addTextElementToData(
"HistoricalTableGroupKey",
790 keyInOrder.toString());
794 if(sortedKeys.size())
795 groupKey = *sortedKeys.rbegin();
797 <<
"Group key requested was invalid or not found, going with latest "
798 << groupKey << __E__;
801 for(
auto& keyInOrder : sortedKeys)
802 xmlOut.addTextElementToData(
"HistoricalTableGroupKey",
803 keyInOrder.toString());
809 for(
auto& keyInOrder : sortedKeys)
810 xmlOut.addTextElementToData(
"HistoricalTableGroupKey",
811 keyInOrder.toString());
817 <<
"There are no active tables. Attempting to initialize active groups."
820 std::string tmpAccumulateWarnings;
823 &tmpAccumulateWarnings);
824 __COUTT__ <<
"Now Active tables: "
826 __COUTT__ <<
"Ingoring warnings during init of active groups: "
827 << tmpAccumulateWarnings << __E__;
831 xmlOut.addTextElementToData(
"TableGroupName", groupName);
832 xmlOut.addTextElementToData(
"TableGroupKey", groupKey.
toString());
834 parentEl = xmlOut.addTextElementToData(
"TableGroupMembers",
"");
838 std::map<std::string , std::string > groupMemberAliases;
840 __COUT__ <<
"groupName=" << groupName << __E__;
841 __COUT__ <<
"groupKey=" << groupKey << __E__;
843 const std::map<std::string, TableInfo>& allTableInfo = cfgMgr->
getAllTableInfo();
844 std::map<std::string, TableInfo>::const_iterator it;
850 std::string groupAuthor, groupComment, groupCreationTime, groupTypeString;
851 std::string accumulateTreeErrors;
853 __COUTV__(ignoreWarnings);
860 &accumulateTreeErrors,
866 &groupMemberAliases);
868 if(accumulateTreeErrors !=
"")
870 __COUTV__(accumulateTreeErrors);
871 xmlOut.addTextElementToData(
"TreeErrors", accumulateTreeErrors);
874 xmlOut.addTextElementToData(
"TableGroupAuthor", groupAuthor);
875 xmlOut.addTextElementToData(
"TableGroupComment", groupComment);
876 xmlOut.addTextElementToData(
"TableGroupCreationTime", groupCreationTime);
877 xmlOut.addTextElementToData(
"TableGroupType", groupTypeString);
879 catch(
const std::runtime_error& e)
881 __SS__ <<
"Table group \"" + groupName +
"(" + groupKey.
toString() +
")" +
882 "\" members can not be loaded!\n\n" + e.what()
884 __COUT_ERR__ << ss.str();
885 xmlOut.addTextElementToData(
"Error", ss.str());
890 __SS__ <<
"Table group \"" + groupName +
"(" + groupKey.
toString() +
")" +
891 "\" members can not be loaded!"
897 catch(
const std::exception& e)
899 ss <<
"Exception message: " << e.what();
904 __COUT_ERR__ << ss.str();
905 xmlOut.addTextElementToData(
"Error", ss.str());
911 std::map<std::string, std::map<std::string, TableVersion>> versionAliases =
914 __COUT__ <<
"# of table version aliases: " << versionAliases.size() << __E__;
917 for(
auto& memberPair : memberMap)
922 if(groupMemberAliases.find(memberPair.first) != groupMemberAliases.end())
925 ConfigurationManager::ALIAS_VERSION_PREAMBLE +
926 groupMemberAliases[memberPair.first],
930 "MemberVersion", memberPair.second.toString(), parentEl);
932 it = allTableInfo.find(memberPair.first);
933 if(it == allTableInfo.end())
935 xmlOut.addTextElementToData(
936 "Error",
"Table \"" + memberPair.first +
"\" can not be retrieved!");
940 if(versionAliases.find(it->first) != versionAliases.end())
941 for(
auto& aliasVersion : versionAliases[it->first])
943 "TableExistingVersion",
944 ConfigurationManager::ALIAS_VERSION_PREAMBLE + aliasVersion.first,
947 for(
auto& version : it->second.versions_)
951 "TableExistingVersion", version.toString(), configEl);
954 for(
auto& memberPair : memberMap)
963 allTableInfo.at(memberPair.first).tablePtr_->getView().getComment(),
1000 catch(std::runtime_error& e)
1002 __SS__ << (
"Error getting table group!\n\n" + std::string(e.what())) << __E__;
1003 __COUT_ERR__ <<
"\n" << ss.str();
1004 xmlOut.addTextElementToData(
"Error", ss.str());
1008 __SS__ << (
"Error getting table group!\n\n") << __E__;
1013 catch(
const std::exception& e)
1015 ss <<
"Exception message: " << e.what();
1020 __COUT_ERR__ <<
"\n" << ss.str();
1021 xmlOut.addTextElementToData(
"Error", ss.str());
1025 bool ConfigurationSupervisorBase::handleAddDesktopIconXML(
1028 const std::string& iconCaption,
1029 const std::string& iconAltText,
1030 const std::string& iconFolderPath,
1031 const std::string& iconImageURL,
1032 const std::string& iconWindowURL,
1033 const std::string& iconPermissions,
1034 std::string windowLinkedApp ,
1035 unsigned int windowLinkedAppLID ,
1036 bool enforceOneWindowInstance ,
1037 const std::string& windowParameters )
1042 const std::string& author = cfgMgr->
getUsername();
1045 __COUTV__(iconCaption);
1046 __COUTV__(iconAltText);
1047 __COUTV__(iconFolderPath);
1048 __COUTV__(iconImageURL);
1049 __COUTV__(iconWindowURL);
1050 __COUTV__(iconPermissions);
1051 __COUTV__(windowLinkedApp);
1052 __COUTV__(windowLinkedAppLID);
1053 __COUTV__(enforceOneWindowInstance);
1055 __COUTV__(windowParameters);
1070 ConfigurationManager::LoadGroupType::
1071 ONLY_BACKBONE_OR_CONTEXT_TYPES
1074 const std::string backboneGroupName =
1075 cfgMgr->getActiveGroupName(ConfigurationManager::GroupType::BACKBONE_TYPE);
1077 GroupEditStruct contextGroupEdit(ConfigurationManager::GroupType::CONTEXT_TYPE,
1088 DesktopIconTable::ICON_TABLE,
true );
1089 TableEditStruct& parameterTable = contextGroupEdit.getTableEditStruct(
1090 DesktopIconTable::PARAMETER_TABLE,
true );
1092 ConfigurationManager::XDAQ_APPLICATION_TABLE_NAME);
1098 std::string iconUID =
"";
1101 for(
unsigned int i = 0; i < decodedCaption.size(); ++i)
1102 if((decodedCaption[i] >=
'a' && decodedCaption[i] <=
'z') ||
1103 (decodedCaption[i] >=
'A' && decodedCaption[i] <=
'Z') ||
1104 (decodedCaption[i] >=
'0' && decodedCaption[i] <=
'9'))
1105 iconUID += decodedCaption[i];
1108 row = iconTable.tableView_->
addRow(
1109 author,
true ,
"generatedIcon" + iconUID);
1111 iconTable.tableView_->getDataView()[row][iconTable.tableView_->
getColUID()];
1124 iconTable.tableView_->
findCol(DesktopIconTable::COL_CAPTION));
1129 iconTable.tableView_->
findCol(DesktopIconTable::COL_ALTERNATE_TEXT));
1132 enforceOneWindowInstance ?
"1" :
"0",
1134 iconTable.tableView_->
findCol(DesktopIconTable::COL_FORCE_ONLY_ONE_INSTANCE));
1139 iconTable.tableView_->
findCol(DesktopIconTable::COL_PERMISSIONS));
1144 iconTable.tableView_->
findCol(DesktopIconTable::COL_IMAGE_URL));
1149 iconTable.tableView_->
findCol(DesktopIconTable::COL_WINDOW_CONTENT_URL));
1154 iconTable.tableView_->
findCol(DesktopIconTable::COL_FOLDER_PATH));
1157 if(windowLinkedAppLID > 0)
1159 __COUTV__(windowLinkedAppLID);
1161 int appRow = appTable.tableView_->
findRow(
1162 appTable.tableView_->
findCol(XDAQContextTable::colApplication_.colId_),
1163 windowLinkedAppLID);
1166 ->getDataView()[appRow][appTable.tableView_->
getColUID()];
1167 __COUT__ <<
"Found app by LID: " << windowLinkedApp << __E__;
1170 if(windowLinkedApp !=
"" && windowLinkedApp !=
"undefined" &&
1171 windowLinkedApp != TableViewColumnInfo::DATATYPE_STRING_DEFAULT)
1176 __COUTV__(windowLinkedApp);
1178 if(!windowLinkedAppLID)
1184 appTable.tableView_->
getColUID(), windowLinkedApp);
1186 catch(
const std::runtime_error& e)
1191 int appRow = appTable.tableView_->
findRow(
1193 XDAQContextTable::colApplication_.colClass_),
1197 ->getDataView()[appRow][appTable.tableView_->
getColUID()];
1202 __SS__ <<
"Failed to create an icon linking to app '"
1204 <<
".' The following error occurred: " << e.what()
1206 appTable.tableView_->print(ss);
1211 __COUTV__(windowLinkedApp);
1214 ConfigurationManager::XDAQ_APPLICATION_TABLE_NAME,
1216 iconTable.tableView_->
findCol(DesktopIconTable::COL_APP_LINK));
1220 iconTable.tableView_->
findCol(DesktopIconTable::COL_APP_LINK_UID));
1224 std::map<std::string, std::string> parameters;
1226 __COUTV__(windowParameters);
1230 if(parameters.size())
1234 DesktopIconTable::PARAMETER_TABLE,
1236 iconTable.tableView_->
findCol(DesktopIconTable::COL_PARAMETER_LINK));
1239 iconUID +
"_Parameters",
1241 iconTable.tableView_->
findCol(DesktopIconTable::COL_PARAMETER_LINK_GID));
1245 unsigned int gidCol =
1246 parameterTable.tableView_->
findCol(DesktopIconTable::COL_PARAMETER_GID);
1249 std::vector<
unsigned int > rowsInGroup =
1251 gidCol, iconUID +
"_Parameters" );
1256 for(
unsigned int r = rowsInGroup.size() - 1; r < rowsInGroup.size(); --r)
1260 iconUID +
"_Parameters" ,
1264 for(
const auto& parameter : parameters)
1267 row = parameterTable.tableView_->
addRow(
1268 author,
true ,
"generatedParameter");
1275 iconUID +
"_Parameters", row, gidCol);
1280 parameterTable.tableView_->
findCol(
1281 DesktopIconTable::COL_PARAMETER_KEY));
1286 parameterTable.tableView_->
findCol(
1287 DesktopIconTable::COL_PARAMETER_VALUE));
1290 std::stringstream ss;
1291 parameterTable.tableView_->print(ss);
1292 __COUT__ << ss.str();
1294 parameterTable.tableView_
1299 std::stringstream ss;
1300 iconTable.tableView_->print(ss);
1301 __COUT__ << ss.str();
1303 iconTable.tableView_->
init();
1307 __COUT__ <<
"Icon table errors while saving. Erasing all newly "
1308 "created table versions."
1314 __COUT__ <<
"Edits complete for new desktop icon, now making persistent tables."
1328 bool foundEquivalentContextKey;
1330 bool foundEquivalentBackboneKey;
1332 contextGroupEdit.saveChanges(contextGroupEdit.originalGroupName_,
1334 &foundEquivalentContextKey,
1339 &foundEquivalentBackboneKey);
1341 xmlOut.addTextElementToData(
"contextGroupName", contextGroupEdit.originalGroupName_);
1342 xmlOut.addTextElementToData(
"contextGroupKey", newContextKey.
toString());
1344 xmlOut.addTextElementToData(
"backboneGroupName", backboneGroupName);
1345 xmlOut.addTextElementToData(
"backboneGroupKey", newBackboneKey.
toString());
1356 std::map<std::string, TableVersion> contextGroupMembers;
1357 std::map<std::string, TableVersion> backboneGroupMembers;
1359 std::map<std::string, TableVersion> activeTables =
1361 for(
auto& table : cfgMgr->getContextMemberNames())
1364 __COUT__ << table <<
" v" << activeTables.at(table) << __E__;
1365 contextGroupMembers[table] = activeTables.at(table);
1370 <<
"Error! Could not find Context member table '" << table
1371 <<
".' All Context members must be present to add a desktop icon."
1375 for(
auto& table : cfgMgr->getBackboneMemberNames())
1378 __COUT__ << table <<
" v" << activeTables.at(table) << __E__;
1379 backboneGroupMembers[table] = activeTables.at(table);
1383 __SS__ <<
"Error! Could not find Backbone member table '" << table
1384 <<
".' All Backbone members must be present to add a desktop "
1391 const std::string contextGroupName =
1392 cfgMgr->getActiveGroupName(ConfigurationManager::GroupType::CONTEXT_TYPE);
1394 cfgMgr->getActiveGroupKey(ConfigurationManager::GroupType::CONTEXT_TYPE);
1395 const std::string backboneGroupName =
1396 cfgMgr->getActiveGroupName(ConfigurationManager::GroupType::BACKBONE_TYPE);
1398 cfgMgr->getActiveGroupKey(ConfigurationManager::GroupType::BACKBONE_TYPE);
1400 __COUTV__(contextGroupName);
1401 __COUTV__(originalContextGroupKey);
1402 __COUTV__(backboneGroupName);
1403 __COUTV__(originalBackboneGroupKey);
1405 if(contextGroupName ==
"" || originalContextGroupKey.
isInvalid())
1407 __SS__ <<
"Error! No active Context group found. "
1408 "There must be an active Context group to add a Desktop Icon."
1424 TableEditStruct appTable(ConfigurationManager::XDAQ_APPLICATION_TABLE_NAME,
1431 std::string iconUID;
1434 row = iconTable.tableView_->
addRow(
1435 author,
true ,
"generatedIcon");
1436 iconUID = iconTable.tableView_
1437 ->getDataView()[row][iconTable.tableView_->
getColUID()];
1450 iconTable.tableView_->
findCol(DesktopIconTable::COL_CAPTION));
1455 iconTable.tableView_->
findCol(DesktopIconTable::COL_ALTERNATE_TEXT));
1458 enforceOneWindowInstance ?
"1" :
"0",
1460 iconTable.tableView_->
findCol(
1461 DesktopIconTable::COL_FORCE_ONLY_ONE_INSTANCE));
1466 iconTable.tableView_->
findCol(DesktopIconTable::COL_PERMISSIONS));
1471 iconTable.tableView_->
findCol(DesktopIconTable::COL_IMAGE_URL));
1476 iconTable.tableView_->
findCol(DesktopIconTable::COL_WINDOW_CONTENT_URL));
1481 iconTable.tableView_->
findCol(DesktopIconTable::COL_FOLDER_PATH));
1484 if(windowLinkedAppLID > 0)
1486 __COUTV__(windowLinkedAppLID);
1488 int appRow = appTable.tableView_->
findRow(
1490 XDAQContextTable::colApplication_.colId_),
1491 windowLinkedAppLID);
1494 ->getDataView()[appRow][appTable.tableView_->
getColUID()];
1495 __COUT__ <<
"Found app by LID: " << windowLinkedApp << __E__;
1498 if(windowLinkedApp !=
"" && windowLinkedApp !=
"undefined" &&
1499 windowLinkedApp != TableViewColumnInfo::DATATYPE_STRING_DEFAULT)
1504 __COUTV__(windowLinkedApp);
1506 if(!windowLinkedAppLID)
1511 appTable.tableView_->
getColUID(), windowLinkedApp);
1513 catch(
const std::runtime_error& e)
1518 int appRow = appTable.tableView_->
findRow(
1520 XDAQContextTable::colApplication_.colClass_),
1524 ->getDataView()[appRow]
1530 __SS__ <<
"Failed to create an icon linking to app '"
1532 <<
".' The following error occurred: " << e.what()
1538 __COUTV__(windowLinkedApp);
1541 ConfigurationManager::XDAQ_APPLICATION_TABLE_NAME,
1543 iconTable.tableView_->
findCol(DesktopIconTable::COL_APP_LINK));
1547 iconTable.tableView_->
findCol(DesktopIconTable::COL_APP_LINK_UID));
1551 std::map<std::string, std::string> parameters;
1553 __COUTV__(windowParameters);
1557 if(parameters.size())
1561 DesktopIconTable::PARAMETER_TABLE,
1563 iconTable.tableView_->
findCol(DesktopIconTable::COL_PARAMETER_LINK));
1566 iconUID +
"_Parameters",
1568 iconTable.tableView_->
findCol(
1569 DesktopIconTable::COL_PARAMETER_LINK_GID));
1573 for(
const auto& parameter : parameters)
1576 row = parameterTable.tableView_->
addRow(
1577 author,
true ,
"generatedParameter");
1584 iconUID +
"_Parameters",
1586 parameterTable.tableView_->
findCol(
1587 DesktopIconTable::COL_PARAMETER_GID));
1592 parameterTable.tableView_->
findCol(
1593 DesktopIconTable::COL_PARAMETER_KEY));
1598 parameterTable.tableView_->
findCol(
1599 DesktopIconTable::COL_PARAMETER_VALUE));
1602 std::stringstream ss;
1603 parameterTable.tableView_->print(ss);
1604 __COUT__ << ss.str();
1606 parameterTable.tableView_
1611 std::stringstream ss;
1612 iconTable.tableView_->print(ss);
1613 __COUT__ << ss.str();
1615 iconTable.tableView_->
init();
1619 __COUT__ <<
"Icon table errors while saving. Erasing all newly "
1620 "created table versions."
1624 __COUT__ <<
"Erasing temporary version " << iconTable.tableName_ <<
"-v"
1625 << iconTable.temporaryVersion_ << __E__;
1628 iconTable.temporaryVersion_);
1632 .createdTemporaryVersion_)
1634 __COUT__ <<
"Erasing temporary version " << parameterTable.tableName_
1635 <<
"-v" << parameterTable.temporaryVersion_ << __E__;
1638 parameterTable.temporaryVersion_);
1643 __COUT__ <<
"Erasing temporary version " << appTable.tableName_ <<
"-v"
1644 << appTable.temporaryVersion_ << __E__;
1647 appTable.temporaryVersion_);
1653 __COUT__ <<
"Edits complete for new desktop icon, now making persistent tables."
1666 __COUT__ <<
"Original version is " << iconTable.tableName_ <<
"-v"
1667 << iconTable.originalVersion_ << __E__;
1668 __COUT__ <<
"Original version is " << parameterTable.tableName_ <<
"-v"
1669 << parameterTable.originalVersion_ << __E__;
1671 contextGroupMembers[DesktopIconTable::ICON_TABLE] =
1675 iconTable.tableName_,
1676 iconTable.originalVersion_,
1679 iconTable.temporaryVersion_,
1681 contextGroupMembers[DesktopIconTable::PARAMETER_TABLE] =
1685 parameterTable.tableName_,
1686 parameterTable.originalVersion_,
1689 parameterTable.temporaryVersion_,
1692 __COUT__ <<
"Temporary target version is " << iconTable.tableName_ <<
"-v"
1693 << contextGroupMembers[DesktopIconTable::ICON_TABLE] <<
"-v"
1694 << iconTable.temporaryVersion_ << __E__;
1695 __COUT__ <<
"Temporary target version is " << parameterTable.tableName_ <<
"-v"
1696 << contextGroupMembers[DesktopIconTable::PARAMETER_TABLE] <<
"-v"
1697 << parameterTable.temporaryVersion_ << __E__;
1699 contextGroupMembers[DesktopIconTable::ICON_TABLE] =
1703 iconTable.tableName_,
1704 iconTable.originalVersion_,
1707 iconTable.temporaryVersion_,
1710 contextGroupMembers[DesktopIconTable::PARAMETER_TABLE] =
1714 parameterTable.tableName_,
1715 parameterTable.originalVersion_,
1718 parameterTable.temporaryVersion_,
1722 __COUT__ <<
"Final target version is " << iconTable.tableName_ <<
"-v"
1723 << contextGroupMembers[DesktopIconTable::ICON_TABLE] << __E__;
1724 __COUT__ <<
"Final target version is " << parameterTable.tableName_ <<
"-v"
1725 << contextGroupMembers[DesktopIconTable::PARAMETER_TABLE] << __E__;
1727 for(
auto& table : contextGroupMembers)
1729 __COUT__ << table.first <<
" v" << table.second << __E__;
1732 __COUT__ <<
"Checking for duplicate Context groups..." << __E__;
1738 __COUT__ <<
"Found equivalent group key (" << newContextKey <<
") for "
1739 << contextGroupName <<
"." << __E__;
1740 xmlOut.addTextElementToData(contextGroupName +
"_foundEquivalentKey",
1747 __COUT__ <<
"Saved new Context group key (" << newContextKey <<
") for "
1748 << contextGroupName <<
"." << __E__;
1751 xmlOut.addTextElementToData(
"contextGroupName", contextGroupName);
1752 xmlOut.addTextElementToData(
"contextGroupKey", newContextKey.
toString());
1756 __COUT__ <<
"Original version is " << iconTable.tableName_ <<
"-v"
1757 << iconTable.originalVersion_ << __E__;
1758 __COUT__ <<
"Original version is " << parameterTable.tableName_ <<
"-v"
1759 << parameterTable.originalVersion_ << __E__;
1761 bool groupAliasChange =
false;
1762 bool tableAliasChange =
false;
1768 cfgMgr->getTableByName(ConfigurationManager::GROUP_ALIASES_TABLE_NAME);
1770 backboneGroupMembers[ConfigurationManager::GROUP_ALIASES_TABLE_NAME];
1775 unsigned int row = 0;
1777 std::vector<std::pair<std::string, ConfigurationTree>> aliasNodePairs =
1778 cfgMgr->
getNode(ConfigurationManager::GROUP_ALIASES_TABLE_NAME)
1780 std::string groupName, groupKey;
1781 for(
auto& aliasNodePair : aliasNodePairs)
1783 groupName = aliasNodePair.second.getNode(
"GroupName").getValueAsString();
1784 groupKey = aliasNodePair.second.getNode(
"GroupKey").getValueAsString();
1786 __COUT__ <<
"Group Alias: " << aliasNodePair.first <<
" => " << groupName
1787 <<
"(" << groupKey <<
"); row=" << row << __E__;
1789 if(groupName == contextGroupName &&
1792 __COUT__ <<
"Found alias! Changing group key." << __E__;
1794 groupAliasChange =
true;
1803 if(groupAliasChange)
1805 std::stringstream ss;
1806 tableView->print(ss);
1807 __COUT__ << ss.str();
1810 backboneGroupMembers[ConfigurationManager::GROUP_ALIASES_TABLE_NAME] =
1822 __COUT__ <<
"Original version is " << table->
getTableName() <<
"-v"
1823 << originalVersion <<
" and new version is v"
1824 << backboneGroupMembers
1825 [ConfigurationManager::GROUP_ALIASES_TABLE_NAME]
1834 cfgMgr->getTableByName(ConfigurationManager::VERSION_ALIASES_TABLE_NAME);
1836 backboneGroupMembers[ConfigurationManager::VERSION_ALIASES_TABLE_NAME];
1841 unsigned int row = 0;
1843 std::vector<std::pair<std::string, ConfigurationTree>> aliasNodePairs =
1844 cfgMgr->
getNode(ConfigurationManager::VERSION_ALIASES_TABLE_NAME)
1846 std::string tableName, tableVersion;
1847 for(
auto& aliasNodePair : aliasNodePairs)
1849 tableName = aliasNodePair.second.getNode(
"TableName").getValueAsString();
1850 tableVersion = aliasNodePair.second.getNode(
"Version").getValueAsString();
1852 __COUT__ <<
"Table Alias: " << aliasNodePair.first <<
" => " << tableName
1853 <<
"-v" << tableVersion <<
"" << __E__;
1855 if(tableName == DesktopIconTable::ICON_TABLE &&
1856 TableVersion(tableVersion) == iconTable.originalVersion_)
1858 __COUT__ <<
"Found alias! Changing icon table version alias."
1861 tableAliasChange =
true;
1864 contextGroupMembers[DesktopIconTable::ICON_TABLE].toString(),
1866 tableView->
findCol(
"Version"));
1868 else if(tableName == DesktopIconTable::PARAMETER_TABLE &&
1869 TableVersion(tableVersion) == parameterTable.originalVersion_)
1872 <<
"Found alias! Changing icon parameter table version alias."
1875 tableAliasChange =
true;
1878 contextGroupMembers[DesktopIconTable::PARAMETER_TABLE].toString(),
1880 tableView->
findCol(
"Version"));
1886 if(tableAliasChange)
1888 std::stringstream ss;
1889 tableView->print(ss);
1890 __COUT__ << ss.str();
1893 backboneGroupMembers[ConfigurationManager::VERSION_ALIASES_TABLE_NAME] =
1905 __COUT__ <<
"Original version is " << table->
getTableName() <<
"-v"
1906 << originalVersion <<
" and new version is v"
1907 << backboneGroupMembers
1908 [ConfigurationManager::VERSION_ALIASES_TABLE_NAME]
1915 if(groupAliasChange || tableAliasChange)
1917 for(
auto& table : backboneGroupMembers)
1919 __COUT__ << table.first <<
" v" << table.second << __E__;
1923 __COUT__ <<
"Checking for duplicate Backbone groups..." << __E__;
1929 __COUT__ <<
"Found equivalent group key (" << newBackboneKey <<
") for "
1930 << backboneGroupName <<
"." << __E__;
1931 xmlOut.addTextElementToData(backboneGroupName +
"_foundEquivalentKey",
1938 __COUT__ <<
"Saved new Backbone group key (" << newBackboneKey <<
") for "
1939 << backboneGroupName <<
"." << __E__;
1942 xmlOut.addTextElementToData(
"backboneGroupName", backboneGroupName);
1943 xmlOut.addTextElementToData(
"backboneGroupKey", newBackboneKey.
toString());
1946 __COUT__ <<
"Activating Context group key (" << newContextKey <<
") for "
1947 << contextGroupName <<
"." << __E__;
1948 __COUT__ <<
"Activating Backbone group key (" << newBackboneKey <<
") for "
1949 << backboneGroupName <<
"." << __E__;
1956 ConfigurationManager::LoadGroupType::ALL_TYPES
1968 catch(std::runtime_error& e)
1970 __SS__ <<
"Error adding Desktop Icon!\n\n " << e.what() << __E__;
1971 __COUT__ <<
"\n" << ss.str() << __E__;
1972 xmlOut.addTextElementToData(
"Error", ss.str());
1977 __SS__ <<
"Error adding Desktop Icon!" << __E__;
1982 catch(
const std::exception& e)
1984 ss <<
"Exception message: " << e.what();
1989 __COUT__ <<
"\n" << ss.str() << __E__;
1990 xmlOut.addTextElementToData(
"Error", ss.str());
1995 void ConfigurationSupervisorBase::recursiveCopyTreeUIDNode(
1998 std::map<std::string /*modified table*/, TableVersion /* modified version */>&
2000 const unsigned int startingDepth,
2001 const unsigned int depth,
2002 const unsigned int numberOfInstances,
2004 const std::string& uidToCopy)
2007 __COUTV__(startingDepth);
2009 __COUTV__(numberOfInstances);
2030 unsigned int col = cfgView->
getColUID();
2031 unsigned int row = cfgView->
findRow(col, uidToCopy);
2033 __COUT__ <<
"Copying " << cfgView->getTableName() <<
" v" << cfgView->getVersion()
2034 <<
" row=" << row <<
" record=" << uidToCopy
2035 <<
" instances=" << numberOfInstances << __E__;
2052 std::string tableName =
"secondary";
2055 TableBase* table = cfgMgr->getTableByName(tableName);
2058 table->setActiveView(version);
2062 if(version.isTemporaryVersion())
2065 __COUT__ <<
"Failed to find stored version, so attempting to "
2067 << tableName <<
" v" << version << __E__;
2071 __COUT__ << tableName <<
" active version is " << table->
getViewVersion() << __E__;
2075 __SS__ <<
"Target table version (" << version
2076 <<
") is not the currently active version (" << table->
getViewVersion()
2077 <<
"). Try refreshing the tree." << __E__;
2092 __COUT__ <<
"Created temporary version " << temporaryVersion << __E__;
2105 __COUT__ <<
"Caught error while editing. Erasing temporary version." << __E__;
2106 table->eraseView(temporaryVersion);
2120 catch(std::runtime_error& e)
2122 __SS__ << (
"Error copying tree target '" + uidToCopy +
"' at depth " +
2123 std::to_string(startingDepth - depth) +
" in table '" +
2124 cfgView->getTableName() +
".' " + std::string(e.what()))
2126 __COUT__ <<
"\n" << ss.str() << __E__;
2127 xmlOut.addTextElementToData(
"Error", ss.str());
2131 __SS__ << (
"Error copying tree target '" + uidToCopy +
"' at depth " +
2132 std::to_string(startingDepth - depth) +
" in table '" +
2133 cfgView->getTableName() +
".' ")
2139 catch(
const std::exception& e)
2141 ss <<
"Exception message: " << e.what();
2146 __COUT__ <<
"\n" << ss.str() << __E__;
2147 xmlOut.addTextElementToData(
"Error", ss.str());
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
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)
static void getConfigurationStatusXML(HttpXmlDocument &xmlOut, ConfigurationManagerRW *cfgMgr, const std::string &username)
getConfigurationStatusXML
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 handleGetTableGroupXML(HttpXmlDocument &xmlOut, ConfigurationManagerRW *cfgMgr, const std::string &groupName, TableGroupKey groupKey, bool ignoreWarnings=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
int fillFromCSV(const std::string &data, const int &dataOffset=0, const std::string &author="")
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="")
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