Examples of UserContact


Examples of org.apache.openmeetings.persistence.beans.user.UserContact

      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManager.getUserLevelByID(users_id);
      // users only
      if (authLevelUtil.checkUserLevel(user_level)) {

        UserContact userContacts = userContactsDao
            .getUserContacts(userContactId);

        if (userContacts == null) {
          return -49;
        }
View Full Code Here

Examples of org.apache.openmeetings.persistence.beans.user.UserContact

      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManager.getUserLevelByID(users_id);
      // users only
      if (authLevelUtil.checkUserLevel(user_level)) {

        UserContact userContacts = userContactsDao
            .getUserContacts(userContactId);

        if (userContacts == null) {
          return -46L;
        }

        if (userContacts.getPending() != null
            && !userContacts.getPending()) {
          return -47L;
        }

        if (pending) {

          userContactsDao.updateContactStatus(userContactId, false);

          userContacts = userContactsDao
              .getUserContacts(userContactId);

          userContactsDao.addUserContact(userContacts.getOwner()
              .getUser_id(), users_id, false, "");

          User user = userContacts.getOwner();

          if (user.getAdresses() != null) {

            Long language_id = user.getLanguage_id();
            if (language_id == null) {
              language_id = configurationDao.getConfValue("default_lang_id", Long.class, "1");
            }

            String message = "";

            Fieldlanguagesvalues fValue1192 = fieldManager
                .getFieldByIdAndLanguage(1192L, language_id);
            Fieldlanguagesvalues fValue1198 = fieldManager
                .getFieldByIdAndLanguage(1198L, language_id);

            message += fValue1192.getValue() + " "
                + user.getFirstname() + " "
                + user.getLastname() + "<br/><br/>";
            message += userContacts.getContact().getFirstname()
                + " " + userContacts.getContact().getLastname()
                + " " + fValue1198.getValue();

            String template = requestContactConfirmTemplate
                .getRequestContactTemplate(message);

            privateMessagesDao.addPrivateMessage(
                user.getFirstname() + " " + user.getLastname()
                    + " " + fValue1198.getValue(), message,
                0L, userContacts.getContact(), user, user,
                false, null, false, 0L, user.getAdresses()
                    .getEmail());

            mailHandler.send(user.getAdresses().getEmail(),
                userContacts.getContact().getFirstname()
                    + " "
                    + userContacts.getContact()
                        .getLastname() + " "
                    + fValue1198.getValue(), template);

          }
View Full Code Here

Examples of org.apache.openmeetings.persistence.beans.user.UserContact

      Long user_level = userManager.getUserLevelByID(users_id);

      // users only
      if (authLevelUtil.checkUserLevel(user_level)) {

        UserContact userContacts = userContactsDao
            .getUserContacts(userContactId);

        userContacts.setShareCalendar(shareCalendar);

        userContactsDao.updateContact(userContacts);

      }
View Full Code Here

Examples of org.apache.openmeetings.persistence.beans.user.UserContact

      registry.bind(User.class, new UserConverter(usersDao, usersMap));
     
      List<UserContact> list = readList(serializer, f, "userContacts.xml", "usercontacts", UserContact.class, true);
      for (UserContact uc : list) {
        Long ucId = uc.getUserContactId();
        UserContact storedUC = userContactsDao.getUserContacts(ucId);

        if (storedUC == null && uc.getContact() != null && uc.getContact().getUser_id() != null) {
          uc.setUserContactId(0);
          Long newId = userContactsDao.addUserContactObj(uc);
          userContactsMap.put(ucId, newId);
View Full Code Here

Examples of org.apache.openmeetings.persistence.beans.user.UserContact

      registry.bind(User.class, new UserConverter(usersDao, usersMap));
     
      List<UserContact> list = readList(serializer, f, "userContacts.xml", "usercontacts", UserContact.class, true);
      for (UserContact uc : list) {
        Long ucId = uc.getUserContactId();
        UserContact storedUC = userContactsDao.getUserContacts(ucId);

        if (storedUC == null && uc.getContact() != null && uc.getContact().getUser_id() != null) {
          uc.setUserContactId(0);
          Long newId = userContactsDao.addUserContactObj(uc);
          userContactsMap.put(ucId, newId);
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.UserContact

        assertReflectionEquals(type, types.get(0));
    }

    @Test
    public void testGetContactById() {
        UserContact contact = ObjectsFactory.getDefaultUserContact();
        session.saveOrUpdate(contact.getOwner());
        session.saveOrUpdate(contact.getType());
        session.saveOrUpdate(contact);

        UserContact persisted = dao.getContactById(contact.getId());

        assertEquals(contact, persisted);
    }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.UserContact

            }
        }
        // Add new and edit existing contacts
        for (UserContactContainer contactContainer: contacts) {
            UserContactType actualType = get(contactContainer.getTypeId());
            UserContact contact = contactContainer.getId() == null ? null
                    : this.getDao().getContactById(contactContainer.getId());
            if (contact != null && contact.getOwner().getId() == user.getId()) {
                contact.setValue(contactContainer.getValue());
                contact.setType(actualType);
            } else {
                contact = new UserContact(contactContainer.getValue(), actualType);
                user.addContact(contact);
            }
        }
        return user;
    }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.UserContact

     * @return added contacts as contact containers
     */
    private static List<UserContactContainer> addContactsToUser(JCUser user, long contactsCount, long contactTypeId) {
        List<UserContactContainer> contacts = new ArrayList<>();
        for (int i = 0; i < contactsCount; i++) {
            UserContact contact = new UserContact("contact" + i, createUserContactType(contactTypeId));
            contact.setId(user.getContacts().size() + 1);
            user.addContact(contact);
            contacts.add(new UserContactContainer(contact.getId(), contact.getValue(), contact.getType().getId()));
        }
        return contacts;
    }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.UserContact

*/
public class UserContactDtoTest {

  @Test
  public void testCreateFromUserContact() {
      UserContact userContact = prepareUserContact();
    //create
    UserContactDto contactDto = new UserContactDto(userContact);
    //check content
    assertEquals(contactDto.getValue(), userContact.getValue(),
        "The problem of copying data. Value - value.");
    assertEquals(contactDto.getId(), Long.valueOf(userContact.getId()),
        "The problem of copying data. Value - Id.");
    assertEquals(contactDto.getType().getId(), userContact.getType().getId(),
        "The problem of copying data. Value - type.");
  }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.UserContact

        //prepare help test values
        UserContactType contactType = new UserContactType();
        JCUser user = new JCUser("username", "email", "password");
        user.setId(1);
        //init main test value
        UserContact userContact = new UserContact("10-10-10", contactType);
        userContact.setOwner(user);
        return userContact;
    }
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.