Examples of UserContacts


Examples of com.cloudsponge.model.UserContacts

    return progressEvents;
  }

  @Override
  public UserContacts parseContacts(String contents) {
    final UserContacts userContacts = new UserContacts();
    parsetUserContacts(userContacts, getDocumentRoot(contents));

    return userContacts;
  }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.user.UserContacts

    UserContactsDaoImpl  contactDaoImpl = UserContactsDaoImpl.getInstance();
   
    assertNotNull("Cann't access to contacts dao implimentation", contactDaoImpl);
    Long id = contactDaoImpl.addUserContact(1L, 1L, false, "");
    assertTrue("New contact cann't added", id > 0);
    UserContacts userContact = contactDaoImpl.getUserContacts(id);

    assertTrue("Contact should be the same with user", userContact.getContact().equals(Usermanagement.getInstance().getUserById(id)));
   
  }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.user.UserContacts

   
    List<UserContacts> ucList = this.getUserContactsByXML(userContactsFile);
   
    for (UserContacts uc : ucList) {
      Long userContactId = uc.getUserContactId();
      UserContacts storedUC = UserContactsDaoImpl.getInstance().getUserContacts(userContactId);
     
      if (storedUC == null){
        uc.setUserContactId(0);
        Long newId = UserContactsDaoImpl.getInstance().addUserContactObj(uc);
        this.userContactsMap.put(userContactId, newId);
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.user.UserContacts

                Users owner = Usermanagement.getInstance().getUserById(getNewId(importLongType(unformatString(usercontact.element("owner").getText())), Maps.USERS));
                Boolean pending = importBooleanType(unformatString(usercontact.element("pending").getText()));
                Boolean shareCalendar = importBooleanType(unformatString(usercontact.element("shareCalendar").getText()));
                Long userContactId = importLongType(unformatString(usercontact.element("userContactId").getText()));
               
                UserContacts userContacts = new UserContacts();
                userContacts.setHash(hash);
                userContacts.setContact(contact);
                userContacts.setOwner(owner);
                userContacts.setPending(pending);
                userContacts.setShareCalendar(shareCalendar);
                userContacts.setUserContactId(userContactId);
               
                ucList.add(userContacts);
               
              }
             
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.user.UserContacts

    Element root = document.addElement("root");
   
    Element usercontacts = root.addElement("usercontacts");
   
    for (Iterator<UserContacts> it = userContacts.iterator();it.hasNext();) {
      UserContacts uc = it.next();
     
      Element usercontact = usercontacts.addElement("usercontact");
     
      usercontact.addElement("userContactId").addCDATA(formatString(""+uc.getUserContactId()));
      usercontact.addElement("hash").addCDATA(formatString(""+uc.getHash()));
      if (uc.getContact() != null) {
        usercontact.addElement("contact").addCDATA(formatString(""+uc.getContact().getUser_id()));
      } else {
        usercontact.addElement("contact").addCDATA("0");
      }
      if (uc.getOwner() != null) {
        usercontact.addElement("owner").addCDATA(formatString(""+uc.getOwner().getUser_id()));
      } else {
        usercontact.addElement("owner").addCDATA("0");
      }
      usercontact.addElement("pending").addCDATA(formatString(""+uc.getPending()));
      usercontact.addElement("shareCalendar").addCDATA(formatString(""+uc.getShareCalendar()));
     
    }
 
    return document;
  }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.user.UserContacts

  }
 
  public Long addUserContact(Long user_id, Long ownerId, Boolean pending, String hash) {
    try {
     
      UserContacts userContact = new UserContacts();
      userContact.setInserted(new Date());
      userContact.setOwner(Usermanagement.getInstance().getUserById(ownerId));
      userContact.setContact(Usermanagement.getInstance().getUserById(user_id));
      userContact.setPending(pending);
      userContact.setHash(hash);
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
     
      userContact = session.merge(userContact);
      Long userContactId = userContact.getUserContactId();
     
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      return userContactId;     
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.user.UserContacts

      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("userContactId", userContactId);
      UserContacts userContacts = null;
      try {
        userContacts = (UserContacts) query.getSingleResult();
        } catch (NoResultException ex) {
        }
      tx.commit();
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.user.UserContacts

  }
 
  public Long updateContactStatus(Long userContactId, Boolean pending) {
    try {
     
      UserContacts userContacts = this.getUserContacts(userContactId);
     
      if (userContacts == null) {
        return null;
      }
      userContacts.setPending(pending);
      userContacts.setUpdated(new Date());
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      if (userContacts.getUserContactId() == 0) {
        session.persist(userContacts);
          } else {
            if (!session.contains(userContacts)) {
              session.merge(userContacts);
          }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.user.UserContacts

       Long users_id = Sessionmanagement.getInstance().checkSession(SID);
       Long user_level = Usermanagement.getInstance().getUserLevelByID(users_id);
       // users only
       if (AuthLevelmanagement.getInstance().checkUserLevel(user_level)) {
        
         UserContacts userContact = UserContactsDaoImpl.getInstance().getContactsByHash(hash);
        
         if (userContact == null) {
          
           log.error("changeUserContactByHash "+hash);
          
           return -48L;
         }
        
         if (userContact.getContact().getUser_id().equals(users_id)) {

           return this.changePendingStatusUserContacts(SID, userContact.getUserContactId(), status);
          
         } else {
           return -48L;
         }
        
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.user.UserContacts

       Long users_id = Sessionmanagement.getInstance().checkSession(SID);
       Long user_level = Usermanagement.getInstance().getUserLevelByID(users_id);
       // users only
       if (AuthLevelmanagement.getInstance().checkUserLevel(user_level)) {
        
         UserContacts userContacts = UserContactsDaoImpl.getInstance().getUserContacts(userContactId);
        
         if (userContacts == null) {
           return -46L;
         }
        
         if (userContacts.getPending() != null && !userContacts.getPending()) {
           return -47L;
         }
        
         return userContactId;
       }
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.