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?
Access Rich Text fields
176 Views Asked by Vomste At
2
There are 2 best solutions below
1
On
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()
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.