Search This Blog

Friday, January 11, 2013

Design element items with plain lotus script and compiled lotus script

Hi

A few years ago I worked for one company that tried to develop some integration solution based on dxl export/import.  That solution had to support a bi-directional synchronization of either Notes Documents or Design elements. Dxl based approach looked the most reasonable for achieving this goal that time.

We met many different issues on our way and the project itself appeared quite complicated since we had to support such integration for releases 6, 7 and 8 of Lotus Notes.
Each release had its own, let's say, 'features' :-) of working with dxl and it was really painful.
May be I will make a post some day about main issues we met and ways of their resolving but in this post I wanted to tell you about strange way of fixing some linking problems we got after dxl-import.

Scenario was next:
Our application (C/C++ extension manager) got package with dxl-files of design elements from remote server and imported it into Lotus Notes database on our side. This approach more or less worked for LN R6 and R7. With release 8 we had a problem that some of imported design elements required recompilation or resaving (do not remember exactly). You know what  I mean: errors like "LSE Error", "LSE Failure" or similar when you try to use such design elements.

As a fast solution (ugly but workable) I used idea with removing items with compiled lotus script for such design elements.

I discovered, that Lotus Domino/Notes perfectly works with plain lotus script of design elements if it can not find items with compiled lotus script. For example, if you check any Notes Form, you will find items "$$FormScript" with plain lotus script and "$$$FormScript_O" with this code compiled; if you take NotesView, you may find there items "$ViewScript" and "$ViewScript_O" correspondingly and so on.



The funny thing is that if you delete item with compiled code (the one with _O) your design element will act properly anyway, like Lotus Domino/Notes uses item with plain lotus script code to link and compile it on the fly.




So, when I tried this idea and deleted items with compiled lotus script for not working design elements (created by importing of dxl) all error disappeared. I had a feeling that such design elements worked in Notes a little bit slowly than usually but I suppose its because of compilation on the fly.

Btw, there is a lot of fun around these items. Playing with these items you may copy lotus script of event handlers from one design element to another. Sometimes it can be helpful since you can not use dxl-export /import everywhere: some of native design elements still can not be processed through dxl.

On this screen you may see a simple lotus script solution for replacing event handlers of one Form with event  handlers from another Form. It works.


No comments:

Post a Comment