Search in sources :

Example 26 with NotesException

use of lotus.domino.NotesException in project org.openntf.domino by OpenNTF.

the class View method createViewNavFrom.

/*
	 * (non-Javadoc)
	 *
	 * @see org.openntf.domino.View#createViewNavFrom(java.lang.Object)
	 */
@Override
public ViewNavigator createViewNavFrom(final Object entry) {
    List<lotus.domino.Base> recycleThis = new ArrayList<lotus.domino.Base>();
    try {
        getDelegate().setAutoUpdate(false);
        getDelegate().setEnableNoteIDsForCategories(true);
        ViewNavigator result = fromLotus(getDelegate().createViewNavFrom(toLotus(entry)), ViewNavigator.SCHEMA, this);
        ((org.openntf.domino.impl.ViewNavigator) result).setType(ViewNavigator.Types.FROM);
        return result;
    } catch (NotesException e) {
        DominoUtils.handleException(e);
    } finally {
        s_recycle(recycleThis);
    }
    return null;
}
Also used : ViewNavigator(org.openntf.domino.ViewNavigator) NotesException(lotus.domino.NotesException) ArrayList(java.util.ArrayList)

Example 27 with NotesException

use of lotus.domino.NotesException in project org.openntf.domino by OpenNTF.

the class View method createColumn.

/*
	 * (non-Javadoc)
	 *
	 * @see org.openntf.domino.View#createColumn(int)
	 */
@Override
public ViewColumn createColumn(final int position) {
    try {
        ViewColumn result = fromLotus(getDelegate().createColumn(position), ViewColumn.SCHEMA, this);
        flushCaches();
        return result;
    } catch (NotesException e) {
        DominoUtils.handleException(e);
    }
    return null;
}
Also used : NotesException(lotus.domino.NotesException) ViewColumn(org.openntf.domino.ViewColumn)

Example 28 with NotesException

use of lotus.domino.NotesException in project org.openntf.domino by OpenNTF.

the class View method createViewNav.

/*
	 * (non-Javadoc)
	 *
	 * @see org.openntf.domino.View#createViewNav()
	 */
@Override
public ViewNavigator createViewNav() {
    try {
        getDelegate().setAutoUpdate(false);
        getDelegate().setEnableNoteIDsForCategories(true);
        ViewNavigator result = fromLotus(getDelegate().createViewNav(), ViewNavigator.SCHEMA, this);
        ((org.openntf.domino.impl.ViewNavigator) result).setType(ViewNavigator.Types.NONE);
        return result;
    } catch (NotesException e) {
        DominoUtils.handleException(e);
    }
    return null;
}
Also used : ViewNavigator(org.openntf.domino.ViewNavigator) NotesException(lotus.domino.NotesException)

Example 29 with NotesException

use of lotus.domino.NotesException in project org.openntf.domino by OpenNTF.

the class View method createViewNavFrom.

/*
	 * (non-Javadoc)
	 *
	 * @see org.openntf.domino.View#createViewNavFrom(java.lang.Object, int)
	 */
@Override
public ViewNavigator createViewNavFrom(final Object entry, final int cacheSize) {
    try {
        Object lotusObj = toLotus(entry);
        getDelegate().setAutoUpdate(false);
        getDelegate().setEnableNoteIDsForCategories(true);
        ViewNavigator result = fromLotus(getDelegate().createViewNavFrom(lotusObj, cacheSize), ViewNavigator.SCHEMA, this);
        result.setCacheSize(cacheSize);
        ((org.openntf.domino.impl.ViewNavigator) result).setType(ViewNavigator.Types.FROM);
        return result;
    } catch (NotesException e) {
        DominoUtils.handleException(e);
    }
    return null;
}
Also used : ViewNavigator(org.openntf.domino.ViewNavigator) NotesException(lotus.domino.NotesException)

Example 30 with NotesException

use of lotus.domino.NotesException in project org.openntf.domino by OpenNTF.

the class ViewEntry method getColumnValues.

/**
 * Returns the columnValues of this entry.
 *
 * @param returnConstants
 *            this parameter controls if constant values should also be returned
 */
protected java.util.Vector<Object> getColumnValues(final boolean returnConstants) {
    try {
        if (columnValues_ == null) {
            // cache the columnValues and rely that the caller will NOT modify the objects inside
            @SuppressWarnings("unchecked") Vector<Object> raw = getDelegate().getColumnValues();
            columnValues_ = wrapColumnValues(raw, this.getAncestorSession());
        }
        if (returnConstants) {
            List<DominoColumnInfo> colInfos = ((org.openntf.domino.impl.View) getParentView()).getColumnInfos();
            if (colInfos.size() > columnValues_.size()) {
                // there were constant columns
                Vector<Object> ret = new Vector<Object>(colInfos.size());
                for (DominoColumnInfo colInfo : colInfos) {
                    int idx = colInfo.getColumnValuesIndex();
                    if (idx < 65535) {
                        if (idx < columnValues_.size()) {
                            ret.add(columnValues_.get(idx));
                        } else {
                            // Categories!
                            ret.add(null);
                        }
                    } else {
                        ret.add(colInfo.getConstantValue());
                    }
                }
                return ret;
            }
        }
        return columnValues_;
    } catch (NotesException e) {
        if (e.id == 4432) {
            return new Vector<Object>();
        }
        DominoUtils.handleException(e);
        return null;
    }
}
Also used : NotesException(lotus.domino.NotesException) DominoColumnInfo(org.openntf.domino.impl.View.DominoColumnInfo) View(org.openntf.domino.View) Vector(java.util.Vector)

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