Examples of Invitations


Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

          for(int y =0; y < members.size(); y++){
            MeetingMember mm = members.get(y);
           
            log.debug("doScheduledMeetingReminder : Member " + mm.getEmail());
           
            Invitations inv = mm.getInvitation();
           
            if(inv==null) {
              log.error("Error retrieving Invitation for member " + mm.getEmail() + " in Appointment " + ment.getAppointmentName());
            } else {
              // Check if Invitation was updated last time
              Date updateTime = inv.getUpdatetime();
             
              if(updateTime !=null && updateTime.after(oneHourBeforeAppStart)){
                log.debug("Member has been informed within one hour before Meeting start");
                continue;
              }
             
             
              if(inv.getBaseUrl() == null  || inv.getBaseUrl().length() < 1){
                log.error("Error retrieving baseUrl from Invitation ID : " + inv.getInvitations_id());
                continue;
              }
             
              //ment.getAppointmentStarttime().toLocaleString()
             
              Users us = ment.getUserId();
             
              String jNameTimeZone = null;
              if (us != null && us.getOmTimeZone() != null) {
                jNameTimeZone = us.getOmTimeZone().getJname();
              } else {
                Configuration conf = Configurationmanagement.getInstance().getConfKey(3L, "default.timezone");
                if (conf != null) {
                  jNameTimeZone = conf.getConf_value();
                }
              }
             
              OmTimeZone omTimeZone = OmTimeZoneDaoImpl.getInstance().getOmTimeZone(jNameTimeZone);
             
              String timeZoneName = omTimeZone.getIcal();
             
              Calendar cal = Calendar.getInstance();
              cal.setTimeZone(TimeZone.getTimeZone(timeZoneName));
              int offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
             
              Date starttime = new Date(ment.getAppointmentStarttime().getTime() + offset);
              Date endtime = new Date(ment.getAppointmentEndtime().getTime() + offset);
             
//              String message = "Meeting : " + ment.getAppointmentName() + "<br>";
//              if(ment.getAppointmentDescription() != null && ment.getAppointmentDescription().length() > 0)
//                message += "(" + ment.getAppointmentDescription() + ")<br>";
//              message += "Start : " + starttime + "<br>";
//              message += "End : " + endtime + "<br>";
//              message += "Timezone : " + omTimeZone.getIcal() + "<br>";
             
             
              String message = labelid1158.getValue() + " "+ ment.getAppointmentName();
             
              if (ment.getAppointmentDescription().length() != 0) {
               
                Fieldlanguagesvalues labelid1152 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1152), language_id);
                message += labelid1152.getValue() + ment.getAppointmentDescription();
               
              }
             
              message += "<br/>" + labelid1153.getValue() + ' '
                      + CalendarPatterns.getDateWithTimeByMiliSeconds(starttime)
                      + " (" + timeZoneName + ")"
                      + "<br/>";
             
              message += labelid1154.getValue() + ' '
                      + CalendarPatterns.getDateWithTimeByMiliSeconds(endtime)
                      + " (" + timeZoneName + ")"
                      + "<br/>";
             
              //Fieldlanguagesvalues labelid1156 = Fieldmanagment.getInstance().getFieldByIdAndLanguage(new Long(1156), language_id);
              //message = labelid1156.getValue() + invitorName + "<br/>";
             
              Invitationmanagement.getInstance().sendInvitationReminderLink(message, inv.getBaseUrl(), mm.getEmail(),
                  labelid1158.getValue() + " "+ ment.getAppointmentName(), inv.getHash());
             
              inv.setUpdatetime(now);
              Invitationmanagement.getInstance().updateInvitation(inv);
            }
           
          }
        }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

      Date validFrom, Date validTo, Long createdBy, String baseUrl, Long language_id,
      Boolean sendMail, Date gmtTimeStart, Date gmtTimeEnd, Long appointmentId){
    try {
      if (AuthLevelmanagement.getInstance().checkUserLevel(user_level)){
       
        Invitations invitation = new Invitations();
        invitation.setIsPasswordProtected(isPasswordProtected);
        if (isPasswordProtected){
          invitation.setInvitationpass(ManageCryptStyle.getInstance().getInstanceOfCrypt().createPassPhrase(invitationpass));
        }
       
        invitation.setInvitationWasUsed(false);
        log.debug(baseUrl);
        invitation.setBaseUrl(baseUrl);
       
        //valid period of Invitation
        if (valid == 1) {
          //endless
          invitation.setIsValidByTime(false);
          invitation.setCanBeUsedOnlyOneTime(false);
        } else if (valid == 2){
          //period
          invitation.setIsValidByTime(true);
          invitation.setCanBeUsedOnlyOneTime(false);
         
          Date gmtTimeStartShifted = new Date(gmtTimeStart.getTime() - ( 5 * 60 * 1000 ) );
         
          invitation.setValidFrom(gmtTimeStartShifted);
          invitation.setValidTo(gmtTimeEnd)
         
          //invitation.setValidFrom(validFrom);
          //invitation.setValidTo(validTo);   
        } else {
          //one-time
          invitation.setIsValidByTime(false);
          invitation.setCanBeUsedOnlyOneTime(true);
          invitation.setInvitationWasUsed(false);
        }
       
        invitation.setDeleted("false");
       
        Users us = UsersDaoImpl.getInstance().getUser(createdBy);
        String hashRaw = "HASH"+(System.currentTimeMillis());
        invitation.setHash(MD5.do_checksum(hashRaw));
       
        invitation.setInvitedBy(us);
        invitation.setInvitedname(username);
        invitation.setInvitedEMail(email);
        invitation.setRoom(Roommanagement.getInstance().getRoomById(rooms_id));
        invitation.setConferencedomain(conferencedomain);
        invitation.setStarttime(new Date());
        invitation.setAppointmentId(appointmentId);
       
        Object idf = PersistenceSessionUtil.createSession();
        EntityManager session = PersistenceSessionUtil.getSession();
        EntityTransaction tx = session.getTransaction();
        tx.begin();
        invitation = session.merge(invitation);
        session.flush();
        long invitationId = invitation.getInvitations_id();
        tx.commit();
        PersistenceSessionUtil.closeSession(idf);
       
        invitation.setInvitations_id(invitationId);
       
        if (invitationId > 0) {
         
          if (sendMail) {
            this.sendInvitionLink(username, message, baseurl, email,
                subject, invitation.getHash(), validFrom,
                validTo, language_id);
          }
         
          return invitation;
        }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

        log.error("Error sending IcalCancelMail for User " + member.getEmail() + " : " + e.getMessage());
      }
    }
   
    // Deleting invitation, if exists
    Invitations inv = member.getInvitation();
   
    if(inv != null){
      inv.setDeleted("true");
      updateInvitation(inv);
    }
   
  }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

      log.debug("addInvitationIcalLink");
     
    try {
      if (AuthLevelmanagement.getInstance().checkUserLevel(user_level)){
       
        Invitations invitation = new Invitations();
        invitation.setIsPasswordProtected(isPasswordProtected);
        if (isPasswordProtected){
          invitation.setInvitationpass(ManageCryptStyle.getInstance().getInstanceOfCrypt().createPassPhrase(invitationpass));
        }
       
        invitation.setInvitationWasUsed(false);
       
        //valid period of Invitation
        if (valid == 1) {
          //endless
          invitation.setIsValidByTime(false);
          invitation.setCanBeUsedOnlyOneTime(false);
        } else if (valid == 2){
          //period
          invitation.setIsValidByTime(true);
          invitation.setCanBeUsedOnlyOneTime(false);
         
          //This has to be in the Server's time cause otherwise it is not
          //in the correct time-zone for the comparison later on if the invitation is still valid
          // and subtract 5 minutes for users to access early
         
//          Calendar cal = Calendar.getInstance();
//          int offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
//         
//          log.debug("addAppointment offset :: "+offset);
//         
//          Date appointmentstart = new Date(gmtTimeStart.getTime() + offset);
//          Date appointmentend = new Date(gmtTimeEnd.getTime() + offset);
//         
//          Date gmtTimeStartShifted = new Date(appointmentstart.getTime() - ( 5 * 60 * 1000 ) );
         
          Date gmtTimeStartShifted = new Date(gmtTimeStart.getTime() - ( 5 * 60 * 1000 ) );
         
          invitation.setValidFrom(gmtTimeStartShifted);
          invitation.setValidTo(gmtTimeEnd)
        } else {
          //one-time
          invitation.setIsValidByTime(false);
          invitation.setCanBeUsedOnlyOneTime(true);
          invitation.setInvitationWasUsed(false);
        }
       
        invitation.setDeleted("false");
       
        Users us = UsersDaoImpl.getInstance().getUser(createdBy);
        String hashRaw = "InvitationHash"+(System.currentTimeMillis());
        log.debug("addInvitationIcalLink : rawHash = " + hashRaw);
        invitation.setHash(MD5.do_checksum(hashRaw));
       
        invitation.setInvitedBy(us);
        invitation.setBaseUrl(baseurl);
        invitation.setInvitedname(username);
        invitation.setInvitedEMail(email);
        invitation.setRoom(Roommanagement.getInstance().getRoomById(rooms_id));
        invitation.setConferencedomain(conferencedomain);
        invitation.setStarttime(new Date());
        invitation.setAppointmentId(appointmentId);
       
        Object idf = PersistenceSessionUtil.createSession();
        EntityManager session = PersistenceSessionUtil.getSession();
        EntityTransaction tx = session.getTransaction();
        tx.begin();
        invitation = session.merge(invitation);
        session.flush();
        long invitationId = invitation.getInvitations_id();
        tx.commit();
        PersistenceSessionUtil.closeSession(idf);
       
        if (invitationId > 0) {
          this.sendInvitionIcalLink(username, message, baseurl,
              email, subject, invitation.getHash(),
              appointMentId, createdBy, invitor, language_id,
              validFrom, validTo, jNameTimeZone);
          return invitationId;
        }
      }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("deleted", "true");
      query.setParameter("invid",invId);
 
      Invitations inv = null;
      try {
        inv = (Invitations) query.getSingleResult();
        } catch (NoResultException ex) {
        }
        session.flush();
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("deleted", "true");
      query.setParameter("invid",invId);
 
      Invitations inv = null;
      try {
        inv = (Invitations) query.getSingleResult();
        } catch (NoResultException ex) {
        }
        session.flush();
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("hashCode", hashCode);
      query.setParameter("deleted", "false");
      Invitations invitation = null;
      try {
        invitation = (Invitations) query.getSingleResult();
        } catch (NoResultException ex) {
        }
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      if (invitation == null) {
        //already deleted or does not exist
        return new Long(-31);
      } else {
        if (invitation.getCanBeUsedOnlyOneTime()){
         
          //do this only if the user tries to get the Invitation, not while checking the PWD
          if (hidePass) {
            //one-time invitation
            if (invitation.getInvitationWasUsed()){
              //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.setInvitationWasUsed(true);
              this.updateInvitation(invitation);
              //invitation.setInvitationpass(null);
              return invitation;
            }
          } else {
            return invitation;
          }

        } else if (invitation.getIsValidByTime()){
          Date today = new Date();
         
          Calendar cal = Calendar.getInstance();
          int offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);
         
          log.debug("addAppointment offset :: "+offset);
         
          Date appointmentstart = new Date(invitation.getValidFrom().getTime() + offset);
          Date appointmentend = new Date(invitation.getValidTo().getTime() + offset);
         
          if (appointmentstart.getTime() <= today.getTime()
              && appointmentend.getTime() >= today.getTime()) {
            this.updateInvitation(invitation);
            //invitation.setInvitationpass(null);
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

  public Object checkInvitationPass(String hashCode, String pass){
    try {
      Object obj = this.getInvitationByHashCode(hashCode, false);
      log.debug("checkInvitationPass - obj: "+obj);
      if (obj instanceof Invitations){
        Invitations invitation = (Invitations) obj;
       
//        log.debug("invitationId "+invitation.getInvitations_id());
//        log.debug("pass "+pass);
//        log.debug("getInvitationpass "+invitation.getInvitationpass());
       
        if (ManageCryptStyle.getInstance().getInstanceOfCrypt().verifyPassword(pass, invitation.getInvitationpass())){
          return new Long(1);
        } else {
          return new Long(-34);
        }
      } else {
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

      if(point.getRemind().getTypId() == 1){
        log.debug("no reminder required");
      } else if(point.getRemind().getTypId() == 2){
        log.debug("Reminder for Appointment : simple email");
       
        Invitations invitation = Invitationmanagement.getInstance().addInvitationLink(
              new Long(2), //userlevel
              firstname + " " + lastname, //username
              message,
              baseUrl, // baseURl
              email, //email
              labelid1151.getValue() + " " + point.getAppointmentName(), //subject
              point.getRoom().getRooms_id(), // room_id
              "public",
              isPasswordProtected, // passwordprotected
              password, // invitationpass
              2, // valid type
              starttime, // valid from
              endtime, // valid to
              meeting_organizer, // created by
              baseUrl, language_id,
              true, //really send mail sendMail
              point.getAppointmentStarttime(),
              point.getAppointmentEndtime(),
              point.getAppointmentId()
            );
       
        invitationId = invitation.getInvitations_id();
       
      } else if(point.getRemind().getTypId() == 3){
        log.debug("Reminder for Appointment : iCal mail");
       
        System.out.println("5"+starttime);
        System.out.println("6"+endtime);
       
        invitationId = Invitationmanagement.getInstance().addInvitationIcalLink(new Long(2), //userlevel
              firstname + " " + lastname, //username
              message,
              baseUrl, // baseURl
              email, //email
              labelid1151.getValue() + " " + point.getAppointmentName(), //subject
              point.getRoom().getRooms_id(), // room_id
              "public",
              isPasswordProtected, // passwordprotected
              password, // invitationpass
              2, // valid
              starttime, // valid from
              endtime, // valid to
              meeting_organizer, // created by
              point.getAppointmentId(),
              member.getInvitor(), language_id,
              jNameTimeZone,
              point.getAppointmentStarttime(),
              point.getAppointmentEndtime(),
              point.getAppointmentId()
            );
       
      }
     
      // Setting InvitationId within MeetingMember
     
      if(invitationId != null){
        Invitations invi = Invitationmanagement.getInstance().getInvitationbyId(invitationId);
     
        member.setInvitation(invi);
       
        updateMeetingMember(member);
       
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.invitation.Invitations

      log.debug("addAppointment offset :: "+offset);
     
      Date gmtTimeStart = new Date(dFrom.getTime() - offset);
      Date gmtTimeEnd = new Date(dTo.getTime() - offset);
       
        Invitations invitation =  Invitationmanagement.getInstance().addInvitationLink(
                        user_level, username, message,
                        baseurl, email, subject, room_id, conferencedomain,
                        isPasswordProtected, invitationpass,
                        valid, dFrom, dTo, users_id, baseurl, language_id, true,
                        gmtTimeStart, gmtTimeEnd, null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.