コード例 #1
0
  protected void updateLDAPUser(User ldapUser, Contact ldapContact, User user)
      throws PortalException, SystemException {

    Contact contact = user.getContact();

    ldapContact.setAimSn(GetterUtil.getString(contact.getAimSn()));
    ldapContact.setFacebookSn(GetterUtil.getString(contact.getFacebookSn()));
    ldapContact.setIcqSn(GetterUtil.getString(contact.getIcqSn()));
    ldapContact.setJabberSn(GetterUtil.getString(contact.getJabberSn()));
    ldapContact.setMale(GetterUtil.getBoolean(contact.getMale()));
    ldapContact.setMsnSn(GetterUtil.getString(contact.getMsnSn()));
    ldapContact.setMySpaceSn(GetterUtil.getString(contact.getMySpaceSn()));
    ldapContact.setPrefixId(GetterUtil.getInteger(contact.getPrefixId()));
    ldapContact.setSkypeSn(GetterUtil.getString(contact.getSkypeSn()));
    ldapContact.setSmsSn(GetterUtil.getString(contact.getSmsSn()));
    ldapContact.setSuffixId(GetterUtil.getInteger(contact.getSuffixId()));
    ldapContact.setTwitterSn(GetterUtil.getString(contact.getTwitterSn()));
    ldapContact.setYmSn(GetterUtil.getString(contact.getYmSn()));

    ldapUser.setComments(GetterUtil.getString(user.getComments()));
    ldapUser.setGreeting(GetterUtil.getString(user.getGreeting()));
    ldapUser.setJobTitle(GetterUtil.getString(user.getJobTitle()));
    ldapUser.setLanguageId(GetterUtil.getString(user.getLanguageId()));
    ldapUser.setMiddleName(GetterUtil.getString(user.getMiddleName()));
    ldapUser.setOpenId(GetterUtil.getString(user.getOpenId()));
    ldapUser.setTimeZoneId(GetterUtil.getString(user.getTimeZoneId()));
  }
コード例 #2
0
  @Indexable(type = IndexableType.REINDEX)
  @Override
  public Contact updateContact(
      long contactId,
      String emailAddress,
      String firstName,
      String middleName,
      String lastName,
      int prefixId,
      int suffixId,
      boolean male,
      int birthdayMonth,
      int birthdayDay,
      int birthdayYear,
      String smsSn,
      String aimSn,
      String facebookSn,
      String icqSn,
      String jabberSn,
      String msnSn,
      String mySpaceSn,
      String skypeSn,
      String twitterSn,
      String ymSn,
      String jobTitle)
      throws PortalException, SystemException {

    Date birthday =
        PortalUtil.getDate(
            birthdayMonth, birthdayDay, birthdayYear, ContactBirthdayException.class);

    Contact contact = contactPersistence.findByPrimaryKey(contactId);

    contact.setModifiedDate(new Date());
    contact.setEmailAddress(emailAddress);
    contact.setFirstName(firstName);
    contact.setMiddleName(middleName);
    contact.setLastName(lastName);
    contact.setPrefixId(prefixId);
    contact.setSuffixId(suffixId);
    contact.setMale(male);
    contact.setBirthday(birthday);
    contact.setSmsSn(smsSn);
    contact.setAimSn(aimSn);
    contact.setFacebookSn(facebookSn);
    contact.setIcqSn(icqSn);
    contact.setJabberSn(jabberSn);
    contact.setMsnSn(msnSn);
    contact.setMySpaceSn(mySpaceSn);
    contact.setSkypeSn(skypeSn);
    contact.setTwitterSn(twitterSn);
    contact.setYmSn(ymSn);
    contact.setJobTitle(jobTitle);

    contactPersistence.update(contact);

    return contact;
  }
