Package org.efs.openreports.objects

Examples of org.efs.openreports.objects.ReportUser


      return INPUT;
    }

    try
    {
      ReportUser user = checkCredentials();

      if (user == null)
      {
          addActionError(getText(LocalStrings.ERROR_LOGIN_INVALID));       
        return INPUT;
      }

      session.put("user", user);
            ActionContext.getContext().setLocale(user.getLocale());
                       
      if (user.isDashboardUser() &&
        (user.getDefaultReport() != null || user.getAlerts().size() > 0))
      {
        return ORStatics.DASHBOARD_ACTION;
      }
     
      return SUCCESS;
View Full Code Here


      {       
        fileName = request.getParameter("fileName");
       
        // report file delivery validates the filename against the username
        // of the user in session for security purposes.
        ReportUser user = (ReportUser) request.getSession().getAttribute(ORStatics.REPORT_USER);
        if (user == null || fileName.indexOf(user.getName()) < 0)
        {
          String message = "Not Authorized...";
          response.getOutputStream().write(message.getBytes());
         
          return;
View Full Code Here

  private AlertProvider alertProvider;
    private TagProvider tagProvider;

  public String execute()
  {
    ReportUser user = null;       
 
    try
    {
      if (command.equals("edit"))
      {
        user = userProvider.getUser(new Integer(id));
      }
      else
      {
        user = new ReportUser();
      }
     
      reports = user.getReports();
      userAlerts = user.getAlerts();

      if (command.equals("edit") && !submitOk && !submitDuplicate)
      {
        id = user.getId().intValue();
        name = user.getName();
        password = user.getPassword();
        passwordConfirm = user.getPassword();       
        externalId = user.getExternalId();
        email = user.getEmail();       
        reportGroups = user.getGroups();
        scheduler = user.isScheduler();
        advancedScheduler = user.isAdvancedScheduler();
        logViewer = user.isLogViewer();
        rootAdmin= user.isRootAdmin();
        reportAdmin = user.isReportAdmin();
        dataSourceAdmin = user.isDataSourceAdmin();
        parameterAdmin = user.isParameterAdmin();
        userAdmin = user.isUserAdmin();
        groupAdmin = user.isGroupAdmin();
        chartAdmin = user.isChartAdmin();
        alertAdmin = user.isAlertAdmin();
        dashboard = user.isDashboardUser();
        alerts = user.isAlertUser();
        uploader = user.isUploader();
        schedulerAdmin = user.isSchedulerAdmin();
                tags = tagProvider.getTagsForObject(user.getId(), ReportUser.class, ORTag.TAG_TYPE_UI);
       
                if (reportGroups != null) Collections.sort(reportGroups);
               
        if (user.getDefaultReport() != null)
        {
          reportId = user.getDefaultReport().getId().intValue();
        }
       
        groupIds = null;
      }

      if (!submitOk && !submitDuplicate) return INPUT;
     
      if (password == null || password.trim().length() < 1 || !password.equals(passwordConfirm))
      {
        addActionError(LocalStrings.ERROR_INVALID_PASSWORD);
        return INPUT;
      }
     
       
            if (submitDuplicate)
            {
              command = "add";
              user.setId(null);
              user.setRoles(new TreeSet<String>());
             
              if (user.getName().equals(name))
              {
                name = "Copy of ".concat(name);
              }
            }

      user.setName(name);
      user.setPassword(password);     
      user.setExternalId(externalId);
      user.setEmail(email);   
      user.setGroups(convertIdsToGroups(groupIds));
      user.setAlertAdmin(alertAdmin);
      user.setChartAdmin(chartAdmin);
      user.setDataSourceAdmin(dataSourceAdmin);
      user.setGroupAdmin(groupAdmin);
      user.setLogViewer(logViewer);
      user.setParameterAdmin(parameterAdmin);
      user.setReportAdmin(reportAdmin);
      user.setRootAdmin(rootAdmin);
      user.setScheduler(scheduler);
      user.setAdvancedScheduler(advancedScheduler);
      user.setUserAdmin(userAdmin)
      user.setDashboardUser(dashboard);
      user.setAlertUser(alerts);
      user.setUploader(uploader);
      user.setSchedulerAdmin(schedulerAdmin);
     
      if (reportId > 0)
      {
        user.setDefaultReport(reportProvider.getReport(new Integer(reportId)));
      }
      else
      {
        user.setDefaultReport(null);
      }

      if (command.equals("edit"))
      {
        userProvider.updateUser(user);
       
        ReportUser currentUser = (ReportUser) ActionContext.getContext().getSession().get(ORStatics.REPORT_USER);
        if ((currentUser != null) && (currentUser.getId().equals(user.getId())))
        {
          session.put(ORStatics.REPORT_USER, user);
        }
      }
View Full Code Here

    ReportSchedule reportSchedule =
      (ReportSchedule) jobDataMap.get(ORStatics.REPORT_SCHEDULE);
    reportSchedule.setScheduleDescription(context.getJobDetail().getDescription());

    Report report = reportSchedule.getReport();
    ReportUser user = reportSchedule.getUser();
    Map<String,Object> reportParameters = reportSchedule.getReportParameters();

    log.debug("Report: " + report.getName());
    log.debug("User: " + user.getName());   

    JRVirtualizer virtualizer = null;
          
    ReportLog reportLog = new ReportLog(user, report, new Date());
        reportLog.setExportType(reportSchedule.getExportType());
        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;
        }
       
        log.debug("Alert Triggered. Running report.");
      }
      //     

      // add standard report parameters
      reportParameters.put(ORStatics.USER_ID, user.getId());
      reportParameters.put(ORStatics.EXTERNAL_ID, user.getExternalId());
      reportParameters.put(ORStatics.USER_NAME, user.getName());
      reportParameters.put(ORStatics.IMAGE_DIR, new File(directoryProvider.getReportImageDirectory()));
      reportParameters.put(ORStatics.REPORT_DIR, new File(directoryProvider.getReportDirectory()));
      //
     
      reportLogProvider.insertReportLog(reportLog);     
View Full Code Here

TOP

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

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.