本文整理汇总了Java中org.kuali.rice.kim.api.group.GroupMember类的典型用法代码示例。如果您正苦于以下问题:Java GroupMember类的具体用法?Java GroupMember怎么用?Java GroupMember使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GroupMember类属于org.kuali.rice.kim.api.group包,在下文中一共展示了GroupMember类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: inactivatePrincipalGroupMemberships
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
protected void inactivatePrincipalGroupMemberships(List<String> groupIds, Timestamp yesterday) {
if (groupIds == null || groupIds.isEmpty() ) {
return;
}
Collection<GroupMember> groupMemberships = getGroupService().getMembers(groupIds);
if ( groupMemberships.isEmpty() ) {
return;
}
List<GroupMember> groupMembers = new ArrayList<GroupMember>();
for (GroupMember groupMembershipInfo : groupMemberships) {
if (MemberType.GROUP.equals(groupMembershipInfo.getType())
&& groupMembershipInfo.isActive(new DateTime())) {
groupMembers.add(groupMembershipInfo);
}
}
// FIXME: Is there a reason we are doing this directly and *not* calling the group service???
for (GroupMember groupMember : groupMembers) {
GroupMember.Builder builder = GroupMember.Builder.create(groupMember);
builder.setActiveToDate(new DateTime(yesterday.getTime()));
getDataObjectService().save(GroupMemberBo.from(builder.build()));
}
}
示例2: isDirectMemberOfGroup
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
@Override
public boolean isDirectMemberOfGroup(String principalId, String groupId) throws RiceIllegalArgumentException {
incomingParamCheck(principalId, "principalId");
incomingParamCheck(groupId, "groupId");
final QueryByCriteria.Builder builder = QueryByCriteria.Builder.create();
builder.setPredicates(
and(
equal(KIMPropertyConstants.GroupMember.MEMBER_ID, principalId),
equal(KIMPropertyConstants.GroupMember.MEMBER_TYPE_CODE, KimConstants.KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE.getCode()),
equal(KIMPropertyConstants.GroupMember.GROUP_ID, groupId),
HistoryQueryUtils.between(KIMPropertyConstants.KimMember.ACTIVE_FROM_DATE_VALUE, KIMPropertyConstants.KimMember.ACTIVE_TO_DATE_VALUE, DateTime.now()))
);
QueryResults<GroupMemberBo> groupMembers = dataObjectService.findMatching(GroupMemberBo.class, builder.build());
return (groupMembers.getResults().size() > 0);
}
示例3: findGroupMembers
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
@Override
public GroupMemberQueryResults findGroupMembers(final QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException {
incomingParamCheck(queryByCriteria, "queryByCriteria");
QueryResults<GroupMemberBo> results = dataObjectService.findMatching(GroupMemberBo.class, queryByCriteria);
GroupMemberQueryResults.Builder builder = GroupMemberQueryResults.Builder.create();
builder.setMoreResultsAvailable(results.isMoreResultsAvailable());
builder.setTotalRowCount(results.getTotalRowCount());
final List<GroupMember.Builder> ims = new ArrayList<GroupMember.Builder>();
for (GroupMemberBo bo : results.getResults()) {
ims.add(GroupMember.Builder.create(bo));
}
builder.setResults(ims);
return builder.build();
}
示例4: getDirectParentGroups
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
protected List<Group> getDirectParentGroups(String groupId, DateTime asOfDate) {
incomingParamCheck(groupId, "groupId");
final QueryByCriteria.Builder builder = QueryByCriteria.Builder.create();
builder.setPredicates(
and(
equal(KIMPropertyConstants.GroupMember.MEMBER_ID, groupId),
equal(KIMPropertyConstants.GroupMember.MEMBER_TYPE_CODE, KimConstants.KimGroupMemberTypes.GROUP_MEMBER_TYPE.getCode()),
HistoryQueryUtils.between(KIMPropertyConstants.KimMember.ACTIVE_FROM_DATE_VALUE,
KIMPropertyConstants.KimMember.ACTIVE_TO_DATE_VALUE, asOfDate)));
List<GroupMember> groupMembers = findGroupMembers(builder.build()).getResults();
Set<String> matchingGroupIds = new HashSet<String>();
// filter to active groups
for ( GroupMember gm : groupMembers ) {
matchingGroupIds.add(gm.getGroupId());
}
if (CollectionUtils.isNotEmpty(matchingGroupIds)) {
return getGroups(matchingGroupIds);
}
return Collections.emptyList();
}
示例5: createGroupMember
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
@Override
public GroupMember createGroupMember(GroupMember groupMember) throws RiceIllegalArgumentException {
incomingParamCheck(groupMember, "groupMember");
if (StringUtils.isNotBlank(groupMember.getId()) && getGroupMemberBo(groupMember.getId()) != null) {
throw new RiceIllegalArgumentException("the groupMember to create already exists: " + groupMember);
}
GroupMemberBo bo = GroupMemberBo.from(groupMember);
GroupBo groupBo = getGroupBo(groupMember.getGroupId());
groupBo.getMembers().add(bo);
groupBo = saveGroup(groupBo);
//get new groupMember from saved group
for (GroupMemberBo member : groupBo.getMembers()) {
if (member.getMemberId().equals(groupMember.getMemberId())
&& member.getType().equals(groupMember.getType())
&& member.getActiveFromDate().equals(groupMember.getActiveFromDate())
&& member.getActiveToDate().equals(groupMember.getActiveToDate())) {
return GroupMemberBo.to(member);
}
}
return GroupMemberBo.to(bo);
}
示例6: loadGroupDoc
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
@Override
public void loadGroupDoc(IdentityManagementGroupDocument identityManagementGroupDocument, Group groupInfo){
identityManagementGroupDocument.setGroupId(groupInfo.getId());
KimType kimType = getKimTypeInfoService().getKimType(groupInfo.getKimTypeId());
identityManagementGroupDocument.setKimType(kimType);
identityManagementGroupDocument.setGroupTypeName(kimType.getName());
identityManagementGroupDocument.setGroupTypeId(kimType.getId());
identityManagementGroupDocument.setGroupName(groupInfo.getName());
identityManagementGroupDocument.setGroupDescription(groupInfo.getDescription());
identityManagementGroupDocument.setActive(groupInfo.isActive());
identityManagementGroupDocument.setGroupNamespace(groupInfo.getNamespaceCode());
List<GroupMember> members = new ArrayList(KimApiServiceLocator.getGroupService().getCurrentAndFutureMembers(groupInfo.getId()));
identityManagementGroupDocument.setMembers(loadGroupMembers(identityManagementGroupDocument, members));
identityManagementGroupDocument.setQualifiers(loadGroupQualifiers(identityManagementGroupDocument, groupInfo.getAttributes()));
identityManagementGroupDocument.setEditing(true);
}
示例7: checkGroupMemberShip
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
/**
*
* This method is to check group members of given group and skip the single approver
* member from the group.
*
* @param approverOrInitiator
* @param member
* @param qualification
* @param qualifiedRoleMembers
* @param checkedMembers
* @param documentId
* @param topLevelRoleId
* @param topLevelRoleMemberId
*/
protected void checkGroupMemberShip(String excludedPrincipalId,RoleMembership member, Map<String, String> qualification,List<RoleMembership> qualifiedRoleMembers, Set<String> checkedMembers, String documentId, String topLevelRoleId, String topLevelRoleMemberId) {
String key = member.getType().getCode()+ "~" + member.getMemberId();
if(!checkedMembers.contains(key)) {
checkedMembers.add(key);
List<GroupMember> GroupMembers = (List<GroupMember>)getGroupService().getMembersOfGroup(member.getMemberId());
for(GroupMember membershipInfo : GroupMembers) {
if(KimConstants.KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE.equals(membershipInfo.getType().getCode())) {
if(!excludedPrincipalId.equals(membershipInfo.getMemberId())) {
RoleMembership.Builder updatedMembershipInfo = RoleMembership.Builder.create(topLevelRoleId, member.getId(), topLevelRoleMemberId, MemberType.PRINCIPAL, qualification);
qualifiedRoleMembers.add(updatedMembershipInfo.build());
}
}
else if (KimConstants.KimGroupMemberTypes.GROUP_MEMBER_TYPE.equals(membershipInfo.getType().getCode())) {
checkGroupMemberShip(excludedPrincipalId, member, qualification, qualifiedRoleMembers, checkedMembers, documentId, topLevelRoleId, topLevelRoleMemberId);
}
}
}
}
示例8: checkGroupMemberShip
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
/**
*
* This method is to check group members of given group and skip the single approver
* member from the group.
*
* @param approverOrInitiator
* @param member
* @param qualification
* @param qualifiedRoleMembers
* @param checkedMembers
* @param documentId
* @param topLevelRoleId
* @param topLevelRoleMemberId
*/
protected void checkGroupMemberShip(String excludedPrincipalId,RoleMembership member, Map<String, String> qualification,List<RoleMembership> qualifiedRoleMembers, Set<String> checkedMembers, String documentId, String topLevelRoleId, String topLevelRoleMemberId) {
String key = member.getType().getCode()+ "~" + member.getMemberId();
if(!checkedMembers.contains(key)) {
checkedMembers.add(key);
List<GroupMember> GroupMembers = (List<GroupMember>)getGroupService().getMembersOfGroup(member.getMemberId());
for(GroupMember membershipInfo : GroupMembers) {
if(MemberType.PRINCIPAL.getCode().equals(membershipInfo.getType().getCode())) {
if(!excludedPrincipalId.equals(membershipInfo.getMemberId())) {
RoleMembership.Builder updatedMembershipInfo = RoleMembership.Builder.create(topLevelRoleId, membershipInfo.getId(), membershipInfo.getMemberId(), MemberType.PRINCIPAL, qualification);
qualifiedRoleMembers.add(updatedMembershipInfo.build());
}
}
else if (MemberType.GROUP.getCode().equals(membershipInfo.getType().getCode())) {
checkGroupMemberShip(excludedPrincipalId, member, qualification, qualifiedRoleMembers, checkedMembers, documentId, topLevelRoleId, topLevelRoleMemberId);
}
}
}
}
示例9: findGroupMembers
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
public List<String> findGroupMembers(String groupId) {
List<String> members = new LinkedList<String>();
List<GroupMember> kimMembers = new LinkedList<GroupMember>();
kimMembers = KimApiServiceLocator.getGroupService().getMembersOfGroup(groupId);
if (CollectionUtils.isNotEmpty(kimMembers)) {
for (GroupMember mbr : kimMembers) {
Principal principal = KimApiServiceLocator.getIdentityService().getPrincipal(mbr.getMemberId());
if (principal == null) {
LOG.info("No principal with principal ID of " + mbr.getMemberId());
return members;
}
members.add(principal.getPrincipalId());
}
}
return members;
}
示例10: getGroupPrincipalsForPrincipalIdAndGroupIds
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
public List<GroupMember> getGroupPrincipalsForPrincipalIdAndGroupIds(Collection<String> groupIds, String principalId) {
List<String> groupIdValues = new ArrayList<String>();
List<GroupMember> groupPrincipals = new ArrayList<GroupMember>();
if (groupIds != null
&& principalId == null) {
groupIdValues = new ArrayList<String>(groupIds);
} else if (principalId != null) {
groupIdValues = KimApiServiceLocator.getGroupService().getGroupIdsByPrincipalId(principalId);
}
if (groupIdValues != null
&& groupIdValues.size() > 0) {
Collection<GroupMember> groupMembers = KimApiServiceLocator.getGroupService().getMembers(groupIdValues);
for (GroupMember groupMembershipInfo : groupMembers) {
if (principalId != null) {
if (MemberType.PRINCIPAL.equals(groupMembershipInfo.getType())
&& StringUtils.equals(principalId, groupMembershipInfo.getMemberId())
&& groupMembershipInfo.isActive(new DateTime())) {
groupPrincipals.add(groupMembershipInfo);
}
} else {
groupPrincipals.add(groupMembershipInfo);
}
}
}
return groupPrincipals;
}
示例11: getGroupMembers
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
public List<GroupMember> getGroupMembers(Collection<String> groupIds) {
List<GroupMember> groupMembers = new ArrayList<GroupMember>();
if (groupIds != null) {
List<String> groupIdValues = new ArrayList<String>(groupIds);
if (groupIdValues.size() > 0) {
Collection<GroupMember> groupMemberships = KimApiServiceLocator.getGroupService().getMembers(groupIdValues);
if (!CollectionUtils.isEmpty(groupMemberships)) {
for (GroupMember groupMembershipInfo : groupMemberships) {
if (MemberType.GROUP.equals(groupMembershipInfo.getType())
&& groupMembershipInfo.isActive(new DateTime())) {
groupMembers.add(groupMembershipInfo);
}
}
}
}
}
return groupMembers;
}
示例12: isDirectMemberOfGroup
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
@Override
public boolean isDirectMemberOfGroup(String principalId, String groupId) throws RiceIllegalArgumentException {
incomingParamCheck(principalId, "principalId");
incomingParamCheck(groupId, "groupId");
Map<String,String> criteria = new HashMap<String,String>();
criteria.put(KIMPropertyConstants.GroupMember.MEMBER_ID, principalId);
criteria.put(KIMPropertyConstants.GroupMember.MEMBER_TYPE_CODE, KimConstants.KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE.getCode());
criteria.put(KIMPropertyConstants.GroupMember.GROUP_ID, groupId);
Collection<GroupMemberBo> groupMembers = businessObjectService.findMatching(GroupMemberBo.class, criteria);
for ( GroupMemberBo gm : groupMembers ) {
if ( gm.isActive(new Timestamp(System.currentTimeMillis())) ) {
return true;
}
}
return false;
}
示例13: findGroupMembers
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
@Override
public GroupMemberQueryResults findGroupMembers(final QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException {
incomingParamCheck(queryByCriteria, "queryByCriteria");
GenericQueryResults<GroupMemberBo> results = criteriaLookupService.lookup(GroupMemberBo.class, queryByCriteria);
GroupMemberQueryResults.Builder builder = GroupMemberQueryResults.Builder.create();
builder.setMoreResultsAvailable(results.isMoreResultsAvailable());
builder.setTotalRowCount(results.getTotalRowCount());
final List<GroupMember.Builder> ims = new ArrayList<GroupMember.Builder>();
for (GroupMemberBo bo : results.getResults()) {
ims.add(GroupMember.Builder.create(bo));
}
builder.setResults(ims);
return builder.build();
}
示例14: getDirectParentGroups
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
protected List<Group> getDirectParentGroups(String groupId) {
if ( groupId == null ) {
return Collections.emptyList();
}
Map<String,String> criteria = new HashMap<String,String>();
criteria.put(KIMPropertyConstants.GroupMember.MEMBER_ID, groupId);
criteria.put(KIMPropertyConstants.GroupMember.MEMBER_TYPE_CODE, KimConstants.KimGroupMemberTypes.GROUP_MEMBER_TYPE.getCode());
List<GroupMemberBo> groupMembers = (List<GroupMemberBo>)businessObjectService.findMatching(GroupMemberBo.class, criteria);
Set<String> matchingGroupIds = new HashSet<String>();
// filter to active groups
for ( GroupMemberBo gm : groupMembers ) {
if ( gm.isActive(new Timestamp(System.currentTimeMillis())) ) {
matchingGroupIds.add(gm.getGroupId());
}
}
if (CollectionUtils.isNotEmpty(matchingGroupIds)) {
return getGroups(matchingGroupIds);
}
return Collections.emptyList();
}
示例15: loadGroupDoc
import org.kuali.rice.kim.api.group.GroupMember; //导入依赖的package包/类
public void loadGroupDoc(IdentityManagementGroupDocument identityManagementGroupDocument, Group groupInfo){
//Map<String, String> criteria = new HashMap<String, String>();
//criteria.put(KimApiConstants.PrimaryKeyConstants.GROUP_ID, groupInfo.getId());
//GroupImpl kimGroupImpl = (GroupImpl)
// getBusinessObjectService().findByPrimaryKey(GroupImpl.class, criteria);
identityManagementGroupDocument.setGroupId(groupInfo.getId());
KimType kimType = KimApiServiceLocator.getKimTypeInfoService().getKimType(groupInfo.getKimTypeId());
identityManagementGroupDocument.setKimType(kimType);
identityManagementGroupDocument.setGroupTypeName(kimType.getName());
identityManagementGroupDocument.setGroupTypeId(kimType.getId());
identityManagementGroupDocument.setGroupName(groupInfo.getName());
identityManagementGroupDocument.setGroupDescription(groupInfo.getDescription());
identityManagementGroupDocument.setActive(groupInfo.isActive());
identityManagementGroupDocument.setGroupNamespace(groupInfo.getNamespaceCode());
List<GroupMember> members = new ArrayList(KimApiServiceLocator.getGroupService().getMembersOfGroup(groupInfo.getId()));
identityManagementGroupDocument.setMembers(loadGroupMembers(identityManagementGroupDocument, members));
identityManagementGroupDocument.setQualifiers(loadGroupQualifiers(identityManagementGroupDocument, groupInfo.getAttributes()));
identityManagementGroupDocument.setEditing(true);
}