/**
*
*/
public RequestData getRequestData(final HttpServletRequest request) throws Exception {
final RequestData requestData = new RequestData();
requestData.setRequest(request);
String contextPath = "";
if (request.getRequestURL().toString().contains("localhost") || request.getRequestURL().toString().contains("127.0.0.1")) {
contextPath = contextPath + request.getContextPath() + "/";
} else {
contextPath = "/";
}
requestData.setContextPath(contextPath);
requestData.setContextNameValue(getCurrentContextNameValue(request));
// SPECIFIC BACKOFFICE
if (requestData.isBackoffice()) {
checkEngineBoSession(request);
} else {
// SPECIFIC FRONTOFFICE
checkEngineEcoSession(request);
requestData.setGeolocData(getCurrentGeolocData(request));
}
requestData.setVelocityEmailPrefix(getCurrentVelocityEmailPrefix(requestData));
requestData.setMarketPlace(getCurrentMarketPlace(requestData));
requestData.setMarket(getCurrentMarket(requestData));
requestData.setMarketArea(getCurrentMarketArea(requestData));
requestData.setMarketAreaLocalization(getCurrentMarketAreaLocalization(requestData));
requestData.setMarketAreaRetailer(getCurrentMarketAreaRetailer(requestData));
requestData.setMarketAreaCurrency(getCurrentMarketAreaCurrency(requestData));
// SPECIFIC BACKOFFICE
if (requestData.isBackoffice()) {
User user = getCurrentUser(request);
if (user != null) {
requestData.setUser(user);
}
Company company = getCurrentCompany(request);
if (company != null) {
requestData.setCompany(company);
}
requestData.setBackofficeLocalization(getCurrentBackofficeLocalization(requestData));
} else {
// SPECIFIC FRONTOFFICE
Customer customer = getCurrentCustomer(request);
if (customer != null) {
requestData.setCustomer(customer);
}
requestData.setCart(getCurrentCart(request));
}
return requestData;
}