Thursday, June 19, 2008

Notes Architecture Is Too Hard To Understand!

Got the title suggestion from Chris & Tim on Yellowcast episode #3. (Yes guys, I am a fanboy...)

But to be truthful, I might have said something to that affect in the first few weeks of learning Notes development years ago. Chris mentioned the whole separation of data from UI which in Notes translates into data documents and forms and views. I couldn't grasp that right away only using the Domino Designer. Then, when I read one of Rocky Oliver's books where he explained how everything is stored as a note in the database, the light bulb finally went off.

Yet I still wasn't effective at separating the two concepts. That is, until I started working with Ytria's Scan EZ and was able to get at the data in its raw form and deal with it as data and not as something married to the UI.

One thing leads to another and as I built upon that knowledge, I was able to really leverage LotusScript, because now I had a very good understanding of the objects inside Notes. Add to that the relatively recent ability to access objects as XML representations using Notes DXL and now you have some very cool ways to manipulate most anything inside a Notes DB.

Nevertheless, I still marvel at the simplicity and power of the Notes formula language. Scott Good has commented about it at his blog and I was fascinated when reading Damin Katz blog on how he re-wrote the formula language way back when. Even though I aspire to learn the higher-level concepts, I never neglect the fact that Notes is a great RAD platform -- something I learned very early on in my Notes development life.

Tuesday, June 10, 2008

Notes Formulas for Strings and Lists

I've spent quite a few hours recently on an application that turns out to have some rather heavy reliance on string and list manipulation. In this regard I'm always impressed with what a developer can do with @Formulas. Sometimes the heavy lifting can come from the pair-wise concatenation capabilities of the Notes Formula Language. Take the following for example:

Say I have a field on my form called "System" and it contains one of the following: WP, SS, PG. (WP=Word Processing, SS=Spreadsheet, PG=Presentation Graphics) The following five lines will find the Technical Lead for whatever value I have in my "System" field.

1) @Set("_System";"WP":"SS":"PG");
2) @Set("_Leads";"Larry":"Curly":"Moe");
3) @Set("_NewList";@Explode(@Transform(_System + ";" + Leads;"x";@If(@Word(x;";";1)=System;x;@Nothing))));
4) @Set("_Count";(@Elements(_NewList)-1)*(-1));
5) @Subset(_NewList;_Count)


Part of the third line combines the two lists into a new list (_System + ";" + _Leads) using pair-wise concatenation...
WP;Larry
SS;Curly
PG;Moe
The condition parameter of the @If formula in line three examines the first word of each item in the new list and the @Transform keeps it if it matches the value in the System field, or removes it using @Nothing it if it doesn't match. The resulting new list...
WP
Larry
created using @Explode subsequently has its first member removed using the @Subset in line five, leaving me with Larry as my Tech Lead for Word Processing. (Note: counting the elements in line four allows me to assign multiple Tech Leads to any System)

The linchpin in this is your two lists must be matched up one-to-one, otherwise the pair-wise concatenation will create a mis-matched new list. Also, sometimes the combination of @Explode and @Implode can help you manipulate your list before you run it through another @Formula like @Transform or @Replace.

One word of caution when doing operations on strings and operations on lists. Sometimes the string operators will work on lists, and if you are wanting to make exact matches on elements, be sure to use the right @Formula. For example, @Contains will check for the presence of a value, but if you have ambiguous values (Frank vs. Franklin), you may not get the results you are expecting. Try @IsMember instead. Same is true for @ReplaceSubstring and @Replace.

Thursday, June 5, 2008

Craving Notes 8.5

Via Nathan, this post Notes view container proof of concept makes me want to dive in deep with the 8.5 designer.
click image for video

Wednesday, June 4, 2008

Notes as CMS

I've been meaning to start a category on Content Management and this post, IBM Melds Enterprise CMS with Social Software, from CMSWire.com was the stimulus to start. We in the Lotus Notes Domino world have been at this far longer than the recent upstarts such as Sharepoint. However, many of the newer offerings are way ahead of what Notes is able to offer in the way of industrial strength CMS. Here I'm referring to both the industry heavyweights like Oracle/Stellent and EMC's Documentum. Also noteworthy are a couple open source offerings, Alfresco and WebGUI. These systems provide a robust Java API and fairly open architectures dominated by the use of XML.

I'm eager to see what Chris & Tim are able to deliver with Broker. This is more along the lines of how the above mentioned products deliver their CMS capabilities. If done well, this could make Notes a serious contender in this space due to its wide-spread installed base as well as the vast developer community.