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


Java ExtLibUtil.getCurrentSession方法代码示例

本文整理汇总了Java中com.ibm.xsp.extlib.util.ExtLibUtil.getCurrentSession方法的典型用法代码示例。如果您正苦于以下问题:Java ExtLibUtil.getCurrentSession方法的具体用法?Java ExtLibUtil.getCurrentSession怎么用?Java ExtLibUtil.getCurrentSession使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ibm.xsp.extlib.util.ExtLibUtil的用法示例。


在下文中一共展示了ExtLibUtil.getCurrentSession方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: notesColorToCSS

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
private String notesColorToCSS(final int notesColor) {
	try {
		Session session = ExtLibUtil.getCurrentSession();
		ColorObject colorObject = session.createColorObject();
		colorObject.setNotesColor(notesColor);

		StringBuilder result = new StringBuilder();
		result.append("rgb(");
		result.append(colorObject.getRed());
		result.append(",");
		result.append(colorObject.getGreen());
		result.append(",");
		result.append(colorObject.getBlue());
		result.append(")");

		return result.toString();
	} catch(NotesException ne) {
		return "";
	}
}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:21,代码来源:DynamicViewCustomizer.java

示例2: isHybridApplication

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public boolean isHybridApplication() {
    checkOnBluemix();
    
    try{
        Session session = ExtLibUtil.getCurrentSession();
        String serverName = session.getServerName();
        
        String defaultServerNameFull  = "CN=vcap/O=Bluemix"; // $NON-NLS-1$
        String defaultServerNameShort = "vcap/Bluemix"; // $NON-NLS-1$
        if(serverName != null && !serverName.equals(defaultServerNameFull) && !serverName.equals(defaultServerNameShort)) {
            return true;
        }
    }catch(NotesException ne) {
        throw new FacesException(ne.getMessage());
    }
    return false;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:18,代码来源:BluemixContext.java

示例3: formatName

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的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

示例4: getSessionAddressBooks

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
private NABDb[] getSessionAddressBooks() throws NotesException {
    Map<String,Object> sc = ExtLibUtil.getSessionScope();
    NABDb[] addressBooks = sc!=null ? (NABDb[])sc.get(KEY_NABS) : null;
    if(addressBooks==null) {
        // Try with the current user
        Session session = ExtLibUtil.getCurrentSession();
        addressBooks = getSessionAddressBooks(session);
        if(addressBooks!=null && addressBooks.length>0) {
            if(sc!=null) {
                sc.put(KEY_NABS, addressBooks);
            }
        } else {
            // No NAB is avail - we don't throw a signal from here as it forces authentication
            // as soon as the page is displayed (the control asks for the NAB when rendering)
            //throw new NoAccessSignal();
        }
    }
    return addressBooks;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:20,代码来源:DominoNABNamePickerData.java

示例5: toCommon

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
private String toCommon(final String value) {
	try {
		Session session = ExtLibUtil.getCurrentSession();
		Name name = session.createName(value);
		String result = name.getCommon();
		name.recycle();
		return result;
	} catch (NotesException ne) {
		return ne.toString();
	}
}
 
开发者ID:jesse-gallagher,项目名称:Miscellany,代码行数:12,代码来源:CommonNameConverter.java

示例6: getPeopleData

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的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());
                    lotus.domino.Database database = session.getCurrentDatabase();
                    // TODO get a Notes/Domino id from an identity provider...
                    String effectiveUserName = session.getEffectiveUserName();
                    data.DBACL_CREATE_DOCS = database.queryAccessPrivileges(effectiveUserName) & lotus.domino.Database.DBACL_CREATE_DOCS;
                    data.DBACL_DELETE_DOCS = database.queryAccessPrivileges(effectiveUserName) & lotus.domino.Database.DBACL_DELETE_DOCS;
                    data.DBACL_CREATE_PRIV_AGENTS = database.queryAccessPrivileges(effectiveUserName) & lotus.domino.Database.DBACL_CREATE_PRIV_AGENTS;
                    data.DBACL_CREATE_PRIV_FOLDERS_VIEWS = database.queryAccessPrivileges(effectiveUserName) & lotus.domino.Database.DBACL_CREATE_PRIV_FOLDERS_VIEWS;
                    data.DBACL_CREATE_SHARED_FOLDERS_VIEWS = database.queryAccessPrivileges(effectiveUserName) & lotus.domino.Database.DBACL_CREATE_SHARED_FOLDERS_VIEWS;
                    data.DBACL_CREATE_SCRIPT_AGENTS = database.queryAccessPrivileges(effectiveUserName) & lotus.domino.Database.DBACL_CREATE_SCRIPT_AGENTS;
                    data.DBACL_READ_PUBLIC_DOCS = database.queryAccessPrivileges(effectiveUserName) & lotus.domino.Database.DBACL_READ_PUBLIC_DOCS;
                    data.DBACL_WRITE_PUBLIC_DOCS = database.queryAccessPrivileges(effectiveUserName) & lotus.domino.Database.DBACL_WRITE_PUBLIC_DOCS;
                    data.DBACL_REPLICATE_COPY_DOCS = database.queryAccessPrivileges(effectiveUserName) & lotus.domino.Database.DBACL_REPLICATE_COPY_DOCS;
                    data.DBACL_ACCESS_LEVEL = database.queryAccess(effectiveUserName);
                    data.DBACL_ACCESS_ROLES = database.queryAccessRoles(effectiveUserName);
                    addProperties(id,data);
                } catch(NotesException ex) {
                    throw new FacesExceptionEx(ex,"Error while retrieving user names"); // $NLX-DominoDBUserBeanDataProvider.Errorwhileretrievingusernames-1$
                }
            }
        }
    }
    return data;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:38,代码来源:DominoDBUserBeanDataProvider.java

示例7: getPeopleData

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的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

示例8: getCurrentSession

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
private static Session getCurrentSession() {
    return ExtLibUtil.getCurrentSession();
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:4,代码来源:NotesFunctionsEx.java

示例9: getCommonServerName

import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public static String getCommonServerName() {
	Session session=ExtLibUtil.getCurrentSession();
	Database db=ExtLibUtil.getCurrentDatabase();
	
	String serverName="";

	try {
		serverName = db.getServer();
	} catch (NotesException e) { }
	
	return toCommon(session, serverName);
	
}
 
开发者ID:sbasegmez,项目名称:ic14demos,代码行数:14,代码来源:DevelopiUtils.java


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