Articles
Thursday 7th, May 2009
XPages - Undocumented Feature that will help you build Plug-n-Play Custom Controls05/07/2009 07:06 AM Domino 8.5
When building Custom Controls for XPages, the ultimate goal is to make the Custom Control plug-n-play. You want to be able to drop the custom control on any XPage and have it interact with the XPage seamlessly.
Being a Design Partner, I have been working with XPages since the pre-beta versions. Prior to that I was Design Partner for the Lotus Component Designer. So to come across a new feature is exciting....
I recently wanted to make a custom control completely independent of the XPage it was on (see this custom control). Yet I still needed to grab some values from the datasource for the XPage the control is placed on. The issue is that the XPage datasource name is set by the developer and I could not see a way to determine the datasource name without requiring the end developer to place additional code on their XPage to support my custom control.
Looking through the Request Scope variables on the page at runtime, I found that there is a variable present on every XPage called currentDocument. Sure enough, it was of NotesXSPDocument type and was set to the current document for the XPage. So I could now have access to any data on the document I needed without knowing the datasource name.
For example, if I wanted to find out what the Form name for the document opened in the XPage that my custom control was on, I could use the following code:
theForm=currentDocument.getForm();
or to get the backend NotesDocument and determine the Document unique ID:
doc=currentDocument.getDocument();
docUNID=doc.getUniversalID();
I checked with the XPages Chief Architect, Phil Riand, and this object will be supported in future releases and will be documented. So it is safe to use this feature in your applications.
Enjoy....
-John
Technorati: Domino 8.5 XPages (5) Wednesday 6th, May 2009
Tuesday 28th, April 2009
Monday 6th, April 2009
XPages/Domino 8.5 - Extending the Dojo Rich Text Editor Toolbar04/06/2009 07:04 AM Domino 8.5
A number of folks, including myself, have been looking to extend the XPages/Domino 8.5 Dojo Rich Text Editor toolbar. The Dojo Editor toolbar usually has other features available such as the create link or insert image. The issue in adding the additional plugins is that Domino 8.5 has it's own flavor of the Dojo Editor.
Steve Leland has just published a Wiki article describing how to extend the "ibm.domino.widget.layout.DominoRichText class" to add in some additional features to the toolbar.
He points out that the plugins for the following are shipped with Designer and Domino Server but are not implemented:
- formatBlock - assigns css defined formats
- createLink - constructs an anchor tag with a user supplied URL
- insertImage - constructs an image tag with a user supplied URL
In this article Steve show's how to extend the Editor for both XPages and the Domino classic web server.
Here's a snippet from the article describing how to extend the toolbar for XPages:
XPages
Let's create a JavaScript class in data\domino\js\dojo-1.1.1\test\widget\layout\TestRichText.js to encapsulate the LinkDialog dependency - using the dojo.require() statement. Here's the file contents:
/* ******************************************************************/
/* */
/* Sample Rich Text Toolbar extension */
/* &a mp;am p;nbs p; */
/* ******************************************************************/
dojo.provide("test.widget.layout.TestRichText");
dojo.require("ibm.domino.widget.layout.DominoRichText");
dojo.require("dijit._editor.plugins.LinkDialog");
dojo.declare("test.widget.layout.TestRichText", ibm.domino.widget.layout.DominoRichText, {
constructor: function() {
if(dojo.isArray(this.extraPlugins)) {
this.extraPlugins.push("|", "formatBlock", "createLink","insertImage", "|");
} else {
this.extraPlugins = [ "formatBlock", "createLink", "insertImage","|" ];
}
}//,
}
);
Save that to the TestRichText.js file.
Now we need to have the XPage which uses our rich text control instruct Dojo runtime to load our class into the browser - with a dojo.requires('test.widget.layout.TestRichText') statement. This is done using our XPage's Properties tab, and selecting 'All Properties'. We are interested in the 'resources' property - clicking on the plus image lets us identify our resource as a Dojo Module, and we give it our class as a value:

