Ben Langhinrichs

Photograph of Ben Langhinrichs

IBM Champion logo

E-mail address - Ben Langhinrichs






September, 2013
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

Search the weblog





























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




%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




%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



Copyright © 2013 Genii Software Ltd.