コード例 #1
0
ファイル: PlanController.java プロジェクト: maestrocorona/SSP
  /**
   * Returns an html page valid for printing
   *
   * <p>
   *
   * @param obj instance to print.
   * @return html text strem
   * @throws ObjectNotFoundException If specified object could not be found.
   */
  @PreAuthorize("hasRole('ROLE_PERSON_READ') or hasRole('ROLE_PERSON_MAP_READ')")
  @RequestMapping(value = "/print", method = RequestMethod.POST)
  public @ResponseBody String print(
      final HttpServletResponse response, @RequestBody final PlanOutputTO planOutputDataTO)
      throws ObjectNotFoundException {

    SubjectAndBody message = service.createOutput(planOutputDataTO);
    if (message != null) return message.getBody();

    return null;
  }
コード例 #2
0
ファイル: PlanController.java プロジェクト: maestrocorona/SSP
  @PreAuthorize("hasRole('ROLE_PERSON_READ') or hasRole('ROLE_PERSON_MAP_READ')")
  @RequestMapping(value = "/printCurrent", method = RequestMethod.POST)
  public @ResponseBody String printCurrent(
      final HttpServletResponse response,
      final @PathVariable UUID personId,
      @RequestBody final PlanOutputTO planOutputDataTO)
      throws ObjectNotFoundException {

    Plan currentPlan = service.getCurrentForStudent(personId);
    PlanTO planTO = getFactory().from(currentPlan);
    planOutputDataTO.setPlan(planTO);

    SubjectAndBody message = service.createOutput(planOutputDataTO);
    if (message != null) return message.getBody();

    return null;
  }