Ben Langhinrichs

Photograph of Ben Langhinrichs

E-mail address - Ben Langhinrichs







Recent posts

Tue 19 May 2020

An unladen user



Thu 7 May 2020

Can we get a huzzah for updated Domino Limits?



Wed 29 Apr 2020

A bigger boat: when in Rome


July, 2020
SMTWTFS
   01 02 03 04
05 06 07 08 09 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Search the weblog





























Genii Weblog

Could working with rich text really be RESTful?

Thu 7 Feb 2019, 02:51 PM



by Ben Langhinrichs
I thought it might be fun to see how the Midas LSX programming model might work as a REST API interface. No particular customer request, but definitely consistent with some of HCL's vision for Domino 11 and even low code development.. Here are a few results of my playing. I want to be clear, this isn't in a released product, and may not be. If anything, it is a demonstration about how flexible Midas programming can be. This required very little work other than adding a JSON parser and making Midas C++ API calls.


Results of GET with /testit.nsf/api/genii/8108D92AE62C4C9485257BCF006F2FEC/Body/Table.1/Row.2

Inline JPEG image


What that initial rich text field looks like

Inline JPEG image



JSON to use in PATCH with /testit.nsf/api/genii/8108D92AE62C4C9485257BCF006F2FEC/Body/Table.1/Row.2

Inline JPEG image



Results of subsequent GET with /testit.nsf/api/genii/8108D92AE62C4C9485257BCF006F2FEC/Body/Table.1/Row.2

Inline JPEG image


Modified rich text field after this patch

Inline JPEG image


Doing the same basic logic in LotusScript (for comparison for those who know Midas LSX)

' *** Code below is untested

Call rtitem.Connect("", "testit.nsf", "8108D92AE62C4C9485257BCF006F2FEC", "Body")
Set rttable = rtitem.DefineChunk("Table 1; Row 2)

' *** Get column one data
Set rtcell = rttable.DefineSubChunk("Inside Column 1)
col1text = rtcell.UnformattedText
col1html = rtcell.GenerateHTML(...)

' *** Get column two data
Call rtcell.GetNextTarget()
col2text = rtcell.UnformattedText
col2html = rtcell.GenerateHTML(...)

' *** Get column three data
Call rtcell.GetNextTarget()
col3text = rtcell.UnformattedText
col3html = rtcell.GenerateHTML(...)


' *** Change column one data
Set rtcell = rttable.DefineSubChunk("Inside Column 1)
Call rtcell.ChangeFont("+Italic")

' *** No change to column two data
Call rtcell.GetNextTarget()

' *** Change column Three data
Call rtcell.GetNextTarget()
Call rtcell.Text = "A terrific debut"

rtitem.Save


Copyright 2019 Genii Software Ltd.

What has been said:

No documents found