use of org.olat.modules.vitero.manager.VmsNotAvailableException in project OpenOLAT by OpenOLAT.
the class ViteroUserToGroupController method loadModel.
private void loadModel() {
try {
ViteroGroupRoles groupRoles = viteroManager.getGroupRoles(booking.getGroupId());
ResourceMembers members = getIdentitiesInResource(groupRoles);
tableCtr.setTableDataModel(new UserToGroupDataModel(members, groupRoles));
int numOfFreePlaces = booking.getRoomSize() - groupRoles.size();
mainVC.contextPut("freePlaces", new String[] { Integer.toString(numOfFreePlaces) });
} catch (VmsNotAvailableException e) {
showError(VmsNotAvailableException.I18N_KEY);
}
}
use of org.olat.modules.vitero.manager.VmsNotAvailableException in project OpenOLAT by OpenOLAT.
the class ViteroBookingEditController method formOK.
@Override
protected void formOK(UserRequest ureq) {
String name = groupName.getValue();
booking.setGroupName(name);
Date begin = beginChooser.getDate();
booking.setStart(begin);
int beginBuffer = 0;
if (beginBufferEl.isOneSelected()) {
beginBuffer = Integer.parseInt(beginBufferEl.getSelectedKey());
}
booking.setStartBuffer(beginBuffer);
Date end = endChooser.getDate();
booking.setEnd(end);
int endBuffer = 0;
if (endBufferEl.isOneSelected()) {
endBuffer = Integer.parseInt(endBufferEl.getSelectedKey());
}
booking.setEndBuffer(endBuffer);
int roomSize = -1;
if (roomSizeEl.isOneSelected()) {
roomSize = Integer.parseInt(roomSizeEl.getSelectedKey());
}
booking.setRoomSize(roomSize);
boolean auto = autoSignIn.isMultiselect() && autoSignIn.isSelected(0);
booking.setAutoSignIn(auto);
try {
if (booking.getBookingId() >= 0) {
ViteroBooking updatedBooking = viteroManager.updateBooking(group, ores, subIdentifier, booking);
if (updatedBooking != null) {
showInfo("booking.ok");
fireEvent(ureq, Event.DONE_EVENT);
} else {
showError("error.unkown");
}
} else {
ViteroStatus status = viteroManager.createBooking(group, ores, subIdentifier, booking);
if (status.isOk()) {
showInfo("booking.ok");
fireEvent(ureq, Event.DONE_EVENT);
} else {
showError(status.getError().i18nKey());
}
}
} catch (VmsNotAvailableException e) {
showError(VmsNotAvailableException.I18N_KEY);
}
}
use of org.olat.modules.vitero.manager.VmsNotAvailableException in project OpenOLAT by OpenOLAT.
the class ViteroBookingsController method signOutVitero.
protected void signOutVitero(UserRequest ureq, ViteroBooking booking) {
try {
ViteroStatus status = viteroManager.removeFromRoom(booking, ureq.getIdentity());
if (status.isOk()) {
showInfo("signout.ok");
} else {
showError("signout.nok");
}
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 openVitero.
protected void openVitero(UserRequest ureq, ViteroBooking booking) {
try {
String url = viteroManager.getURLToBooking(ureq.getIdentity(), booking);
RedirectMediaResource redirect = new RedirectMediaResource(url);
ureq.getDispatchResult().setResultingMediaResource(redirect);
} catch (VmsNotAvailableException e) {
showError(VmsNotAvailableException.I18N_KEY);
}
}
use of org.olat.modules.vitero.manager.VmsNotAvailableException in project OpenOLAT by OpenOLAT.
the class ViteroBookingsController method signInVitero.
protected void signInVitero(UserRequest ureq, ViteroBooking booking) {
try {
ViteroStatus status = viteroManager.addToRoom(booking, ureq.getIdentity(), null);
if (status.isOk()) {
showInfo("signin.ok");
} else {
showError("signin.nok");
}
loadModel();
} catch (VmsNotAvailableException e) {
showError(VmsNotAvailableException.I18N_KEY);
}
}
Aggregations