text: /**
  	* \file DlgWznmFilDownload_blks.cpp
  	* job handler for job DlgWznmFilDownload (implementation of blocks)
  	* \copyright (C) 2016-2020 MPSI Technologies GmbH
  	* \author Alexander Wirthmueller (auto-generation)
  	* \date created: 28 Nov 2020
  	*/
  // IP header --- ABOVE
  
  using namespace std;
  using namespace Sbecore;
  using namespace Xmlio;
  
  /******************************************************************************
   class DlgWznmFilDownload::VecVDo
   ******************************************************************************/
  
  uint DlgWznmFilDownload::VecVDo::getIx(
  			const string& sref
  		) {
  	string s = StrMod::lc(sref);
  
  	if (s == "butdneclick") return BUTDNECLICK;
  
  	return(0);
  };
  
  string DlgWznmFilDownload::VecVDo::getSref(
  			const uint ix
  		) {
  	if (ix == BUTDNECLICK) return("ButDneClick");
  
  	return("");
  };
  
  /******************************************************************************
   class DlgWznmFilDownload::ContInf
   ******************************************************************************/
  
  DlgWznmFilDownload::ContInf::ContInf(
  			const string& Dld
  		) :
  			Block()
  		{
  	this->Dld = Dld;
  
  	mask = {DLD};
  };
  
  void DlgWznmFilDownload::ContInf::writeJSON(
  			Json::Value& sup
  			, string difftag
  		) {
  	if (difftag.length() == 0) difftag = "ContInfDlgWznmFilDownload";
  
  	Json::Value& me = sup[difftag] = Json::Value(Json::objectValue);
  
  	me["Dld"] = Dld;
  };
  
  void DlgWznmFilDownload::ContInf::writeXML(
  			xmlTextWriter* wr
  			, string difftag
  			, bool shorttags
  		) {
  	if (difftag.length() == 0) difftag = "ContInfDlgWznmFilDownload";
  
  	string itemtag;
  	if (shorttags) itemtag = "Ci";
  	else itemtag = "ContitemInfDlgWznmFilDownload";
  
  	xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str());
  		writeStringAttr(wr, itemtag, "sref", "Dld", Dld);
  	xmlTextWriterEndElement(wr);
  };
  
  set<uint> DlgWznmFilDownload::ContInf::comm(
  			const ContInf* comp
  		) {
  	set<uint> items;
  
  	if (Dld == comp->Dld) insert(items, DLD);
  
  	return(items);
  };
  
  set<uint> DlgWznmFilDownload::ContInf::diff(
  			const ContInf* comp
  		) {
  	set<uint> commitems;
  	set<uint> diffitems;
  
  	commitems = comm(comp);
  
  	diffitems = {DLD};
  	for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it);
  
  	return(diffitems);
  };
  
  /******************************************************************************
   class DlgWznmFilDownload::StatApp
   ******************************************************************************/
  
  void DlgWznmFilDownload::StatApp::writeJSON(
  			Json::Value& sup
  			, string difftag
  			, const string& shortMenu
  		) {
  	if (difftag.length() == 0) difftag = "StatAppDlgWznmFilDownload";
  
  	Json::Value& me = sup[difftag] = Json::Value(Json::objectValue);
  
  	me["shortMenu"] = shortMenu;
  };
  
  void DlgWznmFilDownload::StatApp::writeXML(
  			xmlTextWriter* wr
  			, string difftag
  			, bool shorttags
  			, const string& shortMenu
  		) {
  	if (difftag.length() == 0) difftag = "StatAppDlgWznmFilDownload";
  
  	string itemtag;
  	if (shorttags) itemtag = "Si";
  	else itemtag = "StatitemAppDlgWznmFilDownload";
  
  	xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str());
  		writeStringAttr(wr, itemtag, "sref", "shortMenu", shortMenu);
  	xmlTextWriterEndElement(wr);
  };
  
  /******************************************************************************
   class DlgWznmFilDownload::Tag
   ******************************************************************************/
  
  void DlgWznmFilDownload::Tag::writeJSON(
  			const uint ixWznmVLocale
  			, Json::Value& sup
  			, string difftag
  		) {
  	if (difftag.length() == 0) difftag = "TagDlgWznmFilDownload";
  
  	Json::Value& me = sup[difftag] = Json::Value(Json::objectValue);
  
  	if (ixWznmVLocale == VecWznmVLocale::ENUS) {
  		me["Cpt"] = "Download file";
  	};
  	me["Dld"] = StrMod::cap(VecWznmVTag::getTitle(VecWznmVTag::DOWNLOAD, ixWznmVLocale));
  	me["ButDne"] = StrMod::cap(VecWznmVTag::getTitle(VecWznmVTag::DONE, ixWznmVLocale));
  };
  
  void DlgWznmFilDownload::Tag::writeXML(
  			const uint ixWznmVLocale
  			, xmlTextWriter* wr
  			, string difftag
  			, bool shorttags
  		) {
  	if (difftag.length() == 0) difftag = "TagDlgWznmFilDownload";
  
  	string itemtag;
  	if (shorttags) itemtag = "Ti";
  	else itemtag = "TagitemDlgWznmFilDownload";
  
  	xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str());
  		if (ixWznmVLocale == VecWznmVLocale::ENUS) {
  			writeStringAttr(wr, itemtag, "sref", "Cpt", "Download file");
  		};
  		writeStringAttr(wr, itemtag, "sref", "Dld", StrMod::cap(VecWznmVTag::getTitle(VecWznmVTag::DOWNLOAD, ixWznmVLocale)));
  		writeStringAttr(wr, itemtag, "sref", "ButDne", StrMod::cap(VecWznmVTag::getTitle(VecWznmVTag::DONE, ixWznmVLocale)));
  	xmlTextWriterEndElement(wr);
  };
  
  /******************************************************************************
   class DlgWznmFilDownload::DpchAppDo
   ******************************************************************************/
  
  DlgWznmFilDownload::DpchAppDo::DpchAppDo() :
  			DpchAppWznm(VecWznmVDpch::DPCHAPPDLGWZNMFILDOWNLOADDO)
  		{
  	ixVDo = 0;
  };
  
  string DlgWznmFilDownload::DpchAppDo::getSrefsMask() {
  	vector<string> ss;
  	string srefs;
  
  	if (has(JREF)) ss.push_back("jref");
  	if (has(IXVDO)) ss.push_back("ixVDo");
  
  	StrMod::vectorToString(ss, srefs);
  
  	return(srefs);
  };
  
  void DlgWznmFilDownload::DpchAppDo::readJSON(
  			Json::Value& sup
  			, bool addbasetag
  		) {
  	clear();
  
  	bool basefound;
  
  	Json::Value& me = sup;
  	if (addbasetag) me = sup["DpchAppDlgWznmFilDownloadDo"];
  
  	basefound = (me != Json::nullValue);
  
  	if (basefound) {
  		if (me.isMember("scrJref")) {jref = Scr::descramble(me["scrJref"].asString()); add(JREF);};
  		if (me.isMember("srefIxVDo")) {ixVDo = VecVDo::getIx(me["srefIxVDo"].asString()); add(IXVDO);};
  	} else {
  	};
  };
  
  void DlgWznmFilDownload::DpchAppDo::readXML(
  			xmlXPathContext* docctx
  			, string basexpath
  			, bool addbasetag
  		) {
  	clear();
  
  	string scrJref;
  	string srefIxVDo;
  
  	bool basefound;
  
  	if (addbasetag)
  		basefound = checkUclcXPaths(docctx, basexpath, basexpath, "DpchAppDlgWznmFilDownloadDo");
  	else
  		basefound = checkXPath(docctx, basexpath);
  
  	if (basefound) {
  		if (extractStringUclc(docctx, basexpath, "scrJref", "", scrJref)) {
  			jref = Scr::descramble(scrJref);
  			add(JREF);
  		};
  		if (extractStringUclc(docctx, basexpath, "srefIxVDo", "", srefIxVDo)) {
  			ixVDo = VecVDo::getIx(srefIxVDo);
  			add(IXVDO);
  		};
  	} else {
  	};
  };
  
  /******************************************************************************
   class DlgWznmFilDownload::DpchEngData
   ******************************************************************************/
  
  DlgWznmFilDownload::DpchEngData::DpchEngData(
  			const ubigint jref
  			, ContInf* continf
  			, const set<uint>& mask
  		) :
  			DpchEngWznm(VecWznmVDpch::DPCHENGDLGWZNMFILDOWNLOADDATA, jref)
  		{
  	if (find(mask, ALL)) this->mask = {JREF, CONTINF, STATAPP, TAG};
  	else this->mask = mask;
  
  	if (find(this->mask, CONTINF) && continf) this->continf = *continf;
  };
  
  string DlgWznmFilDownload::DpchEngData::getSrefsMask() {
  	vector<string> ss;
  	string srefs;
  
  	if (has(JREF)) ss.push_back("jref");
  	if (has(CONTINF)) ss.push_back("continf");
  	if (has(STATAPP)) ss.push_back("statapp");
  	if (has(TAG)) ss.push_back("tag");
  
  	StrMod::vectorToString(ss, srefs);
  
  	return(srefs);
  };
  
  void DlgWznmFilDownload::DpchEngData::merge(
  			DpchEngWznm* dpcheng
  		) {
  	DpchEngData* src = (DpchEngData*) dpcheng;
  
  	if (src->has(JREF)) {jref = src->jref; add(JREF);};
  	if (src->has(CONTINF)) {continf = src->continf; add(CONTINF);};
  	if (src->has(STATAPP)) add(STATAPP);
  	if (src->has(TAG)) add(TAG);
  };
  
  void DlgWznmFilDownload::DpchEngData::writeJSON(
  			const uint ixWznmVLocale
  			, Json::Value& sup
  		) {
  	Json::Value& me = sup["DpchEngDlgWznmFilDownloadData"] = Json::Value(Json::objectValue);
  
  	if (has(JREF)) me["scrJref"] = Scr::scramble(jref);
  	if (has(CONTINF)) continf.writeJSON(me);
  	if (has(STATAPP)) StatApp::writeJSON(me);
  	if (has(TAG)) Tag::writeJSON(ixWznmVLocale, me);
  };
  
  void DlgWznmFilDownload::DpchEngData::writeXML(
  			const uint ixWznmVLocale
  			, xmlTextWriter* wr
  		) {
  	xmlTextWriterStartElement(wr, BAD_CAST "DpchEngDlgWznmFilDownloadData");
  	xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wznm");
  		if (has(JREF)) writeString(wr, "scrJref", Scr::scramble(jref));
  		if (has(CONTINF)) continf.writeXML(wr);
  		if (has(STATAPP)) StatApp::writeXML(wr);
  		if (has(TAG)) Tag::writeXML(ixWznmVLocale, wr);
  	xmlTextWriterEndElement(wr);
  };
  