text
stringlengths
0
2.2M
if(eles.at(apps).getTagName()=="page")
{
std::string fvw = eles.at(apps).getAttribute("htm");
StringUtil::replaceFirst(fvw,".html",".fview");
ConfigurationData::getInstance()->fviewMappingMap[name][fvw] = eles.at(apps).getAttribute("class");
pathvec.push_back(name);
vecvp.push_back(usrincludes);
stat.push_back(false);
normalizeUrl(name, fvw);
ConfigurationData::getInstance()->ajaxInterfaceMap[name][fvw] = eles.at(apps).getAttribute("class");
afcd.push_back(eles.at(apps).getAttribute("class"));
ElementList elese = eles.at(apps).getChildElements();
std::string nsfns = "\nvar _fview_namespace = {";
std::string js = "\n\nwindow.onload = function(){";
for (int appse = 0; appse < (int)elese.size(); appse++)
{
if(elese.at(appse).getTagName()=="event")
{
nsfns += "\n\"_fview_cntxt_global_js_callback"+CastUtil::fromNumber(appse)+"\" : function(response){" + elese.at(appse).getAttribute("cb") + "},";
js += "\ndocument.getElementById('"+elese.at(appse).getAttribute("eid")+"').";
js += elese.at(appse).getAttribute("type") + " = function(){";
js += eles.at(apps).getAttribute("class")+"."+elese.at(appse).getAttribute("func")+"(";
std::string args = elese.at(appse).getAttribute("args");
if(args!="")
args += ",";
js += args + "\"_fview_cntxt_global_js_callback"+CastUtil::fromNumber(appse)+"\",\"/"+name+"/"+fvw+"\",_fview_namespace);}";
}
else if(elese.at(appse).getTagName()=="form")
{
//ConfigurationData::getInstance()->fviewFormMap[name][elese.at(appse).getAttribute("name")] = *(elese.at(appse));
std::string clas = elese.at(appse).getAttribute("controller");
std::string scope = elese.at(appse).getAttribute("scope");
if(clas!="")
{
Bean bean(clas,"",clas,scope,false,false,name);
ConfigurationData::getInstance()->ffeadContext.addBean(bean);
}
elese.at(appse).copy(&(ConfigurationData::getInstance()->fviewFormMap[name][elese.at(appse).getAttribute("name")]));
logger << ("Fview: Adding form => " + elese.at(appse).getAttribute("name")
+ " , form class => " + elese.at(appse).getAttribute("bean")
+ " , form controller => " + elese.at(appse).getAttribute("controller")) << std::endl;
}
}
js += "\n}\n\n";
nsfns = nsfns.substr(0,nsfns.length()-1) + "\n}\n";
js = nsfns + js;
for (unsigned int appse = 0; appse < elese.size(); appse++)
{
if(elese.at(appse).getTagName()=="functions")
{
js += elese.at(appse).getText();
}
}
AfcUtil::writeTofile(webpubpath+eles.at(apps).getAttribute("class")+".js",js,true);
logger << ("Fview: Adding fview page class => " + eles.at(apps).getAttribute("class")
+ " , html => " + eles.at(apps).getAttribute("htm")) << std::endl;
}
}
}
logger << "done reading fviews.xml " << std::endl;
std::string infjs;
ajrt += AfcUtil::generateJsInterfacessAll(allclsmap,infjs,ajintpthMap,afcd,ref);
std::string objs = AfcUtil::generateJsObjectsAll(allclsmap);
vecvp.clear();
afcd.clear();
pathvec.clear();
ajintpthMap.clear();
AfcUtil::writeTofile(webpubpath+"_afc_Objects.js",objs,true);
AfcUtil::writeTofile(webpubpath+"_afc_Interfaces.js",infjs,true);
LoggerFactory::init(defpath+"/config/logging.xml", defpath, name, isLoggingEnabled);
}
ConfigurationData::getInstance()->classStructureMap = clsstrucMaps;
std::string confsrcFiles = "", confsrcFilesDinter = "";
#ifdef INC_COMP
logger << "started generating component code" <<std::endl;
std::map<std::string, std::string>::iterator cmpit;
for (cmpit=compnts.begin();cmpit!=compnts.end();++cmpit)
{
std::string cudata,cuheader,curemote,curemoteheaders;
try
{
std::string file = gen.generateComponentCU(cmpit->first,cudata,cuheader,curemote,curemoteheaders,cmpit->second);
AfcUtil::writeTofile(rtdcfpath+file+".h",cuheader,true);
AfcUtil::writeTofile(rtdcfpath+file+".cpp",cudata,true);
AfcUtil::writeTofile(rtdcfpath+file+"_Remote.h",curemoteheaders,true);
AfcUtil::writeTofile(rtdcfpath+file+"_Remote.cpp",curemote,true);
#ifdef BUILD_AUTOCONF
confsrcFiles += "../" + file+".cpp ";
confsrcFiles += "../" + file+"_Remote.cpp ";
#else
confsrcFiles += file+".cpp ";
confsrcFiles += file+"_Remote.cpp ";
#endif
isrcs += "./"+file+".cpp \\\n"+"./"+file+"_Remote.cpp \\\n";