• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java GroupService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.kuali.rice.kim.api.group.GroupService的典型用法代码示例。如果您正苦于以下问题:Java GroupService类的具体用法?Java GroupService怎么用?Java GroupService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GroupService类属于org.kuali.rice.kim.api.group包,在下文中一共展示了GroupService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: FutureRequestDocumentStateManager

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的package包/类
public FutureRequestDocumentStateManager (DocumentRouteHeaderValue document, Group kimGroup)
  {
      GroupService ims = KimApiServiceLocator.getGroupService();
      List<String> principalIds =
          ims.getMemberPrincipalIds(kimGroup.getId());

      for (String id : principalIds)
{
    FutureRequestDocumentStateManager requestStateMngr =
        new FutureRequestDocumentStateManager(document, id);
    if (requestStateMngr.isReceiveFutureRequests()) {
	this.receiveFutureRequests = true;
    } else if (requestStateMngr.isDoNotReceiveFutureRequests()) {
	this.doNotReceiveFutureRequests = true;
    }
}
  }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:FutureRequestDocumentStateManager.java


示例2: testGroupImportXml

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的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()));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:GroupXmlImportTest.java


示例3: getGroupService

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的package包/类
protected GroupService getGroupService() {
    if (groupService == null) {
        groupService = KimApiServiceLocator.getGroupService();
    }

    return groupService;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:RoleServiceBase.java


示例4: saveWorkgroup

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的package包/类
@Override
public GroupBo saveWorkgroup(GroupBo group) {
	GroupService ims = getGroupService();
    List<String> oldIds = Collections.emptyList();
	if (StringUtils.isNotEmpty(group.getId())) {
        oldIds = ims.getMemberPrincipalIds(group.getId());
    }
    group = getDataObjectService().save(group,PersistenceOption.FLUSH);
    List<String> newIds = ims.getMemberPrincipalIds(group.getId());
    updateForWorkgroupChange(group.getId(), oldIds, newIds);
    return group;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:GroupInternalServiceImpl.java


示例5: removeAllMembers

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的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);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:32,代码来源:GroupServiceImpl.java


示例6: applyVisibility

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的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);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:32,代码来源:StandardGenericXMLSearchableAttribute.java


示例7: getPreviousAction

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:33,代码来源:ActionTakenServiceImpl.java


示例8: isUserAdministrator

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的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());
  }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:NotificationAuthorizationServiceImpl.java


示例9: processAddGroupMember

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:31,代码来源:GroupDocumentMemberRule.java


示例10: setUp

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的package包/类
@Override
   public void setUp() throws Exception {
	super.setUp();
	groupService = (GroupService)GlobalResourceLoader.getService(
               new QName(KimApiConstants.Namespaces.KIM_NAMESPACE_2_0, KimApiConstants.ServiceNames.GROUP_SERVICE_SOAP));
	businessObjectService = KNSServiceLocator.getBusinessObjectService();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:GroupUpdateServiceImplTest.java


示例11: setupServiceUnderTest

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的package包/类
@Before
@Override
public void setupServiceUnderTest() {
    super.setupServiceUnderTest();
    GroupService remoteProxy =
            harness.publishEndpointAndReturnProxy(GroupService.class, this.getGroupServiceImpl());
    super.setGroupService(remoteProxy);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:GroupServiceRemoteTest.java


示例12: saveWorkgroup

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的package包/类
@Override
public GroupBo saveWorkgroup(GroupBo group) {
	GroupService ims = getGroupService();
    List<String> oldIds = Collections.emptyList();
	if (StringUtils.isNotEmpty(group.getId())) {
        oldIds = ims.getMemberPrincipalIds(group.getId());
    }
    group = (GroupBo)getBusinessObjectService().save( group );
    List<String> newIds = ims.getMemberPrincipalIds(group.getId());
    updateForWorkgroupChange(group.getId(), oldIds, newIds);
    return group;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:13,代码来源:GroupInternalServiceImpl.java


示例13: removeAllMembers

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的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
    this.businessObjectService.save(new ArrayList<GroupMemberBo>(toDeactivate));
    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);
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:30,代码来源:GroupServiceImpl.java


示例14: getPreviousAction

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的package包/类
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 =
            getActionTakenDAO().findByDocumentIdWorkflowId(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;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:38,代码来源:ActionTakenServiceImpl.java


示例15: getGroupService

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的package包/类
public static GroupService getGroupService() {
    if (groupService == null) {
        groupService = KimApiServiceLocator.getGroupService();
    }
    return groupService;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:7,代码来源:DocumentRuleBase.java


示例16: getGroupService

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的package包/类
protected GroupService getGroupService() {
    if (groupService == null) {
        groupService = KimApiServiceLocator.getGroupService();
    }
    return this.groupService;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:7,代码来源:KualiDocumentActionBase.java


示例17: getGroupService

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的package包/类
public static GroupService getGroupService() {
	return getService(KIM_GROUP_SERVICE);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:KimApiServiceLocator.java


示例18: getGroupService

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的package包/类
public GroupService getGroupService() {
    return KimApiServiceLocator.getGroupService();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:GroupLookupableImpl.java


示例19: getGroupService

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的package包/类
protected GroupService getGroupService(){
	return KimApiServiceLocator.getGroupService();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:GroupInternalServiceImpl.java


示例20: getGroupService

import org.kuali.rice.kim.api.group.GroupService; //导入依赖的package包/类
protected GroupService getGroupService() {
    if ( groupService == null ) {
        groupService = KimApiServiceLocator.getGroupService();
    }
    return groupService;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:7,代码来源:KimRemoteModuleService.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Advancement类代码示例发布时间:2022-05-22
下一篇:
Java Anvil类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap