Search in sources :

Example 1 with TotalAwareColumnDescriptor

use of org.olat.course.statistic.TotalAwareColumnDescriptor in project OpenOLAT by OpenOLAT.

the class HomeOrgStatisticManager 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("swissEduPersonHomeOrganization."+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;
}
Also used : TotalAwareColumnDescriptor(org.olat.course.statistic.TotalAwareColumnDescriptor) DefaultColumnDescriptor(org.olat.core.gui.components.table.DefaultColumnDescriptor)

Example 2 with TotalAwareColumnDescriptor

use of org.olat.course.statistic.TotalAwareColumnDescriptor in project OpenOLAT by OpenOLAT.

the class OrgTypeStatisticManager 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("swissEduPersonHomeOrganizationType." + 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;
}
Also used : Translator(org.olat.core.gui.translator.Translator) TotalAwareColumnDescriptor(org.olat.course.statistic.TotalAwareColumnDescriptor) DefaultColumnDescriptor(org.olat.core.gui.components.table.DefaultColumnDescriptor)

Example 3 with TotalAwareColumnDescriptor

use of org.olat.course.statistic.TotalAwareColumnDescriptor in project OpenOLAT by OpenOLAT.

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;
}
Also used : Translator(org.olat.core.gui.translator.Translator) TotalAwareColumnDescriptor(org.olat.course.statistic.TotalAwareColumnDescriptor) DefaultColumnDescriptor(org.olat.core.gui.components.table.DefaultColumnDescriptor)

Example 4 with TotalAwareColumnDescriptor

use of org.olat.course.statistic.TotalAwareColumnDescriptor in project openolat by klemens.

the class DailyStatisticManager method createColumnDescriptor.

@Override
public ColumnDescriptor createColumnDescriptor(UserRequest ureq, int column, String headerId) {
    if (column == 0) {
        throw new IllegalStateException("column must never be 0 here");
    }
    String header = headerId;
    try {
        Date d = columnHeaderFormat_.parse(headerId);
        Calendar c = Calendar.getInstance(ureq.getLocale());
        c.setTime(d);
        DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, ureq.getLocale());
        header = df.format(c.getTime());
    } catch (ParseException pe) {
        log.warn("createColumnDescriptor: ParseException while parsing " + headerId + ".", pe);
    }
    TotalAwareColumnDescriptor cd = new TotalAwareColumnDescriptor(header, column, StatisticDisplayController.CLICK_TOTAL_ACTION + column, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_RIGHT);
    cd.setTranslateHeaderKey(false);
    return cd;
}
Also used : Calendar(java.util.Calendar) SimpleDateFormat(java.text.SimpleDateFormat) DateFormat(java.text.DateFormat) TotalAwareColumnDescriptor(org.olat.course.statistic.TotalAwareColumnDescriptor) ParseException(java.text.ParseException) Date(java.util.Date)

Example 5 with TotalAwareColumnDescriptor

use of org.olat.course.statistic.TotalAwareColumnDescriptor in project openolat by klemens.

the class HomeOrgStatisticManager 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("swissEduPersonHomeOrganization."+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;
}
Also used : TotalAwareColumnDescriptor(org.olat.course.statistic.TotalAwareColumnDescriptor) DefaultColumnDescriptor(org.olat.core.gui.components.table.DefaultColumnDescriptor)

Aggregations

TotalAwareColumnDescriptor (org.olat.course.statistic.TotalAwareColumnDescriptor)14 DefaultColumnDescriptor (org.olat.core.gui.components.table.DefaultColumnDescriptor)10 Translator (org.olat.core.gui.translator.Translator)6 DateFormat (java.text.DateFormat)4 Calendar (java.util.Calendar)4 Date (java.util.Date)4 ParseException (java.text.ParseException)2 SimpleDateFormat (java.text.SimpleDateFormat)2