Access Rich Text fields

女生的网名这么多〃 提交于 2021-02-11 18:23:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!