本文整理汇总了Java中org.kuali.rice.kim.api.services.KimApiServiceLocator.getGroupService方法的典型用法代码示例。如果您正苦于以下问题:Java KimApiServiceLocator.getGroupService方法的具体用法?Java KimApiServiceLocator.getGroupService怎么用?Java KimApiServiceLocator.getGroupService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kim.api.services.KimApiServiceLocator
的用法示例。
在下文中一共展示了KimApiServiceLocator.getGroupService方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGroupImportXml
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
/**
*
* Verify that a workgroup with a bad user in the xml is not going to be put in the db.
*
* @throws Exception
*/
@Test public void testGroupImportXml() throws Exception {
loadXmlFile("GroupXmlImportTest.xml");
IdentityService identityService = KimApiServiceLocator.getIdentityService();
GroupService groupService = KimApiServiceLocator.getGroupService();
//verify that the group was ingested
Group group = groupService.getGroupByNamespaceCodeAndName(KimConstants.KIM_GROUP_WORKFLOW_NAMESPACE_CODE,
"TestUserGroup");
assertNotNull(group);
List<String> members = groupService.getMemberPrincipalIds(group.getId());
List<String> groups = groupService.getMemberGroupIds(group.getId());
assertTrue(groupService.isMemberOfGroup(identityService.getPrincipalByPrincipalName("ewestfal").getPrincipalId(), group.getId()));
assertTrue(groupService.isMemberOfGroup(identityService.getPrincipalByPrincipalName("rkirkend").getPrincipalId(), group.getId()));
assertTrue(groupService.isMemberOfGroup("2015", group.getId()));
assertTrue(KimApiServiceLocator.getGroupService().isGroupMemberOfGroup(groupService.getGroupByNamespaceCodeAndName(
KimConstants.KIM_GROUP_WORKFLOW_NAMESPACE_CODE, "TestWorkgroup").getId(), group.getId()));
}
示例2: getGroupService
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
protected GroupService getGroupService() {
if (groupService == null) {
groupService = KimApiServiceLocator.getGroupService();
}
return groupService;
}
示例3: removeAllMembers
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
@Override
public void removeAllMembers(String groupId) throws RiceIllegalArgumentException{
incomingParamCheck(groupId, "groupId");
GroupService groupService = KimApiServiceLocator.getGroupService();
List<String> memberPrincipalsBefore = groupService.getMemberPrincipalIds(groupId);
Collection<GroupMemberBo> toDeactivate = getActiveGroupMembers(groupId, null, null);
java.sql.Timestamp today = new java.sql.Timestamp(System.currentTimeMillis());
// Set principals as inactive
for (GroupMemberBo aToDeactivate : toDeactivate) {
aToDeactivate.setActiveToDateValue(today);
}
// Save
for (GroupMemberBo bo : toDeactivate) {
this.dataObjectService.save(bo);
}
List<String> memberPrincipalsAfter = groupService.getMemberPrincipalIds(groupId);
if (!CollectionUtils.isEmpty(memberPrincipalsAfter)) {
// should never happen!
LOG.warn("after attempting removal of all members, group with id '" + groupId + "' still has principal members");
}
// do updates
KimImplServiceLocator.getGroupInternalService().updateForWorkgroupChange(groupId, memberPrincipalsBefore,
memberPrincipalsAfter);
}
示例4: applyVisibility
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
/**
* Applies visibility settings to the RemotableAttributeField
*/
private void applyVisibility(RemotableAttributeField.Builder fieldBuilder, RemotableAttributeLookupSettings.Builder attributeLookupSettings, XMLSearchableAttributeContent.FieldDef field) {
boolean visible = true;
// if visibility is explicitly set, use it
if (field.visibility.visible != null) {
visible = field.visibility.visible;
} else {
if (field.visibility.groupName != null) {
UserSession session = GlobalVariables.getUserSession();
if (session == null) {
throw new WorkflowRuntimeException("UserSession is null! Attempted to render the searchable attribute outside of an established session.");
}
GroupService groupService = KimApiServiceLocator.getGroupService();
Group group = groupService.getGroupByNamespaceCodeAndName(field.visibility.groupNamespace, field.visibility.groupName);
visible = group == null ? false : groupService.isMemberOfGroup(session.getPerson().getPrincipalId(), group.getId());
}
}
String type = field.visibility.type;
if ("field".equals(type) || "fieldAndColumn".equals(type)) {
// if it's not visible, coerce this field to a hidden type
if (!visible) {
fieldBuilder.setControl(RemotableHiddenInput.Builder.create());
}
}
if ("column".equals(type) || "fieldAndColumn".equals(type)) {
attributeLookupSettings.setInResults(visible);
}
}
示例5: getPreviousAction
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
@Override
public ActionTakenValue getPreviousAction(ActionRequestValue actionRequest, List<ActionTakenValue> simulatedActionsTaken) {
GroupService ims = KimApiServiceLocator.getGroupService();
ActionTakenValue foundActionTaken = null;
List<String> principalIds = new ArrayList<String>();
if (actionRequest.isGroupRequest()) {
principalIds.addAll( ims.getMemberPrincipalIds(actionRequest.getGroup().getId()));
} else if (actionRequest.isUserRequest()) {
principalIds.add(actionRequest.getPrincipalId());
}
for (String id : principalIds) {
List<ActionTakenValue> actionsTakenByUser =
new ArrayList<ActionTakenValue>(findByDocumentIdPrincipalId(actionRequest.getDocumentId(), id));
if (simulatedActionsTaken != null) {
for (ActionTakenValue simulatedAction : simulatedActionsTaken) {
if (id.equals(simulatedAction.getPrincipalId())) {
actionsTakenByUser.add(simulatedAction);
}
}
}
for (ActionTakenValue actionTaken : actionsTakenByUser) {
if (ActionRequestValue.compareActionCode(actionTaken.getActionTaken(),
actionRequest.getActionRequested(), true) >= 0) {
foundActionTaken = actionTaken;
}
}
}
return foundActionTaken;
}
示例6: isUserAdministrator
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
/**
* Implements by calling the is user member of service in KEW's workgroup service, looking for a specific membership
* in the "NotificationAdmin" workgroup.
* @see org.kuali.rice.ken.service.NotificationAuthorizationService#isUserAdministrator(java.lang.String)
*/
public boolean isUserAdministrator(String userId) {
String groupNameId = NotificationConstants.KEW_CONSTANTS.NOTIFICATION_ADMIN_GROUP_NAME;
Person user = KimApiServiceLocator.getPersonService().getPerson(userId);
if (user == null) {
return false;
}
final GroupService groupService = KimApiServiceLocator.getGroupService();
Group group = groupService.getGroupByNamespaceCodeAndName(KimConstants.KIM_GROUP_WORKFLOW_NAMESPACE_CODE,
groupNameId);
return group == null ? false : groupService.isMemberOfGroup(user.getPrincipalId(), group.getId());
}
示例7: processAddGroupMember
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
public boolean processAddGroupMember(AddGroupMemberEvent addGroupMemberEvent){
GroupDocumentMember newMember = addGroupMemberEvent.getMember();
IdentityManagementGroupDocument document = (IdentityManagementGroupDocument)addGroupMemberEvent.getDocument();
boolean rulePassed = true;
if (newMember == null || StringUtils.isBlank(newMember.getMemberId())){
GlobalVariables.getMessageMap().putError(ERROR_PATH, RiceKeyConstants.ERROR_EMPTY_ENTRY, new String[] {"Member"});
return false;
}
if(!validAssignGroup(newMember, document))
return false;
int i = 0;
for (GroupDocumentMember member: document.getMembers()){
if (member.getMemberId().equals(newMember.getMemberId()) && member.getMemberTypeCode().equals(newMember.getMemberTypeCode())){
rulePassed = false;
GlobalVariables.getMessageMap().putError("document.members["+i+"].memberId", RiceKeyConstants.ERROR_DUPLICATE_ENTRY, new String[] {"Member"});
}
i++;
}
// check for circular reference
GroupService groupService = KimApiServiceLocator.getGroupService();
if (groupService.isGroupMemberOfGroup(document.getGroupId(),newMember.getMemberId())){
GlobalVariables.getMessageMap().putError(ERROR_PATH, RiceKeyConstants.ERROR_ASSIGN_GROUP_MEMBER_CIRCULAR, new String[] {newMember.getMemberId()});
return false;
}
return rulePassed;
}
示例8: getGroupService
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
public static GroupService getGroupService() {
if (groupService == null) {
groupService = KimApiServiceLocator.getGroupService();
}
return groupService;
}
示例9: getGroupService
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
protected GroupService getGroupService() {
if ( groupService == null ) {
groupService = KimApiServiceLocator.getGroupService();
}
return groupService;
}
示例10: getGroupService
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
public GroupService getGroupService() {
return KimApiServiceLocator.getGroupService();
}
示例11: getGroupService
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
protected static GroupService getGroupService() {
if ( groupService == null ) {
groupService = KimApiServiceLocator.getGroupService();
}
return groupService;
}
示例12: getGroupService
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
protected GroupService getGroupService() {
if ( groupService == null ) {
groupService = KimApiServiceLocator.getGroupService();
}
return groupService;
}
示例13: getGroupService
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
public static GroupService getGroupService() {
if ( groupService == null ) {
groupService = KimApiServiceLocator.getGroupService();
}
return groupService;
}
示例14: getGroupService
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
private GroupService getGroupService() {
return KimApiServiceLocator.getGroupService();
}
示例15: getGroupService
import org.kuali.rice.kim.api.services.KimApiServiceLocator; //导入方法依赖的package包/类
protected GroupService getGroupService() {
return KimApiServiceLocator.getGroupService();
}