Search in sources :

Example 36 with VmsNotAvailableException

use of org.olat.modules.vitero.manager.VmsNotAvailableException in project openolat by klemens.

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);
    }
}
Also used : VmsNotAvailableException(org.olat.modules.vitero.manager.VmsNotAvailableException) GroupRole(org.olat.modules.vitero.model.GroupRole) Identity(org.olat.core.id.Identity) ViteroStatus(org.olat.modules.vitero.model.ViteroStatus)

Aggregations

VmsNotAvailableException (org.olat.modules.vitero.manager.VmsNotAvailableException)36 ViteroBooking (org.olat.modules.vitero.model.ViteroBooking)16 ViteroStatus (org.olat.modules.vitero.model.ViteroStatus)12 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)8 Produces (javax.ws.rs.Produces)6 Identity (org.olat.core.id.Identity)6 GroupRole (org.olat.modules.vitero.model.GroupRole)6 ViteroGroupRoles (org.olat.modules.vitero.model.ViteroGroupRoles)6 ArrayList (java.util.ArrayList)4 GET (javax.ws.rs.GET)4 Path (javax.ws.rs.Path)4 SearchIdentityParams (org.olat.basesecurity.SearchIdentityParams)4 Date (java.util.Date)2 Consumes (javax.ws.rs.Consumes)2 POST (javax.ws.rs.POST)2 Response (javax.ws.rs.core.Response)2 TableDataModel (org.olat.core.gui.components.table.TableDataModel)2 RedirectMediaResource (org.olat.core.gui.media.RedirectMediaResource)2 CheckUserInfo (org.olat.modules.vitero.model.CheckUserInfo)2 StartBookingComparator (org.olat.modules.vitero.model.StartBookingComparator)2