use of org.olat.modules.vitero.manager.VmsNotAvailableException in project openolat by klemens.
the class ViteroBookingWebService method getRooms.
/**
* returns the list of booking of the resource.
*
* @response.representation.200.qname {http://www.example.com}viteroBookingVO
* @response.representation.200.mediaType application/xml, application/json
* @response.representation.200.doc This is the list of all bookings of a resource
* @response.representation.200.example {@link org.olat.modules.vitero.restapi.Examples#SAMPLE_ViteroBookingVO}
* @return The list of vitero booking
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public Response getRooms() {
try {
List<ViteroBooking> bookings = viteroManager.getBookings(null, ores, subIdentifier);
ViteroBookingVO[] bookingVos = new ViteroBookingVO[bookings.size()];
int count = 0;
for (ViteroBooking booking : bookings) {
bookingVos[count++] = new ViteroBookingVO(booking);
}
return Response.ok(bookingVos).build();
} catch (VmsNotAvailableException e) {
log.error("", e);
return handleNotAvailableException();
}
}
use of org.olat.modules.vitero.manager.VmsNotAvailableException in project openolat by klemens.
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 ViteroBookingsAdminController method openInfoBox.
protected void openInfoBox(UserRequest ureq, ViteroBooking booking) {
removeAsListenerAndDispose(infoController);
removeAsListenerAndDispose(cmc);
try {
ViteroGroup group = viteroManager.getGroup(booking.getGroupId());
infoController = new ViteroAdminBookingInfosController(ureq, getWindowControl(), booking, group);
listenTo(infoController);
cmc = new CloseableModalController(getWindowControl(), translate("close"), infoController.getInitialComponent(), true, translate("booking.raw.title"));
listenTo(cmc);
cmc.activate();
} catch (VmsNotAvailableException e) {
showError(VmsNotAvailableException.I18N_KEY);
}
}
use of org.olat.modules.vitero.manager.VmsNotAvailableException in project OpenOLAT by OpenOLAT.
the class ViteroBookingsEditController method reloadModel.
protected void reloadModel() {
try {
bookingDisplays.clear();
List<ViteroBooking> bookings = viteroManager.getBookings(group, ores, subIdentifier);
int i = 0;
for (ViteroBooking booking : bookings) {
BookingDisplay display = new BookingDisplay(booking);
if (!readOnly) {
display.setDeleteButton(uifactory.addFormLink("delete_" + i++, "delete", "delete", flc, Link.BUTTON));
display.setEditButton(uifactory.addFormLink("edit_" + i++, "edit", "edit", flc, Link.BUTTON));
}
display.setUsersButton(uifactory.addFormLink("users_" + i++, "users", "users", flc, Link.BUTTON));
display.setGroupButton(uifactory.addFormLink("group_" + i++, "group.open", "group.open", flc, Link.BUTTON));
bookingDisplays.add(display);
}
flc.contextPut("bookingDisplays", bookingDisplays);
} catch (VmsNotAvailableException e) {
showError(VmsNotAvailableException.I18N_KEY);
}
}
use of org.olat.modules.vitero.manager.VmsNotAvailableException in project OpenOLAT by OpenOLAT.
the class ViteroBookingsEditController method occupiedRooms.
protected void occupiedRooms(UserRequest ureq) {
removeAsListenerAndDispose(bookingController);
try {
roomsOverviewController = new ViteroRoomsOverviewController(ureq, getWindowControl());
listenTo(roomsOverviewController);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), translate("close"), roomsOverviewController.getInitialComponent(), true, translate("roomsOverview"));
listenTo(cmc);
cmc.activate();
} catch (VmsNotAvailableException e) {
showError(VmsNotAvailableException.I18N_KEY);
}
}
Aggregations