Package org.efs.openreports.objects

Examples of org.efs.openreports.objects.ReportSchedule


      {
        reportUser = (ReportUser) ActionContext.getContext().getSession().get(
          ORStatics.REPORT_USER);
      }

      ReportSchedule reportSchedule =
        schedulerProvider.getScheduledReport(reportUser, scheduleName);

      name = reportSchedule.getReport().getName();
      description = reportSchedule.getScheduleDescription();
      startDate = dateProvider.formatDate(reportSchedule.getStartDate());
      scheduleTypeName = reportSchedule.getScheduleTypeName();
      scheduleState = reportSchedule.getScheduleState();

      if (!submitOk && !submitCancel)
      {
        if (scheduleState.equals("Normal")) buttonName = "Pause";
        if (scheduleState.equals("Paused")) buttonName = "Resume";       
View Full Code Here


      {
        reportUser = (ReportUser) ActionContext.getContext().getSession().get(
          ORStatics.REPORT_USER);
      }

      ReportSchedule reportSchedule =
        schedulerProvider.getScheduledReport(reportUser, scheduleName);

      name = reportSchedule.getReport().getName();
      description = reportSchedule.getScheduleDescription();
      startDate = dateProvider.formatDate(reportSchedule.getStartDate());
      scheduleTypeName = reportSchedule.getScheduleTypeName();

      if (!submitDelete && !submitCancel)
      {
        return INPUT;
      }
View Full Code Here

public class ScheduleHRefColumnDecorator extends TableDecorator
{     
  public Object getRemoveLink()
  {
    ReportSchedule reportSchedule = (ReportSchedule) getCurrentRowObject();

    return "<a href=\"deleteScheduledReportByUser.action?scheduleName="
        + reportSchedule.getScheduleName() + "&amp;userId="
        + reportSchedule.getUser().getId() + "\">Remove</a>";   
 
View Full Code Here

        + reportSchedule.getUser().getId() + "\">Remove</a>";   
 
 
  public Object getUpdateLink()
  {
    ReportSchedule reportSchedule = (ReportSchedule) getCurrentRowObject();
   
    return "<a href=\"reportScheduleByUser.action?scheduleName="
    + reportSchedule.getScheduleName() + "&amp;userId="
    + reportSchedule.getUser().getId() + "\">Update</a>"
  }
View Full Code Here

    + reportSchedule.getUser().getId() + "\">Update</a>"
  }
 
  public Object getStateLink()
  {
    ReportSchedule reportSchedule = (ReportSchedule) getCurrentRowObject();

    String state = reportSchedule.getScheduleState();   
    if (!state.equals("Normal") && !state.equals("Paused")) return state;
       
    return "<a href=\"changeScheduleState.action?scheduleName="
        + reportSchedule.getScheduleName() + "&amp;state="
        + reportSchedule.getScheduleState() + "&amp;userId="
        + reportSchedule.getUser().getId() + "\">"
        + reportSchedule.getScheduleState() + "</a>";
 
View Full Code Here

    {
      if (scheduleName != null && scheduleName.length() > 0)
      {
        try
        {
          ReportSchedule reportSchedule = schedulerProvider.getScheduledReport(user, scheduleName);

          report = reportSchedule.getReport();
          scheduleType = reportSchedule.getScheduleType();
          startDate = dateProvider.formatDate(reportSchedule.getStartDate());
          startHour = reportSchedule.getStartHour();
          startMinute = reportSchedule.getStartMinute();
          startAmPm = reportSchedule.getStartAmPm();
          recipients = reportSchedule.getRecipients();
          description = reportSchedule.getScheduleDescription();
          hours = reportSchedule.getHours();
          cron = reportSchedule.getCronExpression();
          runToFile = reportSchedule.isDeliveryMethodSelected(DeliveryMethod.FILE.getName());
                   
          if (reportSchedule.getAlert() != null)
          {       
            ReportUserAlert userAlert = reportSchedule.getAlert();
           
            alertId = userAlert.getAlert().getId().intValue();
            alertLimit = userAlert.getLimit();
            alertOperator = userAlert.getOperator();
          }                     
        }
        catch (Exception e)
        {
          addActionError(e.getMessage());
          return INPUT;
        }
      }
      else
      {
        report = (Report) ActionContext.getContext().getSession().get(ORStatics.REPORT);
       
        Calendar calendar = Calendar.getInstance();
       
        startDate = dateProvider.formatDate(calendar.getTime());
        startHour = String.valueOf(calendar.get(Calendar.HOUR));
        startMinute = String.valueOf(calendar.get(Calendar.MINUTE));
       
        if (calendar.get(Calendar.AM_PM) == Calendar.PM) startAmPm = "PM";
      }

      return INPUT;
    }

    if (startDate == null || startDate.length() < 1 || startHour == null || startHour.length() < 1
        || startMinute == null || startMinute.length() < 1 || startAmPm == null
        || startAmPm.length() < 1)
    {
      addActionError(LocalStrings.ERROR_DATEANDTIME_REQUIRED);
      return INPUT;
    }   
   
    int hour = Integer.parseInt(startHour);
    int minute = Integer.parseInt(startMinute);
    if (hour > 12 || hour < 1 || minute < 0 || minute > 59)
    {
      addActionError(LocalStrings.ERROR_DATEANDTIME_INVALID);
      return INPUT;
    }

    ReportSchedule reportSchedule = new ReportSchedule();
   
    try
    {     
      if (scheduleName != null && scheduleName.length() > 0)
      {
        reportSchedule = schedulerProvider.getScheduledReport(user, scheduleName);
      }
      else
      {
        report = (Report) ActionContext.getContext().getSession().get(ORStatics.REPORT);
     
        int exportType = Integer.parseInt((String) ActionContext.getContext().getSession().get(
            ORStatics.EXPORT_TYPE));

        reportSchedule.setReport(report);
        reportSchedule.setUser(user);
        reportSchedule.setReportParameters(getReportParameters());
        reportSchedule.setExportType(exportType);
        reportSchedule.setScheduleName(report.getId() + "|" + new Date().getTime());       
      }

      reportSchedule.setScheduleType(scheduleType);
      reportSchedule.setStartDate(dateProvider.parseDate(startDate));
      reportSchedule.setStartHour(startHour);
      reportSchedule.setStartMinute(startMinute);
      reportSchedule.setStartAmPm(startAmPm);
      reportSchedule.setRecipients(recipients);
      reportSchedule.setScheduleDescription(description);
      reportSchedule.setHours(hours);
      reportSchedule.setCronExpression(cron);
           
            if (runToFile)
            {
                reportSchedule.setDeliveryMethods(new String[]{DeliveryMethod.FILE.getName()});              
            }
            else
            {
                reportSchedule.setDeliveryMethods(new String[]{DeliveryMethod.EMAIL.getName()})
            }
     
      if (alertId != -1)
      {
        ReportAlert alert = alertProvider.getReportAlert(new Integer(alertId));
       
        ReportUserAlert userAlert = new ReportUserAlert();
        userAlert.setAlert(alert);
        userAlert.setUser(user);     
        userAlert.setLimit(alertLimit);
        userAlert.setOperator(alertOperator);
                     
        reportSchedule.setAlert(userAlert);
      }
      else
      {
        reportSchedule.setAlert(null);
     

      if (scheduleName != null && scheduleName.length() > 0)
      {
        // in order to update a schedule report, original reportSchedule
View Full Code Here

    try
    {
      Iterator<ReportSchedule> iterator = schedulerProvider.getScheduledReports(user).iterator()
      while(iterator.hasNext())
      {     
        ReportSchedule schedule = iterator.next();       
     
        ReportScheduleInfo scheduleInfo = new ReportScheduleInfo();
        scheduleInfo.setNextFireDate(schedule.getNextFireDate());
        scheduleInfo.setReportName(schedule.getReport().getName());
        scheduleInfo.setScheduleDescription(schedule.getScheduleDescription());
        scheduleInfo.setScheduleTypeName(schedule.getScheduleTypeName());

        if (schedule.getAlert() != null)
        {
          scheduleInfo.setAlert(Converter.convertToAlertInfo(schedule.getAlert()));
        }
       
        schedules.add(scheduleInfo);     
      }
    }
View Full Code Here

                    }
                }
            }
            else          
            {          
        ReportSchedule schedule = new ReportSchedule();
        schedule.setReport(report);
        schedule.setUser(user);
        schedule.setReportParameters(buildParameterMap(reportInput, report));
        schedule.setExportType(reportInput.getExportType().getCode());       
        schedule.setScheduleName(report.getId() + "|" + new Date().getTime());
        schedule.setScheduleDescription(reportInput.getScheduleDescription());       
        schedule.setScheduleType(ReportSchedule.ONCE);
        schedule.setXmlInput(reportInput.getXmlInput());               
                schedule.setDeliveryReturnAddress(reportInput.getDeliveryReturnAddress());
                schedule.setRequestId(reportInput.getRequestId());
                schedule.setSchedulePriority(reportInput.getSchedulePriority());               
                schedule.setDeliveryMethods(convertDeliveryMethodsToNames(reportInput.getDeliveryMethods()));
                schedule.setLocale(ORUtil.getLocale(reportInput.getLocale()));
               
                if (reportInput.getDeliveryAddress() != null)
                {
                    schedule.setRecipients(reportInput.getDeliveryAddress());
                }
                else
                {
                    schedule.setRecipients(user.getEmail());
                }
       
        // advanced scheduling
        if (reportInput.getStartDate() != null)
        {
          if (!user.isAdvancedScheduler())
          {
            throw new ProviderException("Not Authorized: Advanced Scheduling permission required");         
          }
         
          schedule.setScheduleType(reportInput.getScheduleType().getCode());
          schedule.setStartDate(reportInput.getStartDate());
          schedule.setStartHour(reportInput.getStartHour());
          schedule.setStartMinute(reportInput.getStartMinute());
          schedule.setStartAmPm(reportInput.getStartAmPm().toString());
          schedule.setHours(reportInput.getHours());
          schedule.setCronExpression(reportInput.getCronExpression());         
        }
               
        schedulerProvider.scheduleReport(schedule);         
      }         
           
View Full Code Here

       
        if (submitRunToEmail || submitRunToFile)
        {
            Map<String,Object> reportParameters = getReportParameterMap();           
           
            ReportSchedule schedule = new ReportSchedule();
            schedule.setReport(report);
            schedule.setUser(user);
            schedule.setReportParameters(reportParameters);
            schedule.setExportType(Integer.parseInt(exportType));
            schedule.setRecipients(user.getEmail());
            schedule.setScheduleName(report.getId() + "|" + new Date().getTime());
            schedule.setScheduleDescription(description);              
            schedule.setScheduleType(ReportSchedule.ONCE);

            if (submitRunToFile)
            {
                schedule.setDeliveryMethods(new String[]{DeliveryMethod.FILE.getName()});              
            }
            else
            {
                schedule.setDeliveryMethods(new String[]{DeliveryMethod.EMAIL.getName()})
            }
           
            try
            {
                schedulerProvider.scheduleReport(schedule);
View Full Code Here

        {
          try
          {
            JobDetail jobDetail = scheduler.getJobDetail(jobNames[i], group);
   
            ReportSchedule reportSchedule = (ReportSchedule) jobDetail.getJobDataMap().get(
                ORStatics.REPORT_SCHEDULE);
            reportSchedule.setScheduleDescription(jobDetail.getDescription());
            reportSchedule.setScheduleState(getTriggerStateName(jobNames[i], group));
           
            Trigger trigger = scheduler.getTrigger(jobNames[i], group);
            if (trigger != null)
            {
              reportSchedule.setNextFireDate(trigger.getNextFireTime());         
            }
   
            scheduledReports.add(reportSchedule);
          }
          catch(ProviderException pe)
View Full Code Here

TOP

Related Classes of org.efs.openreports.objects.ReportSchedule

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.