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