Latest Updates

Products & Applications

Showtime
My Blackberry Enterprise Server Push Utility for the Lotus Notes Client, allows you to create Jobs for individual Channel, Message, and Browser Content Pushes, as well as allows you to delete Pushed Channel Icons from defined recipient devices.

Time Tracker
The idea is simple. At the start of your day - upon completion of your first task - create an entry highlighting what you did and whether you feel it was an efficient or inefficient use of your time. Based on several requests, you can also select the priority, apply categories, or even align your time against a project.

For Lotus Notes Client v8.0 and above, you can use the Time Tracker Widget to make this process even easier!

Zephyr
My Configuration-based Rich Text Mail Merge and Emailing Utility, Zephyr allows you to create rich, data-driven emails to support automated workflow - all via Microsoft Word Mail Merge-like architecture. Dear <firstname> allows you to personalize each email message not only to the individual recipient, but also to the individual application workflow event!

xCopy
xCopy is a simple configurable xCopy client for the Lotus Notes client. By creating and defining xCopy Profiles, you can batch process your file backup or remote upload jobs. With the addition of the xCopy sidebar widget, you can easily kick-off these jobs, and modify both the xCopy Profiles and xCopy itself.

Community & Resources

Lotus Technical Information & Education Community

The Lotus Technical Information & Education community is comprised of IBM, business partner, and customer subject matter experts who use product wikis, published articles, white papers, community blogs and the latest in social media to build and share high quality technical content.

OpenNTF.org - Open Source Community for Lotus Notes Domino

OpenNTF is devoted to enabling groups of individuals all over the world to collaborate on IBM Lotus Notes/Domino applications and release them as open source.

developerWorks Lotus : Wikis

Share your deployment experiences and best practices in our wikis and help IBM to create scenarios for successful deployments. Contribute to the community by collaborating on shared content and leverage the shared knowledge from that community.

scriptBlock Artifacting for IBM XPages

05/15/2012 05:45:00 PM by Chris Toohey

scriptBlock Artifacting for IBM XPages on dominoGuru.com by Chris Toohey

I've been working on a few IBM XPages-based application frameworks lately (some basic templates to help jumpstart application development for project work), and have been using Dojo contentPanes (dijit.layout.ContentPane) with great success. One of the features of the Dojo ContentPane is the ability to load content via XHR (XMLHttpRequest). This tactic allows you to use ultimately surface same-domain contents inside of your ContentPane as if they were native to the current application.

Combining this ContentPane tactic with an ExpandoPane (dojox.layout.ExpandoPane)-based BorderContainer (dijit.layout.BorderContainer), I was able to create an amazingly functional and slick, yet totally familiar, shell for my XPages applications that required a more traditional application layout vs. a website-style layout.

In other words, my layout looked like this:

IBM XPages dijit.layout.BorderContainer Application Layout UI Mockup

The yellow area in the above layout mockup is the aforementioned ContentPane, and the blue area highlights the ExpandoPane-based navigator.

Loading an XPage Form or View in the ContentPane via XHR was simple, really - once you understood that XPages would deliver the markup, and all you really needed to do was initiate the Dojo Parser to re-Dojo-ify things. Hell, loading the given Form or View into the target ContentPane and calling that parse was really just a simple ClientSide JavaScript function:

var setFrameHref = function(tfKey, tfHref) {
    var t = dijit.byId(tfKey);
    t.attr("onDownloadEnd", function() {
        dojo.parser.parse();
    });
    t.attr("href", tfHref);
}

Everything was going well until I realized that I needed to update my navigator when I performed some CRUD function via the ContentPane... but the ContentPane had no relationship with the navigator context.

... ok, that might not make sense to you now, but I'll explain.

The ContentPane is basically an IFRAME HTML Element. It loads whatever content via XHR you set, and that becomes part of the HTML Document Object Model.

If I was not using a ContentPane, or specifically not using the HREF property/XHR tactic for loading an XPage form or view, this really wouldn't be an issue. Typically, you compute an xp:panel Control, throw the desired data source details into scoped variables, and you use partial refreshes to dynamically load your contents.