Then we need to put a rich text control on our XPage, exactly as if it were an ordinary rich text control, and on its Properties tab, select 'All Properties' and set the dojoType with a value of our class:

Here is the link to the full article: http://www-10.lotus.com/ldd/ddwiki.nsf/dx/04022009010354PMWEBMZZ.htm
Nice work Steve!
-John Technorati: Domino 8.5 XPages (1) Monday 16th, March 2009
Two New Notes and Domino 8.5 Courses for Developers and Administrators 03/16/2009 08:10 AM Domino 8.5
The folks over at TLCC, The Learning Continuum Company, have just released two new distance learning courses. They are:
- Notes and Domino 8.5 Application Development Update
- Notes Domino 8.5 System Administration Update
In addition, there will be a full XPages course available in April.
I have had the opportunity to review the 8.5 application development update course. It's packed with content, demonstrations, and hands on examples covering all the new features of Domino Designer on Eclipse. This includes XPages, DOJO rich text editor, and the use of CSS and Themes, the new Java and LotusScript programming interfaces, as well as what's new in Composite Applications.
The 8.5 system administration update course covers the Domino Configuration Tuner, Domino Attachment and Object Services (DAOS), Dynamic Policies, and the new ID Vault....to name a few of the topics.
If you want to update your skills, or are looking to take your certification update exams, #951 or #956, then take a look at the the TLCC site for more details and cost info: http://www.tlcc.com/admin/tlccsite.nsf/pages/dom85courses
-John
Technorati: Domino 8.5 (1) Monday 2nd, March 2009
Using XPages to Integrate Between Notes Applications with Relational Databases - Wiki article03/02/2009 03:15 PM Domino 8.5
Jo Grant and Craig Wolpert from the IBM ISV Development Enablement team, have published a new Wiki article titled
Using XPages to Integrate Between Notes Applications with Relational Databases. These guys are on a roll over there and have produced 10 great Wiki examples over the last 2 weeks. (I believe they have secretively developed an XPage vitamin they are taking that allows them to work around the clock....but I can't prove it...)
In this example they show how you can use connectivity to a MySQL database to:
1 - Create a Repeat based view of our data
2 - Create a form to view a single record
3 - Use that form to update the data
Here's a snippet from the article:
You can easily direct XPage elements to surface data from different Notes applications. It turns out not to be much harder to surface data from different back end data sources with XPages.
The key to integrating different data technologies is by binding them together with Javascript. Almost any XPage control that surfaces data has the option to surface that data from a Javascript source. So any data repository you can get to from Javascript can be used by XPages.
Relational databases (RDB) are a very widely used technology for storing data. Many relational databases are accessible through Java Database Connectivity (JDBC). And this Java interface can be called from Javascript. This is our key to surfacing RDB data in an XPage. For our example here we will show connectivity to the MySQL relational database.
Here's a link to the article: http://www-10.lotus.com/ldd/ddwiki.nsf/dx/xpage_integration_rdb.htm
Great article and nice work guys!
John Technorati: Domino 8.5 XPages (0) Monday 23rd, February 2009
Friday 20th, February 2009
Great series of articles published - Using existing business logic in an XPage: Java, LS, and Web Services02/20/2009 01:29 PM Domino 8.5
There is a really interesting series of articles posted today over in the Lotus Designer Wiki. The 4 articles were published today by Jo Grant and Craig Wolpert from IBM.
The series is titled: Using existing business logic in an Xpage.
It discusses how you can use your existing business logic that is in Lotusscript, Java, or Web Services from within your new XPage applications. I've heard many people ask questions and voice concerns around this topic, so I think this series will be a great help to those folks who want to go forward with XPages without having to rewrite lots of code for their applications.
The 1st article is an overview containing links to the other 3 articles. Here's the direct link:
- http://www-10.lotus.com/ldd/ddwiki.nsf/dx/reuse_business_logic_xpage.htm
Thanks Jo and Craig for your hard work....I look forward to reading the series and working with the techniques this weekend!
John Technorati: Domino 8.5 XPages (0)