问题
I need to access a rich text field inside a document, however, if I read the documents with the correct field selected, I don't receive the value of the field in the database response. How can I retrieve the data of a rich text field?
回答1:
Rich text fields are not yet supported. Some very basic RT support is coming in 1.0.4 of the appdev pack, but I don't think you'll be able to use it yet as you would like.
回答2:
If they hold their promise (quarterly releases) and with 1.0.3 out in December, I hope for a 1.0.4 release in March.
回答3:
Our current workaround:
Convert the RTField to HTML using the rt.convertToTHML() method, save it into another field via an agent and process the HTML. Works fine for read only, embedded pictures need a little extra work
RichTextItem rt = (RichTextItem) doc.getFirstItem("body");
String html = rt.convertToHTML(null);
doc.replaceItemValue("bodyHTML", html);
doc.save()
来源:https://stackoverflow.com/questions/60315715/access-rich-text-fields