I needed to update the navigator. Sure, I could use multiple partial refreshes -- the first on the computed xp:panel Control that was my XPage form and a second on the navigator itself.

But since the contents of the ContentPane have absolutely no idea of the container layer -- just like an IFRAME HTML Element wouldn't know when-rendered what any of the parent contents are -- that simply won't work.

It's not like you can define "container_navigator" as the partial refresh target in the XPage form. Remember, the navigator is in an entirely separate XPage (might as well be a different NotesDatabase while we're at it...).

To sum up, the XHR-loaded XPages have no idea that the partial refresh target for the navigator is "container_navigator". And you can't just assume the HTML Element ID, because that changes. It really needs to be the result of #{id:container_navigator}.

So that's where scriptBlock artifacting comes into play!

<xp:scriptBlock>
    <xp:this.value><![CDATA[function refreshMenu_applications() {
    XSP.partialRefreshGet('#{id:container_menu_settings_applications}',{});
    setFrameHref('#{id:NotesView}', 'welcome.xsp');
}]]></xp:this.value>
</xp:scriptBlock>

This xp:scriptBlock Control resides in my layout.xsp Custom Control. It knows exactly what the IDs of my given layout containers are since it shares the same context. It's sole purpose is to handle navigator refreshing... and it's all Client Side JavaScript that sits there waiting to be called by some external object or process.

Here's the Save/Update Application Profile button XPage markup, which puts the scriptBlock artifact function to use:

<xp:button
    value="Save/Update Application Profile"
    styleClass="save"
    id="button_save">
    <xp:eventHandler
        event="onclick"
        submit="true"
        refreshMode="norefresh"
        immediate="false"
        save="false">
        <xp:this.action><![CDATA[#{javascript:CRUD(thisapp, 'create');}]]></xp:this.action>
        <xp:this.onComplete><![CDATA[refreshMenu_applications();]]></xp:this.onComplete>
    </xp:eventHandler>
</xp:button>

This button executes the Server Side function, and onComplete calls the waiting refreshMenu_applications() Client Side JavaScript function.

If you're still thinking, "... wha?!" -- don't worry, it's one of those "the demo explains this better than the author can" scenarios.

The demo in question is coming soon, and will be a long-overdue update to my Adaptive User Experiences in IBM XPages Applications series.

In Closing...

So scriptBlock artifacting is the practice of using an xp:scriptBlock Control in XPages to create Client Side JavaScript variables or functions for use throughout your XPages applications. It's something that I find myself using the further I dive into using Dojo ContentPane controls how they're intended to be used (for example, content population via XHR) vs. how a traditional XPages Developer would use them.

Questions or comments below, and Happy Coding!

 
Stephan H. WisselName:Stephan H. WisselWebsite:http://www.wissel.netComment Nice one. I always loved code that writes code. Is 'scriptblock artefacting' a term you invented? If yes - well done, if no where does it come from? Chris TooheyName:Chris TooheyWebsite:http://www.dominoguru.comComment

@Stephan:

Thanks! As far as I know, I'm the only one that calls it "scriptblock artifacting", so perhaps I coined the term ;-)

I, too, love code that writes code, and this is an example of one of the fundamental features of XPages: a markup delivery system.

Karsten LehmannName:Karsten LehmannWebsite:http://blog.mindoo.comComment Nice! I also played a lot with Dojo layouts and panes to build something like a web based composite application: Independent parts of an application, even coming from different domains, that exchange small asynchronous messages. Used EasyXDM ( http://easyxdm.net/wp/ ) to communicate across IFRAME boundaries. That worked really well. Murray SinclairName:Murray SinclairWebsite:http://www.kworks.co.nzComment Very clever and well thought out - thanks for sharing.  I am also using Dojo BorderContainer, ContentPane and ExpandoPane and finding them very useful for establishing a standard layout framework.  I have gone down the path of having all xPages design in one database so everything is in the same context at present but I can see down the track I may need to distribute the designs to other databases.

(not published)




Evaluate this Formula: @LowerCase(@Text("FOO"))