Genii Weblog


Civility in critiquing the ideas of others is no vice. Rudeness in defending your own ideas is no virtue.


Mon 16 Sep 2013, 12:56 PM
One of the challenges of writing software is to balance the simplicity and complexity so that the users can mostly revel in the simplicity, but can harness the power of the complexity when necessary. For example, the following are all fairly simple agents, but the first uses only defaults and thus renders all the non-system items on the document, and renders the full rich text field. The second narrows down the export to specified fields. The third uses those same narrow set of fields, but renames them. It also says to only render the first graphic in the Photo field and to render the Col1 item as plain text.

%REM
   Agent SimpleAgent1.json - Generate all non-system items
%END REM
Option Public
Option Declare
Uselsx "*lsxrtc"

Sub Initialize
   Dim gColl As New GeniiCollection
   Call gColl.AddByFTSearch("""CurbAppeal.nsf""Lyndhurst")
   Print gColl.GenerateJSON("""")
   Print "Content-Type: application/json"
   Print ||
   Print gColl.GenerateJSON("""")
End Sub

Inline JPEG image


%REM
   Agent SimpleAgent2.json - Only generate certain items in a particular order
%END REM
Option Public
Option Declare
Uselsx "*lsxrtc"

Sub Initialize
   Dim gColl As New GeniiCollection
   Call gColl.AddByFTSearch("""CurbAppeal.nsf""Lyndhurst")
   Print "Content-Type: application/json"
   Print ||
   Print gColl.GenerateJSON("StreetAddress,City,Price,Photo,Col1""")
End Sub

Inline JPEG image


%REM
   Agent SimpleAgent3.json - Rename some variables and alter the rich text generated
%END REM
Option Public
Option Declare
Uselsx "*lsxrtc"

Sub Initialize
   Dim gColl As New GeniiCollection
   Call gColl.AddByFTSearch("""CurbAppeal.nsf""Lyndhurst")
   Print "Content-Type: application/json"
   Print ||
   Print gColl.GenerateJSON("StreetAddress=Address,City,Price=Cost,Photo[Graphic 1],Col1[Plain Text]=Plain""")
End Sub

Inline JPEG image

Copyright 2013 Genii Software Ltd.