Sie sind auf Seite 1von 17

Not es/Domi no 8.

5 Wor k shop
Lab Manual

Lab 1
Cr eat i ng NSF Component s

COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Page 1 of 17

I nt r oduc t i on:
Composite applications are available with IBM Lotus Notes. These composite applications can be
accessed from the local Notes data folder, the IBM Lotus Domino server, or an IBM WebSphere Portal
server. Using new functionality, you can combine one or multiple Notes applications into composite
applications that boost organization productivity by providing the end user with a single context in which
to complete their business process. Multiple components in the composite application can be wired in a
causal relationship; when the end user performs a behavior in one component, the other wired
components can react and perform a predefined behavior.
IBM Lotus Domino Designer provides new features to help you, the developer, set up causal relationships
for Notes applications used as components. The Composite Application Editor (CAE) feature allows you
to assemble multiple components into a single composite application and to define the wiring of the
components in a 1-to-1 or 1-to-many relationship.
Desc r i pt i on:
This lab describes how to create notes components using procedures that make use of features in IBM
Lotus Notes and IBM Lotus Domino Designer. When you complete this lab, you will have an assembled
Composite Application completed with intercommunication wiring.
Obj ec t i ve:
At the end of the lab, you should be able to:
Create a New composite application
Add components to a composite application
Create a WSDL file to support inter-component communication
Define a Notes view columns that publish properties
Define a Notes actions that consume properties

Pr oc edur e:
SECTION 1: CREATING A COMPOSITE APPLICATION
In this lesson you will use one procedure to accomplish the following task:
Create a new composite application stored in a Notes database.
Step 1 Start the Lotus Domino Server through the icon on your desktop, if a popup window comes
up select the radio option Start Domino as a regular application and click OK.
Step 2 If Lotus Notes is not already running, start it now with the password passw0rd(with a zero).

COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Page 2 of 17

Step 3 Click File >Application >New.
Result: The New Database dialog appears.
Step 4 Leave the Server field value set to Local.
Step 5 Type MyCompApp in the Title field.
Step 6 Make sure MyCompApp.nsf is in the File Name field.
Step 7 Select Blank Composite Application- in the Template field.


COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Page 3 of 17
Step 8 Click OK to close the dialog box and create the new database.
Result: The new database is created and a blank application, similar to the graphic below, appears in your Lotus Notes
client.


Step 9 Open Domino Designer 8.5 from windows desktop. We are now going to open the composite
application to see that it will be launched as a composite application.
Step 10 Close the inner welcome screen if it appears.

Step 11 Click File >Application >Open and select MyCompApp.nsf from the list of available options.

Step 12 In designer, click File >Application >Properties.
Step 13 Switch to the Launch tab, which is the second tab.
Step 14 Ensure that the Launch field under Notes Client Launch section is set to Launch as
Composite Application.
Step 15 Close the application properties.
SECTION 2: PREPARING PRODUCER APPLICATION
In this section, you will accomplish the following tasks:
Prepare wiring properties for a Composite application.
Set up publishing for the Property Broker.

Wiring properties are the means of communication between Composite Application components. They send XML
signals to sync otherwise independent functions.

COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Page 4 of 17

Step 1 While inside designer, click File >Application >Open and open Personal Contacts.

Step 2 Open the Composite Applications > Wiring Properties section in the Applications view for
the Personal Contacts application.
Step 3 Double-click to open ContactComponent.wsdl to open the wiring properties editor.
Step 4 Click Add and enter a new property as shown. Enter Contact for the name and Contacts
Name as the title of this property.

Step 5 Click on the Actions tab.

COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Page 5 of 17

Step 6 Click Add and enter the action as shown. Make sure you select and add Contact under the
Action Output Parameters.

Step 7 Save and Close the Wiring Properties.
Step 8 Click Export WSDL and save the file to the C drive.

We are saving a copy of the WSDL so it can be loaded later into another application. NSF components will require that
the WSDLs are synced on both sides of a wired action.


COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Page 6 of 17

Step 9 Expand the Views selection and double-click to open Name CO.

