use of org.olat.modules.vitero.manager.VmsNotAvailableException in project OpenOLAT by OpenOLAT.
the class ViteroBookingsEditController method newBooking.
protected void newBooking(UserRequest ureq) {
try {
ViteroBooking viteroBooking = viteroManager.createBooking(resourceName);
editBooking(ureq, viteroBooking);
} catch (VmsNotAvailableException e) {
showError(VmsNotAvailableException.I18N_KEY);
}
}
use of org.olat.modules.vitero.manager.VmsNotAvailableException in project OpenOLAT by OpenOLAT.
the class ViteroBookingsEditController method openGroup.
protected void openGroup(UserRequest ureq, ViteroBooking booking) {
try {
if (viteroManager.isUserOf(booking, getIdentity())) {
String url = viteroManager.getURLToGroup(ureq.getIdentity(), booking);
if (url == null) {
showError("error.sessionCodeNull");
} else {
viteroGroupVC = createVelocityContainer("opengroup");
viteroGroupVC.contextPut("groupUrl", url);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), translate("close"), viteroGroupVC);
listenTo(cmc);
cmc.activate();
}
} else {
String title = translate("booking.group");
String text = translate("booking.group.warning");
List<String> buttonLabels = Collections.singletonList(translate("ok"));
warningGroupCtr = activateGenericDialog(ureq, title, text, buttonLabels, warningGroupCtr);
}
} catch (VmsNotAvailableException e) {
showError(VmsNotAvailableException.I18N_KEY);
}
}
use of org.olat.modules.vitero.manager.VmsNotAvailableException in project OpenOLAT by OpenOLAT.
the class ViteroConfigurationController method checkUsers.
private void checkUsers() {
try {
CheckUserInfo infos = viteroManager.checkUsers();
if (infos.getAuthenticationCreated() == 0 && infos.getAuthenticationDeleted() == 0) {
showInfo("check.users.ok");
} else {
String[] args = new String[] { Integer.toString(infos.getAuthenticationCreated()), Integer.toString(infos.getAuthenticationDeleted()), Integer.toString(infos.getAuthenticationCreated() + infos.getAuthenticationDeleted()) };
getWindowControl().setInfo(translate("check.users.nok", args));
}
} catch (VmsNotAvailableException e) {
showError(VmsNotAvailableException.I18N_KEY);
}
}
use of org.olat.modules.vitero.manager.VmsNotAvailableException in project OpenOLAT by OpenOLAT.
the class ViteroUserToGroupController method signIn.
private void signIn(List<Identity> identities) {
try {
ResourceMembers members = ((UserToGroupDataModel) tableCtr.getTableDataModel()).getMembers();
for (Identity identity : identities) {
boolean upgrade = members.getCoaches().contains(identity) || members.getOwners().contains(identity);
GroupRole role = upgrade ? GroupRole.teamleader : null;
ViteroStatus status = viteroManager.addToRoom(booking, identity, role);
if (status.isOk()) {
showInfo("signin.ok");
} else {
showInfo("signin.nok");
break;
}
}
loadModel();
} catch (VmsNotAvailableException e) {
showError(VmsNotAvailableException.I18N_KEY);
}
}
use of org.olat.modules.vitero.manager.VmsNotAvailableException 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);
}
}
Aggregations