Package org.apache.openmeetings.persistence.beans.calendar

Examples of org.apache.openmeetings.persistence.beans.calendar.Appointment


      Long memberId = meetingMemberDao.addMeetingMember(firstname,
          lastname, memberStatus, appointmentStatus, appointmentId,
          userid, email, phone, invitor, omTimeZone, false);

      // DefaultInvitation
      Appointment point = appointmentLogic
          .getAppointMentById(appointmentId);

      MeetingMember member = getMemberById(memberId);
      Boolean isInvitor = member.getInvitor();

      Long invitationId = null;

      if (point.getRemind() == null) {
        log.error("Appointment has no assigned ReminderType!");
        return null;
      }

      log.debug(":::: addMeetingMember ..... "
          + point.getRemind().getTypId());

      String subject = formatSubject(language_id, point, timezone);

      String message = formatMessage(language_id, point, timezone,
          invitorName);

      // point.getRemind().getTypId() == 1 will not receive emails

      if (point.getRemind().getTypId() == 2) {
        log.debug("Invitation for Appointment : simple email");

        Invitations invitation = invitationManager
            .addInvitationLink(
                new Long(2), // userlevel
                firstname + " " + lastname, // username
                message,
                baseUrl, // baseURl
                email, // email
                subject, // subject
                point.getRoom().getRooms_id(), // room_id
                "public",
                isPasswordProtected, // passwordprotected
                password, // invitationpass
                2, // valid type
                point.getAppointmentStarttime(), // valid from
                point.getAppointmentEndtime(), // valid to
                meeting_organizer, // created by
                baseUrl,
                language_id,
                true, // really send mail sendMail
                point.getAppointmentStarttime(),
                point.getAppointmentEndtime(),
                point.getAppointmentId(),
                invitorName,
                omTimeZone);

        invitationId = invitation.getInvitations_id();

      } else if (point.getRemind().getTypId() == 3) {
        log.debug("Reminder for Appointment : iCal mail");

        System.out.println("### SENDING iCAL EMAIL");

        invitationId = invitationManager
            .addInvitationIcalLink(
                new Long(2), // userlevel
                firstname + " " + lastname, // username
                message,
                baseUrl, // baseURl
                email, // email
                subject, // subject
                point.getRoom().getRooms_id(), // room_id
                "public",
                isPasswordProtected, // passwordprotected
                password, // invitationpass
                2, // valid
                point.getAppointmentStarttime(), // valid from
                point.getAppointmentEndtime(), // valid to
                meeting_organizer, // created by
                point.getAppointmentId(), isInvitor,
                language_id, timezone,
                point.getAppointmentId(),
                invitorName);

      }

      // Setting InvitationId within MeetingMember
