Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • IBM Notes and Domino wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
Community Articles Product Documentation Learning Center IBM Redbooks This category IBM iNotes 9.0 Social Edition - Administering IBM iNotes 9.0 Social Edition - Using IBM Notes 9.0 Social Edition IBM Notes Traveler 9.0 - Administering IBM Notes Traveler 9.0 - Using Lotus Notes 8.5.3 Documentation Lotus Notes Traveler 8.5.3 Administration Documentation Lotus Notes Traveler 8.5.3 Usage Documentation Custom Search Scope...
Search
Community Articles > Notes Widgets and Live Text > How to enable iWidgets in Domino Web Applications
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

Albert wang
Contribution Summary:
  • Articles authored: 1
  • Articles edited: 1
  • Comments Posted: 0

Recent articles by this author

Enabling iWidgets in IBM Lotus Domino Web applications

Albert Wang IBM Software Group Lotus Quickr Development IBM China Software Development Lab Beijing, China Shilong Zhang IBM Software Group Lotus Domino Web Applications Development IBM China Soft

Community articleHow to enable iWidgets in Domino Web Applications

Added by Albert wang | Edited by IBM contributor Albert wang on July 14, 2009 | Version 24
expanded Abstract
collapsed Abstract
No abstract provided.
Tags: iWidget, Mashup Enabler, Xpages, Customer Control

 
Introduction: Currently, mashup applications become more and more popular, and there are many iWidgets that can be re-used in these applications. This paper will give a very brief introduction to the IBM mashup Center and the new Xpage feature of domino designer, and then will mainly focus on how to enable iWidgets in the domino web applications, both in web page and in Xpage in the form of customer control.

1. IBM mashup Center brief
IBM mashup Center is a graphical, browser-based tool that supports easy, on the glass assembly of mashups. It includes
1.     A set of out-of-the-box widgets
2.     A catalog capability which supports discovery and sharing of mashup components
3.     A light weight Mashup server.
A mashup is typically characterized by the lightweight integration of applications via widgets. Widgets can be mashed and wired together in the browser. They use Web technologies such as HTTP, JSON, XML, JavaScript, ATOM and RSS to deliver application content. A widget is a portable piece of code that can run in any Web application without requiring a separate compilation.
There are a number of frameworks implementing this paradigm today with significant overlap in the concepts embedded within their component models. Due to the lack of open standards, these shared concepts are all surfaced in different manners, eliminating interoperability of the components between frameworks. IBM Mashups has adopted the evolving widget specification and is based on V1.0 of this spec.

2.    Domino8.5 new feature with Xpage support
From version8.5, domino provides a new Xpages feature, It provides a new  tool for domino web application, with JSF support, it makes  domino web application development more easy and more J2EE like.
Domino XPages contain the text and user interface (UI) controls that users interact with while working with application XPages. You can design the look and functionality of XPages before you deploy them to the target server or servers.
Controls are visual elements such as images, text, and objects that allow users to manipulate data on an XPage. Examples of controls include edit fields, buttons, drop-down lists, and links for downloading and uploading files.
A custom control is a collection of controls that are stored as a single object. Similar to IBM Lotus Domino Designer Subforms, custom controls are design elements that can be created once and add to multiple XPages. When a custom control is updated, every XPage that uses that custom control automatically gets updated with the changes. This saves design time because do not have to update each XPage separately.

3. Using iWidgets in Domino Server
This section will introduce how to enable iWidgets in domino web page.
First step, copy Mashup Enabler from IBM mashup Center into the folder “domino\data\domino\html” in domino server installation directory to set up Mashup environment in the domino server.
Image:How to enable iWidgets in Domino Web Applications
Figure 1. mashup files

 
Second step, put one or more sample iWidgets under the “html” folder also. Figure 2 shows the stock iwidget from IBM mashup Center in the folder \html\mum\widgets.
Image:How to enable iWidgets in Domino Web Applications
Figure 2. Sample stock iwidget

 
Finally, create an html file to load the iWidget. The following script must be used in the html file to include the mashup Enabler codes and bring up iWidgets on the web page. 

