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. 01/26/2023Better Running VirtualBox or VMWARE Virtual Machines on Windows 10+ Forgive me, Reader, for I have sinned. I has been nearly 3 years since my last blog entry. The truth is, I haven't had much to say that was worthy of more than a basic social media post -- until today. For my current work, I was assigned a new laptop. It's a real powerhouse machine with 14 processor cores and 64 gigs of ram. It should be perfect for running my development environment in a virtual machine, but it wasn't. VirtualBox was barely starting, and no matter how many features I turned off, it could ...... 
  2. 04/04/2020How many Ventilators for the price of those tanks the Pentagon didn't even want?This goes WAY beyond Trump or Obama. This is decades of poor planning and poor use of funds. Certainly it should have been addressed in the Trump, Obama, Bush, Clinton, Bush, and Reagan administrations -- all of which were well aware of the implications of a pandemic. I want a military prepared to help us, not just hurt other people. As an American I expect that with the ridiculous funding of our military might, we are prepared for damn near everything. Not just killing people and breaking things, but ...... 
  3. 01/28/2020Copyright Troll WarningThere's a copyright troll firm that has automated reverse-image searches and goes around looking for any posted images that they can make a quick copyright claim on. This is not quite a scam because it's technically legal, but it's run very much like a scam. This company works with a few "clients" that have vast repositories of copyrighted images. The trolls do a reverse web search on those images looking for hits. When they find one on a site that looks like someone they can scare, they work it like ...... 
  4. 03/26/2019Undestanding how OAUTH scopes will bring the concept of APPS to your Domino server 
  5. 02/05/2019Toro Yard Equipment - Not really a premium brand as far as I am concerned 
  6. 10/08/2018Will you be at the NYC Launch Event for HCL Domino v10 -- Find me! 
  7. 09/04/2018With two big projects on hold, I suddenly find myself very available for new short and long term projects.  
  8. 07/13/2018Who is HCL and why is it a good thing that they are now the ones behind Notes and Domino? 
  9. 03/21/2018Domino Apps on IOS is a Game Changer. Quit holding back. 
  10. 02/15/2018Andrew’s Proposed Gun Laws 
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.