本文整理汇总了Java中lotus.domino.NotesFactory类的典型用法代码示例。如果您正苦于以下问题:Java NotesFactory类的具体用法?Java NotesFactory怎么用?Java NotesFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NotesFactory类属于lotus.domino包,在下文中一共展示了NotesFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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.");
}
示例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;
}
示例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.");
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
}