• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java NotesFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中lotus.domino.NotesFactory的典型用法代码示例。如果您正苦于以下问题:Java NotesFactory类的具体用法?Java NotesFactory怎么用?Java NotesFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: getSession

import lotus.domino.NotesFactory; //导入依赖的package包/类
@Override
public Session getSession() {
	org.openntf.domino.Session _session = null;

	try {
		_session = (org.openntf.domino.Session) org.openntf.domino.utils.Factory
				.fromLotus(NotesFactory.createSession((String) null, (String) null, Credentials.getPassword()),
						org.openntf.domino.Session.class, null);

	} catch (NotesException e) {
		throw new RiverException(e);
	}

	Session session = River.getSession(River.ORG_OPENNTF_DOMINO, _session);
	return session;
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:17,代码来源:Context.java


示例2: getDataPath

import lotus.domino.NotesFactory; //导入依赖的package包/类
private String getDataPath() {
	Logger logCurrent = LoggerFactory.getLogger(this.getClass().getCanonicalName());
	if (m_Datapath == null) {
		try {
			logCurrent.fine("Initialize the notes context");
			NotesThread.sinitThread();
			Session sesCurrent = NotesFactory.createSession();
			m_Datapath = sesCurrent.getEnvironmentString("Directory", true);
			logCurrent.fine("DIRECTORY == " + m_Datapath);
			sesCurrent.recycle();
			NotesThread.stermThread();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	return m_Datapath;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:18,代码来源:XPageAgentManager.java


示例3: openTrusted

import lotus.domino.NotesFactory; //导入依赖的package包/类
public static Session openTrusted(){
	Session s = null;
	try {
		NotesThread.sinitThread();
		s = NotesFactory.createTrustedSession();
		logger.log(Level.FINE,"opened trusted session for " + s.getEffectiveUserName());
	} catch (NotesException e) {
		logger.log(Level.SEVERE,null,e);
	}
	return s;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:12,代码来源:SessionFactory.java


示例4: openSession

import lotus.domino.NotesFactory; //导入依赖的package包/类
public static Session openSession(String username, String password){
	Session s = null;
	try {
		NotesThread.sinitThread();
		s = NotesFactory.createSession((String) null, username, password);
		logger.log(Level.FINE,"opened session for " + s.getUserName());
	} catch (NotesException e) {
		logger.log(Level.SEVERE,null,e);
	}
	return s;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:12,代码来源:SessionFactory.java


示例5: createTrustedSession

import lotus.domino.NotesFactory; //导入依赖的package包/类
public static Session createTrustedSession(){
	NotesThread.sinitThread();
	Session s=null;
	try {
		s = NotesFactory.createTrustedSession();
	} catch (NotesException e) {
		logger.log(Level.SEVERE,null, e);
	}
	return s;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:11,代码来源:XSPUtils.java


示例6: getSession

import lotus.domino.NotesFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public Session<org.openntf.domino.Session> getSession(Object... parameters) {
	org.openntf.domino.Session __obj = null;

	if (parameters.length == 1 && parameters[0] instanceof org.openntf.domino.Session) {
		log.finer("Creating a session with one org.openntf.domino.Session parameter");

		__obj = (org.openntf.domino.Session) parameters[0];

		_session = getWrapper(DefaultSession.class, org.openntf.domino.Session.class, __obj); 
		return (Session<org.openntf.domino.Session>) _session; 
	}

	if (parameters.length == 3 && parameters[2] instanceof String) {
		log.finer("Creating a session with three parameters: server, username, password");

		try {
			__obj = (org.openntf.domino.Session) org.openntf.domino.utils.Factory
					.fromLotus(NotesFactory.createSession((String) parameters[0], (String) parameters[1], (String) parameters[2]),
							org.openntf.domino.Session.class, null);
		} catch (NotesException e) {
			throw new RiverException(e);
		}

		_session = getWrapper(DefaultSession.class, org.openntf.domino.Session.class, __obj);
		return (Session<org.openntf.domino.Session>) _session; 
	}

	throw new RiverException(
			"Valid parameters: (A) one org.openntf.domino.Session or (B) three Strings in this order: server, username and password.");
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:32,代码来源:DefaultFactory.java


示例7: getSession

import lotus.domino.NotesFactory; //导入依赖的package包/类
@Override
public Session getSession() {
	org.openntf.domino.Session _session = null;

	try {
		_session = (org.openntf.domino.Session) org.openntf.domino.utils.Factory
				.fromLotus(NotesFactory.createSession((String) null, (String) null, Credentials.getPassword()),
						org.openntf.domino.Session.class, null);
	} catch (NotesException e) {
		throw new RiverException(e);
	}

	Session session = River.getSession(River.ORG_OPENNTF_DOMINO, _session);
	return session;
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:16,代码来源:Context.java


示例8: getSession

import lotus.domino.NotesFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public Session<lotus.domino.Session> getSession(Object... parameters) {
	lotus.domino.Session __obj = null;

	if (parameters.length == 1 && parameters[0] instanceof lotus.domino.Session) {
		log.finer("Creating a session with one lotus.domino.Session parameter");

		__obj = (lotus.domino.Session) parameters[0];

		_session = getWrapper(DefaultSession.class, lotus.domino.Session.class, __obj); 
		return (Session<lotus.domino.Session>) _session; 
	}

	if (parameters.length == 3 && parameters[2] instanceof String) {
		log.finer("Creating a session with three parameters: server, username, password");

		try {
			isRemoteSession = (parameters[0] != null);					

			__obj = NotesFactory.createSession((String) parameters[0], (String) parameters[1], (String) parameters[2]); 
		} catch (NotesException e) {
			throw new RiverException(e);
		}

		_session = getWrapper(DefaultSession.class, lotus.domino.Session.class, __obj);
		return (Session<lotus.domino.Session>) _session; 
	}

	throw new RiverException(
			"Valid parameters: (A) one lotus.domino.Session or (B) three Strings in this order: server, username and password.");
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:32,代码来源:DefaultFactory.java


示例9: getSession

import lotus.domino.NotesFactory; //导入依赖的package包/类
@Override
public Session getSession() {
	lotus.domino.Session __session = null;

	try {
		__session = NotesFactory.createSession((String) null, (String) null, Credentials.getPassword());
	} catch (NotesException e) {
		throw new RiverException(e);
	}

	Session session = River.getSession(River.LOTUS_DOMINO, __session);
	return session;
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:14,代码来源:Context.java


示例10: getSession

import lotus.domino.NotesFactory; //导入依赖的package包/类
@Override
public Session getSession() {
	lotus.domino.Session _session = null;

	try {
		_session = NotesFactory.createSession((String) null, (String) null, Credentials.getPassword());
	} catch (NotesException e) {
		throw new RiverException(e);
	}

	Session session = River.getSession(River.LOTUS_DOMINO, _session);
	return session;
}
 
开发者ID:mariosotil,项目名称:river-framework,代码行数:14,代码来源:Context.java


示例11: getUserNameFromRequest

import lotus.domino.NotesFactory; //导入依赖的package包/类
private String getUserNameFromRequest(Request request){
	  String user = null;
	  try{
			String LtpaToken = null;

			// Extract cookie named "LtpaToken"
			Series<Cookie> cookies = request.getCookies();
			if (cookies == null) {
				return null;
			}

			for (int i = 0; i < cookies.size(); i++) {
				LOGGER.finest("i=" + i + " & name="
						+ cookies.get(i).getName());

				if (cookies.get(i).getName().equals("LtpaToken")) {
					LtpaToken = cookies.get(i).getValue();
					LOGGER.finest("got LTPA value:" + LtpaToken);
					break;
				}
			}
			if(LtpaToken!=null){
				  NotesThread.sinitThread();
		    	  Session session = NotesFactory.createSession(null, LtpaToken);
		    	  user = session.getUserName();
//		    	  user = session.getUserNameObject().getAbbreviated();
		    	  session.recycle();
		    	  NotesThread.stermThread();
			}
			LOGGER.finest("Activity rest service: get user name:"+user);
	  }catch(Exception e){
		  e.printStackTrace();
	  }
	  return user;
  }
 
开发者ID:OpenNTF,项目名称:WorkflowForXPages,代码行数:36,代码来源:ActivitiRestApplication.java


示例12: getNrpcSessionAsHost

import lotus.domino.NotesFactory; //导入依赖的package包/类
public lotus.domino.Session getNrpcSessionAsHost() {
	lotus.domino.Session result = null;
	try {
		result = AccessController.doPrivileged(new PrivilegedExceptionAction<lotus.domino.Session>() {
			@Override
			public Session run() throws Exception {
				return NotesFactory.createSessionWithFullAccess();
			}
		});
	} catch (PrivilegedActionException e) {
		DominoUtils.handleException(e);
	}
	return result;
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:15,代码来源:BackgroundRunnable.java


示例13: getTrustedSession

import lotus.domino.NotesFactory; //导入依赖的package包/类
public lotus.domino.Session getTrustedSession() {
	lotus.domino.Session result = null;
	try {
		result = AccessController.doPrivileged(new PrivilegedExceptionAction<lotus.domino.Session>() {
			@Override
			public Session run() throws Exception {
				return NotesFactory.createTrustedSession();
			}
		});
	} catch (PrivilegedActionException e) {
		DominoUtils.handleException(e);
	}
	return result;
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:15,代码来源:BackgroundRunnable.java


示例14: run

import lotus.domino.NotesFactory; //导入依赖的package包/类
@Override
public void run() {
	try {
		Session sess = NotesFactory.createSession();
		DbDirectory dir = sess.getDbDirectory("");

		Database db = sess.getDatabase("", FAKENAMES_NSF);
		if (db != null)
			db.remove();

		db = dir.createDatabase(FAKENAMES_NSF, true);
		View view = db.createView("Names", "SELECT Form = \"DocName\"");
		view.createColumn(2, "Title", "Title").recycle();

		view.createColumn(3, "Prefix", "NamePrefix").recycle();
		view.createColumn(4, "First Name", "FirstName").recycle();
		view.createColumn(5, "Last Name", "LastName").recycle();

		view.createColumn(6, "Zip Code", "ZipCode").recycle();
		view.createColumn(7, "Country", "Country").recycle();
		view.createColumn(8, "Address", "Address").recycle();

		view.createColumn(9, "Birthday", "Birthday").recycle();
		view.createColumn(10, "PhoneNumber", "PhoneNumber").recycle();
		view.recycle();
		db.recycle();
		dir.recycle();
		//	sess.recycle();
	} catch (NotesException e) {
		e.printStackTrace();
	}
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:33,代码来源:CreateTestDatabaseLotus.java


示例15: getSession

import lotus.domino.NotesFactory; //导入依赖的package包/类
protected Session getSession() {
	try {
		Session session = Factory.getWrapperFactory().fromLotus(NotesFactory.createSession(), Session.SCHEMA, null);
		return session;
	} catch (Throwable t) {
		DominoUtils.handleException(t);
		return null;
	}
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:10,代码来源:NoteListTest.java


示例16: run

import lotus.domino.NotesFactory; //导入依赖的package包/类
@Override
public void run() {
	try {
		System.out.println("Starting NotesRunner");
		Session session = NotesFactory.createSession();
		run4(session);
		session.recycle();
	} catch (Throwable t) {
		t.printStackTrace();
	}
	System.out.println("FINI!");
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:13,代码来源:NotesRunner.java


示例17: openSession

import lotus.domino.NotesFactory; //导入依赖的package包/类
public static Session openSession(){
	Session s = null;
	try {

		NotesThread.sinitThread();
		String password = "";
		s = NotesFactory.createSession((String)null, (String)null, password);
		logger.log(Level.FINE,"opened session for " + s.getUserName());
	} catch (NotesException e) {
		logger.log(Level.SEVERE,null,e);
	}
	return s;
}
 
开发者ID:mwambler,项目名称:webshell-xpages-ext-lib,代码行数:14,代码来源:SessionFactory.java


示例18: init

import lotus.domino.NotesFactory; //导入依赖的package包/类
@BeforeClass
public static void init() throws Exception {
	// MUST use sysout because the log handler crashes when the Notes thread has not been initialized
	System.out.println("Init " + AllTests.class.getName()); //$NON-NLS-1$

	NotesThread.sinitThread();
	Factory.startup();
	Factory.initThread(Factory.PERMISSIVE_THREAD_CONFIG);

	lotusSession = NotesFactory.createSession();
	session = Factory.getWrapperFactory().fromLotus(lotusSession, Session.SCHEMA, null);
	FrameworkUtils.setFallbackSession(session);

	MODELS_DB_PATH = instantiateDb("models");
}
 
开发者ID:jesse-gallagher,项目名称:XPages-Scaffolding,代码行数:16,代码来源:AllTests.java


示例19: checkIfExists

import lotus.domino.NotesFactory; //导入依赖的package包/类
private IStatus checkIfExists() {
	
	IStatus status = Status.OK_STATUS;

	final Status[] arrayOfStatus = new Status[1];

	Runnable runnable = new Runnable() {
		
		@SuppressWarnings("unused")
		public void run() {
			
			Session session = null;
			Database database = null;
			
			try {
				
				session = NotesFactory.createSession();

				database = session.getDatabase(CreateNSFJob.this.serverName, CreateNSFJob.this.nsfName, false);
				if (database != null) {
					CreateNSFJob.this.alreadyExists = true;
				}
				
			} catch (NotesException e) {

				String msg = StringUtil.format("NSF creation failed for {0} [server:{1}]",
						new Object[] { CreateNSFJob.this.nsfName, CreateNSFJob.this.serverName });
				
				arrayOfStatus[0] = new Status(4, "com.ibm.designer.domino", CommandLineJobManager.STATUSCODE_ERROR,
						msg, e);
				if (database != null) {
					try {
						database.recycle();
					} catch (Exception localException1) {
					}
				}
				if (session != null) {
					try {
						session.recycle();
					} catch (Exception localException2) {
					}
				}
			} finally {
				if (database != null) {
					try {
						database.recycle();
					} catch (Exception localException3) {
					}
				}
				if (session != null) {
					try {
						session.recycle();
					} catch (Exception localException4) {
					}
				}
			}
		}
	};
	
	try {
		NotesPlatform.getInstance().syncExec(runnable);
	} catch (Throwable localThrowable) {
		String str = StringUtil.format("NSF existance check failed for {0} [server:{1}]",
				new Object[] { this.nsfName, this.serverName });
		arrayOfStatus[0] = new Status(4, "com.ibm.designer.domino", CommandLineJobManager.STATUSCODE_ERROR, str,
				localThrowable);
	}
	if ((status.isOK()) && (arrayOfStatus[0] != null)) {
		status = arrayOfStatus[0];
	}
	return status;
}
 
开发者ID:camac,项目名称:BuildXPages,代码行数:73,代码来源:CreateNSFJob.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ParameterizableViewController类代码示例发布时间:2022-05-22
下一篇:
Java LikeActionController类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap