本文整理匯總了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;
}