caf32c83 by Ean Schuessler

Merge branch 'master' into BF-8039

Conflicts:
	src/com/brainfood/ofbiz/DirectControlServlet.java
2 parents a80bfaac 249f5ebb
......@@ -396,6 +396,14 @@ public class DirectControlServlet extends HttpServlet {
Delegator delegator = getDelegator(request.getServletContext());
LocalDispatcher dispatcher = getDispatcher(request.getServletContext());
DispatchContext dctx = dispatcher.getDispatchContext();
ModelService model = dctx.getModelService(serviceName);
// some needed info for when running the service
Locale locale = UtilHttp.getLocale(request);
TimeZone timeZone = UtilHttp.getTimeZone(request);
List<Object> errorMessages = new ArrayList<Object>();
// Check if there is an output handler
......@@ -427,7 +435,13 @@ public class DirectControlServlet extends HttpServlet {
// prolong the session
if (UtilValidate.isNotEmpty(checkSessionService)) {
dispatcher.runSync(checkSessionService, UtilMisc.<String, Object>toMap("sessionId", authToken, "userLogin", userLogin));
Map<String, Object> checkSessionServiceContext = new HashMap<String, Object>();
checkSessionServiceContext.put("sessionId", authToken);
checkSessionServiceContext.put("userLogin", userLogin);
checkSessionServiceContext.put("serviceModel", model);
ModelService checkSessionModel = dctx.getModelService(checkSessionService);
checkSessionServiceContext = checkSessionModel.makeValid(checkSessionServiceContext, ModelService.IN_PARAM, true, errorMessages, timeZone, locale);
dispatcher.runSync(checkSessionService, checkSessionServiceContext);
}
}
}
......@@ -447,15 +461,6 @@ public class DirectControlServlet extends HttpServlet {
}
context.put("httpHeaders", headerMap);
DispatchContext dctx = dispatcher.getDispatchContext();
ModelService model = dctx.getModelService(serviceName);
// some needed info for when running the service
Locale locale = UtilHttp.getLocale(request);
TimeZone timeZone = UtilHttp.getTimeZone(request);
List<Object> errorMessages = new ArrayList<Object>();
context = model.makeValid(context, ModelService.IN_PARAM, true, errorMessages, timeZone, locale);
Map<String, Object> result = dispatcher.runSync(serviceName, context);
......