本文整理汇总了Java中org.kuali.rice.kim.impl.type.KimTypeBo.setServiceName方法的典型用法代码示例。如果您正苦于以下问题:Java KimTypeBo.setServiceName方法的具体用法?Java KimTypeBo.setServiceName怎么用?Java KimTypeBo.setServiceName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kim.impl.type.KimTypeBo
的用法示例。
在下文中一共展示了KimTypeBo.setServiceName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initPersonDocRole
import org.kuali.rice.kim.impl.type.KimTypeBo; //导入方法依赖的package包/类
private PersonDocumentRole initPersonDocRole() throws Exception {
// Map pkMap = new HashMap();
// pkMap.put("roleId", "r1");
// PersonDocumentRole docRole = (PersonDocumentRole)uiDocumentService.getBusinessObjectService().findByPrimaryKey(PersonDocumentRole.class, pkMap);
PersonDocumentRole docRole = new PersonDocumentRole();
docRole.setKimTypeId("roleType1");
docRole.setRoleId("r1");
KimTypeBo kimType = new KimTypeBo();
kimType.setId("roleType1");
kimType.setServiceName("kimRoleTypeService");
List<KimTypeAttributeBo> attributeDefinitions = new ArrayList<KimTypeAttributeBo>();
KimTypeAttributeBo attr1 = KradDataServiceLocator.getDataObjectService().find(KimTypeAttributeBo.class, "kimAttr3");
// attr1.setKimAttributeId("kimAttrDefn2");
// attr1.setSortCode("a");
// attr1.setKimTypeAttributeId("kimAttr3");
attributeDefinitions.add(attr1);
// attr1 = new KimTypeAttributeBo();
// attr1.setKimAttributeId("kimAttrDefn3");
// attr1.setSortCode("b");
// attr1.setKimTypeAttributeId("kimAttr4");
KimTypeAttributeBo attr2 = KradDataServiceLocator.getDataObjectService().find(KimTypeAttributeBo.class, "kimAttr4");
attributeDefinitions.add(attr2);
kimType.setAttributeDefinitions(attributeDefinitions);
Field fld = PersonDocumentRole.class.getDeclaredField("kimRoleType");
fld.setAccessible(true);
fld.set(docRole, kimType);
return docRole;
}
示例2: initPersonDocRole
import org.kuali.rice.kim.impl.type.KimTypeBo; //导入方法依赖的package包/类
private PersonDocumentRole initPersonDocRole() throws Exception {
// Map pkMap = new HashMap();
// pkMap.put("roleId", "r1");
// PersonDocumentRole docRole = (PersonDocumentRole)uiDocumentService.getBusinessObjectService().findByPrimaryKey(PersonDocumentRole.class, pkMap);
PersonDocumentRole docRole = new PersonDocumentRole();
docRole.setKimTypeId("roleType1");
docRole.setRoleId("r1");
KimTypeBo kimType = new KimTypeBo();
kimType.setId("roleType1");
kimType.setServiceName("kimRoleTypeService");
List<KimTypeAttributeBo> attributeDefinitions = new ArrayList<KimTypeAttributeBo>();
Map pkMap = new HashMap();
pkMap.put("kimTypeAttributeId", "kimAttr3");
KimTypeAttributeBo attr1 = (KimTypeAttributeBo) KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(KimTypeAttributeBo.class, pkMap);
// attr1.setKimAttributeId("kimAttrDefn2");
// attr1.setSortCode("a");
// attr1.setKimTypeAttributeId("kimAttr3");
attributeDefinitions.add(attr1);
// attr1 = new KimTypeAttributeBo();
// attr1.setKimAttributeId("kimAttrDefn3");
// attr1.setSortCode("b");
// attr1.setKimTypeAttributeId("kimAttr4");
pkMap.put("kimTypeAttributeId", "kimAttr4");
KimTypeAttributeBo attr2 = (KimTypeAttributeBo) KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(KimTypeAttributeBo.class, pkMap);
attributeDefinitions.add(attr2);
kimType.setAttributeDefinitions(attributeDefinitions);
Field fld = PersonDocumentRole.class.getField("kimRoleType");
fld.set(docRole, kimType);
return docRole;
}
示例3: createDelegate
import org.kuali.rice.kim.impl.type.KimTypeBo; //导入方法依赖的package包/类
private void createDelegate(){
if (suiteCreateDelegateInitialized) {
return;
}
// create delegation KimType
Long kimDlgnTypeId = getNextSequenceLongValue("KRIM_TYP_ID_S");
KimTypeBo kimDlgnType = new KimTypeBo();
kimDlgnType.setId("" + kimDlgnTypeId);
kimDlgnType.setName("TestBaseDelegationType");
kimDlgnType.setNamespaceCode(NAMESPACE);
kimDlgnType.setServiceName("testBaseDelegationTypeService");
kimDlgnType.setActive(true);
kimDlgnType = KradDataServiceLocator.getDataObjectService().save(kimDlgnType);
/*
* Manually create a delegate
*/
String id = "" + getNextSequenceLongValue("KRIM_DLGN_MBR_ID_S");
DelegateTypeBo delegate = new DelegateTypeBo();
delegate.setDelegationId(id);
delegate.setDelegationType(DelegationType.PRIMARY);
delegate.setActive(true);
delegate.setKimTypeId("" + kimDlgnTypeId);
/*
* Assign it a role that was created above. This should mean that every
* principle in the role can have the delegate added below as a delegate
*/
Role role = KimApiServiceLocator.getRoleService().getRoleByNamespaceCodeAndName(NAMESPACE, ROLE_NAME);
assertNotNull("Role should exist.", role);
delegate.setRoleId(role.getId());
delegate = KradDataServiceLocator.getDataObjectService().save(delegate);
// BC of the way the jpa is handled we have to create the delagate, then the members
String delgMemberId = "" + getNextSequenceLongValue("KRIM_DLGN_MBR_ID_S");
DelegateMemberBo user1RoleDelegate = new DelegateMemberBo();
user1RoleDelegate.setDelegationMemberId(delgMemberId);
// This is the user the delegation requests should be sent to.
// Note: If initiator is same as delegate, forceAction is utilized in responsibilities of approvers.
Principal kPrincipal = KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName("ewestfal");
assertNotNull(kPrincipal);
user1RoleDelegate.setMemberId(kPrincipal.getPrincipalId());
/*
* this is checked when adding delegates in both the ActionRequestFactory
* and RoleServiceImpl
*/
user1RoleDelegate.setType( MemberType.PRINCIPAL );
// attach it to the delegate we created above
user1RoleDelegate.setDelegationId(delegate.getDelegationId());
user1RoleDelegate = KradDataServiceLocator.getDataObjectService().save(user1RoleDelegate);
suiteCreateDelegateInitialized = true;
}
示例4: createDelegate
import org.kuali.rice.kim.impl.type.KimTypeBo; //导入方法依赖的package包/类
private void createDelegate(){
if (suiteCreateDelegateInitialized) {
return;
}
// create delegation KimType
Long kimDlgnTypeId = KRADServiceLocator.getSequenceAccessorService().getNextAvailableSequenceNumber("KRIM_TYP_ID_S");
KimTypeBo kimDlgnType = new KimTypeBo();
kimDlgnType.setId("" + kimDlgnTypeId);
kimDlgnType.setName("TestBaseDelegationType");
kimDlgnType.setNamespaceCode(NAMESPACE);
kimDlgnType.setServiceName("testBaseDelegationTypeService");
kimDlgnType.setActive(true);
kimDlgnType = KRADServiceLocator.getBusinessObjectService().save(kimDlgnType);
/*
* Manually create a delegate
*/
String id = "" + KRADServiceLocator.getSequenceAccessorService().getNextAvailableSequenceNumber("KRIM_DLGN_MBR_ID_S");
DelegateTypeBo delegate = new DelegateTypeBo();
delegate.setDelegationId(id);
delegate.setDelegationType(DelegationType.PRIMARY);
delegate.setActive(true);
delegate.setKimTypeId("" + kimDlgnTypeId);
/*
* Assign it a role that was created above. This should mean that every
* principle in the role can have the delegate added below as a delegate
*/
Role role = KimApiServiceLocator.getRoleService().getRoleByNamespaceCodeAndName(NAMESPACE, ROLE_NAME);
assertNotNull("Role should exist.", role);
delegate.setRoleId(role.getId());
delegate = KRADServiceLocator.getBusinessObjectService().save(delegate);
// BC of the way the jpa is handled we have to create the delagate, then the members
String delgMemberId = "" + KRADServiceLocator.getSequenceAccessorService().getNextAvailableSequenceNumber("KRIM_DLGN_MBR_ID_S");
DelegateMemberBo user1RoleDelegate = new DelegateMemberBo();
user1RoleDelegate.setDelegationMemberId(delgMemberId);
// This is the user the delegation requests should be sent to.
// Note: If initiator is same as delegate, forceAction is utilized in responsibilities of approvers.
Principal kPrincipal = KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName("ewestfal");
assertNotNull(kPrincipal);
user1RoleDelegate.setMemberId(kPrincipal.getPrincipalId());
/*
* this is checked when adding delegates in both the ActionRequestFactory
* and RoleServiceImpl
*/
user1RoleDelegate.setType( MemberType.PRINCIPAL );
// attach it to the delegate we created above
user1RoleDelegate.setDelegationId(delegate.getDelegationId());
user1RoleDelegate = KRADServiceLocator.getBusinessObjectService().save(user1RoleDelegate);
suiteCreateDelegateInitialized = true;
}