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

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


      if (AuthLevelUtil.checkWebServiceLevel(user_level) || AuthLevelUtil.checkAdminLevel(user_level)) {
        // fine
      } else if (AuthLevelUtil.checkUserLevel(user_level)) {
        // 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));
      WebSession.get().setBaseUrl(baseurl); //TODO verify !!!!!
      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, baseurl, users_id).getId();
    } catch (Exception err) {
      log.error("[updateAppointment]", err);
      throw new AxisFault(err.getMessage());
View Full Code Here


  public Long deleteAppointment(String SID, Long appointmentId, Long language_id) throws AxisFault {
    try {
      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManager.getUserLevelByID(users_id);

      Appointment a = appointmentDao.get(appointmentId);
      if (AuthLevelUtil.checkWebServiceLevel(user_level) || AuthLevelUtil.checkAdminLevel(user_level)) {
        // fine
      } else if (AuthLevelUtil.checkUserLevel(user_level)) {
        // 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, getBaseUrl(), users_id); //FIXME check this !!!!
      return a.getId();
    } catch (Exception err) {
      log.error("[deleteAppointment]", err);
      throw new AxisFault(err.getMessage());
    }
  }
View Full Code Here

      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManager.getUserLevelByID(users_id);
      if (AuthLevelUtil.checkUserLevel(user_level)) {

        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

      // Defining Organizer

      HashMap<String, String> organizerAttendee = handler.getAttendeeData(email, username, isOwner);
      organizerAttendee = handler.getAttendeeData(replyToEmail, owner.getLogin(), isOwner);

      Appointment a = i.getAppointment();
      // Create ICal Message
      //FIXME should be checked to generate valid time
      String meetingId = handler.addNewMeeting(a.getStart(), a.getEnd(),
          a.getTitle(), atts, invitation_link,
          organizerAttendee, a.getIcalId(), timezoneUtil.getTimeZone(owner));

      // Writing back meetingUid
      if (a.getIcalId() == null || a.getIcalId().length() < 1) {
        a.setIcalId(meetingId);
        // TODO should it be saved ???
      }

      log.debug(handler.getICalDataAsString());
      mailHandler.send(new MailMessage(email, replyToEmail, subject, template, handler.getIcalAsByteArray()));
View Full Code Here

          baseURL = "http://" + domain + webapp;
        } else if (port.equals("443")) {
          baseURL = "https://" + domain + webapp;
        }

        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, baseURL, 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

      // Defining Organizer

      HashMap<String, String> organizerAttendee = handler.getAttendeeData(email, username, isOwner);
      organizerAttendee = handler.getAttendeeData(replyToEmail, owner.getLogin(), isOwner);

      Appointment a = i.getAppointment();
      // Create ICal Message
      //FIXME should be checked to generate valid time
      String meetingId = handler.addNewMeeting(a.getStart(), a.getEnd(),
          a.getTitle(), atts, invitation_link,
          organizerAttendee, a.getIcalId(), timezoneUtil.getTimeZone(owner));

      // Writing back meetingUid
      if (Strings.isEmpty(a.getIcalId())) {
        a.setIcalId(meetingId);
        // TODO should it be saved ???
      }

      log.debug(handler.getICalDataAsString());
      mailHandler.send(new MailMessage(email, replyToEmail, subject, template, handler.getIcalAsByteArray()));
View Full Code Here

    if (room.getAppointment() == false)
      return null;

    try {
      Appointment ment = appointmentLogic.getAppointmentByRoom(room_id);

      return ment;
    } catch (Exception e) {
      log.error("getAppointMentDataForRoom " + e.getMessage());
      return null;
View Full Code Here

 
      if (room.getAppointment() == false) {
        throw new IllegalStateException("Room has no appointment");
      }
   
      Appointment appointment = appointmentLogic
          .getAppointmentByRoom(room_id);

      Map<String, Object> returnMap = new HashMap<String, Object>();

      returnMap.put("appointment", appointment);

      User us = userDao.get(currentClient.getUser_id());
      TimeZone timezone = timezoneUtil.getTimeZone(us);

      returnMap.put("appointment", appointment);

      returnMap.put(
          "start",
          CalendarPatterns.getDateWithTimeByMiliSeconds(
              appointment.getStart(), timezone));
      returnMap.put(
          "end",
          CalendarPatterns.getDateWithTimeByMiliSeconds(
              appointment.getEnd(), timezone));
      returnMap.put("timeZone", timezone.getDisplayName());

      return returnMap;
    } catch (Exception e) {
      log.error("getAppointMentAndTimeZones " , e );
View Full Code Here

          .getTodaysAppointmentsForUser(users_id);
      List<Room> result = new ArrayList<Room>();

      if (points != null) {
        for (int i = 0; i < points.size(); i++) {
          Appointment ment = points.get(i);

          Long rooms_id = ment.getRoom().getRooms_id();
          Room rooom = roomDao.get(rooms_id);

          if (!rooom.getRoomtype().getRoomtypes_id()
              .equals(room_types_id))
            continue;
View Full Code Here

            .getTodaysAppointmentsForUser(users_id);
        List<Room> result = new ArrayList<Room>();

        if (appointments != null) {
          for (int i = 0; i < appointments.size(); i++) {
            Appointment ment = appointments.get(i);

            Long rooms_id = ment.getRoom().getRooms_id();
            Room rooom = roomDao.get(rooms_id);

            rooom.setCurrentusers(this
                .getRoomClientsListByRoomId(rooom.getRooms_id()));
            result.add(rooom);
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.