<   script language="JavaScript" type="text/javascript">
var ibmConfig = {
"com.ibm.mashups.pro xy.url": "/xsp/proxy/BasicProxy",
"com.ibm.mashups.contextroot": "/mum",
"com.ibm.mashups.contextroot.enabler": "/mum",
};
var djConfig={
isDebug:ibmConfig.isDebug,
popupConsole:ibmConfig.popupConsole,
locale:"en-us"
};
<  /script>
< &nbsptitle>IBM Lotus Mashups<  /title>
< &nbsplink rel="shortcut icon" href="/mum/images/favicon.ico" type="image/x-icon">
< &nbsplink rel="icon" href="/mum/images/favicon.ico" type="image/x-icon">
< &nbsplink rel="stylesheet" href="/mum/_combined.css" type="text/css">
< &nbsplink rel="stylesheet" href="/mum/js/bluedojo/dijit/themes/tundra/tundra.css" type="text/css">
< &nbspscript type="text/javascript" src='/mum/js/bluedojo/dojo/dojo.js'><  /script>
< &nbspscript language="JavaScript" type="text/javascript">
dojo.registerModulePath("com.ibm.mm.enabler","/mum/js/com/ibm/mm/enabler");
dojo.registerModulePath("com.ibm.mashups.enabler","/mum/js/com/ibm/mashups/enabler");
dojo.registerModulePath("com.ibm.mm.data","/mum/js/com/ibm/mm/data");
<  /script>
< &nbspscript type="text/javascript" src="/mum/js/com/ibm/mm/enabler/enabler.js"><  /script>
< &nbspscript type="text/javascript" >
dojo.registerModulePath("com.ibm.mashups.livetext","/mum/js/com/ibm/mashups/livetext");
dojo.registerModulePath("com.ibm.mm.livetext","/mum/js/com/ibm/mm/livetext");
dojo.require("com.ibm.mm.livetext.serviceImpl");
var livetextService = new com.ibm.mm.livetext.serviceImpl();
TagService = SemTagSvc = livetextService;
dojo.addOnLoad(function(){
livetextService.init();
});
< /script>

In those JavaScript code, we set the Ajax HTTP Proxy of the Mashup Enabler to point to Domino iNotes Proxy server as bellowing:"com.ibm.mashups.proxy.url": "/xsp/proxy/BasicProxy"
Actually, depends on different IBM mashup Center or Enabler versions, these JavaScript may have some differences. These codes can be fetched from IBM mashup Center Web pages directly. The following steps will tell you how to get those above JavaScript codes.
First step, startup IBM mashup Center in tomcat server.
Second step, use http://localhost:8080/mum/enabler to access mashup center as shown in Figure 3.

Image:How to enable iWidgets in Domino Web Applications
Figure 3. Login page of mashup center

 
Third step, after Login IBM Mashup center, click the “create a new page” as shown in the Figure 4. Then select the newly created page.
Image:How to enable iWidgets in Domino Web Applications  

Figure 4. create a test page in mashup center
Finally, as shown in Figure 5, drag and drop the “stock” iwidget into the test page, the stock iwidget will be displayed in the test page as shown in the Figure 6. then Right click the test page and select the “View Source” option, the html source with the above script code will be displayed. You can just copy and paste them to your iwidget web pages.
Image:How to enable iWidgets in Domino Web Applications
Figure 5. the stock iwidget in the mashup center

 Image:How to enable iWidgets in Domino Web Applications
Figure 6. View Source

 

After insert the Mashup Enabler initialization codes into the web pag e, you can write html code as bellowing to load  iWidgets.

