use of lotus.domino.NotesException in project org.openntf.domino by OpenNTF.
the class Item method appendToTextList.
/*
* (non-Javadoc)
*
* @see org.openntf.domino.Item#appendToTextList(java.util.Vector)
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void appendToTextList(final Vector values) {
markDirty();
List<lotus.domino.Base> recycleThis = new ArrayList();
try {
Vector v = toDominoFriendly(values, getAncestorSession(), recycleThis);
getDelegate().appendToTextList(v);
} catch (NotesException e) {
DominoUtils.handleException(e, this);
} finally {
s_recycle(recycleThis);
}
}
use of lotus.domino.NotesException in project org.openntf.domino by OpenNTF.
the class Log method openMailLog.
/*
* (non-Javadoc)
*
* @see org.openntf.domino.Log#openMailLog(java.util.Vector, java.lang.String)
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void openMailLog(final Vector recipients, final String subject) {
List recycleThis = new ArrayList();
try {
java.util.Vector v = toDominoFriendly(recipients, getAncestorSession(), recycleThis);
getDelegate().openMailLog(v, subject);
} catch (NotesException ne) {
DominoUtils.handleException(ne);
} finally {
s_recycle(recycleThis);
}
}
use of lotus.domino.NotesException in project org.openntf.domino by OpenNTF.
the class Session method getDatabase.
/*
* (non-Javadoc)
*
* @see org.openntf.domino.Session#getDatabase(java.lang.String, java.lang.String, boolean)
*/
@Override
public org.openntf.domino.Database getDatabase(final String server, final String db, final boolean createOnFail) {
// Handle quickly the case of .getDatabase("", "")
if ((server == null || server.isEmpty()) && (db == null || db.isEmpty())) {
try {
synchronized (getDB_lock) {
return fromLotus(getDelegate().getDatabase("", ""), Database.SCHEMA, this);
}
} catch (NotesException e) {
DominoUtils.handleException(e, this);
return null;
}
}
if (db == null || db.isEmpty()) {
throw new IllegalArgumentException("Filepath argument cannot be null or empty string unless the server is also empty.");
}
// try {
lotus.domino.Database database = null;
org.openntf.domino.Database result = null;
if (result == null) {
try {
boolean isDbRepId = DominoUtils.isReplicaId(db);
if (isDbRepId) {
lotus.domino.Database nullDb;
synchronized (getDB_lock) {
nullDb = getDelegate().getDatabase(null, null);
}
boolean opened = nullDb.openByReplicaID(server, db);
if (opened) {
result = fromLotus(nullDb, Database.SCHEMA, this);
} else {
s_recycle(nullDb);
result = null;
}
} else {
synchronized (getDB_lock) {
database = getDelegate().getDatabase(server, db, createOnFail);
}
result = fromLotus(database, Database.SCHEMA, this);
}
// if (isDbCached_ && result != null) {
// databases_.put(key, result);
// if (isDbRepId) {
// databases_.put(result.getApiPath(), result);
// } else {
// databases_.put(result.getMetaReplicaID(), result);
// }
// }
} catch (NotesException e) {
if (e.id == NotesError.NOTES_ERR_DBNOACCESS) {
throw new UserAccessException("User " + getEffectiveUserName() + " cannot open database " + db + " on server " + server, e);
} else {
DominoUtils.handleException(e, this);
return null;
}
}
}
return result;
// } catch (Exception e) {
// DominoUtils.handleException(e);
// return null;
// }
}
use of lotus.domino.NotesException in project org.openntf.domino by OpenNTF.
the class View method createViewNavFromDescendants.
/*
* (non-Javadoc)
*
* @see org.openntf.domino.View#createViewNavFromDescendants(java.lang.Object)
*/
@Override
public ViewNavigator createViewNavFromDescendants(final Object entry) {
try {
getDelegate().setAutoUpdate(false);
getDelegate().setEnableNoteIDsForCategories(true);
ViewNavigator result = fromLotus(getDelegate().createViewNavFromDescendants(toLotus(entry)), ViewNavigator.SCHEMA, this);
((org.openntf.domino.impl.ViewNavigator) result).setType(ViewNavigator.Types.DESCENDANTS);
return result;
} catch (NotesException e) {
DominoUtils.handleException(e);
}
return null;
}
use of lotus.domino.NotesException in project org.openntf.domino by OpenNTF.
the class View method createViewNavFromAllUnread.
/*
* (non-Javadoc)
*
* @see org.openntf.domino.View#createViewNavFromAllUnread(java.lang.String)
*/
@Override
public ViewNavigator createViewNavFromAllUnread(final String userName) {
try {
getDelegate().setAutoUpdate(false);
getDelegate().setEnableNoteIDsForCategories(true);
ViewNavigator result = fromLotus(getDelegate().createViewNavFromAllUnread(userName), ViewNavigator.SCHEMA, this);
((org.openntf.domino.impl.ViewNavigator) result).setType(ViewNavigator.Types.UNREAD);
((org.openntf.domino.impl.ViewNavigator) result).setUnreadUser(userName);
return result;
} catch (NotesException e) {
DominoUtils.handleException(e);
}
return null;
}
Aggregations