コード例 #3
0
  /**
   * Converts the soap model instance into a normal model instance.
   *
   * @param soapModel the soap model instance to convert
   * @return the normal model instance
   */
  public static Contact toModel(ContactSoap soapModel) {
    if (soapModel == null) {
      return null;
    }

    Contact model = new ContactImpl();

    model.setContactId(soapModel.getContactId());
    model.setCompanyId(soapModel.getCompanyId());
    model.setUserId(soapModel.getUserId());
    model.setUserName(soapModel.getUserName());
    model.setCreateDate(soapModel.getCreateDate());
    model.setModifiedDate(soapModel.getModifiedDate());
    model.setClassNameId(soapModel.getClassNameId());
    model.setClassPK(soapModel.getClassPK());
    model.setAccountId(soapModel.getAccountId());
    model.setParentContactId(soapModel.getParentContactId());
    model.setEmailAddress(soapModel.getEmailAddress());
    model.setFirstName(soapModel.getFirstName());
    model.setMiddleName(soapModel.getMiddleName());
    model.setLastName(soapModel.getLastName());
    model.setPrefixId(soapModel.getPrefixId());
    model.setSuffixId(soapModel.getSuffixId());
    model.setMale(soapModel.getMale());
    model.setBirthday(soapModel.getBirthday());
    model.setSmsSn(soapModel.getSmsSn());
    model.setAimSn(soapModel.getAimSn());
    model.setFacebookSn(soapModel.getFacebookSn());
    model.setIcqSn(soapModel.getIcqSn());
    model.setJabberSn(soapModel.getJabberSn());
    model.setMsnSn(soapModel.getMsnSn());
    model.setMySpaceSn(soapModel.getMySpaceSn());
    model.setSkypeSn(soapModel.getSkypeSn());
    model.setTwitterSn(soapModel.getTwitterSn());
    model.setYmSn(soapModel.getYmSn());
    model.setEmployeeStatusId(soapModel.getEmployeeStatusId());
    model.setEmployeeNumber(soapModel.getEmployeeNumber());
    model.setJobTitle(soapModel.getJobTitle());
    model.setJobClass(soapModel.getJobClass());
    model.setHoursOfOperation(soapModel.getHoursOfOperation());

    return model;
  }
コード例 #4
0
  @Indexable(type = IndexableType.REINDEX)
  @Override
  public Contact addContact(
      long userId,
      String className,
      long classPK,
      String emailAddress,
      String firstName,
      String middleName,
      String lastName,
      int prefixId,
      int suffixId,
      boolean male,
      int birthdayMonth,
      int birthdayDay,
      int birthdayYear,
      String smsSn,
      String aimSn,
      String facebookSn,
      String icqSn,
      String jabberSn,
      String msnSn,
      String mySpaceSn,
      String skypeSn,
      String twitterSn,
      String ymSn,
      String jobTitle)
      throws PortalException, SystemException {

    User user = userPersistence.findByPrimaryKey(userId);
    Date birthday =
        PortalUtil.getDate(
            birthdayMonth, birthdayDay, birthdayYear, ContactBirthdayException.class);
    Date now = new Date();

    validate(className, classPK);

    long contactId = counterLocalService.increment();

    Contact contact = contactPersistence.create(contactId);

    contact.setCompanyId(user.getCompanyId());
    contact.setUserId(user.getUserId());
    contact.setUserName(user.getFullName());
    contact.setCreateDate(now);
    contact.setModifiedDate(now);
    contact.setClassName(className);
    contact.setClassPK(classPK);
    contact.setEmailAddress(emailAddress);
    contact.setFirstName(firstName);
    contact.setMiddleName(middleName);
    contact.setLastName(lastName);
    contact.setPrefixId(prefixId);
    contact.setSuffixId(suffixId);
    contact.setMale(male);
    contact.setBirthday(birthday);
    contact.setSmsSn(smsSn);
    contact.setAimSn(aimSn);
    contact.setFacebookSn(facebookSn);
    contact.setIcqSn(icqSn);
    contact.setJabberSn(jabberSn);
    contact.setMsnSn(msnSn);
    contact.setMySpaceSn(mySpaceSn);
    contact.setSkypeSn(skypeSn);
    contact.setTwitterSn(twitterSn);
    contact.setYmSn(ymSn);
    contact.setJobTitle(jobTitle);

    contactPersistence.update(contact);

    return contact;
  }