《span class="mm_iWidget" sty le="color:blue;font-size:12pt;font-fam ily: courier;fact-name:Verdan" id="2" 》

      《a class="mm_Definition" href="widgets/stock.xml" 》《/a》

      《span class="mm_ItemSet" title="attributes"》

        《a class="mm_Item" href="#company" style="visibility:hidden"》YAHOO《/a》

        《a class="mm_Item" href="#stock" style="visibility:hidden"》27《/a》

        《a class="mm_Item" href="#broker"style="visibility:hidden" 》Ameritrade《 /a》

      《/span》

       《span class="mm_ReceivedEvent" 》

        《a class="mm_SourceEvent"href="#1" style="visibility:hidden" 》sendStockData《/a》

        《span class="mm_TargetEvent" style="visibility:hidden" 》onGetCompanyName《/span》

        《!-- one per overridden handler attribute --》

      《/span》

《/span》

《span class="mm_iWidget"  style="color:green;font-size:12pt;font-family: courier;fact-name:Verdan" id="1" 》

      《a class="mm_Definition" href="widgets/stock.xml" 》《/a》

      《span class="mm_ItemSet" title="attributes"》

        《a class="mm_Item" href="#company" style="visibility:hidden" 》IBM《/a》

        《a clas s="mm_Item" href="#stock" style="visibility:hidden" 》115《/a》

      《/span》

《/span》

These above codes will insert 2 instance of stock iwidget into the web page with event  wring setting.  
Save your web page and Start the domino server, and then open the html file in the web Browser, the 2 stock iWidgets will be shown in the page as Figure 7. Click the “Send Data” button in the stock iwidget at the bottom, the events handler defined in the stock.js will be triggered and change the data of the top stock iwidget as shown in figure 8.
Image:How to enable iWidgets in Domino Web Applications
Figure 7. two stock widgets in domino web page

 Image:How to enable iWidgets in Domino Web Applications
Figure 8. the result page

4. Using iWidgets in XPage
There are two ways to enable iWidgets in XPage.

One is using customer control to contain iWidgets, The following steps introduces this method.

1. Start the domino designer and click “File” > “new” > “Application” to create a new note application as shown in Figure 9.

2. Right click “Xpages” in your newly created application to create a new xpage and copy the Mashup Enabler initialization JavaScript codes into that Xpage file in source mode as shown in Figure 10.

 Image:How to enable iWidgets in Domino Web Applications

Figure 9.create new XPage

Image:How to enable iWidgets in Domino Web Applications

Figure 10. XPage with Mashup Enabler initialization codes

 

3. Right click “Custom Controls” below “XPages” to create 2 custom control, and copy the Stock iwidget loading and Event wiring codes into the custom control separately as shown in figure 11 and figure 12.

Image:How to enable iWidgets in Domino Web Applications

Figure 11. stock widget1 with event wiring

 Image:How to enable iWidgets in Domino Web Applications

< p>Figure 12. stock widg et2 with event wiring

 

 4. Drag and drop these two Custom Control into Xpage as shown in Figure 13.

 Image:How to enable iWidgets in Domino Web Applications

Figur e 13. add Custom Control into the XPage

5. Start your Domino Server and open your XPage, you will see the similar result as figure 7.

 

Another method to enable the sample Stock iwidget in Xpage is to use the html file given in section 3 directly as bellowing:

 

1.     Create a new XPage file.

2.     Copy and paste the content of the html file built in section 3 into the newly created XPage file.

3.     Delete the “html”, “body”, “head” tags from the XPage file as shown in Figure 14.

4.     Start the domino web server and open this XPage file in web browser, those 2 sample stock iwidgets can also be loaded and run correctly.

 

 Image:How to enable iWidgets in Domino Web Applications

 

Figure 14. part codes of the XPage file

 


