Skip to main content

Access/write additional metdata fields from plugin

Comments

2 comments

  • Official comment
    Jonas Kuhn

    Hi Alex,

    Metadata in the Info tab can be set by creating new DocumentNotes and adding them with `DocumentNoteUtilities.addNotesTo(...)`. 

    You'll also need to create DocumentNoteTypes and DocumentNoteFields, here's a short example of how to do that:

    DocumentNoteField field1 = DocumentNoteField.createTextNoteField("test field", "Some field", "testField", Collections.emptyList(), true);
    DocumentNoteField field2 = DocumentNoteField.createTextNoteField("longer test field", "Some other field", "testField2", Collections.emptyList(), true);
    DocumentNoteType noteType = DocumentNoteUtilities.createNewNoteType("test note", "testNote1", "Some description", Arrays.asList(field1, field2), true);
    DocumentNoteUtilities.setNoteType(noteType);
    DocumentNote note = noteType.createDocumentNote();
    DocumentNoteUtilities.addNotesTo(myAPD, Collections.singletonList(note));
  • Alex Zwetsloot

    Excellent, thanks a lot for your help Jonas!

    0

Please sign in to leave a comment.