Package org.protege.notesapi.notes

Examples of org.protege.notesapi.notes.Annotation


    }


    @Override
    public void deleteNoteAndReplies(NoteId noteId) {
        Annotation note = notesManager.getNote(noteId.getLexicalForm());
        if (note != null) {
            notesManager.deleteNote(noteId.getLexicalForm());
            project.getEventManager().postEvent(new NoteDeletedEvent(project.getProjectId(), noteId));
        }
    }
View Full Code Here


    }


    @Override
    public void setNoteStatus(NoteId noteId, NoteStatus noteStatus) {
        Annotation note = notesManager.getNote(noteId.getLexicalForm());
        if(note == null) {
            // Sometimes we fail to find the note.  I'm not sure why.  This has something to do with the weird internals
            // and typing of the notes API.
            LOGGER.info(project.getProjectId(), "Failed to find note by Id when changing the note status.  The noteId was %s", noteId);
            return;
        }
        if(noteStatus == NoteStatus.OPEN) {
            note.setArchived(false);
        }
        else {
            note.setArchived(true);
        }
        project.getEventManager().postEvent(new NoteStatusChangedEvent(project.getProjectId(), noteId, noteStatus));
    }
View Full Code Here

    private Note addNoteToTarget(AnnotatableThing target, NoteContent noteContent, UserId author, long timestamp) throws NotesException {
        final String subject = noteContent.getSubject().or("");
        final String body = noteContent.getBody().or("");
        final org.protege.notesapi.notes.NoteType noteType = org.protege.notesapi.notes.NoteType.Comment;
        Annotation annotation = notesManager.createSimpleNote(noteType, subject, body, author.getUserName(), target);
        annotation.setCreatedAt(timestamp);
        final NoteId noteId = NoteId.createNoteIdFromLexicalForm(annotation.getId());
        NoteHeader noteHeader = new NoteHeader(noteId, Optional.<NoteId>absent(), author, timestamp);
        return Note.createNote(noteHeader, noteContent);
    }
View Full Code Here

TOP

Related Classes of org.protege.notesapi.notes.Annotation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.