Step 10 Right-click on the last column Name, and select Column Properties. This option is second
to the top.
Step 11 Go to the last tab, and select Contact under Property. This is the last option on the bottom,
and tells the view to export the value of this column as a Contact.

Step 12 Save and close the view.

COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Page 7 of 17

SECTION 3: PREPARING CONSUMER APPLICATION
In this section, you will accomplish the following tasks:
Prepare wiring properties for a Composite application.
Wiring properties are the means of communication between Composite Application components. They send XML
signals to sync otherwise independent functions.
Step 1 Click File >Application >Open and open Call Tracking.

Step 2 Open the Composite Applications > Wiring Properties section in the Applications view.
Step 3 Click Import WSDL and Open the ContactComponent.wsdl file from the C drive.

Step 4 Double-click to open the newly imported WSDL.

COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Page 8 of 17

Step 5 Go to the Actions tab and enter the new action as shown below.

Step 6 Save and close the Wiring Property.
Step 7 Click Export WSDL and save the file to the C drive. This will replace the existing file with a
newer version.
Step 8 Expand the Forms section in the Applications view.
Step 9 Double-click to open the form MBED Calls.
Step 10 Click Create >Action >Action to create a new action.
This action will link the property broker to the form.
Step 11 Give the action the name Update View.
Step 12 Deselect the options Include action in Action bar and Include action in Action menu.


COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Page 9 of 17

Step 13 Go to the advanced tab of the properties window, and select the Action Name
ConsumeContact.

Step 14 In the Programmers Pane change the type to LotusScript and enter the following code. This
code can also be found at c:\Lab Files\C&P.doc.
Sub Cl i ck( Sour ce As But t on)
Di ms As New Not essessi on
Di mws As New Not esUI Wor kspace
Di mdb As Not esDat abase
Set db = s. cur r ent dat abase ' handl e t o t he cur r ent dat abase
Di mui db As Not esUI Dat abase
Di mui doc As Not esUI Document
Di mdoc As Not esDocument
On Er r or Got o handl er
' handl e er r or 4719, r et ur ned i f t he scr i pt i s r un wi t hout a pr oper t ybr oker cont ext
On Er r or 4719 Got o er r 4719
' new pr oper t y br oker code
Di mpb As Not esPr oper t yBr oker
Set pb = s. get Pr oper t yBr oker ' cr eat e new Not esPr oper t yBr oker obj ect
' com. i bm. apps. sampl e - - t hi s i s t he namespace used i n t he WSDL
Di mpbI nput Pr oper t y As Not esPr oper t y
Di mpbCont ext As Var i ant
pbCont ext = pb. I nput Pr oper t yCont ext ' ar r ay of Not esPr oper t y obj ect s
Set pbI nput Pr oper t y = pbCont ext ( 0) ' handl e t o f i r st Not esPr oper t y obj ect
Di mI nput Pr oper t yName As St r i ng
Di mNamespace As St r i ng
I nput Pr oper t yName = pbI nput Pr oper t y. Name ' name of t he Not esPr oper t y obj ect
NameSpace = pbI nput Pr oper t y. NameSpace ' namespace of t he Not esPr oper t y
Di mpbVal ue As Var i ant
pbVal ue = pb. Get Pr oper t yVal ue( I nput Pr oper t yName)
' ar r ay of val ues of Not esPr oper t y
cName$ = pbVal ue( 0) ' f i r st val ue f r omar r ay of val ues
Ski pPr oper t yBr oker :
I f cName$ = Then
cName$ = I nput box( " Fi l t er " , cName$)
I f cName$ = Then
Exi t Sub
End I f
End I f
' Messagebox cName$
Set ui doc = ws. Cur r ent Document ' handl e t o onscr een document
Set doc = ui doc. Document ' used t o have t he saveopt i ons f or t he Fi l t er
document
doc. saveopt i ons = 0 ' set t o 0 so i t does not save
Cal l ui doc. Fi el dSet Text ( " Cust omer " , cName$)
' set gl obal var i abl e f or t he cont act s name
Cal l s. Set Envi r onment Var ( " Cont act " , cName$)
Cal l ui doc. Ref r esh
Exi t Sub
er r 4719:
Pr i nt " Er r or " & St r ( Er r ) & " : " &Er r or $
Messagebox " er r or "
Resume ski pPr oper t yBr oker
handl er :
Pr i nt " Er r or " & St r ( Er r ) & " : " &Er r or $
Exi t Sub
End Sub

COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Page 10 of 17

Page 11 of 17
This code will consume the property pulled in by the Formand update the Customer field with a value to update the
embedded view.

Step 15 Save and close the form.
Step 16 Open the Composite Applications > Wiring Properties section in the Applications view for
the Personal Contacts application.
Step 17 Replace this WSDL with the WSDL saved in step 3 by clicking the Replace button in the action
bar. This will sync them with the new wiring properties.

The above step is very important. The WSDL documents need to be kept the same or else sometimes the wiring
properties wont show up later in the lab.

SECTION 4: CREATING THE COMPOSITE INTERFACE
In this section, you will accomplish the following tasks:
Add NSF components to a Composite Application.
Connecting the wiring from a published property into a Consumed Application.
Wiring properties are the means of communication between Composite Application components. They send XML
signals to sync otherwise independent functions.
Step 1 If Lotus Notes 8.5 is not already running, start it now.

COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.


Step 2 If it is not already open, Click File >Open >Lotus Notes Application and open
MyCompApp.nsf.

Result: The blank composite application is opened, similar to the graphic below, appears in your Lotus Notes client.

Step 3 Click Action >Edit Application. This will open the Composite Application Editor.
Step 4 On top of the Component Palette click Add Component > Add NSF Component.
Step 5 Let us name the component Contacts.

COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Page 12 of 17

Step 6 Click Browse, in the Locate Object window change the object to View, click the Select icon by
the Application Drop Down, and select the Personal Contacts database on the local drive.

Step 7 Select the view Name Co in the locate object drop-down then click OK, and then click OK on
the New NSF Component window.


COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Page 13 of 17

Step 8 Click and drag the new Contacts component from the component palette on the right to the
center pane. This will add the view component to the Composite Applications Interface.

We are going to repeat the steps from above to add a second component to our application.
Step 9 On top of the Component Palette click Add Component > Add NSF Component.
Step 10 Name this new component Calls.
Step 11 Click Browse, in the Locate Object window, change the Kind of object to Form, click the
Folder icon by the Application Drop-down, and select Call Tracking database on the local
drive.


COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Page 14 of 17

Step 12 Select the form MBED Calls in the locate object drop-down then click OK, and then click OK
on the New NSF Component window.

Step 13 Click and Drag the new Calls component into the right side of the center panel.

Step 14 Right-click on the Blank Page in the Page Navigator, and select Wiring.



COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Page 15 of 17

Page 16 of 17
We are going to wire the two applications together so that the NSF components pair the new exported and imported
properties.
Step 15 Click and drag Contacts Name to Get Contact. Contacts Name is the publishing property,
and Get Contact is the consuming property.

Step 16 Click File >Save and Close and click Yes or OK to any confirmation messages.
Step 17 Click around on the documents in the left view within the composite application. When each
document is changed, the right panel of the application updates showing documents based on
an updated Contact filter.


COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.


Page 17 of 17
Congratulations. You have completed this section. You have added an action to the Notes form. When you later use this
Notes form as a component in a composite application, the component can consume a published property and perform
the action defined by the LotusScript code.

Summar y:
Congratulations! You have finished all the lessons and have used your Notes application development skills and new
features and functions in Lotus Notes and Domino Designer to create a notes component ready to be used in a
Composite Application with inter-component communication using property broker functionality.
In this lab, you completed the following procedures:
Modified a WSDL file to include a new property and publishing action.
Imported the WSDL file into your application that will be used as a Notes component.
Changed view column that, when selected, will publish a property that can be used in a composite application.
Added action to a form action that will perform an activity when the property is published.

COPYRIGHT IBM CORPORATION 2009. ALL RIGHTS RESERVED. IBM ISV & DEVELOPER RELATIONS.

Das könnte Ihnen auch gefallen