public void onPrintTag(int palletId) {
    String printTagReportName = Utils.genReportName("_PrintTag");
    String partReport = "";
    PalletModel palletModel = null;
    List<PalletManagemengModelReport> reportViews = null;
    HashMap map = new HashMap<String, Object>();

    try {
      palletModel = palletDAO.findByID(palletId);
      if (!Utils.isNull(palletModel) && Utils.isZero(palletModel.getIsCombine())) {
        reportViews = palletDAO.genSQLReportPallet(palletId);
        partReport = pathPrintTagReport;
      } else if (!Utils.isNull(palletModel) && !Utils.isZero(palletModel.getIsCombine())) {
        partReport = pathPrintTagV2Report;
        map.put("path", FacesUtil.getRealPath(pathSubReport));
        map.put("MainPallet", palletDAO.findByIdToReport(palletModel.getId()));
        map.put("SubPallet", palletDAO.genSQLReportPalletV2(palletModel.getId()));
      }
    } catch (Exception e) {
      log.debug("Exception error onPrintTag : ", e);
    }

    try {
      reportService.exportPDF(partReport, map, printTagReportName, reportViews);
    } catch (Exception e) {
      log.debug("Exception Report : ", e);
    }
  }
Exemple #2
0
 /**
  * Instantiates a new razor server, its services, and starts the scheduler. This can be replaced
  * by a dynamic handler manager but has the benefit of simplicity.
  */
 public RazorServer() {
   super();
   SERVICES.put(Service.ACCOUNT, AccountService.getInstance());
   SERVICES.put(Service.ALERT, AlertService.getInstance());
   SERVICES.put(Service.ASSET, AssetService.getInstance());
   SERVICES.put(Service.ATTRIBUTE, AttributeService.getInstance());
   SERVICES.put(Service.AUDIT, AuditService.getInstance());
   SERVICES.put(Service.CONTRACT, ContractService.getInstance());
   SERVICES.put(Service.FINANCE, FinanceService.getInstance());
   SERVICES.put(Service.JOURNAL, JournalService.getInstance());
   SERVICES.put(Service.IMAGE, ImageService.getInstance());
   SERVICES.put(Service.IMAGETEXT, ImageTextService.getInstance());
   SERVICES.put(Service.LICENSE, LicenseService.getInstance());
   SERVICES.put(Service.LOCATION, LocationService.getInstance());
   SERVICES.put(Service.MAIL, MailService.getInstance());
   SERVICES.put(Service.MONITOR, MonitorService.getInstance());
   SERVICES.put(Service.PARTNER, PartnerService.getInstance());
   SERVICES.put(Service.PARTY, PartyService.getInstance());
   SERVICES.put(Service.PRICE, PriceService.getInstance());
   SERVICES.put(Service.PRODUCT, ProductService.getInstance());
   SERVICES.put(Service.RATE, RateService.getInstance());
   SERVICES.put(Service.REPORT, ReportService.getInstance());
   SERVICES.put(Service.RESERVATION, ReservationService.getInstance());
   SERVICES.put(Service.SESSION, SessionService.getInstance());
   SERVICES.put(Service.SMS, SmsService.getInstance());
   SERVICES.put(Service.TASK, TaskService.getInstance());
   SERVICES.put(Service.TAX, TaxService.getInstance());
   SERVICES.put(Service.TEXT, TextService.getInstance());
   SERVICES.put(Service.WORKFLOW, WorkflowService.getInstance());
   //		startScheduler();
   //		PartnerService.startSchedulers();
 }
  /*
   * Simple end to end test (mostly for debug work)
   */
  public void testHelloOneWay() throws Exception {
    HandlerTracker tracker = HandlerTracker.getClientInstance();
    tracker.clearAll();

    TestService_Service service = getService();
    TestService test = getTestStub(service);
    ReportService report = getReportStub(service);

    report.clearHandlerTracker();

    test.testIntOneWay(0);

    // make normal call after
    assertEquals("did not get expected response", 4, test.testInt(4));

    System.out.println("ok");
  }
  /*
   * Simple end to end test (mostly for debug work)
   */
  public void testHello() throws Exception {
    HandlerTracker tracker = HandlerTracker.getClientInstance();
    tracker.clearAll();

    TestService_Service service = getService();
    TestService test = getTestStub(service);
    ReportService report = getReportStub(service);

    report.clearHandlerTracker();

    int foo = -1;
    int bar = test.testInt(foo);
    assertTrue(foo == bar);
    System.out.println("ok");

    List<String> closedHandlers = report.getReport(TestConstants.REPORT_CLOSED_HANDLERS);

    List<String> handlers = report.getReport(TestConstants.REPORT_CALLED_HANDLERS);
    assertNotNull("received null list back from server", handlers);
  }
