klehmann / domino-jna

Java project to access the IBM/HCL Domino C API using Java Native Access (JNA)
Apache License 2.0
66 stars 16 forks source link

Doc links are not generated after converting rich text to html #60

Closed sattam-datum closed 3 years ago

sattam-datum commented 3 years ago

image

I am unable to find generated link for doc links, like the above screen shot

klehmann commented 3 years ago

Haven’t checked yet, but have you made sure the database contains a default view? Could be causing this kind of problem.

sattam-datum commented 3 years ago

It's not related to view, this doc link inside rich text in the document:

so as example rich text will contains like this : Click here >> image

klehmann commented 3 years ago

I know. But have you checked that there is a default view in the design?

sattam-datum commented 3 years ago

Yes there is , also note that I don't have privilege to change anything.

klehmann commented 3 years ago

Ok. And there is no IMG tag at all for the doclink? I would expect it to be broken because it’s not a normal embedded image that can be extracted from the richtext CD records, but a shared icon resource. Will test it later today.

sattam-datum commented 3 years ago

It's standard style of lotus notes link : below is sample of the generated xml of it from lotus notes standard integration

<doclink document='8D4E93D5D4063234234324234' view='32432423423423' database='1234566' description='Database $$test;, View '$$test ', Document '$$test ''/>

klehmann commented 3 years ago

Some progress here. I also don't get doclinks when I use the richtext-html conversion with my local Notes Client, but it works when running on the Domino server (tried the XPages plugin on Domino R10 / R11). Will need to ask HCL core dev if there are any settings I need to set to make it work locally as well.

klehmann commented 3 years ago

More progress. By setting a conversion property via HTMLSetProperty I can change the link handling behavior. Will be in the next version coming out soon. Without the property:

<font size="2" face="sans-serif">Doclink:</font><br>
<br>
<br>
<font size="2" face="sans-serif">View-Link:</font><br>
<br>
<br>
<font size="2" face="sans-serif">Db-Link:</font><br>
<br>
<br>

With the property set:

<font size="2" face="sans-serif">Doclink:</font><br>
<a href="/__482571d7000a8bd1.nsf/862561bd0045e8e785255b3c105a57bb/afcb7236f22e8338482573fb00323555?Redirect&Name=Karstens-Mac.local"><img src="/icons/doclink.gif" border="0" alt="IBM C API Notes/Domino 9.0.1 Reference"></a><br>
<br>
<font size="2" face="sans-serif">View-Link:</font><br>
<a href="/__482571d7000a8bd1.nsf/862561bd0045e8e785255b3c105a57bb?Redirect&Name=Karstens-Mac.local"><img src="/icons/viewlink.gif" border="0" alt="IBM C API Notes/Domino 9.0.1 Reference"></a><br>
<br>
<font size="2" face="sans-serif">Db-Link:</font><br>
<a href="/__482571d7000a8bd1.nsf?Redirect&Name=Karstens-Mac.local"><img src="/icons/dblink.gif" border="0" alt="IBM C API Notes/Domino 9.0.1 Reference"></a><br>

Will be on by default but can be disabled.

sattam-datum commented 3 years ago

New update on this: some doc links are retuning in html like below but the href is not working <a href="/filepath.nsf/cbe588ea18299e4785257482004e5f55/42ac321cf12b96148525799900757db6?OpenDocument"><img src="/icons/doclink.gif" border="0" alt="Testing"></a>

and standard anchor generated and working fine like below:

<a href="Notes:///8525706F0068109E/5FA05CA50D3C2BF3852570FC00653E79">Notes Link</a&gt

this was tested on version 0.9.39

klehmann commented 3 years ago

FYI: The new Domino JNA version with advanced richtext-html conversion options is now available.

sattam-datum commented 3 years ago

can you provide us with the sample code of how to show the doc links in the generated html?

klehmann commented 3 years ago

Yes, sure: https://github.com/klehmann/domino-jna/blob/master/domino-jna/src/test/java/com/mindoo/domino/jna/test/TestRichtextConversionToHTML.java#L80