You are on page 1of 15

Domino's XPages Workshop Lab Manual

Lab 10 XPage Widgets

Page 1 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

Introduction:
The My Widgets feature is installed with Notes since 8.0.1. Using available policy and preference settings, an administrator you - can control which users can display My Widgets in their sidebar as well as various levels of access to My Widgets functionality. End users will typically not see My Widgets in their sidebar, yet still access widgets that are available when they act on Live Text in their (i)Notes documents.

Description:

This lab will show policies which enable widgets, create a widget from an XPage application, and enable it on iNotes

Objective:
At the end of the lab, you should be able to: Set up a server to utilize widgets, and give access to users Create a widget from an XPage Enable use of this widget through iNotes

Procedure:
SECTION 1: SETUP SERVER
TO

UTILIZE WIDGETS & GIVE ACCESS

TO

USERS

In this section, you will create and deploy the policies required for enabling the My Widgets feature for Notes and iNotes users.

Step 1 Step 2 Step 3

If Domino has not been started, start it now. Open Domino Administrator from the desktop icon. Create a New Widget Catalog on your Domino server. Note: You could either achieve that by creating a new application based on the toolbox.ntf template or as used in this exercise create a replica from an existing catalog (widgetcatalog.nsf) hosted on www.noteswidgets.com.

Page 2 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

Step 4

Navigate to the Configuration tab. From the right-hand menu select Policies > Create.

Step 5

Create a New Mail Settings policy document.

Step 6

Name the new mail settings policy document iNotesWidgets. Navigate to the Lotus iNotes tab and select Configuration.

Step 7

Navigate to the Widget Settings section. Enable the Show the Widgets folder in the Mail outline option.

Page 3 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

Step 8

Save and close the new document. Again, select Policies > Create to build a new Dynamic Desktop Settings policy document.

Step 9

Name the Settings document Widgets. Navigate to the Widgets tab and enforce the following settings (keep the defaults for all other options) on client side: Widget catalog server: Widget catalog application name: Xpages/Lotus toolbox.nsf

Page 4 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

Step 10

Save and close the Settings document. Click on Policy > Create again to build a new Policy.

Step 11

Name the explicit Policy /MyWidgets. Select the Widgets Desktop and iNotesWidgets Mail Settings documents to assign.

Page 5 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

Step 12

Save and close the Policy. Then, navigate to the People & Groups tab. Select Groups from the left-hand navigator and create a new group containing all users:

Step 13 Step 14

Save and close the new group. Assign the /MyWidgets policy to the All group:

Step 15 Step 16

If a warning dialog comes up, click Yes to overwrite existing assignments. Navigate to the Domino console. Run the following command:
tell adminp process mail policy

Page 6 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

NOTE: You have created and deployed the policies required for enabling the Notes and iNotes users to leverage the My Widgets feature.

SECTION 2: XPAGE

WIDGET

In this section, you will learn how to start enabling your XPage application into a Web widget..

Step 1 Step 2

Open the Scrapbook application in Domino Designer. Open the home XPage. Navigate to the Events tab. From the Page navigator, select beforePageLoad and click Add Action.

Step 3

Add an Execute Script action containing the following code:


v = facesContext.getExternalContext().getRequest().getParameter(name); if (v != null) { url = @LeftBack(context.getUrl().toString(),/) + facesContext.getExternalContext().getRequestContextPath(); sessionScope.nameToSearch = v; facesContext.getExternalContext().redirect(url + /results.xsp); }

Page 7 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

Step 4 Step 5

Save and close the home XPage. Close Domino Designer and Lotus Notes, if opened.

SECTION 3: INOTES

WIDGET

In this section, you learn how to add your XPage application as a Web widget to the iNotes navigator pane. Step 1 From the My Widgets sidebar component header menu, select Get Started again.

Page 8 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

Step 2

Our widget will consume a Web Page, therefore select the Web Page option.

Step 3

Specify notesdomino.dfw.ibm.com/XScrapbook.nsf/home.xsp as our Web source, then click Next >.

Step 4

Specify a HTTP GET as the submit option of choice.

Step 5

You might need to authenticate with the Domino Web Server. Provide your credentials and assure to enable the Remember my password box, then click OK.

Page 9 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

Step 6

The home XPage is getting opened. Extend the URL of the XPage by the following QueryString parameter:
?name=Nobody

Step 7 Step 8

Notice: Do not click the Load URL button before selecting Next >. From the Configure a Widget dialog, name the widget Search Profile (iNotes), then navigate to the Advanced tab. Enable the Configure name option and click Next >.

Step 9

Step 10 Step 11

Click Finish. The new Widget has been added to the My Widgets sidebar component.

Page 10 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

Step 12

Right-click on the new widget, then select Configure a New Action.

Step 13

Select the Text Selection recognizer and specify contents as the type property. The results should be displayed in a Floating Window.

Step 14

Click OK.

Page 11 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

Step 15

In a last step, we will publish this newly created widget to our companys widget catalog. Therefore, right-click on the new widget and select Publish to Catalog.

Step 16

Name the widget Search Profile from iNotes, the save and close the document.

Step 17

Navigate to the Attachment section within the document. Open the extension.xml file in a text editor such as Notepad.

Page 12 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

Step 18

Open the Windows Explorer and navigate to your Lotus Domino installation directory. Within the data\domino\html subdirectory, find the file inotes_config.xml.template.

Step 19

Copy the template into a new file inotes_config.xml. Open this file in another Notepad window. From the extension.xml window, copy all the code except the first line and insert it into the inotes_config.xml before the closing </inotes:extensions> tag:

Step 20

Page 13 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

Step 21 Step 22

Save and close the inotes_config.xml. Afterwards, restart your Domino server. If Domino is up and running again, open your Browser client and navigate to your mail file, e.g. notesdomino.dfw.ibm.com/mail/dadmin.nsf. After authentication, you should see a Widgets section within the left-hand navigator.

Step 23

Step 24

Navigate to your inbox. Open the mail we sent during the previous section:

Page 14 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

Step 25

Select the name of the colleague (in this case John Doe), then expand the Widgets tab and click on Search Profile (iNotes).

Summary:
Congratulations! You have completed this lab of XPages widgets. In this lab, you completed the following procedures: Setup a server to utilize widgets, and give access to users Create a widget from an XPage Enable user of a widget through iNotes

Page 15 of 15
COPYRIGHT IBM CORPORATION 2010. ALL RIGHTS RESERVED. LAB 10 IBM ISV & DEVELOPER RELATIONS.

You might also like