Exemple #5
0
  @RequestMapping(value = "/report/{year}/{month}/{day}/{employeeId}", method = RequestMethod.GET)
  public ModelAndView sendViewReports(
      @PathVariable("year") Integer year,
      @PathVariable("month") Integer month,
      @PathVariable("day") Integer day,
      @PathVariable("employeeId") Integer employeeId,
      @ModelAttribute("ReportForm") TimeSheetForm tsForm,
      BindingResult result) {
    logger.info("Date for report: {}.{}", year, month);
    logger.info("Date for report: {}", day);
    ModelAndView mav = new ModelAndView("report");
    mav.addObject("ReportForm", tsForm);
    mav.addObject("year", Integer.toString(year));
    mav.addObject("month", month);
    mav.addObject("day", day);
    mav.addObject("employeeId", employeeId);

    final TimeSheet timeSheet =
        timeSheetService.findForDateAndEmployee(
            year.toString() + "-" + month.toString() + "-" + day.toString(), employeeId);

    if (timeSheet == null) {
      ModelAndView errorMav = new ModelAndView("/errors/commonErrors");
      errorMav.addObject("cause", ERROR_CAUSE);
      logger.error("Trying to view a report that was deleted or placed in draft");
      return errorMav;
    } else {

      mav.addObject(
          "creationDate",
          (timeSheet.getCreationDate() != null)
              ? DateTimeUtil.dateToString(
                  timeSheet.getCreationDate(), DateTimeUtil.VIEW_DATE_TIME_PATTERN)
              : "");
      mav.addObject(
          "report", reportService.modifyURL(sendMailService.initMessageBodyForReport(timeSheet)));

      logger.info("<<<<<<<<< End of RequestMapping <<<<<<<<<<<<<<<<<<<<<<");
      return mav;
    }
  }
  @RequestMapping(method = RequestMethod.GET)
  public String index(Model model, HttpServletRequest request) {
    model.addAttribute("hasVulnerabilities", vulnerabilityService.activeVulnerabilitiesExist());
    model.addAttribute("reportParameters", new ReportParameters());
    model.addAttribute("error", ControllerUtils.getErrorMessage(request));
    model.addAttribute("firstReport", ControllerUtils.getItem(request, "reportId"));
    model.addAttribute("firstTeamId", ControllerUtils.getItem(request, "teamId"));
    model.addAttribute("firstAppId", ControllerUtils.getItem(request, "appId"));
    boolean isEnterprise = EnterpriseTest.isEnterprise();
    model.addAttribute("isEnterprise", isEnterprise);
    PermissionUtils.addPermissions(model, null, null, Permission.CAN_MANAGE_TAGS);

    // Return custom report entities
    List<Report> reports =
        reportService.loadAllNonNativeReportsByLocationType(ReportLocation.ANALYTIC);
    if (reports != null && reports.size() > 0) {
      model.addAttribute("reportJsPaths", cacheBustService.notCachedJsPaths(request, reports));
      model.addAttribute("customReports", reports);
    }

    return "reports/index";
  }
 /**
  * @deprecated Use the {@link com.silanis.esl.sdk.service.ReportService#downloadUsageReportAsCSV}.
  */
 @Deprecated
 public String downloadUsageReportAsCSV(Date from, Date to) {
   return reportService.downloadUsageReportAsCSV(from, to);
 }
 /** @deprecated Use the {@link com.silanis.esl.sdk.service.ReportService#downloadUsageReport}. */
 @Deprecated
 public com.silanis.esl.sdk.UsageReport downloadUsageReport(Date from, Date to) {
   return reportService.downloadUsageReport(from, to);
 }
 /**
  * @deprecated Use the {@link
  *     com.silanis.esl.sdk.service.ReportService#downloadCompletionReportAsCSV}.
  */
 @Deprecated
 public String downloadCompletionReportAsCSV(
     com.silanis.esl.sdk.PackageStatus packageStatus, Date from, Date to) {
   return reportService.downloadCompletionReportAsCSV(packageStatus, from, to);
 }
 /**
  * @deprecated Use the {@link com.silanis.esl.sdk.service.ReportService#downloadCompletionReport}.
  */
 @Deprecated
 public com.silanis.esl.sdk.CompletionReport downloadCompletionReport(
     com.silanis.esl.sdk.PackageStatus packageStatus, String senderId, Date from, Date to) {
   return reportService.downloadCompletionReport(packageStatus, senderId, from, to);
 }