Examples of StatisticResult


Examples of org.olat.course.statistic.StatisticResult

  @Override
  protected StatisticResult recalculateStatisticResult(UserRequest ureq) {
    // recalculate the statistic result based on the from and to dates.
    // do this by going via sql (see DailyStatisticManager)
    DailyStatisticManager dailyStatisticManager = (DailyStatisticManager)getStatisticManager();     
    StatisticResult statisticResult =
      dailyStatisticManager.generateStatisticResult(ureq, getCourse(), getCourseRepositoryEntryKey(), form_.getFromDate(), form_.getToDate());
    return statisticResult;
  }
View Full Code Here

Examples of org.olat.course.statistic.StatisticResult

  public StatisticResult generateStatisticResult(UserRequest ureq, ICourse course, long courseRepositoryEntryKey) {
    DBQuery dbQuery = DBFactory.getInstance().createQuery("select businessPath,homeOrg,value from org.olat.course.statistic.homeorg.HomeOrgStat sv "
        + "where sv.resId=:resId");
    dbQuery.setLong("resId", courseRepositoryEntryKey);

    return new StatisticResult(course, dbQuery.list());
  }
View Full Code Here

Examples of org.olat.course.statistic.StatisticResult

  public StatisticResult generateStatisticResult(UserRequest ureq, ICourse course, long courseRepositoryEntryKey) {
    DBQuery dbQuery = DBFactory.getInstance().createQuery("select businessPath,day,value from org.olat.course.statistic.daily.DailyStat sv "
        + "where sv.resId=:resId");
    dbQuery.setLong("resId", courseRepositoryEntryKey);

    return new StatisticResult(course, dbQuery.list());
  }
View Full Code Here

Examples of org.olat.course.statistic.StatisticResult

  }

  public StatisticResult generateStatisticResult(UserRequest ureq, ICourse course, long courseRepositoryEntryKey, Date fromDate, Date toDate) {
    if (fromDate==null && toDate==null) {
      // no restrictions, return the defaults
      StatisticResult statisticResult = generateStatisticResult(ureq, course, courseRepositoryEntryKey);
      fillGapsInColumnHeaders(statisticResult);
      return statisticResult;
    }
   
    StringBuffer dateClause = new StringBuffer();
    if (fromDate!=null) {
      dateClause.append(" and (day>=:fromDate) ");
    }
    if (toDate!=null) {
      dateClause.append(" and (day<=:toDate) ");
    }
    DBQuery dbQuery = DBFactory.getInstance().createQuery("select businessPath,day,value from org.olat.course.statistic.daily.DailyStat sv "
        + "where sv.resId=:resId "
        + dateClause);
    dbQuery.setLong("resId", courseRepositoryEntryKey);
    if (fromDate!=null) {
      dbQuery.setDate("fromDate", fromDate);
    }
    if (toDate!=null) {
      dbQuery.setDate("toDate", toDate);
    }
   
    StatisticResult statisticResult = new StatisticResult(course, dbQuery.list());
    fillGapsInColumnHeaders(statisticResult);
    return statisticResult;
  }
View Full Code Here

Examples of org.olat.course.statistic.StatisticResult

  public StatisticResult generateStatisticResult(UserRequest ureq, ICourse course, long courseRepositoryEntryKey) {
    DBQuery dbQuery = DBFactory.getInstance().createQuery("select businessPath,studyBranch3,value from org.olat.course.statistic.studybranch3.StudyBranch3Stat sv "
        + "where sv.resId=:resId");
    dbQuery.setLong("resId", courseRepositoryEntryKey);

    return new StatisticResult(course, dbQuery.list());
  }
View Full Code Here

