Search This Blog

Sunday, August 8, 2021

Do not use NotesRichTextItem.ConvertToHTML() or use it but be ready it will be removed in the future release.

 Hi

Just a suggesstion.

Since R9(?) it was possible to use NotesRichTextItem.ConvertToHTML(), see its description here: https://help.hcltechsw.com/dom_designer/9.0.1/appdev/H_CONVERTOHTML_METHOD_NOTESRICHTEXTITEM.html

It was kind of relief to be able to use a native API instead of making those custom solutions based on MIME/DXL/XmlHttpRequest/...

However, later we noticed that every call of NotesRichTextItem.ConvertToHTML() in server agent showed this message in the Domino console: 

        CSRF Init: iNotes_WA_Security_ReturnUrlCheck> c_CSRFReturnUrlCheck: 1

It is very easy to reproduce it. Create an agent which works in server's context (run it from console or by schedule) and write something like Dim s As New NotesSession Dim db As NotesDatabase Dim doc As NotesDocument Dim rtItem As NotesRichTextItem Dim html As String Set db = s.Currentdatabase Set doc = db.Alldocuments.Getfirstdocument() '<-- This is a doc with richtextitem Body Set rtItem = doc.Getfirstitem("Body") html = rtItem.convertToHTML() Domino console has to show: [0AB8:0025-08E8] 31-05-2021 16:32:21,71 CSRF Init: iNotes_WA_Security_ReturnUrlCheck> c_CSRFReturnUrlCheck: 1 [0AB8:0025-08E8] 31-05-2021 16:32:21 AMgr: Start executing agent 'testAgent' in 'test\test.nsf' [0AB8:0025-08E8] iNotes Init: Credential Store Configuration not enabled, less secure mode. [0AB8:0025-08E8] 31-05-2021 16:32:22 AMgr: Agent 'testAgent' in 'test\test.nsf' completed execution We have a big database with several RichTextItems in every document and for every such item in every document a scheduled agent does some magic and uses rtItem.convertToHTML() - Domino console spams million of such messages for more than 1 hour.

I contacted HCL regarding this and they said that they forgot to hide this method: it is not supported and will be removed in a future release, though it was reproduced even in R12.


5 comments:

  1. Hi.
    I get this message when Http task started.
    And I have a agent that use with method, and no message in log when it work.
    Perhaps the agent launch is via http?

    ReplyDelete
    Replies
    1. Hi, the message is not in log, it appears in console only without going to log.nsf. Try to run your agent and check live Domino-console.
      HCL confirmed they reproduced this problem.

      Delete
    2. yes, I checked. There is a message, strange that I did not pay attention before.

      Delete
  2. pls check this: https://twitter.com/hinkyminky/status/1352686187358674947
    solution : iNotes_WA_Security_ReturnUrlCheck=0 in notes.ini

    i think you are not using inotes.

    ReplyDelete
    Replies
    1. Great, thank you, I will check this parameter,
      yes, we do not use iNotes, just standard Notes UI + Traveler.

      Delete