當前位置: 首頁>>代碼示例>>Java>>正文


Java UserUtils類代碼示例

本文整理匯總了Java中org.kuali.rice.kew.user.UserUtils的典型用法代碼示例。如果您正苦於以下問題:Java UserUtils類的具體用法?Java UserUtils怎麽用?Java UserUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UserUtils類屬於org.kuali.rice.kew.user包,在下文中一共展示了UserUtils類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: replaceCurrentUserToken

import org.kuali.rice.kew.user.UserUtils; //導入依賴的package包/類
protected static String replaceCurrentUserToken(String value, Person person) {
    Matcher matcher = CURRENT_USER_PATTERN.matcher(value);
    boolean matched = false;
    StringBuffer sb = new StringBuffer();
    while (matcher.find()) {
        matched = true;
        String idType = "principalName";
        if (matcher.groupCount() > 0) {
            String group = matcher.group(1);
            if (group != null) {
                idType = group.substring(1); // discard period after CURRENT_USER
            }
        }
        String idValue = UserUtils.getIdValue(idType, person);
        if (!StringUtils.isBlank(idValue)) {
            value = idValue;
        } else {
            value = matcher.group();
        }
        matcher.appendReplacement(sb, value);

    }
    matcher.appendTail(sb);
    return matched ? sb.toString() : null;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:26,代碼來源:DocumentSearchCriteriaBoLookupableHelperService.java

示例2: addDelegatorElement

import org.kuali.rice.kew.user.UserUtils; //導入依賴的package包/類
protected static void addDelegatorElement(Document doc, Element baseElement, ActionItem actionItem) {
    Element delegatorElement = doc.createElement("delegator");
    if ( (actionItem.getDelegatorPrincipalId() != null) ) {
        // add empty delegator element
        baseElement.appendChild(delegatorElement);
        return;
    }
    String delegatorType = "";
    String delegatorId = "";
    String delegatorDisplayValue = "";
    if (actionItem.getDelegatorPrincipalId() != null) {
        delegatorType = "user";
        delegatorId = actionItem.getDelegatorPrincipalId();
        Principal delegator = KimApiServiceLocator.getIdentityService().getPrincipal(delegatorId);
        
        if (delegator == null) {
        	LOG.error("Cannot find user for id " + delegatorId);
        	delegatorDisplayValue = "USER NOT FOUND";
        } else {
        	delegatorDisplayValue = UserUtils.getTransposedName(GlobalVariables.getUserSession(), delegator);
        }
    } else if (actionItem.getDelegatorPrincipalId() != null) {
        delegatorType = "workgroup";
        delegatorId = actionItem.getDelegatorGroupId();
        delegatorDisplayValue = KimApiServiceLocator.getGroupService().getGroup(actionItem.getDelegatorGroupId()).getName();
    }
    delegatorElement.setAttribute("type", delegatorType);
    // add the id element
    Element idElement = doc.createElement("id");
    idElement.appendChild(doc.createTextNode(delegatorId));
    delegatorElement.appendChild(idElement);
    // add the display value element
    Element displayValElement = doc.createElement("displayValue");
    displayValElement.appendChild(doc.createTextNode(delegatorDisplayValue));
    delegatorElement.appendChild(displayValElement);
    baseElement.appendChild(delegatorElement);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:38,代碼來源:StyleableEmailContentServiceImpl.java

示例3: addDelegatorElement

import org.kuali.rice.kew.user.UserUtils; //導入依賴的package包/類
protected static void addDelegatorElement(Document doc, Element baseElement, ActionItem actionItem) {
    Element delegatorElement = doc.createElement("delegator");
    if ( (actionItem.getDelegatorPrincipalId() != null) && (actionItem.getDelegatorPrincipalId() != null) ) {
        // add empty delegator element
        baseElement.appendChild(delegatorElement);
        return;
    }
    String delegatorType = "";
    String delegatorId = "";
    String delegatorDisplayValue = "";
    if (actionItem.getDelegatorPrincipalId() != null) {
        delegatorType = "user";
        delegatorId = actionItem.getDelegatorPrincipalId();
        Principal delegator = KimApiServiceLocator.getIdentityService().getPrincipal(delegatorId);
        
        if (delegator == null) {
        	LOG.error("Cannot find user for id " + delegatorId);
        	delegatorDisplayValue = "USER NOT FOUND";
        } else {
        	delegatorDisplayValue = UserUtils.getTransposedName(GlobalVariables.getUserSession(), delegator);
        }
    } else if (actionItem.getDelegatorPrincipalId() != null) {
        delegatorType = "workgroup";
        delegatorId = actionItem.getDelegatorGroupId().toString();
        delegatorDisplayValue = KimApiServiceLocator.getGroupService().getGroup(actionItem.getDelegatorGroupId()).getName();
    }
    delegatorElement.setAttribute("type", delegatorType);
    // add the id element
    Element idElement = doc.createElement("id");
    idElement.appendChild(doc.createTextNode(delegatorId));
    delegatorElement.appendChild(idElement);
    // add the display value element
    Element displayValElement = doc.createElement("displayValue");
    displayValElement.appendChild(doc.createTextNode(delegatorDisplayValue));
    delegatorElement.appendChild(displayValElement);
    baseElement.appendChild(delegatorElement);
}
 
開發者ID:kuali,項目名稱:rice,代碼行數:38,代碼來源:StyleableEmailContentServiceImpl.java


注:本文中的org.kuali.rice.kew.user.UserUtils類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。