当前位置: 首页>>代码示例>>Java>>正文


Java DocumentHeader.setDocumentNumber方法代码示例

本文整理汇总了Java中org.kuali.rice.krad.bo.DocumentHeader.setDocumentNumber方法的典型用法代码示例。如果您正苦于以下问题:Java DocumentHeader.setDocumentNumber方法的具体用法?Java DocumentHeader.setDocumentNumber怎么用?Java DocumentHeader.setDocumentNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.krad.bo.DocumentHeader的用法示例。


在下文中一共展示了DocumentHeader.setDocumentNumber方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createTestingEntity

import org.kuali.rice.krad.bo.DocumentHeader; //导入方法依赖的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

示例2: testInactivatePrincipal

import org.kuali.rice.krad.bo.DocumentHeader; //导入方法依赖的package包/类
@Test
public void testInactivatePrincipal() {
    createTestingEntity();
    // 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);
    EntityDefault entity = KimApiServiceLocator.getIdentityService().getEntityDefault(personDoc.getEntityId());

    assertNotNull( "Entity missing after inactivation: " + personDoc, entity);
    assertNotNull( "Principal list was null on retrieved record", entity.getPrincipals() );
    assertEquals( "Principal list was incorrect length", 1, entity.getPrincipals().size() );
    assertFalse( "Principal is active on saved record (after inactivation)", entity.getPrincipals().get(0).isActive() );
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:UiDocumentServiceImplTest.java

示例3: testInactivatePrincipalDelegations

import org.kuali.rice.krad.bo.DocumentHeader; //导入方法依赖的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

示例4: testSaveToEntity

import org.kuali.rice.krad.bo.DocumentHeader; //导入方法依赖的package包/类
@Test
	public void testSaveToEntity() {
	    Person adminPerson = KimApiServiceLocator.getPersonService().getPersonByPrincipalName("admin");
		IdentityManagementPersonDocument personDoc = initPersonDoc();

		WorkflowDocument document = WorkflowDocumentFactory.createDocument(adminPerson.getPrincipalId(),"TestDocumentType");
        DocumentHeader documentHeader = new DocumentHeader();
        documentHeader.setWorkflowDocument(document);
        documentHeader.setDocumentNumber(document.getDocumentId());
        personDoc.setDocumentHeader(documentHeader);

		uiDocumentService.saveEntityPerson(personDoc);

		Entity entity = KimApiServiceLocator.getIdentityService().getEntity(personDoc.getEntityId());
        EntityTypeContactInfo entityType = entity.getEntityTypeContactInfos().get(0);
        personDoc.getExternalIdentifiers();
		assertAddressTrue(personDoc.getAddrs().get(0), entityType.getAddresses().get(0));
		assertPhoneTrue(personDoc.getPhones().get(0), entityType.getPhoneNumbers().get(0));
		assertEmailTrue(personDoc.getEmails().get(0), entityType.getEmailAddresses().get(0));
		assertNameTrue(personDoc.getNames().get(0), entity.getNames().get(0));
		assertPrincipalTrue(personDoc, entity.getPrincipals().get(0));

		assertAffiliationTrue(personDoc.getAffiliations().get(0), entity.getAffiliations().get(0));
		assertEmpInfoTrue(personDoc.getAffiliations().get(0).getEmpInfos().get(0), entity.getEmploymentInformation().get(0));

		//verify that update doesn't cause external identifier to be encrypted twice
		// and that update doesn't cause any problems
		uiDocumentService.saveEntityPerson(personDoc);
		Entity entity2 = ((IdentityService) KIMServiceLocatorInternal.getService("kimIdentityDelegateService")).getEntity(
                personDoc.getEntityId());
        EntityTypeContactInfo entityType2 = entity2.getEntityTypeContactInfos().get(0);
        personDoc.getExternalIdentifiers();
        assertAddressTrue(personDoc.getAddrs().get(0), entityType2.getAddresses().get(0));
        assertPhoneTrue(personDoc.getPhones().get(0), entityType2.getPhoneNumbers().get(0));
        assertEmailTrue(personDoc.getEmails().get(0), entityType2.getEmailAddresses().get(0));
        assertNameTrue(personDoc.getNames().get(0), entity2.getNames().get(0));
        assertPrincipalTrue(personDoc, entity2.getPrincipals().get(0));



		//		List<String> groupIds = groupService.getDirectMemberGroupIds("g1");
//		System.out.println( groupIds );
//		assertTrue( "g1 must contain group g2", groupIds.contains( "g2" ) );
//		assertFalse( "g1 must not contain group g3", groupIds.contains( "g3" ) );
//
//		groupIds = groupService.getDirectMemberGroupIds("g2");
//		System.out.println( groupIds );
//		assertTrue( "g2 must contain group g3", groupIds.contains( "g3" ) );
//		assertFalse( "g2 must not contain group g4 (inactive)", groupIds.contains( "g4" ) );

	}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:52,代码来源:UiDocumentServiceImplTest.java


注:本文中的org.kuali.rice.krad.bo.DocumentHeader.setDocumentNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。