本文整理汇总了Java中org.kuali.rice.kim.impl.type.KimTypeBo.setActive方法的典型用法代码示例。如果您正苦于以下问题:Java KimTypeBo.setActive方法的具体用法?Java KimTypeBo.setActive怎么用?Java KimTypeBo.setActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kim.impl.type.KimTypeBo
的用法示例。
在下文中一共展示了KimTypeBo.setActive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}