domino-jna
domino-jna copied to clipboard
Subforms
Is there a way to get subforms related to a specific form?
In standard notes. jar I can get any subform by name using Database.getForm but I didn't find any linkage between form and related subforms
I just added NotesDatabase.getForms(): 37778797bfee9facb6a6785d317711ed7b805b81 20e62309817e4723b86dfd9d2ee39caa8bb0cf12
Next I will take a look at subform usage. Should be possible by traversing the design richtext ($body item).
And here are the methods to read subform names and formulas: 80cc4d4e7f94b7612c482cc9ecf9c26440311096
thanks, Can you add sample code of how to use it? And when will you release latest artifact?
I think you can always have a look at the test-code to see how to use the new methods: https://github.com/klehmann/domino-jna/blob/master/domino-jna/src/test/java/com/mindoo/domino/jna/test/TestDesignFormAccess.java
Here is a snippet:
NotesDatabase db = new NotesDatabase("", "mydatabase.nsf", "");
NotesForm form = db.getForm("MyFormWithSubform");
//read the design richtext
IRichTextNavigator rtNav = form.getNote().getRichtextNavigator("$Body");
//returns pairs of dbreplicaid/subformname that are contained in the form
//(replica id "0000000000000000" for the same db as the form)
List<Pair<String,String>> namedSubforms = RichTextUtils.collectNamedSubforms(rtNav);
//returns a list of subform formulas
List<String> subformFormulas = RichTextUtils.collectSubformFormulas(rtNav));