@Override protected StatisticResult recalculateStatisticResult(final UserRequest ureq) { // recalculate the statistic result based on the from and to dates. // do this by going via sql (see WeeklyStatisticManager) final IStatisticManager weeklyStatisticManager = getStatisticManager(); final StatisticResult statisticResult = weeklyStatisticManager.generateStatisticResult( ureq, getCourse(), getCourseRepositoryEntryKey(), form_.getFromDate(), form_.getToDate()); return statisticResult; }
@Override protected Component createInitialComponent(final UserRequest ureq) { setVelocityRoot(Util.getPackageVelocityRoot(getClass())); weeklyStatisticVc_ = this.createVelocityContainer("weeklystatisticparent"); weeklyStatisticFormVc_ = this.createVelocityContainer("weeklystatisticform"); form_ = new DateChooserForm(ureq, getWindowControl(), 8 * 7); listenTo(form_); weeklyStatisticFormVc_.put("statisticForm", form_.getInitialComponent()); weeklyStatisticFormVc_.contextPut("statsSince", getStatsSinceStr(ureq)); weeklyStatisticVc_.put("weeklystatisticform", weeklyStatisticFormVc_); final Component parentInitialComponent = super.createInitialComponent(ureq); weeklyStatisticVc_.put("statistic", parentInitialComponent); return weeklyStatisticVc_; }