This section describes how to build NSF components.
NSF components are elements of a Lotus Notes application surfaced in a composite application. Without modifying an existing Notes application, you can use the Composite Application Editor feature to simply surface the views, forms, documents, and other elements of the Notes application as components.
The Notes application must first have the required WSDL parts and property broker support enabled for this to occur. Refer to the topic "Using the Property Broker Editor feature in Domino Designer" for more information.
To support inter-component communication, use the new IBM Lotus Domino Designer features to modify the NSF and to modify the elements that will be surfaced as components. The property broker functionality included in IBM Lotus Notes provides the runtime environment that supports inter-component communication.
Use Lotus Domino Designer to build the NSF components in the composite application. It is assumed that you are familiar with creating new Notes databases in the Lotus Notes client. It is also assumed that you are familiar with using prior versions of Lotus Domino Designer to modify Notes views, create simple Notes forms, and use the Programmers pane to input Notes formulas and LotusScript code.
Building a Notes component includes the following procedures:
- Determine the properties the component will publish
- Determine the actions the component will perform when it is wired to the property of another component
- Create the WSDL that lists the actions and properties for the component. This is done using the Property Broker Editor feature.
- Import the WSDL into the NSF where specific design elements or documents will be surfaced as NSF components. This is done from Domino Designer.
- Modify the NSF design elements to link them to the previously defined properties and actions using the features of Domino Designer, including LotusScript classes, methods and properties.
Building NSF components can be an iterative process and can be applied to existing Notes applications or to new Notes applications.
Note: If the NSF will be used as one or more components in a composite application hosted on WebShere Portal, generate a portlet .WAR file (Web modules). Use the Composite Application Editor to generate the portlets. You can then deploy/install it on WebSphere Portal using either the WebSphere Portal administrator user interface or an xmlaccess script.
Notes component fundamentals
A Notes component is a link to a specific view, frameset, document, or other design component contained in a Notes database. The same Notes database can contain multiple components, and those components can be used in multiple composite applications.
All components in a single Notes database share the same set of types, properties and actions defined in one or more Composite Applications Wiring Properties and Applications design elements. The component does not have to publish all of the output properties, or implement all of the actions, that are defined in the composite application properties WSDL file. Refer to the topics on the Property Broker Editor for more information.
To have the component participate in a composite application, it must make reference to properties and actions in the composite application properties WSDL file. A component can publish properties, or consume them, or both. There are two ways for a component to publish a property:
- Use the LotusScript API described below. You can do this anywhere LotusScript executes, including in an agent.
- If the component is a view or folder, you can associate a column to an output property defined in the WSDL file. This option is in the Advanced tab of the column properties. Since a column contains a single value, only properties with "simple" types can be associated with a column.
Note: The term "action" is used in general to talk about the "plug" in a component that consumes a property value. Do not confuse the term "action" used in this sense, with the action buttons used in Notes views and forms. All components can have "WSDL actions," whether or not they are Notes applications.
There is only one way for a Notes component to consume a property from another component. The Notes component must contain a "Notes action" that refers to a "WSDL action" which is wired to receive the property. To create an association between a Notes action and a WSDL action, use the Advanced tab of the Action Infobox.
When a property change event occurs, if that property has been "wired" to a WSDL action in your Notes component, and if the Notes component contains a Notes action which is associated with that WSDL action, then the Notes action is executed. Normally, the Notes action will use the LotusScript APIs described below to discover what value was published, and it will do something with that value (for instance, use it as a key to reposition the current view to a matching document).
A Notes action is executed in response to the triggering of a WSDL action, only if the form, view or page containing that action is displayed by the component at that time. You can associate a Notes "shared action" with a WSDL action, but this will not make it execute throughout the application; you still have to put the shared action on the form or view where it's supposed to execute.
The Hide attributes of a Notes action are not used to determine whether it will execute in response to a WSDL action. In fact, all Notes actions called by property change events, should generally be hidden at all times. Such actions will typically use the LotusScript API to read an input property from the property broker, and this would cause an error if activated by a user, since there is no input property to read at that time.
You can build Lotus NSF components (databases, view, forms and so on) for use in a composite application as presented below:
- Standard Notes database design is done with Domino Designer.
- Properties and actions are defined in a WSDL file. The WSDL file must be imported into the Notes database from Domino Designer.
- New LotusScript APIs allow publishing properties to and receiving properties from the property broker. See the "Using LotusScript classes and APIs in composite applications" topic for related information. For example, in order to implement a new composite application, the following new LotusScript APIs may be used to publish a property programmatically:
New composite application-related LotusScript APIs
This release includes many new properties, methods, and classes in the LotusScript APIs. These include the following:
- NotesSession.GetPropertyBroker( ) -- Returns NotesPropertyBroker.
- NotesPropertyBroker.InputPropertyContext (property) -- Returns an array of input NotesProperties. For current releases, only the first member of the array will be populated.
- NotesPropertyBroker.Namespace (property) -- String. Provides the Read/Write default namespace of interest for PropertyBroker.
- NotesPropertyBroker.HasProperty(Name) -- Boolean. Indicates whether a new property exists.
- NotesPropertyBroker.GetProperty(Name) -- Returns NotesProperty.
- NotesPropertyBroker.GetPropertyValue(Name) --Returns the value for a specified property.
- NotesPropertyBroker.SetPropertyValue(Name, Value) -- Returns NotesProperty. It creates a backend object and populates it with the value. This method throws an error if the property name is not defined by WSDL..
- NotesPropertyBroker.ClearProperty -- A new method that purges any new or modified property, not for input properties.
- NotesPropertyBroker.Publish -- A new method that publishes all new and modified properties.
- NotesProperty.Values (property) - Read/Write for simple properties: Returns a Variant array of type String. Single value properties contain data in first array element. As input, accepts Variant or Array of type String. The Array must be homogeneous. At this time, an Array can contain only one String entry. Input properties cannot be set.
- NotesProperty.Name (property) -- Read only. Returns property name as string.
- NotesProperty.TypeName (property) -- Read only. Returns type name as string.
- NotesProperty.NameSpace (property) -- Read only. Returns namespace as string.
- NotesProperty.Title (property) -- Read only. Returns title as string.
- NotesProperty.isInput (property) -- Read only. Returns true if this is an input property, otherwise false. Returns Boolean.
- NotesProperty.Description (property) -- Read only. Returns description as string.
- NotesProperty.Publish( ) -- A new method that publishes this property if modified.
- NotesProperty.Clear( ) -- A new method that purges this property if new or modified.
Note: For information about the new classes, methods and properties, see the "Documentation updates" section of the release notes and the Domino Designer help.