Skip to main content link. Accesskey S
  • Log In
  • Help
  • IBM Logo
  • IBM Composite Applications wiki
  • All Wikis
  • All Forums
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
Community Articles Product Documentation Learning Center IBM Redbooks This category Custom Search Scope...
Search
Community Articles > Assembling Applications > Wiring Applications > IBM - My First Wire
  • New Article
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

Jennifer Dunne
Contribution Summary:
  • Articles authored: 9
  • Articles edited: 7
  • Comments Posted: 0

Recent articles by this author

Understanding the data model

The composite application data model is very similar to the model on Websphere Portal for applications. Understanding the model is key to creating great applications. You access the model using the Topology Handler Api's in Lotus Expeditor. You have three basic levels of data: Application |_Pages ...

IBM Composite Application Component Library

Background information A library of 22 components you can use to make composite applications in Lotus Notes 8. Sample description Here are the included components: Checker: This presents a check box to the user with configurable text. When checked, it broadcasts mashups of properties set on it. ...

IBM - My First Wire

This sample is only to teach you how to create your first wire within a composite application. This is targeted for new users who have no experience in composite applications and want to understand the basic concept of a wire and how it works between two notes objects. The finished database is ...

Related Resources

Articles Designing composite applications: Component design This article charts some basic approaches for designing components for composite application development that have maximum reuse. You can use many different strategies to provide the optimum components. Designing composite applications: ...

IBM - Lead Manager

Sample description The Lead Manager sample demonstrates the new composite application features in IBM Lotus Notes 8 and IBM Lotus Domino Designer 8. This sample contains the files and instructions to install and run the Lead Manager composite application sample on IBM Lotus Notes 8. A guide is ...

Community articleIBM - My First Wire

Added by Jennifer Dunne | Edited by IBM contributor Michael Cooper on October 22, 2009 | Version 8
  • Edit
  • More Actions Show Menu▼
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars
expanded Abstract
collapsed Abstract
No abstract provided.
Tags: samples, my first wire, wiring, getting started, new users
This sample is only to teach you how to create your first wire within a composite application. This is targeted for new users who have no experience in composite applications and want to understand the basic concept of a wire and how it works between two notes objects. The finished database is also supplied as an attachment. When completed you will have a view passing the value of a column over to a document window.

Steps
1. From the menu click File -> Application -> New. (Shortcut is CTRL-N).
2. In the new Application dialog box enter in the following information.

  • Title: My First Wire
  • File Name: My First Wire.nsf
  • Template: - Blank Composite Application -
You can leave the other options as default. It should look like this. If it does then click OK.


2. The database will open and you will get a blank screen. For the moment we can ignore this. Close the database and reopen it in designer.

3. Go to "Composite Applications -> Wiring Properties" section and click "New Wiring Properties".


4. Enter the name "My Wire Properties" and click OK.


5. With "My Wire Properties" selected click "Open File".


6. The Wiring Properties Editor should now show up. On the Properties tab Click "Add". Then enter in the following.
  • Name: field1
  • Type: String
  • Title: Field 1 Changed
  • Click on "Allow Publishing".
This is the property that we are going to pass to the wire.


7. Click the Actions tab and press "Add" then enter in the following information.
Action Details
  • Name: myAction
  • Title: Display Field 1 information
  • Action Input Parameter
  • Name: field1
  • property: String


8. Close the Property Broker Editor. You should see a "Save Resource" dialog. Click Yes.


9. Your wiring properties are now saved to the disk. You need to refresh them into the database. To do this click the refresh button. Select the correct WSDL file (normally already selected by default) and click Open.


10. Select forms section in designer and click New Form.


11. On the form create a text field called "Field1".


12. From the create menu select "Action -> Action..."

13. Set the Action to LotusScript. Then open the Action properties and give it the name "Display Field 1 Details". Make sure "Include action in Action bar" and "Include in Action menu" are not selected.

14. Select the third tab on the action properties (propeller cap). Set the "Composite Settings" action name to "myAction". This tells the property broker that if "myAction" is triggered it will run this Action.

15. For the moment we aren't going to write any code (we leave that for the end). Close the form. You will be prompted to save the form for the Form name. Call it "MyForm" and click OK.

16. Expand the views section and click on the "(Untitled)". This will open the view for editing.

17. Select the first column, open the properties and give it a name of "Field 1". Set the column to display a Field and set it to "Field1".

18. On the properties of the field column select the last tab (looks like propeller cap). In the bottom of the tab set the "Composite Settings" set the Property to "field1" in the drop down list. You have now set up this column to send the value of the selected column in the view to the property broker when the user selects a different document.

19. Save and close the view. When prompted for the name call it "myView".

20. Now go back to Lotus Notes and open the application (CTRL-O). You will be greeted with a blank screen. Select the actions menu and select "Edit Application". This will open the Application Editor.

