Package org.apache.openmeetings.db.entity.calendar

Examples of org.apache.openmeetings.db.entity.calendar.Appointment


        if (rooms_id <= 0) {
          return rooms_id;
        }

        Appointment a = new Appointment();
        a.setTitle("appointmentName");
        a.setOwner(userDao.get(users_id));
        a.setLocation("appointmentLocation");
        a.setDescription("appointmentDescription");
        a.setStart(dFrom);
        a.setEnd(dTo);
        a.setCategory(appointmentCategoryDao.get(1L));
        a.setRemind(appointmentReminderTypDao.get(reminderTypeId));
        a.setRoom(roomDao.get(rooms_id));
        a.setPasswordProtected(isPasswordProtected);
        a.setPassword(password);
        a.setLanguageId(1L); //TODO check
        appointmentDao.update(a, users_id); //FIXME verify !!!

        return rooms_id;

      } else {
View Full Code Here


      throws AxisFault {
    try {
      Long users_id = sessiondataDao.checkSession(SID);

      if (AuthLevelUtil.hasWebServiceLevel(userDao.getRights(users_id))) {
        Appointment a = appointmentLogic.getAppointmentByRoom(room_id);

        if (email == null || a == null) {
          return -1L;
        }
        for (MeetingMember mm : a.getMeetingMembers()) {
          if (email.equals(mm.getUser().getAdresses().getEmail())) {
            return mm.getId();
          }
        }
        MeetingMember mm = new MeetingMember();
        mm.setAppointment(a);
        mm.setUser(userDao.getContact(email, firstname, lastname, language_id, jNameTimeZone, users_id));
        a.getMeetingMembers().add(mm);
        appointmentDao.update(a, users_id);

        return mm.getId(); //FIXME check to return ID
      } else {
        return -2L;
View Full Code Here

    try {
      Long users_id = sessiondataDao.checkSession(SID);
      log.debug("saveAppointMent users_id:" + users_id);

      if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {
        Appointment a = appointmentLogic.getAppointment(appointmentName, appointmentLocation, appointmentDescription,
            appointmentstart, appointmentend, isDaily, isWeekly, isMonthly, isYearly, categoryId, remind,
            mmClient, roomType, languageId, isPasswordProtected, password, roomId, users_id);
        return appointmentDao.update(a, users_id).getId();
      } else {
        log.error("saveAppointment : wrong user level");
View Full Code Here

      Long users_id = sessiondataDao.checkSession(SID);
      Set<Right> rights = userDao.getRights(users_id);
      if (AuthLevelUtil.hasUserLevel(rights)) {

        Appointment a = appointmentDao.get(appointmentId);
        if (!AuthLevelUtil.hasAdminLevel(rights) && !a.getOwner().getUser_id().equals(users_id)) {
          throw new AxisFault("The Appointment cannot be updated by the given user");
        }
        if (!a.getStart().equals(appointmentstart) || !a.getEnd().equals(appointmentend)) {
          a.setStart(appointmentstart);
          a.setEnd(appointmentend);
          //FIXME this might change the owner!!!!!
          return appointmentDao.update(a, users_id).getId();
        }         
      }
    } catch (Exception err) {
View Full Code Here

      if (AuthLevelUtil.hasWebServiceLevel(rights) || AuthLevelUtil.hasAdminLevel(rights)) {
        // fine
      } else if (AuthLevelUtil.hasUserLevel(rights)) {
        // check if the appointment belongs to the current user
        Appointment a = appointmentDao.get(appointmentId);
        if (!a.getOwner().getUser_id().equals(users_id)) {
          throw new AxisFault("The Appointment cannot be updated by the given user");
        }
      } else {
        throw new AxisFault("Not allowed to preform that action, Authenticate the SID first");
      }

      Appointment a = appointmentDao.get(appointmentId);
      a.setTitle(appointmentName);
      a.setLocation(appointmentLocation);
      a.setDescription(appointmentDescription);
      a.setStart(appointmentstart.getTime());
      a.setEnd(appointmentend.getTime());
      a.setIsDaily(isDaily);
      a.setIsWeekly(isWeekly);
      a.setIsMonthly(isMonthly);
      a.setIsYearly(isYearly);
      a.setCategory(appointmentCategoryDao.get(categoryId));
      a.setRemind(appointmentReminderTypDao.get(remind));
      a.getRoom().setComment(appointmentDescription);
      a.getRoom().setName(appointmentName);
      a.getRoom().setRoomtype(roomTypeDao.get(roomType));
      a.setOwner(userDao.get(users_id));
      a.setPasswordProtected(isPasswordProtected);
      a.setPassword(password);
      a.setMeetingMembers(new ArrayList<MeetingMember>());
      for (String singleClient : mmClient) {
        MeetingMember mm = appointmentLogic.getMeetingMember(users_id, languageId, singleClient);
        mm.setAppointment(a);
        a.getMeetingMembers().add(mm);
      }
      return appointmentDao.update(a, users_id).getId();
    } catch (Exception err) {
      log.error("[updateAppointment]", err);
      throw new AxisFault(err.getMessage());
View Full Code Here

        Date end = createCalendarDate(timezone, validToDate, validToTime);

        log.info("validFromDate: " + CalendarPatterns.getDateWithTimeByMiliSeconds(start));
        log.info("validToDate: " + CalendarPatterns.getDateWithTimeByMiliSeconds(end));

        Appointment a = new Appointment();
        a.setTitle(subject);
        a.setDescription(message);
        a.setStart(start);
        a.setEnd(end);
        a.setCategory(appointmentCategoryDao.get(1L));
        a.setOwner(from);
        if (bookedRoom) {
          a.setRoom(new Room());
          a.getRoom().setAppointment(true);
          a.getRoom().setName(subject);
          a.getRoom().setRoomtype(roomTypeDao.get(roomtype_id));
          a.getRoom().setNumberOfPartizipants(100L);
          a.getRoom().setAllowUserQuestions(true);
          a.getRoom().setAllowFontStyles(true);
        }
        for (String email : recipients) {
          MeetingMember mm = new MeetingMember();
          mm.setAppointment(a);
          mm.setUser(userDao.getContact(email, users_id));
          a.getMeetingMembers().add(mm);
        }
        a = appointmentDao.update(a, users_id);
        for (MeetingMember mm : a.getMeetingMembers()) {
          User to = mm.getUser();
          Room room = a.getRoom();
         
          //TODO should be reviewed
          if (!to.getUser_id().equals(from.getUser_id())) {
            // One message to the Send
            privateMessagesDao.addPrivateMessage(subject,
View Full Code Here

  public Long deleteAppointment(String SID, Long appointmentId, Long language_id) throws AxisFault {
    try {
      Long users_id = sessiondataDao.checkSession(SID);
      Set<Right> rights = userDao.getRights(users_id);

      Appointment a = appointmentDao.get(appointmentId);
      if (AuthLevelUtil.hasWebServiceLevel(rights) || AuthLevelUtil.hasAdminLevel(rights)) {
        // fine
      } else if (AuthLevelUtil.hasUserLevel(rights)) {
        // check if the appointment belongs to the current user
        if (!a.getOwner().getUser_id().equals(users_id)) {
          throw new AxisFault("The Appointment cannot be updated by the given user");
        }
      } else {
        throw new AxisFault("Not allowed to preform that action, Authenticate the SID first");
      }
      appointmentDao.delete(a, users_id); //FIXME check this !!!!
      return a.getId();
    } catch (Exception err) {
      log.error("[deleteAppointment]", err);
      throw new AxisFault(err.getMessage());
    }
  }
View Full Code Here

    try {

      Long users_id = sessiondataDao.checkSession(SID);
      if (AuthLevelUtil.hasUserLevel(userDao.getRights(users_id))) {

        Appointment appointment = new Appointment();

        Appointment appStored = appointmentDao.getAppointmentByRoomId(
            users_id, room_id);

        appointment.setStart(appStored
            .getStart());
        appointment.setEnd(appStored
            .getEnd());

        return appointment;
      }
View Full Code Here

        // Update the Client List
        sessionManager.updateClientByStreamId(streamid, currentClient, false, null);
      } else {
        // If this is an Appointment then the Moderator will be set to the Invitor

        Appointment ment = appointmentLogic.getAppointmentByRoom(room_id);

        Long userIdInRoomClient = currentClient.getUser_id();

        boolean found = false;
        boolean moderator_set = false;
        // First check owner who is not in the members list
        if (ment.getOwner().getUser_id().equals(userIdInRoomClient)) {
          found = true;
          log.debug("User "
              + userIdInRoomClient
              + " is moderator due to flag in MeetingMember record");
          currentClient.setIsMod(true);
          moderator_set = true;

          // Update the Client List
          sessionManager.updateClientByStreamId(streamid, currentClient, false, null);

          List<Client> modRoomList = sessionManager.getCurrentModeratorByRoom(currentClient.getRoom_id());

          // There is a need to send an extra Event here, cause at this moment
          // there could be already somebody in the Room waiting

          //Sync message to everybody
          syncMessageToCurrentScope("setNewModeratorByList", modRoomList, false);
        }
        if (!found) {
          // Check if current user is set to moderator
          for (MeetingMember member : ment.getMeetingMembers()) {
            // only persistent users can schedule a meeting
            // user-id is only set for registered users
            if (member.getUser() != null) {
              log.debug("checking user " + member.getUser().getFirstname()
                  + " for moderator role - ID : "
View Full Code Here

      Calendar appointmentstart, Calendar appointmentend,
      Boolean isDaily, Boolean isWeekly, Boolean isMonthly,
      Boolean isYearly, Long categoryId, Long remind, String[] mmClient,
      Long roomType, Long languageId,
      Boolean isPasswordProtected, String password, long roomId, Long users_id) {
    Appointment a = new Appointment();
    a.setTitle(appointmentName);
    a.setLocation(appointmentLocation);
    a.setDescription(appointmentDescription);
    a.setStart(appointmentstart.getTime());
    a.setEnd(appointmentend.getTime());
    a.setIsDaily(isDaily);
    a.setIsWeekly(isWeekly);
    a.setIsMonthly(isMonthly);
    a.setIsYearly(isYearly);
    a.setCategory(appointmentCategoryDao.get(categoryId));
    a.setRemind(appointmentReminderTypDao.get(remind));
    if (roomId > 0) {
      a.setRoom(roomDao.get(roomId));
    } else {
      a.setRoom(new Room());
      a.getRoom().setComment(appointmentDescription);
      a.getRoom().setName(appointmentName);
      a.getRoom().setRoomtype(roomTypeDao.get(roomType));
    }
    a.setOwner(userDao.get(users_id));
    a.setPasswordProtected(isPasswordProtected);
    a.setPassword(password);
    a.setMeetingMembers(new ArrayList<MeetingMember>());
    for (String singleClient : mmClient) {
      MeetingMember mm = getMeetingMember(users_id, languageId, singleClient);
      mm.setAppointment(a);
      a.getMeetingMembers().add(mm);
    }
    return a;
  }
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.db.entity.calendar.Appointment

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.