Search in sources :

Example 1 with NotesNote

use of com.ibm.designer.domino.napi.NotesNote in project org.openntf.nsfodp by OpenNTF.

the class DarwinoNCompositeData method writeJavaScriptLibraryData.

@Override
public void writeJavaScriptLibraryData(OutputStream os) throws IOException {
    try {
        // TODO figure out why the Darwino implementation chops data
        // https://github.com/OpenNTF/org.openntf.nsfodp/issues/271
        // this.data.writeJavaScriptLibraryData(os);
        long dbHandle = this.note.getParent().getHandle();
        NotesSession notesSession = new NotesSession();
        try {
            NotesDatabase notesDatabase = notesSession.getDatabase((int) dbHandle);
            NotesNote notesNote = notesDatabase.openNote(this.note.getNoteID(), 0);
            FileAccess.readFileContent(notesNote, os);
        } finally {
            notesSession.recycle();
        }
    } catch (NotesAPIException e) {
        throw new NDominoException(e.getNativeErrorCode(), e);
    } catch (DominoException e) {
        throw new NDominoException(e.getStatus(), e);
    }
}
Also used : NDominoException(org.openntf.nsfodp.commons.odp.notesapi.NDominoException) NotesNote(com.ibm.designer.domino.napi.NotesNote) NotesDatabase(com.ibm.designer.domino.napi.NotesDatabase) NotesSession(com.ibm.designer.domino.napi.NotesSession) NotesAPIException(com.ibm.designer.domino.napi.NotesAPIException) DominoException(com.darwino.domino.napi.DominoException) NDominoException(org.openntf.nsfodp.commons.odp.notesapi.NDominoException)

Aggregations

DominoException (com.darwino.domino.napi.DominoException)1 NotesAPIException (com.ibm.designer.domino.napi.NotesAPIException)1 NotesDatabase (com.ibm.designer.domino.napi.NotesDatabase)1 NotesNote (com.ibm.designer.domino.napi.NotesNote)1 NotesSession (com.ibm.designer.domino.napi.NotesSession)1 NDominoException (org.openntf.nsfodp.commons.odp.notesapi.NDominoException)1