Search in sources :

Example 1 with TableDataModel

use of org.olat.core.gui.components.table.TableDataModel in project OpenOLAT by OpenOLAT.

the class ViteroBookingsController method loadModel.

protected void loadModel() {
    try {
        List<ViteroBooking> bookings = viteroManager.getBookings(group, ores, subIdentifier);
        List<ViteroBooking> myBookings = viteroManager.getBookingInFutures(getIdentity());
        FilterBookings.filterMyFutureBookings(bookings, myBookings);
        Collections.sort(bookings, new StartBookingComparator());
        TableDataModel<ViteroBooking> tableData = new ViteroBookingDataModel(bookings, myBookings);
        tableCtr.setTableDataModel(tableData);
    } catch (VmsNotAvailableException e) {
        TableDataModel<ViteroBooking> tableData = new ViteroBookingDataModel();
        tableCtr.setTableDataModel(tableData);
        showError(VmsNotAvailableException.I18N_KEY);
    }
}
Also used : ViteroBooking(org.olat.modules.vitero.model.ViteroBooking) VmsNotAvailableException(org.olat.modules.vitero.manager.VmsNotAvailableException) StartBookingComparator(org.olat.modules.vitero.model.StartBookingComparator) TableDataModel(org.olat.core.gui.components.table.TableDataModel)

Example 2 with TableDataModel

use of org.olat.core.gui.components.table.TableDataModel in project openolat by klemens.

the class ViteroBookingsController method loadModel.

protected void loadModel() {
    try {
        List<ViteroBooking> bookings = viteroManager.getBookings(group, ores, subIdentifier);
        List<ViteroBooking> myBookings = viteroManager.getBookingInFutures(getIdentity());
        FilterBookings.filterMyFutureBookings(bookings, myBookings);
        Collections.sort(bookings, new StartBookingComparator());
        TableDataModel<ViteroBooking> tableData = new ViteroBookingDataModel(bookings, myBookings);
        tableCtr.setTableDataModel(tableData);
    } catch (VmsNotAvailableException e) {
        TableDataModel<ViteroBooking> tableData = new ViteroBookingDataModel();
        tableCtr.setTableDataModel(tableData);
        showError(VmsNotAvailableException.I18N_KEY);
    }
}
Also used : ViteroBooking(org.olat.modules.vitero.model.ViteroBooking) VmsNotAvailableException(org.olat.modules.vitero.manager.VmsNotAvailableException) StartBookingComparator(org.olat.modules.vitero.model.StartBookingComparator) TableDataModel(org.olat.core.gui.components.table.TableDataModel)

Aggregations

TableDataModel (org.olat.core.gui.components.table.TableDataModel)2 VmsNotAvailableException (org.olat.modules.vitero.manager.VmsNotAvailableException)2 StartBookingComparator (org.olat.modules.vitero.model.StartBookingComparator)2 ViteroBooking (org.olat.modules.vitero.model.ViteroBooking)2