当前位置: 首页>>代码示例>>Java>>正文


Java GroupMember.getActiveToDate方法代码示例

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


在下文中一共展示了GroupMember.getActiveToDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadGroupToPersonDoc

import org.kuali.rice.kim.api.group.GroupMember; //导入方法依赖的package包/类
/**
*
   * This method loads related group data to pending person document when user initiates the 'edit' or 'inquiry'.
   *
* @param identityManagementPersonDocument
* @param groups
*/
  protected void loadGroupToPersonDoc(IdentityManagementPersonDocument identityManagementPersonDocument, List<? extends Group> groups) {
      List <PersonDocumentGroup> docGroups = new ArrayList <PersonDocumentGroup>();
      if(ObjectUtils.isNotNull(groups)){
          for (Group group: groups) {
              if (getGroupService().isDirectMemberOfGroup(identityManagementPersonDocument.getPrincipalId(), group.getId())) {
                  PersonDocumentGroup docGroup = new PersonDocumentGroup();
                  docGroup.setGroupId(group.getId());
                  docGroup.setGroupName(group.getName());
                  docGroup.setNamespaceCode(group.getNamespaceCode());
                  docGroup.setPrincipalId(identityManagementPersonDocument.getPrincipalId());
                  Collection<GroupMember> groupMemberships = null;
                  groupMemberships = getGroupService().getMembersOfGroup(group.getId());

                  if(ObjectUtils.isNotNull(groupMemberships)){
                      for (GroupMember groupMember: groupMemberships) {
                          if (StringUtils.equals(groupMember.getMemberId(), identityManagementPersonDocument.getPrincipalId()) &&
                                  KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE.equals(groupMember.getType())) {
                              docGroup.setGroupMemberId(groupMember.getId());
                              if (groupMember.getActiveFromDate() != null) {
                                  docGroup.setActiveFromDate(groupMember.getActiveFromDate() == null ? null : new Timestamp(groupMember.getActiveFromDate().getMillis()));
                              }
                              if (groupMember.getActiveToDate() != null) {
                                  docGroup.setActiveToDate(groupMember.getActiveToDate() == null ? null : new Timestamp(groupMember.getActiveToDate().getMillis()));
                              }
                              continue;
                          }
                      }
                  }
                  docGroup.setKimTypeId(group.getKimTypeId());
                  docGroup.setEdit(true);
                  docGroups.add(docGroup);
              }
          }
      }
      identityManagementPersonDocument.setGroups(docGroups);
  }
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:44,代码来源:UiDocumentServiceImpl.java

示例2: loadGroupToPersonDoc

import org.kuali.rice.kim.api.group.GroupMember; //导入方法依赖的package包/类
/**
*
   * This method loads related group data to pending person document when user initiates the 'edit' or 'inquiry'.
   *
* @param identityManagementPersonDocument
* @param groups
*/
  protected void loadGroupToPersonDoc(IdentityManagementPersonDocument identityManagementPersonDocument, List<? extends Group> groups) {
      List <PersonDocumentGroup> docGroups = new ArrayList <PersonDocumentGroup>();
      if(ObjectUtils.isNotNull(groups)){
          for (Group group: groups) {
              if (getGroupService().isDirectMemberOfGroup(identityManagementPersonDocument.getPrincipalId(), group.getId())) {
                  PersonDocumentGroup docGroup = new PersonDocumentGroup();
                  docGroup.setGroupId(group.getId());
                  docGroup.setGroupName(group.getName());
                  docGroup.setNamespaceCode(group.getNamespaceCode());
                  docGroup.setPrincipalId(identityManagementPersonDocument.getPrincipalId());
                  Collection<GroupMember> groupMemberships = null;
                  groupMemberships = getGroupService().getMembersOfGroup(group.getId());

                  if(ObjectUtils.isNotNull(groupMemberships)){
                      for (GroupMember groupMember: groupMemberships) {
                          if (StringUtils.equals(groupMember.getMemberId(), identityManagementPersonDocument.getPrincipalId()) &&
                                  KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE.equals(groupMember.getType())) {
                              docGroup.setGroupMemberId(groupMember.getId());
                              if (groupMember.getActiveFromDate() != null) {
                                  docGroup.setActiveFromDate(groupMember.getActiveFromDate() == null ? null : new Timestamp(groupMember.getActiveFromDate().getMillis()));
                              }
                              if (groupMember.getActiveToDate() != null) {
                                  docGroup.setActiveToDate(groupMember.getActiveToDate() == null ? null : new Timestamp(groupMember.getActiveToDate().getMillis()));
                              }
                              continue;
                          }
                      }
                  }
                  docGroup.setKimTypeId(group.getKimTypeId());
                  docGroup.setEdit(true);
                  docGroups.add(docGroup);
              }
          }
      }
      Collections.sort(docGroups, new Comparator<PersonDocumentGroup>() {
          @Override
          public int compare(PersonDocumentGroup o1, PersonDocumentGroup o2) {
              return o1.getGroupId().compareTo(o2.getGroupId());
          }
      });
      identityManagementPersonDocument.setGroups(docGroups);
  }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:50,代码来源:UiDocumentServiceImpl.java


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