View Full Code Here


      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManager.getUserLevelByID(users_id);

      if (authLevelUtil.checkWebServiceLevel(user_level)) {

        Appointment appointment = appointmentDao
            .getAppointmentByRoom(room_id);

        if (appointment == null) {
          return -1L;
        }
        // Not In Remote List available - extern user
        Long memberId = meetingMemberLogic.addMeetingMember(firstname,
            lastname, "0", "0", appointment.getAppointmentId(),
            null, email, null, baseUrl, null, new Boolean(false),
            language_id, false, "", null, null, "");

        return memberId;
View Full Code Here

      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManager.getUserLevelByID(users_id);

      if (authLevelUtil.checkWebServiceLevel(user_level)) {

        Appointment appointment = appointmentDao
            .getAppointmentByRoom(room_id);

        if (appointment == null) {
          return -1L;
        }

        // Not In Remote List available - extern user
        Long memberId = meetingMemberLogic.addMeetingMember(firstname,
            lastname, "0", "0", appointment.getAppointmentId(),
            null, email, "", baseUrl, null, new Boolean(false),
            language_id, false, "", null, null, invitorName);

        return memberId;
View Full Code Here

      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManager.getUserLevelByID(users_id);

      if (authLevelUtil.checkUserLevel(user_level)) {
        // check if the appointment belongs to the current user
        Appointment appointment = appointmentLogic
            .getAppointMentById(appointmentId);
        if (!appointment.getUserId().getUser_id().equals(users_id)) {
          throw new AxisFault(
              "The Appointment cannot be updated by the given user");
        }
      } else if (authLevelUtil.checkUserLevel(user_level)) {
        // fine
      } else {
        throw new AxisFault(
            "Not allowed to preform that action, Authenticate the SID first");
      }

      List<Map<String, String>> newList = new ArrayList<Map<String, String>>();

      for (String singleClient : mmClient) {
        String[] params = singleClient.split(",");
        Map<String, String> map = new HashMap<String, String>();
        map.put("meetingMemberId", params[0]);
        map.put("firstname", params[1]);
        map.put("lastname", params[2]);
        map.put("email", params[3]);
        map.put("userId", params[4]);
        map.put("jNameTimeZone", params[5]);
        newList.add(map);
      }

      log.debug("updateAppointment");

      RoomType rt = roomManager.getRoomTypesById(roomType);

      Appointment app = appointmentLogic
          .getAppointMentById(appointmentId);

      Room room = app.getRoom();
      if (room != null) {

        room.setComment(appointmentDescription);
        room.setName(appointmentName);
        room.setRoomtype(rt);
View Full Code Here

        return appointmentLogic.deleteAppointment(appointmentId,
            users_id, language_id);

      } else if (authLevelUtil.checkUserLevel(user_level)) {

        Appointment appointment = appointmentLogic
            .getAppointMentById(appointmentId);

        if (!appointment.getUserId().getUser_id().equals(users_id)) {
          throw new AxisFault(
              "The Appointment cannot be deleted by the given user");
        }

        return appointmentLogic.deleteAppointment(appointmentId,
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.setAppointmentStarttime(appStored
            .getAppointmentStarttime());
        appointment.setAppointmentEndtime(appStored
            .getAppointmentEndtime());

        return appointment;
      }
View Full Code Here

    WebMarkupContainer calendar = new WebMarkupContainer("calendar");
    calendar.setOutputMarkupId(true);
    calendar.setMarkupId("calendar");
    add(calendar);
   
    final CalendarForm form = new CalendarForm("appointment", new CompoundPropertyModel<Appointment>(new Appointment()));
    add(form);
   
    //fetchEvents
    add(new AbstractDefaultAjaxBehavior() {
      private static final long serialVersionUID = 6880514947331946407L;

      @Override
      protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
        super.updateAjaxAttributes(attributes);
        attributes.setDataType("json");
        attributes.setWicketAjaxResponse(false);
        attributes.getAjaxCallListeners().add(new AjaxCallListener().onSuccess("callback(data);"));
      }
     
      @Override
      public void renderHead(Component component, IHeaderResponse response) {
        super.renderHead(component, response);
        response.render(JavaScriptHeaderItem.forScript(
          "var fetchEventsFunc = "
            + this.getCallbackFunction(
              context("start")
              , context("end")
              , context("callback")
              , resolved("_start", "start.getTime()")
              , resolved("_end", "end.getTime()")) + ";"
          , "fetchEventsFunc"));
      }

      @Override
      protected void respond(AjaxRequestTarget target) {
        Calendar start = WebSession.getCalendar();
        start.setTimeInMillis(getRequestCycle().getRequest().getRequestParameters().getParameterValue("_start").toLong());
        Calendar end = WebSession.getCalendar();
        end.setTimeInMillis(getRequestCycle().getRequest().getRequestParameters().getParameterValue("_end").toLong());
        JSONArray events = new JSONArray();
        for (Appointment a : Application.getBean(AppointmentDao.class).getAppointmentsByRange(WebSession.getUserId(),
            start.getTime(), end.getTime())) {
          try {
            events.put(new JSONObject()
              .put("id", a.getAppointmentId())
              .put("title", a.getAppointmentName())
              .put("description", a.getAppointmentDescription())
              .put("start", WebSession.getDateFormat().format(a.getAppointmentStarttime()))
              .put("end", WebSession.getDateFormat().format(a.getAppointmentEndtime()))
              .put("allDay", false));
          } catch (JSONException e) {
            e.printStackTrace();
          }
        }
              getRequestCycle().scheduleRequestHandlerAfterCurrent(
                new TextRequestHandler("application/json", "UTF-8", events.toString()));
      }
    });
    //dropEvent
    add(new DropResizeBehavior(true, "dropEventFunc"));
    //resizeEvent
    add(new DropResizeBehavior(false, "resizeEventFunc"));
    //create on click-and-drag
    add(new AbstractDefaultAjaxBehavior() {
      private static final long serialVersionUID = 6880514947331946407L;

      @Override
      protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
        super.updateAjaxAttributes(attributes);
        attributes.getAjaxCallListeners().add(new AjaxCallListener().onSuccess("$('#appointment').dialog('open');"));
      }
     
      @Override
      public void renderHead(Component component, IHeaderResponse response) {
        super.renderHead(component, response);
        response.render(JavaScriptHeaderItem.forScript(
          "var selectFunc = "
            + this.getCallbackFunction(
              context("start")
              , context("end")
              , context("allDay")
              , context("jsEvent")
              , context("view")
              , resolved("_start", "start.getTime()")
              , resolved("_end", "end.getTime()")) + ";"
          , "selectFunc"));
      }

      @Override
      protected void respond(AjaxRequestTarget target) {
        Calendar start = WebSession.getCalendar();
        start.setTimeInMillis(getRequestCycle().getRequest().getRequestParameters().getParameterValue("_start").toLong());
        Calendar end = WebSession.getCalendar();
        end.setTimeInMillis(getRequestCycle().getRequest().getRequestParameters().getParameterValue("_end").toLong());
       
        if (start.equals(end)) {
          end.add(Calendar.HOUR_OF_DAY, 1);
        }
        Appointment a = new Appointment();
        a.setAppointmentStarttime(start.getTime());
        a.setAppointmentEndtime(end.getTime());
        form.setModelObject(a);
       
        target.add(form);
      }
    });
    //eventClick
    add(new AbstractDefaultAjaxBehavior() {
      private static final long serialVersionUID = 6880514947331946407L;

      @Override
      protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
        super.updateAjaxAttributes(attributes);
        attributes.getAjaxCallListeners().add(new AjaxCallListener().onSuccess("$('#appointment').dialog('open');"));
      }
     
      @Override
      public void renderHead(Component component, IHeaderResponse response) {
        super.renderHead(component, response);
        response.render(JavaScriptHeaderItem.forScript(
          "var eventClickFunc = "
            + this.getCallbackFunction(
              context("event")
              , context("jsEvent")
              , context("view")
              , resolved("_id", "event.id")) + ";"
          , "eventClickFunc"));
      }

      @Override
      protected void respond(AjaxRequestTarget target) {
        Appointment a = Application.getBean(AppointmentDao.class).getAppointmentById(
            getRequestCycle().getRequest().getRequestParameters().getParameterValue("_id").toLong());
        form.setModelObject(a);
       
        target.add(form);
      }
View Full Code Here

    }
   
    @Override
    protected void respond(AjaxRequestTarget target) {
      AppointmentDao dao = Application.getBean(AppointmentDao.class);
      Appointment a = dao.getAppointmentById(
        getRequestCycle().getRequest().getRequestParameters().getParameterValue("_id").toLong());

      int dayDelta = getRequestCycle().getRequest().getRequestParameters().getParameterValue("dayDelta").toInt();
      int minuteDelta = getRequestCycle().getRequest().getRequestParameters().getParameterValue("minuteDelta").toInt();

      Calendar cal = WebSession.getCalendar();
      if (drop) {
        cal.setTime(a.getAppointmentStarttime());
        cal.add(Calendar.DATE, dayDelta);
        cal.add(Calendar.MINUTE, minuteDelta);
        a.setAppointmentStarttime(cal.getTime());
      }
      cal.setTime(a.getAppointmentEndtime());
      cal.add(Calendar.DATE, dayDelta);
      cal.add(Calendar.MINUTE, minuteDelta);
      a.setAppointmentEndtime(cal.getTime());
     
      dao.updateAppointment(a);
    }
View Full Code Here

      Long user_level = userManager.getUserLevelByID(users_id);
      if (authLevelUtil.checkUserLevel(user_level)) {

        log.debug("updateAppointment");

        Appointment app = appointmentLogic.getAppointMentById(appointmentId);
        Room room = app.getRoom();
        if (roomId > 0) {
          if ( room.getRooms_id() != roomId) {
            app.setRoom(roomDao.get(roomId));
            appointmentDao.updateAppointment(app);
            boolean isAppRoom = room.getAppointment();
            if (isAppRoom) {
              roomDao.delete(room, users_id);
            }
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.setAppointmentStarttime(appStored
            .getAppointmentStarttime());
        appointment.setAppointmentEndtime(appStored
            .getAppointmentEndtime());

        return appointment;
      }
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.persistence.beans.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.