本文整理汇总了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);
}
示例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);
}
示例3: setDefaultResponsibilityTypeService
import org.kuali.rice.kim.framework.responsibility.ResponsibilityTypeService; //导入依赖的package包/类
public void setDefaultResponsibilityTypeService(final ResponsibilityTypeService defaultResponsibilityTypeService) {
this.defaultResponsibilityTypeService = defaultResponsibilityTypeService;
}