Search in sources :

Example 1 with Encapsulated

use of org.openntf.domino.types.Encapsulated in project org.openntf.domino by OpenNTF.

the class Database method getModifiedDocuments.

/*
	 * (non-Javadoc)
	 *
	 * @see org.openntf.domino.Database#getModifiedDocuments(lotus.domino.DateTime, int)
	 */
@Override
public DocumentCollection getModifiedDocuments(final lotus.domino.DateTime since, final int noteClass) {
    try {
        DocumentCollection result;
        lotus.domino.DateTime dt = toLotus(since);
        result = fromLotus(getDelegate().getModifiedDocuments(dt, noteClass), DocumentCollection.SCHEMA, this);
        if (since instanceof Encapsulated) {
            dt.recycle();
        }
        return result;
    } catch (NotesException e) {
        DominoUtils.handleException(e, this);
        return null;
    }
}
Also used : Encapsulated(org.openntf.domino.types.Encapsulated) OpenNTFNotesException(org.openntf.domino.exceptions.OpenNTFNotesException) NotesException(lotus.domino.NotesException) DocumentCollection(org.openntf.domino.DocumentCollection)

Example 2 with Encapsulated

use of org.openntf.domino.types.Encapsulated in project org.openntf.domino by OpenNTF.

the class Database method getModifiedDocuments.

@Override
public DocumentCollection getModifiedDocuments(java.util.Date since, final ModifiedDocClass noteClass) {
    try {
        DocumentCollection result;
        if (since == null) {
            since = new Date(0);
        }
        lotus.domino.DateTime tempDT = getAncestorSession().createDateTime(since);
        lotus.domino.DateTime dt = toLotus(tempDT);
        if (!getDelegate().isOpen()) {
            getDelegate().open();
        }
        result = fromLotus(getDelegate().getModifiedDocuments(dt, noteClass.getValue()), DocumentCollection.SCHEMA, this);
        if (tempDT instanceof Encapsulated) {
            dt.recycle();
        }
        return result;
    } catch (NotesException e) {
        DominoUtils.handleException(e, this);
        return null;
    }
}
Also used : Encapsulated(org.openntf.domino.types.Encapsulated) OpenNTFNotesException(org.openntf.domino.exceptions.OpenNTFNotesException) NotesException(lotus.domino.NotesException) DocumentCollection(org.openntf.domino.DocumentCollection) Date(java.util.Date)

Example 3 with Encapsulated

use of org.openntf.domino.types.Encapsulated in project org.openntf.domino by OpenNTF.

the class Database method search.

/*
	 * (non-Javadoc)
	 *
	 * @see org.openntf.domino.Database#search(java.lang.String, lotus.domino.DateTime, int)
	 */
@Override
public DocumentCollection search(final String formula, final lotus.domino.DateTime startDate, final int maxDocs) {
    try {
        DocumentCollection result;
        lotus.domino.DateTime dt = toLotus(startDate);
        result = fromLotus(getDelegate().search(formula, dt, maxDocs), DocumentCollection.SCHEMA, this);
        if (startDate instanceof Encapsulated) {
            dt.recycle();
        }
        return result;
    } catch (NotesException e) {
        DominoUtils.handleException(e, this);
        return null;
    }
}
Also used : Encapsulated(org.openntf.domino.types.Encapsulated) OpenNTFNotesException(org.openntf.domino.exceptions.OpenNTFNotesException) NotesException(lotus.domino.NotesException) DocumentCollection(org.openntf.domino.DocumentCollection)

Aggregations

NotesException (lotus.domino.NotesException)3 DocumentCollection (org.openntf.domino.DocumentCollection)3 OpenNTFNotesException (org.openntf.domino.exceptions.OpenNTFNotesException)3 Encapsulated (org.openntf.domino.types.Encapsulated)3 Date (java.util.Date)1