21. Expand the Component Pallette if it is not already by clicking on the bar on the right. Right click in the Component Pallette (not on an item) and select the menu item "Add Components -> Add NSF Component".

22. On the new NSF Component dialog box click "Browse...". A locate Object should appear. Select the following options.
  • Kind of object: View
  • Application: - Current database -
  • View: myView
    Click OK.

23. You will be returned to the new NSF component dialog box. You will see that the "Notes URL" is filled out.. Fill out the remaining details.
  • Component Name: View Component
  • Category: General
    Click OK.

24. You need to create another NSF component by right clicking in the component pallette and select the menu item "Add Components -> Add NSF Component".

25. On the new NSF Component dialog box click "Browse...". A locate Object should appear. Select the following options.
  • Kind of object: Form
  • Application: - Current database -
  • View: myForm
    Click OK.

26. You will be returned to the new NSF component dialog box. You will see that the "Notes URL" is filled out.. Fill out the remaining details.
  • Component Name: Form Component
  • Category: General
    Click OK.

27. Drag the "View Component" and "Form Component" to the center area so that they are displayed. You drag the Form Component near the bottom of the area so that both appear as shown.

28. Right click "View Component" on the left hand side and select "Wiring".

29. In the Wiring view drag the "Field 1 Changed" to the "Display Field 1 information". You have now created the connection of the view to the form in your composite application. Close the

30. Close the wiring view. You will be asked to save. Click Yes.

31. Close the composite application editor. You will be asked to save. Click yes.

32. You are now back in your composite application. Everything is ready to go! However your action doesn't have any code in it so nothing will happen. We will add code to that, but before we do lets create a few documents. To do that you need to click on the view section of the composite application and select "Create -> myForm" from the menu. Create a few documents and save them. So it looks like something below.

33. Go back to Designer and edit the form "myForm" and select the action "Display Field 1 Details". We are going to enter in code into the agent.

34. Enter in the following code. Save and close the form. (See further down for explanation of code).
Dim session As New NotesSession
Dim dataBase As NotesDatabase
Dim propertyBroker As NotesPropertyBroker

Dim field1 As NotesProperty

Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument

Set propertyBroker = session.GetPropertyBroker

If Not propertyBroker Is Nothing Then
Set field1 = propertyBroker.getProperty("field1")

Dim doc As NotesDocument
Set doc = uidoc.Document
doc.SaveOptions = "0"

uidoc.FieldSetText "Field1", field1.Values(0)
End If

35. Your application is complete! Now open the application and select a document. It should update the other window with the value of the selected document.

Explanation of the Code
There are a few ways to interact with the Property broker but this is the most basic. Here is an explanation of each part of the code.

First we set up the variables we are going to use.
Dim session As New NotesSession
Dim dataBase As NotesDatabase
Dim propertyBroker As NotesPropertyBroker
Dim field1 As NotesProperty

We make a connection to the current document which is the "form component" window.
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument

Now make a connection to the propertyBroker. This is the core section to interact with the wiring system.
Set propertyBroker = session.GetPropertyBroker

We check to ensure that the property broker is working correctly before we run any other code.
If Not propertyBroker Is Nothing Then
End If

We get the value of "field1" from the property broker which was passed in by the "View component".
Set field1 = propertyBroker.getProperty("field1")

These next three lines are just to tell the "Form component" that we don't want to save it as a document. This is to stop the "Do you want to save" popping up if we close the application.
Dim doc As NotesDocument
Set doc = uidoc.Document
doc.SaveOptions = "0"

Because the last lines interacted with the backend document it would eras e anything entered into the UI document, so this line has to come after them. This will display the "field1" in the "Form component".
uidoc.FieldSetText "Field1", field1.Values(0)

Download
Download the sample here: My+First+Wire.zip


  • Edit
  • More Actions Show Menu▼


expanded Attachments (0)
collapsed Attachments (0)
Edit the article to add or modify attachments.
expanded Versions (8)
collapsed Versions (8)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (8)Oct 22, 2009 6:36:38 PMMichael Cooper  IBM contributor
7Aug 19, 2008 4:17:11 PMSimon ODoherty  IBM contributor
7Oct 11, 2009 9:10:42 PMDeanna Drschiwiski  IBM contributor
5Jul 8, 2008 6:53:52 AMErik Behrends  IBM contributor
4May 29, 2008 5:41:27 PMJennifer Dunne  IBM contributor
3May 29, 2008 5:24:20 PMJennifer Dunne  IBM contributor
2May 29, 2008 5:20:20 PMJennifer Dunne  IBM contributor
1May 21, 2008 12:59:06 PMJennifer Dunne  IBM contributor
expanded Comments (0)
collapsed Comments (0)
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