Package org.apache.openmeetings.db.dao.room

Examples of org.apache.openmeetings.db.dao.room.RoomModeratorsDao


    AjaxFormValidatingBehavior.addToAllFormComponents(this, "keydown", Duration.ONE_SECOND);
  }

  void updateModerators(AjaxRequestTarget target) {
    long roomId = (getModelObject().getRooms_id() != null ? getModelObject().getRooms_id() : 0)
    RoomModeratorsDao moderatorsDao = getBean(RoomModeratorsDao.class);
    final List<RoomModerator> moderatorsInRoom = moderatorsDao.getRoomModeratorByRoomId(roomId);
    moderators.setDefaultModelObject(moderatorsInRoom);
    target.add(moderatorContainer);
  }
View Full Code Here


  @Override
  public void submitView(AjaxRequestTarget target, List<User> usersToAdd) {
    // TODO Auto-generated method stub
    long roomId = getModelObject().getRooms_id();
    RoomModeratorsDao moderatorsDao = getBean(RoomModeratorsDao.class);
    List<RoomModerator> moderators = moderatorsDao.getRoomModeratorByRoomId(roomId);
    moderatorsInRoom = (moderatorsInRoom == null) ? new ArrayList<RoomModerator>() : moderatorsInRoom;
    for (User u : usersToAdd) {
      boolean found = false;
      for ( RoomModerator rm : moderators) {
        if (rm.getUser().getUser_id().equals(u.getUser_id())) {
          found = true;
          break;
        }
      }
      if (!found) {
        RoomModerator rModerator = new RoomModerator();
        rModerator.setUser(u);
        rModerator.setIsSuperModerator(false);
        rModerator.setStarttime(new Date());
        rModerator.setDeleted(false);
        rModerator.setRoomId(roomId);
        moderatorsInRoom.add(rModerator);
        moderatorsDao.addRoomModeratorByUserId(u, false, roomId);
      }
    }
    updateModerators(target);
  }
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.db.dao.room.RoomModeratorsDao

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.