Search in sources :

Example 21 with NotesException

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);
    }
}
Also used : NotesException(lotus.domino.NotesException) ArrayList(java.util.ArrayList) Vector(java.util.Vector)

Example 22 with NotesException

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);
    }
}
Also used : NotesException(lotus.domino.NotesException) Vector(java.util.Vector) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList)

Example 23 with NotesException

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;
// }
}
Also used : OpenNTFNotesException(org.openntf.domino.exceptions.OpenNTFNotesException) NotesException(lotus.domino.NotesException) UserAccessException(org.openntf.domino.exceptions.UserAccessException) Database(org.openntf.domino.Database)

Example 24 with NotesException

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;
}
Also used : ViewNavigator(org.openntf.domino.ViewNavigator) NotesException(lotus.domino.NotesException)

Example 25 with NotesException

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;
}
Also used : ViewNavigator(org.openntf.domino.ViewNavigator) NotesException(lotus.domino.NotesException)

Aggregations

NotesException (lotus.domino.NotesException)105 OpenNTFNotesException (org.openntf.domino.exceptions.OpenNTFNotesException)29 ArrayList (java.util.ArrayList)28 List (java.util.List)19 ViewNavigator (org.openntf.domino.ViewNavigator)13 Vector (java.util.Vector)11 Database (lotus.domino.Database)11 Database (org.openntf.domino.Database)10 IOException (java.io.IOException)8 ViewColumn (org.openntf.domino.ViewColumn)8 DocumentCollection (org.openntf.domino.DocumentCollection)7 EmbeddedObject (org.openntf.domino.EmbeddedObject)7 RichTextItem (org.openntf.domino.RichTextItem)7 Session (lotus.domino.Session)6 MIMEEntity (org.openntf.domino.MIMEEntity)5 Date (java.util.Date)4 Document (org.openntf.domino.Document)4 DocumentCollection (lotus.domino.DocumentCollection)3 DominoQuery (lotus.domino.DominoQuery)3 Item (org.openntf.domino.Item)3