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 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

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


msgbox("not this time!!")

end if

Maybe i am lazy but why must the syntax be so hard to read and write in
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. 09/04/2018With two big projects on hold, I suddenly find myself very available for new short and long term projects. In twenty five years, I don't think I've ever written an entry like this, but if you need the kind of work I do now would be a great time to get in touch. Both of the big projects I had lined up for late summer and early fall have been placed on hold and will be that way for a while. With the kids now all off at college and careers, I'm open to more travel than such than I have been in decades, but unless something else comes along, I'll be here working on updates to Second Signal and other things that ...... 
  2. 07/13/2018Who is HCL and why is it a good thing that they are now the ones behind Notes and Domino?We need to address some biases here. IBM has made a deal under which the Notes & Domino software and intellectual property is now being developed and maintained by HCL America. HCL America is part of the very large "HCL Technologies" company that has grown from its roots in India to become an 8 Billion Dollar company with a global presence in the IT Industry. You could be excused for initially believing, as many people do when they hear this, that "they've outsourced the code to India where they'll milk it ...... 
  3. 03/21/2018Domino Apps on IOS is a Game Changer. Quit holding back.BOOM. This will be as important for the platform as Traveler. If your company has ditched Notes and Domino, I feel sorry for you. For companies that do use Notes/Domino this is a game changer and Apple should be paying attention. Here's why: There are hundreds of little Notes client applications you'd never spend the time and money to build and deploy for your internal user base on IOS that we use Notes for all the time (those of us still using it). Now, those are suddenly ALL available on the iPad. ...... 
  4. 02/15/2018Andrew’s Proposed Gun Laws 
  5. 05/05/2016Is the growing social-sourced economy the modern back door into socialism? 
  6. 04/20/2016Want to be whitelisted? Here are some sensible rules for web site advertising 
  7. 12/30/2015Fantastic new series on Syfy called “The Expanse” – for people who love traditional science fiction 
  8. 10/20/2015My suggestion is to stay away from PayAnywhere(dot)com  
  9. 08/07/2015Here is one for you VMWARE gurus - particularly if you run ESXi without fancy drive arrays 
  10. 08/06/2015The Killer of Orphans (Orphan Documents) 
Click here for more articles.....

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

Please wait while your document is saved.