Lab 01 Creating NSF Components

download Lab 01 Creating NSF Components

of 17

Transcript of Lab 01 Creating NSF Components

  • 8/11/2019 Lab 01 Creating NSF Components

    1/17

    Notes/Domino 8.5 Workshop

    Lab Manual

    Lab 1

    Creating NSF Components

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

    Page 1 of 17

  • 8/11/2019 Lab 01 Creating NSF Components

    2/17

    Introduction:

    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 whichto 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.

    Description:

    This lab describes how to create notes components using procedures that make use of features in IBMLotus Notes and IBM Lotus Domino Designer. When you complete this lab, you will have an assembled

    Composite Application completed with intercommunication wiring.

    Objective:

    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

    Procedure:

    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 Startthe Lotus Domino Serverthrough the icon on your desktop, if a popup window comes

    up select the radio option Start Domino as a regular applicationand 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

  • 8/11/2019 Lab 01 Creating NSF Components

    3/17

    Step 3 Click File>Appl ication > New.

    Result: The New Database dialog appears.

    Step 4 Leave the Serverfield value set to Local.

    Step 5 Type MyCompAppin the Title field.

    Step 6 Make sure MyCompApp.nsfis in the File Namefield.

    Step 7 SelectBlank Composi te Applicat ion-in the Templatefield.

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

    Page 3 of 17

    Step 8 Click OKto 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 Notesclient.

  • 8/11/2019 Lab 01 Creating NSF Components

    4/17

    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 Closethe inner welcome screen if it appears.

    Step 11 Click File>Appl ication > Openand select MyCompApp.nsffrom the list of available options.

    Step 12 In designer, click File>Appl ication > Properties .

    Step 13 Switch to the Launchtab, which is the second tab.

    Step 14 Ensure that the Launchfield under Notes Client Launch section is set to Launch as

    Composite Application.

    Step 15 Closethe application properties.

    SECTION 2:PREPARING PRODUCERAPPLICATION

    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 XMLsignals to sync otherwise independent functions.

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

    Page 4 of 17

  • 8/11/2019 Lab 01 Creating NSF Components

    5/17

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

    Step 2 Open the Composite Applications > Wiring Properties section in theApplicationsview for

    the Personal Contactsapplication.

    Step 3 Double-clickto open ContactComponent.wsdlto open the wiring properties editor.

    Step 4 ClickAddand enter a new property as shown. Enter Contactfor the name and Contacts

    Nameas the title of this property.

    Step 5 Click on theActionstab.

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

    Page 5 of 17

  • 8/11/2019 Lab 01 Creating NSF Components

    6/17

    Step 6 ClickAddand enter the action as shown. Make sure you select and add Contactunder the

    Action Output Parameters .

    Step 7 Saveand Closethe Wiring Properties.

    Step 8 Click Export WSDLand save the file to the Cdrive.

    We are saving a copy of the WSDL so it can be loaded later into another application. NSF components will require thatthe 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

  • 8/11/2019 Lab 01 Creating NSF Components

    7/17

    Step 9 Expandthe Viewsselection and double-clickto open Name CO.

    Step 10 Right-clickon the last column Name, and select Column Properties. This option is secondto 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 Saveand closethe view.

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

    Page 7 of 17

  • 8/11/2019 Lab 01 Creating NSF Components

    8/17

    SECTION 3:PREPARING CONSUMERAPPLICATION

    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 XMLsignals to sync otherwise independent functions.

    Step 1 Click File>Appl ication > Open and open Call Tracking.

    Step 2 Open the Composite Applications > Wiring Properties section in theApplicationsview.

    Step 3 Click Import WSDLand Open the ContactComponent.wsdl file from the Cdrive.

    Step 4 Double-clickto open the newly imported WSDL.

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

    Page 8 of 17

  • 8/11/2019 Lab 01 Creating NSF Components

    9/17

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

    Step 6 Saveand closethe Wiring Property.

    Step 7 Click Export WSDLand save the file to the Cdrive. This will replace the existing file with a

    newer version.

    Step 8 Expandthe Forms section in theApplicationsview.

    Step 9 Double-clickto 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 optionsInclude action in Ac tion bar andInclude action in Ac tion menu.

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

    Page 9 of 17

  • 8/11/2019 Lab 01 Creating NSF Components

    10/17

    Step 13 Go to the advanced tab of the properties window, and select theAction Name

    ConsumeContact.

    Step 14 In the Programmers Panechange 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 m s As New Not essessi onDi m ws As New Not esUI Wor kspaceDi m db As Not esDat abaseSet db = s. cur r ent database ' handl e to t he cur r ent dat abaseDi m ui db As NotesUI Dat abaseDi m ui doc As Not esUI DocumentDi m doc As Not esDocument

    On Er r or Goto handl er' handl e er r or 4719, r eturned i f t he scr i pt i s r un wi t hout a pr opert ybr oker cont ext

    On Er r or 4719 Got o err 4719' new proper t y broker code

    Di m pb As NotesPr opert yBr okerSet pb = s. getPr opert yBr oker ' cr eat e new NotesPropert yBr oker obj ect

    ' com. i bm. apps. sampl e - - t hi s i s t he namespace used i n the WSDLDi m pbI nputPr opert y As NotesPropert yDi m pbCont ext As Vari antpbCont ext = pb. I nput Propert yCont ext ' arr ay of NotesPropert y obj ectsSet pbI nput Pr opert y = pbCont ext ( 0) ' handl e to f i r st NotesPr opert y obj ectDi m I nputPr opert yName As Str i ngDi m Namespace As St r i ngI nputPr opert yName = pbI nputPr opert y. Name ' name of t he NotesPr opert y obj ectNameSpace = pbI nput Pr oper t y. NameSpace ' namespace of t he Not esPr oper t yDi m pbVal ue As Var i antpbVal ue = pb. GetProper t yVal ue( I nputPr opert yName)

    ' arr ay of val ues of NotesPropert ycName$ = pbVal ue(0) ' f i r st val ue fr om ar r ay of val ues

    Ski pPropert yBr oker:I f cName$ = Then

    cName$ = I nputbox( "Fi l t er" , cName$)I f cName$ = Then

    Exi t SubEnd I f

    End I f' Mess agebox cName$

    Set ui doc = ws. Curr ent Document ' handl e to onscr een documentSet doc = ui doc. Document ' used t o have the saveopt i ons f or t he Fi l t er

    documentdoc. saveopti ons = 0 ' set t o 0 so i t does not saveCal l ui doc. Fi el dSetText ( "Customer" , cName$)' set gl obal var i abl e f or t he contact s nameCal l s. Set Envi r onment Var( "Contact ", cName$)

    Cal l ui doc. Refr eshExi t Sub

    err 4719:Pr i nt "Err or" & St r( Err ) & ": " &Er ror$Messagebox "er r or "Resume ski pPr oper t yBr oker

    handl er :Pr i nt "Err or" & St r( Err ) & ": " &Er ror$Exi t Sub

    End Sub

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

    Page 10 of 17

  • 8/11/2019 Lab 01 Creating NSF Components

    11/17

    Page 11 of 17

    This code will consume the property pulled in by the Form and update the Customer field with a value to update theembedded view.

    Step 15 Saveand closethe form.

    Step 16 Open the Composite Applications > Wiring Properties section in theApplicationsview for

    the Personal Contactsapplication.

    Step 17 Replace this WSDLwith the WSDLsaved in step 3 by clicking the Replacebutton 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 XMLsignals 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.

  • 8/11/2019 Lab 01 Creating NSF Components

    12/17

    Step 2 If it is not already open, Click File> Open> Lotus Notes Applicationand open

    MyCompApp.nsf.

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

    Step 3 ClickAction > Edit Application. This will open the Composite Application Editor.

    Step 4 On top of the Component PaletteclickAdd 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

  • 8/11/2019 Lab 01 Creating NSF Components

    13/17

    Step 6 Click Browse, in the Locate Object window change the object to View, click the Selecticon by

    the Application Drop Down, and select the Personal Contacts database on the local drive.

    Step 7 Select the view Name Coin the locate object drop-down then click OK, and then click OKon

    the New NSF Componentwindow.

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

    Page 13 of 17

  • 8/11/2019 Lab 01 Creating NSF Components

    14/17

    Step 8 Click and dragthe new Contactscomponent 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 PaletteclickAdd Component > Add NSF Component.

    Step 10 Name this new component Calls.

    Step 11 Click Browse, in the Locate Objectwindow, change the Kind of objectto Form, click the

    Foldericon by the Application Drop-down, and select Call Trackingdatabase on the local

    drive.

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

    Page 14 of 17

  • 8/11/2019 Lab 01 Creating NSF Components

    15/17

    Step 12 Select the form MBED Callsin the locate object drop-down then click OK, and then click OK

    on the New NSF Componentwindow.

    Step 13 Click and Dragthe new Callscomponent into the right side of the center panel.

    Step 14 Right-clickon the Blank Pagein the Page Navigator, and select Wiring.

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

    Page 15 of 17

  • 8/11/2019 Lab 01 Creating NSF Components

    16/17

    Page 16 of 17

    We are going to wire the two applications together so that the NSF components pair the new exported and importedproperties.

    Step 15 Click and drag Contacts Nameto Get Contact.Contacts Name is the publishing property,

    and Get Contact is the consuming property.

    Step 16 Click File> Save and Closeand click Yesor OKto 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 onan updated Contact filter.

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

  • 8/11/2019 Lab 01 Creating NSF Components

    17/17

    Page 17 of 17

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

    Summary:

    Congratulations! You have finished all the lessons and have used your Notes application development skills and newfeatures and functions in Lotus Notes and Domino Designer to create a notes component ready to be used in aComposite 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.