Andrew Pollack's Blog

Technology, Family, Entertainment, Politics, and Random Noise

Mixing @Formulas and Lotusscript on Web Pages?

By Andrew Pollack on 06/30/2008 at 09:34 AM EDT

Now that XPages are set to take over the world, did you think your Lotuscript skills were wasted? The short answer is absolutely not. As you can see from this image (taken from another fantastic XPages example by John Mackey), there's something funny going on here. This looks an awful lot like Lotuscript.

It isn't really Lotusscript, but instead it's JavaScript with objects created to do most of the same things you can do with both Formula languages.

Most people who program in Lotuscript mix up two distinct aspects of the language. The syntax and keywords of the language itself, and the back end object model that you use it with. They're actually two entirely distinct things. The back end object model you're used to is where you've spent most of your time getting comfortable with doing things. Most of that skill and comfort transition to XPages easily because most of that object model is right there at your fingertips.

The syntax will more closely match the back end object implementation in Java, if you're familiar with that, but the differences are fairly minor. Take a look at what's going on here.



You're seeing the Lotus back end objects -- just like you use them in Lotuscript -- being used as part of the design on an XPage for the web. This isn't in a webQuerySave agent or anything, its right on the page as part of the event for an object on the page.

Something else you should notice -- look in the top left of the picture. Notice it says "(Server Side)"? That's where much of the truly sick power of XPages comes from. I'll write more on that later.


There are  - loading -  comments....

Prediction: a couple things that will still throw peopleBy Tim Tripcony on 06/30/2008 at 10:52 AM EDT
1 - Parentheses will be required... makes me glad I've gotten in the habit of
including them in LotusScript even though it doesn't force us to.
2 - Case will matter. doc.GetItemValueString != doc.getItemValueString...
LotusScript doesn't care, but JavaScript definitely does.
3 - Semicolons. Strictly speaking, JavaScript doesn't require that each line
end with one (because it's hoping the browser can guess where they should have
been included), but if this is all getting parsed by Java on the server, it
probably will break if a semicolon is omitted.

Folks that have spent a sizable amount of time coding Java in Domino by the
time 8.5 is released will already have all of these habits, because the
compiler will have forced them to conform to each, so transitioning into using
that syntax in JavaScript will be much easier.
Oh, there will be a LOT of things to trip over...By Andrew Pollack on 06/30/2008 at 11:21 AM EDT
...it is javascript after all. Syntax will be a killer for people who aren't
used to it. I think having the object model there is going to provide a really
good way in though for a lot of people.
re: Oh, there will be a LOT of things to trip over...By Mark Hughes on 06/30/2008 at 06:03 PM EDT
Yes!

i only use javascript sparingly and still get stuck on simple if then
statements when i do use it, it is so much easier in the basic languages

if x =y then

do this

else

msgbox("not this time!!")

end if

Maybe i am lazy but why must the syntax be so hard to read and write in
javascript?
Lazy If thenBy Peter Herrmann on 07/01/2008 at 02:46 PM EDT
//in javascript you can use shorthand like this:
x=y ? alert('do this') : alert('not this time')


Other Recent Stories...

  1. 03/26/2019Undestanding how OAUTH scopes will bring the concept of APPS to your Domino serverWhile a full description of OATH is way beyond what I can do in this quick blog entry, I wanted to talk a bit about how "SCOPES" interact with the already rich authorization model used by Domino. Thanks to the fantastic work by John Curtis and his team, the node.js integration with Domino is going to be getting a rich security model. What we know is that a user's authorizations will be respected through the node.js application to the Domino server -- including reader names, ACLs, Roles, and so on. The way ...... 
  2. 02/05/2019Toro Yard Equipment - Not really a premium brand as far as I am concernedDear Toro Customer Service, I arm writing about the following machine: Toro Power Max 1120 OXEModel:38654S/N:31000#### Specifically, bearing part #:63-3450 This is the part ($15 online / $25 at the local dealer) that caused me to raise my objections on-line. This piece of garbage is supposed to be a bearing. It carries the shaft which drives both stages of the auger. The shaft passes through the bearing (which is what bearings do) after the auger drive pulley as the shaft goes through the back (engine ...... 
  3. 10/08/2018Will you be at the NYC Launch Event for HCL Domino v10 -- Find me!Come find me in NYC on Wednesday at the Launch Event if you're there. I really do want to talk to ...... 
  4. 09/04/2018With two big projects on hold, I suddenly find myself very available for new short and long term projects.  
  5. 07/13/2018Who is HCL and why is it a good thing that they are now the ones behind Notes and Domino? 
  6. 03/21/2018Domino Apps on IOS is a Game Changer. Quit holding back. 
  7. 02/15/2018Andrew’s Proposed Gun Laws 
  8. 05/05/2016Is the growing social-sourced economy the modern back door into socialism? 
  9. 04/20/2016Want to be whitelisted? Here are some sensible rules for web site advertising 
  10. 12/30/2015Fantastic new series on Syfy called “The Expanse” – for people who love traditional science fiction 
Click here for more articles.....


pen icon Comment Entry
Subject
Your Name
Homepage
*Your Email
* Your email address is required, but not displayed.
 
Your thoughts....
 
Remember Me  

Please wait while your document is saved.