本文整理汇总了Java中org.kuali.rice.kim.api.identity.entity.EntityDefault类的典型用法代码示例。如果您正苦于以下问题:Java EntityDefault类的具体用法?Java EntityDefault怎么用?Java EntityDefault使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityDefault类属于org.kuali.rice.kim.api.identity.entity包,在下文中一共展示了EntityDefault类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: build
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
public EntityDefault build() {
if (entityId == null) entityId = UUID.randomUUID().toString();
if (principalId == null) principalId = UUID.randomUUID().toString();
if (principalName == null) principalName = principalId;
if (active == null) active = true;
Principal.Builder principal = Principal.Builder.create(principalName);
principal.setActive(active);
principal.setEntityId(entityId);
principal.setPrincipalId(principalId);
EntityDefault.Builder kedi = EntityDefault.Builder.create();
kedi.setPrincipals(Collections.singletonList(principal));
kedi.setEntityId(entityId);
return kedi.build();
}
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:IdentityCurrentAndArchivedServiceTest.java
示例2: testGetEntityDefault
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
@Test
public void testGetEntityDefault() throws Exception {
MinimalKEDIBuilder builder = new MinimalKEDIBuilder("bogususer");
builder.setEntityId("bogususer");
EntityDefault bogusUserInfo = builder.build();
//Create a record in KRIM_ENTITY_CACHE_T
identityArchiveService.saveEntityDefaultToArchive(bogusUserInfo);
identityArchiveService.flushToArchive();
// retrieve using the archiveService to make sure its in the KRIM_ENTITY_CACHE_T
EntityDefault retrieved = identityArchiveService.getEntityDefaultFromArchiveByPrincipalId(
builder.getPrincipalId());
assertNotNull("no value retrieved for principalId: " + retrieved.getPrincipals().get(0).getPrincipalId(), retrieved);
// retrieve it using the identity current and archived Service should not use cache
retrieved = identityService.getEntityDefaultByPrincipalId("bogususer");
assertNotNull("no value retrieved for principalId: " + retrieved.getPrincipals().get(0).getPrincipalId(), retrieved);
// retrieve again - should use cache
EntityDefault retrieveAgain = identityService.getEntityDefaultByPrincipalId("bogususer");
assertNotNull("no value retrieved for principalId: " + retrieveAgain.getPrincipals().get(0).getPrincipalId(), retrieveAgain);
}
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:IdentityCurrentAndArchivedServiceTest.java
示例3: getEntityDefault
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
public EntityDefault getEntityDefault(String entityId) {
if (entityId == null) {
return null;
}
Map<String, Object> criteria = new HashMap();
criteria.put(getKimConstants().getKimLdapIdProperty(), entityId);
List<EntityDefault> results = search(EntityDefault.class, criteria);
debug("Got results from info lookup ", results, " with size ", results.size());
if (results.size() > 0) {
return results.get(0);
}
return null;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:LdapPrincipalDaoImpl.java
示例4: getPrincipalIdsString
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
/**
* This method builds a newline delimited String containing the identity's principal IDs in sorted order
*
* @param entity
* @return
*/
private String getPrincipalIdsString(EntityDefault entity) {
String result = "";
if (entity != null) {
List<Principal> principals = entity.getPrincipals();
if (principals != null) {
if (principals.size() == 1) { // one
result = principals.get(0).getPrincipalId();
} else { // multiple
String [] ids = new String [principals.size()];
int insertIndex = 0;
for (Principal principal : principals) {
ids[insertIndex++] = principal.getPrincipalId();
}
Arrays.sort(ids);
result = StringUtils.join(ids, "\n");
}
}
}
return result;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:IdentityArchiveServiceImpl.java
示例5: createTestingEntity
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
protected EntityDefault createTestingEntity() {
IdentityManagementPersonDocument personDoc = initPersonDoc();
WorkflowDocument document = WorkflowDocumentFactory.createDocument(adminPerson.getPrincipalId(),"TestDocumentType");
DocumentHeader documentHeader = new DocumentHeader();
documentHeader.setWorkflowDocument(document);
documentHeader.setDocumentNumber(document.getDocumentId());
personDoc.setDocumentHeader(documentHeader);
// first - save them so we can inactivate them
uiDocumentService.saveEntityPerson(personDoc);
// verify that the record was saved
EntityDefault entity = KimApiServiceLocator.getIdentityService().getEntityDefault(personDoc.getEntityId());
assertNotNull( "Entity was not saved: " + personDoc, entity);
assertNotNull( "Principal list was null on retrieved record", entity.getPrincipals() );
assertEquals( "Principal list was incorrect length", 1, entity.getPrincipals().size() );
assertTrue( "Principal is not active on saved record", entity.getPrincipals().get(0).isActive() );
return entity;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:UiDocumentServiceImplTest.java
示例6: findEntityDefaults
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
@Override
public EntityDefaultQueryResults findEntityDefaults(
QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException {
incomingParamCheck(queryByCriteria, "queryByCriteria");
QueryResults<EntityBo> results = dataObjectService.findMatching(EntityBo.class, queryByCriteria);
EntityDefaultQueryResults.Builder builder = EntityDefaultQueryResults.Builder.create();
builder.setMoreResultsAvailable(results.isMoreResultsAvailable());
builder.setTotalRowCount(results.getTotalRowCount());
final List<EntityDefault.Builder> ims = new ArrayList<EntityDefault.Builder>();
for (EntityBo bo : results.getResults()) {
ims.add(EntityDefault.Builder.create(bo));
}
builder.setResults(ims);
return builder.build();
}
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:IdentityServiceImpl.java
示例7: getPerson
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
/**
* @see org.kuali.rice.kim.api.identity.PersonService#getPerson(java.lang.String)
*/
@Override
public Person getPerson(String principalId) {
if ( StringUtils.isBlank(principalId) ) {
return null;
}
// get the corresponding principal
final Principal principal = getIdentityService().getPrincipal( principalId );
// get the identity
if ( principal != null ) {
final EntityDefault entity = getIdentityService().getEntityDefault(principal.getEntityId());
// convert the principal and identity to a Person
// skip if the person was created from the DB cache
if (entity != null ) {
return convertEntityToPerson( entity, principal );
}
}
return null;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:PersonServiceImpl.java
示例8: convertEntityToPerson
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
protected PersonImpl convertEntityToPerson( EntityDefault entity, Principal principal ) {
try {
// get the EntityEntityType for the EntityType corresponding to a Person
for ( String entityTypeCode : personEntityTypeCodes ) {
EntityTypeContactInfoDefault entType = entity.getEntityType( entityTypeCode );
// if no "person" identity type present for the given principal, skip to the next type in the list
if ( entType == null ) {
continue;
}
// attach the principal and identity objects
// PersonImpl has logic to pull the needed elements from the KimEntity-related classes
return new PersonImpl( principal, entity, entityTypeCode );
}
return null;
} catch ( Exception ex ) {
// allow runtime exceptions to pass through
if ( ex instanceof RuntimeException ) {
throw (RuntimeException)ex;
}
throw new RuntimeException( "Problem building person object", ex );
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:PersonServiceImpl.java
示例9: getPersonByPrincipalName
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
/**
* @see org.kuali.rice.kim.api.identity.PersonService#getPersonByPrincipalName(java.lang.String)
*/
@Override
public Person getPersonByPrincipalName(String principalName) {
if ( StringUtils.isBlank(principalName) ) {
return null;
}
// get the corresponding principal
final Principal principal = getIdentityService().getPrincipalByPrincipalName( principalName );
// get the identity
if ( principal != null ) {
final EntityDefault entity = getIdentityService().getEntityDefault(principal.getEntityId());
// convert the principal and identity to a Person
if ( entity != null ) {
return convertEntityToPerson( entity, principal );
}
}
return null;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:PersonServiceImpl.java
示例10: getPersonByEmployeeId
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
@Override
public Person getPersonByEmployeeId(String employeeId) {
if ( StringUtils.isBlank( employeeId ) ) {
return null;
}
final List<Person> people = findPeople(Collections.singletonMap(KIMPropertyConstants.Person.EMPLOYEE_ID,
employeeId));
if ( !people.isEmpty() ) {
return people.get(0);
}
// If no person was found above, check for inactive records
EntityDefault entity = getIdentityService().getEntityDefaultByEmployeeId(employeeId);
if (entity != null) {
if ( !entity.getPrincipals().isEmpty() ) {
Principal principal = getIdentityService().getPrincipal(entity.getPrincipals().get(0).getPrincipalId());
if (principal != null) {
return convertEntityToPerson( entity, principal );
}
}
}
return null;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:PersonServiceImpl.java
示例11: populateEmploymentInfo
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
protected void populateEmploymentInfo( EntityDefault entity ) {
if(entity!=null){
EntityEmployment employmentInformation = entity.getEmployment();
if ( employmentInformation != null ) {
employeeStatusCode = unNullify( employmentInformation.getEmployeeStatus() != null ? employmentInformation.getEmployeeStatus().getCode() : null);
employeeTypeCode = unNullify( employmentInformation.getEmployeeType() != null ? employmentInformation.getEmployeeType().getCode() : null);
primaryDepartmentCode = unNullify( employmentInformation.getPrimaryDepartmentCode() );
employeeId = unNullify( employmentInformation.getEmployeeId() );
if ( employmentInformation.getBaseSalaryAmount() != null ) {
baseSalaryAmount = employmentInformation.getBaseSalaryAmount();
} else {
baseSalaryAmount = KualiDecimal.ZERO;
}
} else {
employeeStatusCode = "";
employeeTypeCode = "";
primaryDepartmentCode = "";
employeeId = "";
baseSalaryAmount = KualiDecimal.ZERO;
}
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:PersonImpl.java
示例12: build
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
public EntityDefault build() {
if (entityId == null) entityId = UUID.randomUUID().toString();
if (principalId == null) principalId = UUID.randomUUID().toString();
if (principalName == null) principalName = principalId;
if (active == null) active = true;
Principal.Builder principal = Principal.Builder.create(principalName);
principal.setActive(active);
principal.setEntityId(entityId);
principal.setPrincipalId(principalId);
EntityDefault.Builder kedi = EntityDefault.Builder.create();
kedi.setPrincipals(Collections.singletonList(principal));
kedi.setEntityId(entityId);
return kedi.build();
}
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:IdentityArchiveServiceTest.java
示例13: getMemberFullName
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
public String getMemberFullName(MemberType memberType, String memberId){
if(memberType == null || StringUtils.isEmpty(memberId)) {
return "";
}
if(MemberType.PRINCIPAL.equals(memberType)){
EntityDefault principalInfo = getIdentityService().getEntityDefaultByPrincipalId(memberId);
if (principalInfo != null && principalInfo.getName() != null ) {
return principalInfo.getName().getFirstName() + " " + principalInfo.getName().getLastName();
}
} else if(MemberType.GROUP.equals(memberType)){
Group group = (Group) getMember(memberType, memberId);
if (group != null) {
return group.getName();
}
} else if(MemberType.ROLE.equals(memberType)){
Role role = (Role) getMember(memberType, memberId);
if ( role != null ) {
return role.getName();
}
}
return "";
}
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:UiDocumentServiceImpl.java
示例14: testGetEntityDefaultByPrincipalName
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
@Test
public void testGetEntityDefaultByPrincipalName() {
EntityDefault entity = identityService.getEntityDefaultByPrincipalName("williamh");
assertNotNull("Entity must not be null", entity);
assertEquals("Entity name matched expected result", "williamh", entity.getPrincipals().get(0)
.getPrincipalName());
}
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:LDAPIdentityServiceImplTest.java
示例15: testGetEntityDefault
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
@Test
public void testGetEntityDefault() {
EntityDefault entity = identityService.getEntityDefault("williamh");
assertNotNull("Entity must not be null", entity);
assertEquals("Entity name matched expected result", "williamh", entity.getPrincipals().get(0)
.getPrincipalName());
}
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:LDAPIdentityServiceImplTest.java
示例16: getEntityDefaultFromArchiveByPrincipalId
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
@Override
public EntityDefault getEntityDefaultFromArchiveByPrincipalId(String principalId) {
if (StringUtils.isBlank(principalId)) {
throw new IllegalArgumentException("principalId is blank");
}
EntityDefaultInfoCacheBo cachedValue = dataObjectService.find(EntityDefaultInfoCacheBo.class, principalId);
return (cachedValue == null) ? null : cachedValue.convertCacheToEntityDefaultInfo();
}
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:IdentityArchiveServiceImpl.java
示例17: testGetEntityDefaultByPrincipalId
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
@Test
public void testGetEntityDefaultByPrincipalId() {
EntityDefault entity = identityService.getEntityDefaultByPrincipalId("williamh");
assertNotNull("Entity must not be null", entity);
assertEquals("Entity name matched expected result", "williamh", entity.getPrincipals().get(0)
.getPrincipalName());
}
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:LDAPIdentityServiceImplTest.java
示例18: saveEntityDefaultToArchive
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
@Override
public void saveEntityDefaultToArchive(EntityDefault entity) {
if (entity == null) {
throw new IllegalArgumentException("entity is blank");
}
// if the max size has been reached, schedule now
if (getMaxWriteQueueSize() <= writeQueue.offerAndGetSize(entity) /* <- this enqueues the KEDI */ &&
writer.requestSubmit()) {
KSBServiceLocator.getThreadPool().execute(maxQueueSizeExceededWriter);
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:IdentityArchiveServiceImpl.java
示例19: processCustomSaveDocumentBusinessRules
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
@Override
protected boolean processCustomSaveDocumentBusinessRules(Document document) {
if (!(document instanceof IdentityManagementPersonDocument)) {
return false;
}
IdentityManagementPersonDocument personDoc = (IdentityManagementPersonDocument)document;
boolean valid = true;
GlobalVariables.getMessageMap().addToErrorPath(KRADConstants.DOCUMENT_PROPERTY_NAME);
//KRADServiceLocatorInternal.getDictionaryValidationService().validateDocument(document);
getDictionaryValidationService().validateDocumentAndUpdatableReferencesRecursively(document, getMaxDictionaryValidationDepth(), true, false);
valid &= validDuplicatePrincipalName(personDoc);
EntityDefault origEntity = getIdentityService().getEntityDefault(personDoc.getEntityId());
boolean isCreatingNew = origEntity==null?true:false;
if(canModifyEntity(GlobalVariables.getUserSession().getPrincipalId(), personDoc.getPrincipalId()) || isCreatingNew) {
valid &= validateEntityInformation(isCreatingNew, personDoc);
}
// kimtypeservice.validateAttributes is not working yet.
valid &= validateRoleQualifier (personDoc.getRoles());
valid &= validateDelegationMemberRoleQualifier(personDoc.getDelegationMembers());
if (StringUtils.isNotBlank(personDoc.getPrincipalName())) {
valid &= doesPrincipalNameExist (personDoc.getPrincipalName(), personDoc.getPrincipalId());
}
valid &= validActiveDatesForRole (personDoc.getRoles());
valid &= validActiveDatesForGroup (personDoc.getGroups());
valid &= validActiveDatesForDelegations (personDoc.getDelegationMembers());
// all failed at this point.
// valid &= checkUnassignableRoles(personDoc);
// valid &= checkUnpopulatableGroups(personDoc);
GlobalVariables.getMessageMap().removeFromErrorPath(KRADConstants.DOCUMENT_PROPERTY_NAME);
return valid;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:40,代码来源:IdentityManagementPersonDocumentRule.java
示例20: testInactivatePrincipalDelegations
import org.kuali.rice.kim.api.identity.entity.EntityDefault; //导入依赖的package包/类
@Test
public void testInactivatePrincipalDelegations() {
EntityDefault entity = createTestingEntity();
// create a delegation for the system to inactivate
String delegateMemberId = UUID.randomUUID().toString();
DelegateMemberBo delegateMemberBo = new DelegateMemberBo();
delegateMemberBo.setMemberId(entity.getPrincipals().get(0).getPrincipalId());
delegateMemberBo.setType(MemberType.PRINCIPAL);
delegateMemberBo.setDelegationMemberId(delegateMemberId);
KradDataServiceLocator.getDataObjectService().save(delegateMemberBo,PersistenceOption.FLUSH);
// attempt to reload - to make sure it's all working
delegateMemberBo = KradDataServiceLocator.getDataObjectService().find(DelegateMemberBo.class, delegateMemberId);
assertNotNull( "Unable to find delegate member bo", delegateMemberBo);
assertTrue( "delegate member should be active", delegateMemberBo.isActive() );
// create a new person document and inactivate the record we just created
IdentityManagementPersonDocument personDoc = initPersonDoc();
WorkflowDocument document = WorkflowDocumentFactory.createDocument(adminPerson.getPrincipalId(),"TestDocumentType");
DocumentHeader documentHeader = new DocumentHeader();
documentHeader.setWorkflowDocument(document);
documentHeader.setDocumentNumber(document.getDocumentId());
personDoc.setDocumentHeader(documentHeader);
personDoc.setActive(false);
uiDocumentService.saveEntityPerson(personDoc);
delegateMemberBo = KradDataServiceLocator.getDataObjectService().find(DelegateMemberBo.class, delegateMemberId);
assertNotNull( "Unable to find delegate member bo", delegateMemberBo);
assertFalse( "delegate member should be inactive: " + delegateMemberBo, delegateMemberBo.isActive() );
}
开发者ID:kuali,项目名称:kc-rice,代码行数:34,代码来源:UiDocumentServiceImplTest.java
注:本文中的org.kuali.rice.kim.api.identity.entity.EntityDefault类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论