本文整理汇总了Java中lotus.domino.Name.getCanonical方法的典型用法代码示例。如果您正苦于以下问题:Java Name.getCanonical方法的具体用法?Java Name.getCanonical怎么用?Java Name.getCanonical使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lotus.domino.Name
的用法示例。
在下文中一共展示了Name.getCanonical方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: formatName
import lotus.domino.Name; //导入方法依赖的package包/类
private static String formatName(String baseName, NameFormat format) throws NotesException {
// optionally reformat the name, as contributed in #14 subpart D1:
// https://github.com/OpenNTF/XPagesExtensionLibrary/pull/14
if( StringUtil.isEmpty(baseName) ){
// don't format empty string
return baseName;
}
if (NameFormat.UNFORMATTED == format) {
return baseName;
} else {
Session sess = ExtLibUtil.getCurrentSession();
Name nm = sess.createName(baseName); // throws NotesException
switch(format){
case ABBREVIATED: return nm.getAbbreviated();
case CANONICAL: return nm.getCanonical();
case COMMON: return nm.getCommon();
default: return baseName; // won't happen
}
}
}
示例2: getPeopleData
import lotus.domino.Name; //导入方法依赖的package包/类
@SuppressWarnings("unchecked") // $NON-NLS-1$
private PeopleData getPeopleData(PersonImpl person) {
String id = person.getId();
if(StringUtil.isEmpty(id)) {
return EMPTY_DATA;
}
PeopleData data = (PeopleData)getProperties(id,PeopleData.class);
if(data==null) {
synchronized(getSyncObject()) {
data = (PeopleData)getProperties(id,PeopleData.class);
if(data==null) {
try {
data = new PeopleData();
Session session = ExtLibUtil.getCurrentSession(FacesContext.getCurrentInstance());
// TODO get a Notes/Domino id from an identity provider...
Name n = session.createName(id);
data.displayName = getCommonName(session, id, n); //n.getCommon();
data.abbreviatedName = n.getAbbreviated();
data.canonicalName = n.getCanonical();
data.effectiveUserName = session.getEffectiveUserName();
addProperties(id,data);
} catch(NotesException ex) {
throw new FacesExceptionEx(ex,"Error while retrieving user names"); // $NLX-DominoUserBeanDataProvider.Errorwhileretrievingusernames-1$
}
}
}
}
return data;
}
示例3: makeCanonical
import lotus.domino.Name; //导入方法依赖的package包/类
private String makeCanonical(String strUserName) {
String strRC = strUserName;
try {
if (strRC != null && !"".equals(strRC)) {
Name nonCurrent = ExtLibUtil.getCurrentSession().createName(strUserName);
strRC = nonCurrent.getCanonical();
nonCurrent.recycle();
}
} catch (Exception e) {
e.printStackTrace();
}
return strRC;
}
示例4: setPerson
import lotus.domino.Name; //导入方法依赖的package包/类
public String setPerson(String strValue, boolean isNamesValue) {
String rcValue = strValue;
Name person = null;
try {
person = ExtLibUtil.getCurrentSession().createName(strValue);
if (person != null && isNamesValue)
rcValue = person.getCanonical();
} catch (Exception e) {
e.printStackTrace();
}
return rcValue;
}
示例5: setPerson
import lotus.domino.Name; //导入方法依赖的package包/类
public String setPerson(String strValue, boolean isNamesValue, Session sesCurrent) {
String rcValue = strValue;
try {
if (isNamesValue) {
Name person = sesCurrent.createName(strValue);
if (person != null) {
rcValue = person.getCanonical();
person.recycle();
}
}
} catch (Exception e) {
e.printStackTrace();
}
return rcValue;
}