text
stringlengths
0
2.2M
std::string scope = dvs.at(dn).getAttribute("scope");
if(clas!="")
{
Bean bean(clas,"",clas,scope,false,false,name);
ConfigurationData::getInstance()->ffeadContext.addBean(bean);
}
logger << ("Adding Dynamic View for " + (name+url) + " :: " + clas) << std::endl;
}
}
}
#endif
else if(eles.at(apps).getTagName()=="ajax-interfaces")
{
ElementList ajintfs = eles.at(apps).getChildElements();
for (unsigned int dn = 0; dn < ajintfs.size(); dn++)
{
if(ajintfs.at(dn).getTagName()=="ajax-interface")
{
std::string url = ajintfs.at(dn).getAttribute("path");
if(url.find("*")==std::string::npos && url.find("regex(")==std::string::npos)
{
normalizeUrl(name, url);
std::string clas = ajintfs.at(dn).getAttribute("class");
ConfigurationData::getInstance()->ajaxInterfaceMap[name][url] = clas;
pathvec.push_back(name);
vecvp.push_back(usrincludes);
stat.push_back(false);
ajintpthMap[clas] = url;
afcd.push_back(clas);
logger << ("Adding Ajax Interface for " + (name+url) + " :: " + clas) << std::endl;
}
else
{
logger << ("Skipping Ajax Interface as path contains */regex function") << std::endl;
}
}
}
}
else if(eles.at(apps).getTagName()=="restcontrollers")
{
ElementList cntrls = eles.at(apps).getChildElements();
for (unsigned int cntn = 0; cntn < cntrls.size(); cntn++)
{
if(cntrls.at(cntn).getTagName()=="restcontroller")
{
std::string url = cntrls.at(cntn).getAttribute("path");
std::string clas = cntrls.at(cntn).getAttribute("class");
std::string rname = "";//cntrls.at(cntn).getAttribute("name");
std::string scope = cntrls.at(cntn).getAttribute("scope");
ElementList resfuncs = cntrls.at(cntn).getChildElements();
for (unsigned int cntn1 = 0; cntn1 < resfuncs.size(); cntn1++)
{
if(resfuncs.at(cntn1).getTagName()=="restfunction")
{
RestFunction restfunction;
restfunction.appName = name;
restfunction.name = resfuncs.at(cntn1).getAttribute("name");
restfunction.path = resfuncs.at(cntn1).getAttribute("path");
restfunction.clas = clas;
restfunction.unmapped = StringUtil::toLowerCopy(resfuncs.at(cntn1).getAttribute("unmapped"))=="true";
restfunction.meth = StringUtil::toUpperCopy(resfuncs.at(cntn1).getAttribute("meth"));
restfunction.statusCode = resfuncs.at(cntn1).getAttribute("statusCode");
restfunction.rtype = resfuncs.at(cntn1).getAttribute("rtype");
CryptoHandler::deSanitizeHtml(restfunction.rtype);
if(restfunction.statusCode!="")
{
try {
CastUtil::toInt(restfunction.statusCode);
} catch(const std::exception& e) {
logger << "Rest: invalid response statusCode specified, defaulting to 200.." << std::endl;
restfunction.statusCode = "200";
}
}
restfunction.serOpt = SerializeBase::identifySerOption(restfunction.rtype);
/*restfunction.baseUrl = resfuncs.at(cntn1).getAttribute("baseUrl");
if(restfunction.baseUrl!="")
{
if(restfunction.baseUrl.at(0)!='/')
restfunction.baseUrl = "/" + restfunction.baseUrl;
}*/
restfunction.icontentType = resfuncs.at(cntn1).getAttribute("icontentType");
restfunction.ocontentType = resfuncs.at(cntn1).getAttribute("ocontentType");
if(restfunction.ocontentType=="") {
restfunction.ocontentType = ContentTypes::CONTENT_TYPE_TEXT_PLAIN;
}
if(StringUtil::toLowerCopy(restfunction.ocontentType).find(ContentTypes::CONTENT_TYPE_APPLICATION_JSON)==0) {
restfunction.serOpt += 1000;
} else if(StringUtil::toLowerCopy(restfunction.ocontentType).find(ContentTypes::CONTENT_TYPE_APPLICATION_XML)==0) {
restfunction.serOpt += 2000;
}
ElementList resfuncparams = resfuncs.at(cntn1).getChildElements();
bool hasBodyParam = false, invalidParam = false;;
for (unsigned int cntn2 = 0; cntn2 < resfuncparams.size(); cntn2++)
{
if(resfuncparams.at(cntn2).getTagName()=="param")
{
RestFunctionParams param;
param.type = resfuncparams.at(cntn2).getAttribute("type");
CryptoHandler::deSanitizeHtml(param.type);
param.serOpt = SerializeBase::identifySerOption(param.type);