expanded Attachments (0)
collapsed Attachments (0)
expanded Versions (52)
collapsed Versions (52)
Version Comparison     
VersionDateChanged by              Summary of changes
54Aug 11, 2009 5:25:30 AMAlbert wang  IBM contributor
53Aug 11, 2009 5:22:57 AMAlbert wang  IBM contributor
52Aug 11, 2009 5:19:47 AMAlbert wang  IBM contributor
51Aug 11, 2009 5:17:28 AMAlbert wang  IBM contributor
50Aug 11, 2009 5:14:34 AMAlbert wang  IBM contributor
49Aug 11, 2009 5:04:55 AMAlbert wang  IBM contributor
48Aug 11, 2009 4:55:41 AMAlbert wang  IBM contributor
47Aug 11, 2009 4:46:19 AMAlbert wang  IBM contributor
46Aug 11, 2009 4:45:05 AMAlbert wang  IBM contributor
45Aug 11, 2009 4:42:49 AMAlbert wang  IBM contributor
44Aug 11, 2009 4:40:59 AMAlbert wang  IBM contributor
43Aug 11, 2009 4:35:08 AMAlbert wang  IBM contributor
42Aug 11, 2009 4:27:21 AMAlbert wang  IBM contributor
41Aug 11, 2009 4:20:24 AMAlbert wang  IBM contributor
40Aug 11, 2009 4:11:49 AMAlbert wang  IBM contributor
38Jul 24, 2009 4:55:15 PMMary Jrolf  IBM contributor
36Jul 24, 2009 4:20:08 PMJason English  IBM contributor
35Jul 24, 2009 4:20:08 PMJason English  IBM contributor
34Jul 24, 2009 3:31:01 PMMary Jrolf  IBM contributor
33Jul 24, 2009 3:23:04 PMMary Jrolf  IBM contributor
32Jul 24, 2009 3:16:47 PMMary Jrolf  IBM contributor
31Jul 24, 2009 3:06:34 PMMary Jrolf  IBM contributor
30Jul 15, 2009 4:23:38 AMShilong Zhang  IBM contributor
29Jul 15, 2009 3:26:13 AMAlbert wang  IBM contributor
28Jul 15, 2009 2:00:57 AMAlbert wang  IBM contributor
27Jul 15, 2009 1:50:10 AMAlbert wang  IBM contributor
26Jul 14, 2009 11:37:01 PMAlbert wang  IBM contributor
25Jul 14, 2009 11:23:45 PMAlbert wang  IBM contributor
This version (24)Jul 14, 2009 11:20:11 PMAlbert wang  IBM contributor
23Jul 14, 2009 11:17:21 PMAlbert wang  IBM contributor
22Jul 14, 2009 11:14:04 PMAlbert wang  IBM contributor
21Jul 14, 2009 11:09:50 PMAlbert wang  IBM contributor
20Jul 14, 2009 11:03:44 PMAlbert wang  IBM contributor
19Jul 14, 2009 11:00:27 PMAlbert wang  IBM contributor
18Jul 14, 2009 10:57:00 PMAlbert wang  IBM contributor
17Jul 14, 2009 10:53:04 PMAlbert wang  IBM contributor
16Jul 14, 2009 10:45:47 PMAlbert wang  IBM contributor
15Jul 14, 2009 10:36:17 PMAlbert wang  IBM contributor
14Jul 14, 2009 5:25:33 AMAlbert wang  IBM contributor
13Jul 14, 2009 5:21:48 AMAlbert wang  IBM contributor
12Jul 14, 2009 5:18:51 AMAlbert wang  IBM contributor
11Jul 14, 2009 4:56:37 AMAlbert wang  IBM contributor
10Jul 14, 2009 4:52:56 AMAlbert wang  IBM contributor
9Jul 14, 2009 4:49:16 AMAlbert wang  IBM contributor
8Jul 14, 2009 4:42:57 AMAlbert wang  IBM contributor
7Jul 13, 2009 3:03:49 AMShilong Zhang  IBM contributor
6Jul 13, 2009 2:54:37 AMShilong Zhang  IBM contributor
5Jul 9, 2009 4:05:04 PMAmy Smith  IBM contributor
4Jul 9, 2009 2:45:30 PMAmy Smith  IBM contributor
3Jul 9, 2009 2:31:52 PMAmy Smith  IBM contributor
2Jul 7, 2009 11:00:32 PMShilong Zhang  IBM contributor
1Jul 7, 2009 3:33:28 AMAlbert wang  IBM contributor
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • FacebookIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkIBM Collaboration Solutions
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use