Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.Report


        String reportIds[] = form.getReportIds();
       
        try {
          if (reportIds != null) {
            for (int i = 0; i < reportIds.length; i++) {
                Report report = ReportDAO.load(getAdminBean(request).getSite().getSiteId(), Format.getLong(reportIds[i]));
                if (report.getSystemRecord() == Constants.VALUE_YES) {
                  continue;
                }
                em.remove(report);
            }
            em.getTransaction().commit();
View Full Code Here


          query.setParameter("reportName", "%" + form.getSrReportName() + "%");
        }
        Iterator<?> iterator = query.getResultList().iterator();
        Vector<ReportDisplayForm> vector = new Vector<ReportDisplayForm>();
        while (iterator.hasNext()) {
          Report report = (Report) iterator.next();
        ReportDisplayForm reportDisplay = new ReportDisplayForm();
        reportDisplay.setReportId(Format.getLong(report.getReportId()));
        reportDisplay.setReportName(report.getReportName());
        reportDisplay.setReportDesc(report.getReportDesc());
        if (report.getLastRunBy() != null) {
          reportDisplay.setLastRunBy(report.getLastRunBy());
        }
        if (report.getLastRunDatetime() != null) {
          reportDisplay.setLastRunDatetime(Format.getFullDatetime(report.getLastRunDatetime()));
        }
        reportDisplay.setSystemRecord(String.valueOf(report.getSystemRecord()));
        vector.add(reportDisplay);
        }
        form.setReports(vector);
       
        ActionForward actionForward = actionMapping.findForward("success");
View Full Code Here

  public ReportEngine(String siteId, Long reportId, ServletContext servletContext) throws Exception {
    this.siteId = siteId;
    this.reportId = reportId;
    this.servletContext = servletContext;
   
    Report report = ReportDAO.load(siteId, reportId);
    EngineConfig config = new EngineConfig();
    config.setEngineHome("");
    IPlatformContext context = new PlatformServletContext(servletContext);
    config.setPlatformContext(context);

    Platform.startup(config);
    IReportEngineFactory factory = (IReportEngineFactory) Platform
      .createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
    engine = factory.createReportEngine(config);
       
    runnable = engine.openReportDesign(new StringInputStream(report.getReportText()));
    task = engine.createRunAndRenderTask(runnable);
  }
View Full Code Here

    sql = "from Report report where report.site.siteId = :siteId";
    query = em.createQuery(sql);
    query.setParameter("siteId", site.getSiteId());
    iterator = query.getResultList().iterator();
    while (iterator.hasNext()) {
      Report report = (Report) iterator.next();
        em.remove(report);
    }
   
    sql = "from IeProfileHeader ieProfileHeader where ieProfileHeader.site.siteId = :siteId";
    query = em.createQuery(sql);
View Full Code Here

          query.setParameter("reportName", "%" + form.getSrReportName() + "%");
        }
        Iterator<?> iterator = query.getResultList().iterator();
        Vector<ReportDisplayForm> vector = new Vector<ReportDisplayForm>();
        while (iterator.hasNext()) {
          Report report = (Report) iterator.next();
        ReportDisplayForm reportDisplay = new ReportDisplayForm();
        reportDisplay.setReportId(Format.getLong(report.getReportId()));
        reportDisplay.setReportName(report.getReportName());
        reportDisplay.setReportDesc(report.getReportDesc());
        if (report.getLastRunBy() != null) {
          reportDisplay.setLastRunBy(report.getLastRunBy());
        }
        if (report.getLastRunDatetime() != null) {
          reportDisplay.setLastRunDatetime(Format.getFullDatetime(report.getLastRunDatetime()));
        }
        reportDisplay.setSystemRecord(String.valueOf(report.getSystemRecord()));
        vector.add(reportDisplay);
        }
        form.setReports(vector);
       
        ActionForward actionForward = actionMapping.findForward("success");
View Full Code Here

            HttpServletResponse response) throws Exception {
      ReportGeneratorActionForm form = (ReportGeneratorActionForm) actionForm;
        AdminBean adminBean = getAdminBean(request);
        Site site = adminBean.getSite();
       
        Report report = ReportDAO.load(site.getSiteId(), Format.getLong(form.getReportId()));
        form.setReportName(report.getReportName());
        form.setReportDesc(report.getReportDesc());

        ReportEngine engine = new ReportEngine(site.getSiteId(),
           Long.valueOf(form.getReportId()),
           this.getServlet().getServletConfig().getServletContext());
        Collection<?> collection = engine.getReportParameters();
View Full Code Here

      return actionMapping.findForward("error");
    }
   
    engine.setOutputFormat(form.getReportOutputMode());
       
        Report report = ReportDAO.load(site.getSiteId(), Format.getLong(form.getReportId()));
        Collection<?> collection = engine.getReportParameters();
        Iterator<?> iterator = collection.iterator();
        while (iterator.hasNext()) {
          IParameterDefnBase definition = (IParameterDefnBase) iterator.next();
          if (definition.getName().equals("siteId")) {
            engine.setReportParameter("siteId", adminBean.getSiteId(), String.valueOf(definition.getParameterType()));
          }
        }
       
        ReportParamDisplayForm reportParameters[] = form.getReportParameters();
        for (ReportParamDisplayForm reportParameter : reportParameters) {
          engine.setReportParameter(reportParameter.getName(), reportParameter.getValue(), reportParameter.getType());
        }
       
        engine.generate(response);
        report.setLastRunBy(adminBean.getUserId());
        report.setLastRunDatetime(new Date());
        return null;
    }
View Full Code Here

        ReportMaintActionForm form = (ReportMaintActionForm) actionForm;
        if (form == null) {
            form = new ReportMaintActionForm();
        }
    String reportId = request.getParameter("reportId");
        Report report = new Report();
        report = ReportDAO.load(site.getSiteId(), Format.getLong(reportId));
        form.setMode("U");
        copyProperties(form, report);
        FormUtils.setFormDisplayMode(request, form, FormUtils.EDIT_MODE);
        ActionForward actionForward = actionMapping.findForward("success");
View Full Code Here

   
      Site site = getAdminBean(request).getSite();
    EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    ReportMaintActionForm form = (ReportMaintActionForm) actionForm;
    try {
      Report Report = ReportDAO.load(site.getSiteId(), Format.getLong(form.getReportId()));
      em.remove(Report);
      em.getTransaction().commit();
    }
    catch (Exception e) {
      if (Utility.isConstraintViolation(e)) {
View Full Code Here

      insertMode = true;
    }

    AdminBean adminBean = getAdminBean(request);
    Site site = adminBean.getSite();
    Report report = new Report();
    if (!insertMode) {
      report = ReportDAO.load(site.getSiteId(), Format.getLong(form.getReportId()));
    }

    ActionMessages errors = validate(form);
    if (errors.size() != 0) {
      saveMessages(request, errors);
      return mapping.findForward("error");
    }

    if (insertMode) {
      report.setRecCreateBy(adminBean.getUser().getUserId());
      report.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      report.setSystemRecord(Constants.VALUE_NO);
    }
    report.setSite(site);
    report.setReportName(form.getReportName());
    report.setReportDesc(form.getReportDesc());
    report.setReportText(form.getReportText());
    report.setRecUpdateBy(adminBean.getUser().getUserId());
    report.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
    if (insertMode) {
      em.persist(report);
    }
        form.setMode("U");
        form.setReportId(report.getReportId().toString());
        FormUtils.setFormDisplayMode(request, form, FormUtils.EDIT_MODE);
    return mapping.findForward("success");
  }
View Full Code Here

TOP

Related Classes of com.jada.jpa.entity.Report

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.