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


Java ResponsibilityTypeService类代码示例

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


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

示例1: getMatchingResponsibilities

import org.kuali.rice.kim.framework.responsibility.ResponsibilityTypeService; //导入依赖的package包/类
/**
 * Compare each of the passed in responsibilities with the given responsibilityDetails.  Those that
 * match are added to the result list.
 */
private List<Responsibility> getMatchingResponsibilities(List<Responsibility> responsibilities, Map<String, String> responsibilityDetails) {
    // if no details passed, assume that all match
    if (responsibilityDetails == null || responsibilityDetails.isEmpty()) {
        return responsibilities;
    }

    final List<Responsibility> applicableResponsibilities = new ArrayList<Responsibility>();
    // otherwise, attempt to match the permission details
    // build a map of the template IDs to the type services
    Map<String, ResponsibilityTypeService> responsibilityTypeServices = getResponsibilityTypeServicesByTemplateId(responsibilities);
    // build a map of permissions by template ID
    Map<String, List<Responsibility>> responsibilityMap = groupResponsibilitiesByTemplate(responsibilities);
    // loop over the different templates, matching all of the same template against the type
    // service at once
    for (Map.Entry<String, List<Responsibility>> respEntry : responsibilityMap.entrySet()) {
        ResponsibilityTypeService responsibilityTypeService = responsibilityTypeServices.get(respEntry.getKey());
        List<Responsibility> responsibilityInfos = respEntry.getValue();
        if (responsibilityTypeService == null) {
            responsibilityTypeService = defaultResponsibilityTypeService;
        }
        applicableResponsibilities.addAll(responsibilityTypeService.getMatchingResponsibilities(responsibilityDetails, responsibilityInfos));
    }
    return Collections.unmodifiableList(applicableResponsibilities);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:ResponsibilityServiceImpl.java

示例2: getResponsibilityTypeServicesByTemplateId

import org.kuali.rice.kim.framework.responsibility.ResponsibilityTypeService; //导入依赖的package包/类
private Map<String, ResponsibilityTypeService> getResponsibilityTypeServicesByTemplateId(Collection<Responsibility> responsibilities) {
    Map<String, ResponsibilityTypeService> responsibilityTypeServices = new HashMap<String, ResponsibilityTypeService>(responsibilities.size());
    for (Responsibility responsibility : responsibilities) {
        final Template t = responsibility.getTemplate();
        final KimType type = kimTypeInfoService.getKimType(t.getKimTypeId());

        final String serviceName = type.getServiceName();
        if (serviceName != null) {
            ResponsibilityTypeService responsibiltyTypeService = GlobalResourceLoader.getService(QName.valueOf(serviceName));
            if (responsibiltyTypeService != null) {
                responsibilityTypeServices.put(responsibility.getTemplate().getId(), responsibiltyTypeService);
            } else {
                responsibilityTypeServices.put(responsibility.getTemplate().getId(), defaultResponsibilityTypeService);
            }
        }
    }
    return Collections.unmodifiableMap(responsibilityTypeServices);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:ResponsibilityServiceImpl.java

示例3: setDefaultResponsibilityTypeService

import org.kuali.rice.kim.framework.responsibility.ResponsibilityTypeService; //导入依赖的package包/类
public void setDefaultResponsibilityTypeService(final ResponsibilityTypeService defaultResponsibilityTypeService) {
    this.defaultResponsibilityTypeService = defaultResponsibilityTypeService;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:ResponsibilityServiceImpl.java


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