text
stringlengths
0
2.2M
}
return testStatus;
}
// ----------------------------------------------------------------------------
// Copyright 2019 Bloomberg Finance L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------- END-OF-FILE ----------------------------------
/*
Copyright 2009-2020, Sumeet Chhetri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* ConfigurationHandler.cpp
*
* Created on: 19-Jun-2012
* Author: sumeetc
*/
#include "ConfigurationHandler.h"
ConfigurationHandler::ConfigurationHandler() {
}
ConfigurationHandler::~ConfigurationHandler() {
}
void ConfigurationHandler::normalizeUrl(const std::string& appName, std::string& url) {
if(url=="")return;
if(StringUtil::startsWith(url, "regex(") && StringUtil::endsWith(url, ")")) {
std::string regurl = url.substr(6, url.length()-7);
if(!RegexUtil::isValidRegex(regurl)) {
url = "";
}
return;
}
if(url.at(0)!='/')
url = "/" + url;
if(url.find("/")==0 && url.find("/"+appName+"/")!=0) {
url = "/" + appName + url;
}
RegexUtil::replace(url, "[/]+", "/");
StringUtil::trim(url);
}
void ConfigurationHandler::handle(strVec webdirs, const strVec& webdirs1, const std::string& incpath, const std::string& rtdcfpath, const std::string& serverRootDirectory, const std::string& respath)
{
QueryClause::init();
QueryOperator::init();
JoinType::init();
Reflection ref;
//First initialize framework markers
ref.addMarker(Marker("@CondBarrier", Marker::TYPE_CLASS, MarkerHandler::collectStr(2, "type", "value")));
ref.addMarker(Marker("@CondBarrier", Marker::TYPE_PROP, MarkerHandler::collectStr(2, "type", "value")));
ref.addMarker(Marker("@CondBarrier", Marker::TYPE_METH, MarkerHandler::collectStr(2, "type", "value")));
//Start Rest-full markers
ref.addMarker(Marker("@RestController", Marker::TYPE_CLASS, MarkerHandler::collectStr(1, "path")));
ref.addMarker(Marker("@GET", Marker::TYPE_METH, MarkerHandler::collectStr(5, "statusCode", "path", "icontentType", "ocontentType", "unmapped"),
MarkerHandler::collectBool(5, false, true, false, false, false)));
ref.addMarker(Marker("@PUT", Marker::TYPE_METH, MarkerHandler::collectStr(5, "statusCode", "path", "icontentType", "ocontentType", "unmapped"),
MarkerHandler::collectBool(5, false, true, false, false, false)));
ref.addMarker(Marker("@POST", Marker::TYPE_METH, MarkerHandler::collectStr(5, "statusCode", "path", "icontentType", "ocontentType", "unmapped"),
MarkerHandler::collectBool(5, false, true, false, false, false)));
ref.addMarker(Marker("@DELETE", Marker::TYPE_METH, MarkerHandler::collectStr(5, "statusCode", "path", "icontentType", "ocontentType", "unmapped"),
MarkerHandler::collectBool(5, false, true, false, false, false)));
ref.addMarker(Marker("@PathParam", Marker::TYPE_ARG, MarkerHandler::collectStr(1, "name")));
ref.addMarker(Marker("@QueryParam", Marker::TYPE_ARG, MarkerHandler::collectStr(1, "name")));
ref.addMarker(Marker("@FormParam", Marker::TYPE_ARG, MarkerHandler::collectStr(1, "name")));
ref.addMarker(Marker("@HeaderParam", Marker::TYPE_ARG, MarkerHandler::collectStr(1, "name")));
ref.addMarker(Marker("@MultipartContent", Marker::TYPE_ARG, MarkerHandler::collectStr(1, "name")));
ref.addMarker(Marker("@Body", Marker::TYPE_ARG));
ref.addMarker(Marker("@DefaultValue", Marker::TYPE_ARG, MarkerHandler::collectStr(1, "value")));
//Start Web-Service markers