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. 05/05/2016Is the growing social-sourced economy the modern back door into socialism?Is the growing social-sourced economy the modern back door into socialism? I read a really insightful post a couple of days ago that suggested the use of social network funding sites like “Go Fund Me” and “Kickstarter” have come about and gained popularity in part because the existing economy in no longer serving its purpose for anyone who isn’t already wealthy. Have the traditional ways to get new ventures funded become closed to all but a few who aren’t already connected to them and so onerous as to make ...... 
  2. 04/20/2016Want to be whitelisted? Here are some sensible rules for web site advertisingAn increasing number of websites are now detecting when users have ad-blocking enabled, and refuse to show content unless you "whitelist" their site (disable your ad-blocking for them). I think that is a fair decision on their part, it's how they pay for the site. However, if you want me (and many others) to white list your site, there are some rules you should follow. If you violate these rules, I won't whitelist your site, I'll just find content elsewhere. 1. The total space taken up by advertisements ...... 
  3. 12/30/2015Fantastic new series on Syfy called “The Expanse” – for people who love traditional science fiction[] “The Expanse” is a new science fiction series being broadcast onthe Syfy channelthis winter. It’s closely based on a series of books by author James S. A. Corey beginning with “Leviathan Wakes”. There are 5 books in the “Expanse” series so far. If you’re a fan of the novels you’ll appreciate how closely the books are followed.TIP: The first five episodes are already available on Syfy.com. If you’re having trouble getting into the characters and plot, use those to get up to speed.The worlds created for ...... 
  4. 10/20/2015My suggestion is to stay away from PayAnywhere(dot)com  
  5. 08/07/2015Here is one for you VMWARE gurus - particularly if you run ESXi without fancy drive arrays 
  6. 08/06/2015The Killer of Orphans (Orphan Documents) 
  7. 06/02/2015Homeopathic Marketing: Traveler on my Android is now calling itself VERSE. Allow me to translate that for the IBM Notes community... 
  8. 03/17/2015A review of British Airways Premium Economy Service – How to destroy customer goodwill all at once 
  9. 02/26/2015There's a bug in how @TextToTime() and @ToTime() process date strings related to international standards and browser settings. 
  10. 01/21/2015Delivering two new presentations at Developer Camp (EntwicklerCamp) 2015 in Germany 
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.