Hello.Let me first tell you the context. I am migrating Lotus documents into an SQL database. The migration of richtext fields are done getting their HTML. Before getting the HTML, I have to pre process it first. The links, embedded objects and attachments have to be extracted, replaced by an URL and removed from the richtext.
The bug (?) happens in a particular case when a RT field contains text-LINK1-text-EMBEDDEDOBJECT. Here is the code :
rtnavTemp = rtTemp.createNavigator();
int x = 0;
if (rtnavTemp.findFirstElement(RichTextItem.RTELEM_TYPE_DOCLINK)) {
do {
rtTemp.beginInsert(rtnavTemp);
rtTemp.appendStyle(httpstyle);
rtTemp.appendText("test");
rtTemp.appendStyle(originalstyle);
rtTemp.endInsert();
x += 1;
} while (rtnavTemp.findNextElement());
}
for ( int i = 1; i <= x; i++ ) {
link = (RichTextDoclink) rtnavTemp.getNthElement(RichTextItem.RTELEM_TYPE_DOCLINK,1);
link.remove();
}
The “test” word is inserted not where it should be but just before the embedded object. If there is other doc links between the first link and the embedded object, the insert is at the right place.
I work on R7.0.2.
Do you have any idea? Do you need some more details?
Thank you in advance for your help.
Koray.