Package org.efs.openreports.objects

Examples of org.efs.openreports.objects.ReportUserAlert


        return ActionContext.getContext().getLocale();
    }  

    public String addRowClass()
    {
        ReportUserAlert userAlert = (ReportUserAlert)getCurrentRowObject();

        if (userAlert.isTriggered()) return "triggered";
        return "nottriggered";
    }
View Full Code Here


        return "nottriggered";
    }

    public Object getStatus()
    {
        ReportUserAlert userAlert = (ReportUserAlert)getCurrentRowObject();

        if (userAlert.isTriggered()) return textProvider.getText(LocalStrings.ALERT_PASSED);
        return textProvider.getText(LocalStrings.ALERT_FAILED);
    }
View Full Code Here

    ArrayList<AlertInfo> alerts = new ArrayList<AlertInfo>();
   
    Iterator<ReportUserAlert> iterator = user.getAlerts().iterator()
    while(iterator.hasNext())
    {     
      ReportUserAlert userAlert = iterator.next();       
      userAlert.setUser(user);
     
      try
      {
        userAlert = alertProvider.executeAlert(userAlert, false);     
View Full Code Here

          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
      {
View Full Code Here

    Iterator<ReportUserAlert> iterator = user.getAlerts().iterator();
    while(iterator.hasNext())
    {
      try
      {
        ReportUserAlert userAlert = iterator.next();
        userAlert.setUser(user);
       
        ReportUserAlert alert = alertProvider.executeAlert(userAlert, false);
     
        alerts.add(alert);
      }
      catch(ProviderException pe)
      {
View Full Code Here

        reportLog.setRequestId(reportSchedule.getRequestId());
       
    try
    {
      //
      ReportUserAlert alert = reportSchedule.getAlert();     
     
      if (alert != null)
      {
        log.debug("Executing Alert Condition");
       
        alert.setReport(report);
        alert = alertProvider.executeAlert(alert, true);
       
        if (!alert.isTriggered())
        {
          log.debug("Alert Not Triggered. Report not run.");
          return;
        }
       
View Full Code Here

TOP

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

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.