HCL-TECH-SOFTWARE / domino-jnx

Modern Domino Java API based on JNA access to Domino's C API
https://opensource.hcltechsw.com/domino-jnx/
Apache License 2.0
13 stars 3 forks source link

Investigate changing Document#getAsText to use NSFItemConvertValueToText #397

Closed jesse-gallagher closed 11 months ago

jesse-gallagher commented 11 months ago

The current implementation uses NSFItemConvertToText, which looks to convert only the first one. The docs indicate that NSFItemConvertValueToText is useful when there are multiple items by the same name, though the mechanics of that function imply that it'd be up to the caller to iterate over all such items.

It may be worth adding a secondary method to this to describe how to handle concatenating the values from multiple items. The use of a character for concatenating list-type items would be a reasonable default, but realistically what you'd want with e.g. a rich-text item is either no character or a different one, like a newline.

jesse-gallagher commented 11 months ago

Alternatively, it may make sense to add a binding to this to the Item class, since that will let the user iterate over items and convert them.