Merge branch 'master' into BF-8039
Conflicts: src/com/brainfood/ofbiz/DirectControlServlet.java
Showing
1 changed file
with
15 additions
and
10 deletions
... | @@ -396,6 +396,14 @@ public class DirectControlServlet extends HttpServlet { | ... | @@ -396,6 +396,14 @@ public class DirectControlServlet extends HttpServlet { |
396 | 396 | ||
397 | Delegator delegator = getDelegator(request.getServletContext()); | 397 | Delegator delegator = getDelegator(request.getServletContext()); |
398 | LocalDispatcher dispatcher = getDispatcher(request.getServletContext()); | 398 | LocalDispatcher dispatcher = getDispatcher(request.getServletContext()); |
399 | DispatchContext dctx = dispatcher.getDispatchContext(); | ||
400 | ModelService model = dctx.getModelService(serviceName); | ||
401 | |||
402 | // some needed info for when running the service | ||
403 | Locale locale = UtilHttp.getLocale(request); | ||
404 | TimeZone timeZone = UtilHttp.getTimeZone(request); | ||
405 | |||
406 | List<Object> errorMessages = new ArrayList<Object>(); | ||
399 | 407 | ||
400 | // Check if there is an output handler | 408 | // Check if there is an output handler |
401 | 409 | ||
... | @@ -427,7 +435,13 @@ public class DirectControlServlet extends HttpServlet { | ... | @@ -427,7 +435,13 @@ public class DirectControlServlet extends HttpServlet { |
427 | 435 | ||
428 | // prolong the session | 436 | // prolong the session |
429 | if (UtilValidate.isNotEmpty(checkSessionService)) { | 437 | if (UtilValidate.isNotEmpty(checkSessionService)) { |
430 | dispatcher.runSync(checkSessionService, UtilMisc.<String, Object>toMap("sessionId", authToken, "userLogin", userLogin)); | 438 | Map<String, Object> checkSessionServiceContext = new HashMap<String, Object>(); |
439 | checkSessionServiceContext.put("sessionId", authToken); | ||
440 | checkSessionServiceContext.put("userLogin", userLogin); | ||
441 | checkSessionServiceContext.put("serviceModel", model); | ||
442 | ModelService checkSessionModel = dctx.getModelService(checkSessionService); | ||
443 | checkSessionServiceContext = checkSessionModel.makeValid(checkSessionServiceContext, ModelService.IN_PARAM, true, errorMessages, timeZone, locale); | ||
444 | dispatcher.runSync(checkSessionService, checkSessionServiceContext); | ||
431 | } | 445 | } |
432 | } | 446 | } |
433 | } | 447 | } |
... | @@ -447,15 +461,6 @@ public class DirectControlServlet extends HttpServlet { | ... | @@ -447,15 +461,6 @@ public class DirectControlServlet extends HttpServlet { |
447 | } | 461 | } |
448 | context.put("httpHeaders", headerMap); | 462 | context.put("httpHeaders", headerMap); |
449 | 463 | ||
450 | DispatchContext dctx = dispatcher.getDispatchContext(); | ||
451 | ModelService model = dctx.getModelService(serviceName); | ||
452 | |||
453 | // some needed info for when running the service | ||
454 | Locale locale = UtilHttp.getLocale(request); | ||
455 | TimeZone timeZone = UtilHttp.getTimeZone(request); | ||
456 | |||
457 | List<Object> errorMessages = new ArrayList<Object>(); | ||
458 | |||
459 | context = model.makeValid(context, ModelService.IN_PARAM, true, errorMessages, timeZone, locale); | 464 | context = model.makeValid(context, ModelService.IN_PARAM, true, errorMessages, timeZone, locale); |
460 | 465 | ||
461 | Map<String, Object> result = dispatcher.runSync(serviceName, context); | 466 | Map<String, Object> result = dispatcher.runSync(serviceName, context); | ... | ... |
-
Please register or sign in to post a comment