Examples of org.olat.course.statistic.StatisticResult

  public StatisticResult generateStatisticResult(UserRequest ureq, ICourse course, long courseRepositoryEntryKey) {
    DBQuery dbQuery = DBFactory.getInstance().createQuery("select businessPath,hour,value from org.olat.course.statistic.hourofday.HourOfDayStat sv "
        + "where sv.resId=:resId");
    dbQuery.setLong("resId", courseRepositoryEntryKey);

    StatisticResult statisticResult = new StatisticResult(course, dbQuery.list());
    List<String> columnHeaders = statisticResult.getColumnHeaders();
    if (columnHeaders!=null && columnHeaders.size()>1) {
      try{
        int start = Integer.parseInt(columnHeaders.get(0));
        int end = Integer.parseInt(columnHeaders.get(columnHeaders.size()-1));
        List<String> resultingColumnHeaders = new ArrayList<String>((end-start)+1);
        for(int hour=start; hour<=end; hour++) {
          resultingColumnHeaders.add(String.valueOf(hour));
        }
        statisticResult.setColumnHeaders(resultingColumnHeaders);
      } catch(NumberFormatException nfe) {
        log_.warn("generateStatisticResult: Got a NumberFormatException: "+nfe, nfe);
      }
    }
    return statisticResult;
View Full Code Here

Examples of org.olat.course.statistic.StatisticResult

  public StatisticResult generateStatisticResult(UserRequest ureq, ICourse course, long courseRepositoryEntryKey) {
    DBQuery dbQuery = DBFactory.getInstance().createQuery("select businessPath,studyLevel,value from org.olat.course.statistic.studylevel.StudyLevelStat sv "
        + "where sv.resId=:resId");
    dbQuery.setLong("resId", courseRepositoryEntryKey);

    return new StatisticResult(course, dbQuery.list());
  }
View Full Code Here

Examples of org.olat.course.statistic.StatisticResult

  public StatisticResult generateStatisticResult(UserRequest ureq, ICourse course, long courseRepositoryEntryKey) {
    DBQuery dbQuery = DBFactory.getInstance().createQuery("select businessPath,week,value from org.olat.course.statistic.weekly.WeeklyStat sv "
        + "where sv.resId=:resId");
    dbQuery.setLong("resId", courseRepositoryEntryKey);

    return new StatisticResult(course, dbQuery.list());
  }
View Full Code Here

Examples of org.olat.course.statistic.StatisticResult

  }

  public StatisticResult generateStatisticResult(UserRequest ureq, ICourse course, long courseRepositoryEntryKey, Date fromDate, Date toDate) {
    if (fromDate==null && toDate==null) {
      // no restrictions, return the defaults
      StatisticResult statisticResult = generateStatisticResult(ureq, course, courseRepositoryEntryKey);
      fillGapsInColumnHeaders(statisticResult);
      return statisticResult;
    }
   
    StringBuffer dateClause = new StringBuffer();
    //concat(year(creationdate),'-',week(creationdate)) week
    if (fromDate!=null) {
      dateClause.append(" and (week=:fromDate or week>=:fromDate) ");
    }
    if (toDate!=null) {
      dateClause.append(" and (week=:toDate or week<=:toDate) ");
    }
    DBQuery dbQuery = DBFactory.getInstance().createQuery("select businessPath,week,value from org.olat.course.statistic.weekly.WeeklyStat sv "
        + "where sv.resId=:resId "
        + dateClause);
    dbQuery.setLong("resId", courseRepositoryEntryKey);
    StringBuffer infoMsg = new StringBuffer();
    if (fromDate!=null) {
      String fromDateStr = getYear(fromDate)+"-"+getWeek(fromDate);
      infoMsg.append("from date: "+fromDateStr);
      dbQuery.setString("fromDate", fromDateStr);
    }
    if (toDate!=null) {
      String toDateStr = getYear(toDate)+"-"+getWeek(toDate);
      if (infoMsg!=null) {
        infoMsg.append(", ");
      }
      infoMsg.append("to date: "+toDateStr);
      dbQuery.setString("toDate", toDateStr);
    }
   
    log_.info("generateStatisticResult: Searching with params "+infoMsg.toString());
   
    StatisticResult statisticResult = new StatisticResult(course, dbQuery.list());
    fillGapsInColumnHeaders(statisticResult);
    return statisticResult;
  }
View Full Code Here

Examples of org.olat.course.statistic.StatisticResult

  @Override
  protected StatisticResult recalculateStatisticResult(UserRequest ureq) {
    // recalculate the statistic result based on the from and to dates.
    // do this by going via sql (see WeeklyStatisticManager)
    IStatisticManager weeklyStatisticManager = getStatisticManager();     
    StatisticResult statisticResult =
      weeklyStatisticManager.generateStatisticResult(ureq, getCourse(), getCourseRepositoryEntryKey(), form_.getFromDate(), form_.getToDate());
    return statisticResult;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.