当前位置: 首页>>代码示例>>Java>>正文


Java Name.getCanonical方法代码示例

本文整理汇总了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
        }
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:21,代码来源:DominoNABNamePickerData.java

示例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;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:30,代码来源:DominoUserBeanDataProvider.java

示例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;
}
 
开发者ID:OpenNTF,项目名称:myWebGate-Scrum,代码行数:14,代码来源:MyWebGatePeopleDataProvider.java

示例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;
}
 
开发者ID:OpenNTF,项目名称:myWebGate-Scrum,代码行数:14,代码来源:NamesProcessor.java

示例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;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:16,代码来源:NamesProcessor.java


注:本文中的lotus.domino.Name.getCanonical方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。