/**
  * Submit query looks at the list of strategies it has available and chooses the correct strategy
  * based on the queryDTO type. It then creates a new Task to be handed by to the user, while it
  * called the execute method of the strategy asynchronously.
  */
 public Task submitQuery(HttpSession session, QueryDTO queryDTO) throws FindingsQueryException {
   Task task =
       new Task(
           REMBRANDT_TASK_RESULT + queryDTO.getQueryName(),
           session.getId(),
           FindingStatus.Running,
           queryDTO);
   task.setQueryDTO(queryDTO);
   RembrandtTaskResult taskResult = new RembrandtTaskResult(task);
   // presentationTierCache.addNonPersistableToSessionCache(taskResult.getTask().getCacheId(),
   //		taskResult.getTask().getId(), taskResult);
   RembrandtAsynchronousFindingStrategy strategy =
       new RembrandtAsynchronousFindingStrategy(taskResult, session);
   strategy.executeQuery();
   return task;
 }
Example #2
0
 public ActionForward submit(
     ActionMapping mapping,
     ActionForm form,
     HttpServletRequest request,
     HttpServletResponse response)
     throws IOException {
   EagleClinicalQueryDTO dto = new EagleClinicalQueryDTO();
   dto.setQueryName("test");
   try {
     Task task = findingsManager.submitQuery(dto);
     presentationCacheManager.addNonPersistableToSessionCache(
         request.getSession().getId(), task.getId(), task);
   } catch (FindingsQueryException e) {
     ActionErrors errors = new ActionErrors();
     errors.add("queryErrors", new ActionMessage("caintegrator.error.query"));
     saveMessages(request, errors);
     return (mapping.findForward("failure"));
   }
   return (mapping.findForward("success"));
 }