use of org.kuali.kfs.kim.impl.identity.type.EntityTypeContactInfo in project cu-kfs by CU-CommunityApps.
the class DisbursementVoucherDocument method getNonDefaultAddress.
/**
* Finds the address for the given employee, matching the type in the
* KFS-FP / Disbursement Voucher/ DEFAULT_EMPLOYEE_ADDRESS_TYPE parameter, to use as the address for the employee
*
* @param employee the employee to find a non-default address for
* @return the non-default address, or null if not found
*/
protected EntityAddress getNonDefaultAddress(Person employee) {
final String addressType = getParameterService().getParameterValueAsString(DisbursementVoucherDocument.class, FPParameterConstants.DEFAULT_EMPLOYEE_ADDRESS_TYPE);
final Entity entity = getIdentityService().getEntityByPrincipalId(employee.getPrincipalId());
if (entity != null) {
final EntityTypeContactInfo entityEntityType = getPersonEntityEntityType(entity);
if (entityEntityType != null) {
final List<EntityAddress> addresses = entityEntityType.getAddresses();
return findAddressByType(addresses, addressType);
}
}
return null;
}
use of org.kuali.kfs.kim.impl.identity.type.EntityTypeContactInfo in project cu-kfs by CU-CommunityApps.
the class PersonImpl method populateEntityInfo.
protected void populateEntityInfo(Entity entity, Principal principal, String personEntityTypeCode) {
if (entity != null) {
populatePrivacyInfo(entity);
EntityTypeContactInfo entityTypeContactInfoDefault = entity.getEntityTypeContactInfoByTypeCode(personEntityTypeCode);
entityTypeCode = personEntityTypeCode;
populateNameInfo(personEntityTypeCode, entity, principal);
populateAddressInfo(entityTypeContactInfoDefault);
populateEmailInfo(entityTypeContactInfoDefault);
populatePhoneInfo(entityTypeContactInfoDefault);
populateAffiliationInfo(entity);
populateEmploymentInfo(entity);
populateExternalIdentifiers(entity);
populateFullEntityInfo();
}
}
use of org.kuali.kfs.kim.impl.identity.type.EntityTypeContactInfo in project cu-kfs by CU-CommunityApps.
the class DisbursementVoucherDocument method getPersonEntityEntityType.
/**
* Lazy loop through the entity entity types in the given KimEntityInfo and return the one who has the type of
* "PERSON"
*
* @param entity the entity info to loop through entity entity types of
* @return a found entity entity type or null if a PERSON entity entity type is not associated with the given
* KimEntityInfo record
*/
protected EntityTypeContactInfo getPersonEntityEntityType(Entity entity) {
final List<EntityTypeContactInfo> entityEntityTypes = entity.getEntityTypeContactInfos();
int count = 0;
EntityTypeContactInfo foundInfo = null;
while (count < entityEntityTypes.size() && foundInfo == null) {
if (entityEntityTypes.get(count).getEntityTypeCode().equals(KimConstants.EntityTypes.PERSON)) {
foundInfo = entityEntityTypes.get(count);
}
count += 1;
}
return foundInfo;
}
Aggregations