示例#1
0
  @Override
  protected void doDelete(Object obj) throws Exception {
    User user = (User) obj;

    deleteDocument(user.getCompanyId(), user.getUserId());

    Indexer indexer = IndexerRegistryUtil.nullSafeGetIndexer(Contact.class);

    Contact contact = new ContactImpl();

    contact.setContactId(user.getContactId());
    contact.setCompanyId(user.getCompanyId());

    indexer.delete(contact);
  }
  /**
   * 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;
  }