Package org.apache.openmeetings.db.entity.room

Examples of org.apache.openmeetings.db.entity.room.Invitation


    Long users_id = this.sessiondataDao.checkSession(SID);
    Long user_level = this.userManager.getUserLevelByID(users_id);
   
    if (AuthLevelUtil.checkUserLevel(user_level)) {
      User invitee = userDao.getContact(username, username, username, users_id);
      Invitation invitation = invitationManager.getInvitation(invitee, roomDao.get(room_id),
              false, "", Valid.OneTime
              , userDao.get(users_id), 1L, null, null, null);
 
      return ((invitation == null) ? null : invitation.getHash());
    } else {
      return "Need Admin Privileges to perfom the Action";
    }
  }
View Full Code Here


          log.info("validToDate: "
              + CalendarPatterns
                  .getDateWithTimeByMiliSeconds(dTo));
        }
        User invitee = userDao.getContact(username, username, username, users_id);
        Invitation invitation = invitationManager.getInvitation(invitee, roomDao.get(room_id),
                isPasswordProtected, invitationpass, Valid.fromInt(valid)
                , userDao.get(users_id), 1L, dFrom, dTo, null);

        if (invitation != null) {
          return invitation.getHash();
        } else {
          return "Sys - Error";
        }
      } else {
        return "Need Admin Privileges to perfom the Action";
View Full Code Here

              + CalendarPatterns
                  .getDateWithTimeByMiliSeconds(dTo));
        }

        User invitee = userDao.getContact(email, users_id);
        Invitation invitation = invitationManager.getInvitation(invitee, roomDao.get(room_id),
                isPasswordProtected, invitationpass, Valid.fromInt(valid)
                , userDao.get(users_id), language_id,
                dFrom, dTo, null);

        if (invitation != null) {
          if (sendMail) {
            invitationManager.sendInvitionLink(invitation, MessageType.Create, subject, message, false);
          }

          return invitation.getHash();
        } else {
          return "Sys - Error";
        }
      } else {
        return "Need Admin Privileges to perfom the Action";
View Full Code Here

            + CalendarPatterns.getDateWithTimeByMiliSeconds(dFrom));
        log.info("validToDate: "
            + CalendarPatterns.getDateWithTimeByMiliSeconds(dTo));

        User invitee = userDao.getContact(email, users_id);
        Invitation invitation = invitationManager.getInvitation(invitee, roomDao.get(room_id),
                isPasswordProtected, invitationpass, Valid.fromInt(valid)
                , userDao.get(users_id), language_id,
                dFrom, dTo, null);

        if (invitation != null) {
          if (sendMail) {
            invitationManager.sendInvitionLink(invitation, MessageType.Create, subject, message, false);
          }

          return invitation.getHash();
        } else {
          return "Sys - Error";
        }
      } else {
        return "Need Admin Privileges to perfom the Action";
View Full Code Here

 
        Date dFrom = calFrom.getTime();
        Date dTo = calTo.getTime();
 
        User invitee = userDao.getContact(email, users_id);
        Invitation invitation = invitationManager.getInvitation(invitee, roomDao.get(room_id),
                isPasswordProtected, invitationpass, Valid.fromInt(valid)
                , userDao.get(users_id), language_id,
                dFrom, dTo, null);

        if (invitation != null) {
View Full Code Here

      , Long language_id) throws Exception {
    Long users_id = sessiondataDao.checkSession(SID);
    Long user_level = userManager.getUserLevelByID(users_id);

    if (AuthLevelUtil.checkUserLevel(user_level)) {
      Invitation inv = (Invitation)invitationManager.getInvitationByHashCode(invitationHash, true);
      inv.getInvitee().setLanguage_id(language_id);
      invitationManager.sendInvitionLink(inv, MessageType.Create, subject, message, false);
    } else {
      return "Need User Privileges to perfom the Action";
    }
    return "Success";
View Full Code Here

  public Invitation getInvitation(User inveetee, Room room
      , boolean isPasswordProtected, String invitationpass, Valid valid,
      User createdBy, Long language_id, Date gmtTimeStart, Date gmtTimeEnd
      , Appointment appointment)
  {
    Invitation i = getInvitation(null, inveetee, room, isPasswordProtected, invitationpass, valid, createdBy
        , language_id, gmtTimeStart, gmtTimeEnd, appointment);
    i = invitationDao.update(i);
    return i;
  }
View Full Code Here

  public Invitation getInvitation(Invitation _invitation, User inveetee, Room room
      , boolean isPasswordProtected, String invitationpass, Valid valid,
      User createdBy, Long language_id, Date gmtTimeStart, Date gmtTimeEnd
      , Appointment appointment) {
   
    Invitation invitation = _invitation;
    if (null == _invitation) {
      invitation = new Invitation();
      String hashRaw = "HASH" + (System.currentTimeMillis());
      try {
        invitation.setHash(MD5.do_checksum(hashRaw));
      } catch (NoSuchAlgorithmException e) {
        log.error("Unexpected error while creating invitation", e);
        throw new RuntimeException(e);
      }
    }

    invitation.setPasswordProtected(isPasswordProtected);
    if (isPasswordProtected) {
      invitation.setPassword(ManageCryptStyle.getInstanceOfCrypt().createPassPhrase(invitationpass));
    }

    invitation.setUsed(false);
    invitation.setValid(valid);
   
    // valid period of Invitation
    switch (valid) {
      case Period:
        invitation.setValidFrom(new Date(gmtTimeStart.getTime() - (5 * 60 * 1000)));
        invitation.setValidTo(gmtTimeEnd);
        break;
      case Endless:
      case OneTime:
      default:
        break;
    }

    invitation.setDeleted(false);

    invitation.setInvitedBy(createdBy);
    invitation.setInvitee(inveetee);
    if (language_id != null && Type.contact == invitation.getInvitee().getType()) {
      invitation.getInvitee().setLanguage_id(language_id);
    }
    invitation.setRoom(room);
    invitation.setInserted(new Date());
    invitation.setAppointment(appointment);

    return invitation;
  }
View Full Code Here

   * @param hidePass
   * @return
   */
  public Object getInvitationByHashCode(String hashCode, boolean hidePass) {
    try {
      Invitation invitation = invitationDao.getInvitationByHashCode(hashCode, hidePass);

      if (invitation == null) {
        // already deleted or does not exist
        return new Long(-31);
      } else {
        switch (invitation.getValid()) {
          case OneTime:
            // do this only if the user tries to get the Invitation, not
            // while checking the PWD
            if (hidePass) {
              // one-time invitation
              if (invitation.isUsed()) {
                // Invitation is of type *only-one-time* and was
                // already used
                return new Long(-32);
              } else {
                // set to true if this is the first time / a normal
                // getInvitation-Query
                invitation.setUsed(true);
                invitationDao.update(invitation);
                // invitation.setInvitationpass(null);
                invitation.setAllowEntry(true);
              }
            } else {
              invitation.setAllowEntry(true);
            }
            break;
          case Period:
            TimeZone tz = timezoneUtil.getTimeZone(invitation.getInvitee());
            Calendar now = Calendar.getInstance(tz);
            Calendar start = Calendar.getInstance(tz);
            start.setTime(invitation.getValidFrom());

            Calendar end = Calendar.getInstance(tz);
            end.setTime(invitation.getValidTo());
            if (now.after(start) && now.before(end)) {
              invitationDao.update(invitation);
              // invitation.setInvitationpass(null);
              invitation.setAllowEntry(true);
            } else {

              // Invitation is of type *period* and is not valid
              // anymore, this is an extra hook to display the time
              // correctly
              // in the method where it shows that the hash code does
              // not work anymore
              invitation.setAllowEntry(false);
            }
            break;
          case Endless:
          default:
            invitationDao.update(invitation);

            invitation.setAllowEntry(true);
            // invitation.setInvitationpass(null);
            break;
        }
        return invitation;
      }
View Full Code Here

    }
    return null;
  }

  private void sendReminder(User u, Appointment a) throws Exception {
    Invitation i = new Invitation();
    i.setInvitedBy(u);
    i.setInvitee(u);
    i.setAppointment(a);
    sendReminder(u, a, i);
  }
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.db.entity.room.Invitation

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.