use of org.olat.course.statistic.TotalAwareColumnDescriptor in project OpenOLAT by OpenOLAT.
the class StudyLevelStatisticManager method createColumnDescriptor.
@Override
public ColumnDescriptor createColumnDescriptor(UserRequest ureq, int column, String headerId) {
if (column == 0) {
return new DefaultColumnDescriptor("stat.table.header.node", 0, null, ureq.getLocale());
}
if (headerId != null) {
Translator translator = Util.createPackageTranslator(ShibbolethModule.class, ureq.getLocale());
if (translator != null) {
String newHeaderId = translator.translate("swissEduPersonStudyLevel." + headerId);
if (newHeaderId != null && !newHeaderId.startsWith(Translator.NO_TRANSLATION_ERROR_PREFIX)) {
headerId = newHeaderId;
}
}
}
TotalAwareColumnDescriptor cd = new TotalAwareColumnDescriptor(headerId, column, StatisticDisplayController.CLICK_TOTAL_ACTION + column, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_RIGHT);
cd.setTranslateHeaderKey(false);
return cd;
}
use of org.olat.course.statistic.TotalAwareColumnDescriptor in project openolat by klemens.
the class HourOfDayStatisticManager method createColumnDescriptor.
@Override
public ColumnDescriptor createColumnDescriptor(UserRequest ureq, int column, String headerId) {
if (column == 0) {
return new DefaultColumnDescriptor("stat.table.header.node", 0, null, ureq.getLocale());
}
String hourOfDayLocaled = headerId;
try {
Calendar c = Calendar.getInstance(ureq.getLocale());
c.setTime(new Date());
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(headerId));
c.set(Calendar.MINUTE, 0);
DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT, ureq.getLocale());
hourOfDayLocaled = df.format(c.getTime());
} catch (RuntimeException re) {
re.printStackTrace(System.out);
}
TotalAwareColumnDescriptor cd = new TotalAwareColumnDescriptor(hourOfDayLocaled, column, StatisticDisplayController.CLICK_TOTAL_ACTION + column, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_RIGHT);
cd.setTranslateHeaderKey(false);
return cd;
}
use of org.olat.course.statistic.TotalAwareColumnDescriptor in project openolat by klemens.
the class StudyBranch3StatisticManager method createColumnDescriptor.
@Override
public ColumnDescriptor createColumnDescriptor(UserRequest ureq, int column, String headerId) {
if (column == 0) {
return new DefaultColumnDescriptor("stat.table.header.node", 0, null, ureq.getLocale());
}
if (headerId != null) {
Translator translator = Util.createPackageTranslator(ShibbolethModule.class, ureq.getLocale());
if (translator != null) {
String newHeaderId = translator.translate("swissEduPersonStudyBranch3." + headerId);
if (newHeaderId != null && !newHeaderId.startsWith(Translator.NO_TRANSLATION_ERROR_PREFIX)) {
headerId = newHeaderId;
}
}
}
TotalAwareColumnDescriptor cd = new TotalAwareColumnDescriptor(headerId, column, StatisticDisplayController.CLICK_TOTAL_ACTION + column, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_RIGHT);
cd.setTranslateHeaderKey(false);
return cd;
}
use of org.olat.course.statistic.TotalAwareColumnDescriptor in project openolat by klemens.
the class WeeklyStatisticManager method createColumnDescriptor.
@Override
public ColumnDescriptor createColumnDescriptor(UserRequest ureq, int column, String headerId) {
if (column == 0) {
throw new IllegalStateException("column must never be 0 here");
}
TotalAwareColumnDescriptor cd = new TotalAwareColumnDescriptor(headerId, column, StatisticDisplayController.CLICK_TOTAL_ACTION + column, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_RIGHT);
cd.setTranslateHeaderKey(false);
return cd;
}
Aggregations