當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。