COMPOSITE APPLICATIONS - DESIGN AND MANAGEMENT


Using component configuration features in the Composite Application Editor
To help composite application developers easily view and set component preferences in the Composite Application Editor, you can define editable properties with extension points, add tabs to the Edit Component Properties dialog box, and add property controls that appear directly in your component user interface while it is being edited.

Note The procedures and examples described below occur in Lotus Expeditor and the Composite Application Editor. Both of these are valuable additional tools for developers creating composite applications and components in Domino Designer.

Defining properties through an extension point

You can define component properties with an extension point. The properties and their default values are added to the component when the component is added to an application. The Edit Component Properties dialog box in the Composite Application Editor displays the properties on the Component Settings tab and allows users to set them.

To use an extension point to define a component property, do the following:

1. Create a new com.ibm.rcp.ca.utils.properties extension.

2. Right-click the extension and click New > Properties.

3. In the id field for the new properties element, specify an ID.

4. In the referenceID field, specify a view or component ID (defined in the com.ibm.rcp.aaf.paletteEntries extension). Below, the referenceID value refers to the ID of the Test View view, com.ibm.rcp.test.view.

Note If there are two properties with the same name, one associated with a view ID and one with the component ID, the property associated with the component ID is the one that appears on the Component Settings tab. This gives you finer control over the properties and values for each component. A property associated with a view ID is applied to all components that use that view ID (for example, multiple managed browser components, each needing a URL property). A property associated with a component ID is applied only to the component with that ID. Associating a property with a component ID lets you define the property for a specific component, without having it applied to other components that may use the same view ID.

5. In the typeID field, specify one of the predefined property types–string, boolean, number, choice, file, color, nsfPicker (for Notes databases), directory, or list (for multi-valued properties). You can also specify a custom type; for more information, see "Defining custom property types," below.

6. In the name field, specify the localizable property name.

7. In the value field, specify the default value of the property, such as a file name or a color.

8. In the restrictions field, enter a semicolon-separated list of value limits or choices appropriate for the property type, as shown below:


All properties (and their default values) are added to the component when the component is added to an application. The Composite Application Editor displays the property controls on the Component Settings tab of the Edit Component Properties dialog box.

If you define a property with a custom type, you can also provide a control to allow users to set the value of the property. For more information, see "Defining custom property types," below.

You can also assign properties to groups, so that they will appear next to other related properties on the Component Settings tab. For more information, see "Adding properties to groups," below.

Defining custom property types

You can define component properties with custom types, and provide edit controls for these properties on the Edit Composite Properties tab of the Composite Application Editor.

The com.ibm.rcp.ca.utils.properties extension point has a gtypeh element you can use to define a custom type for a component property. To add the element, perform the following steps.

1. Right-click the extension and click New > Type.

2. In the type element, specify a type ID and name and reference the Java class for the type.

The Java class must implement com.ibm.rcp.ca.utils.componentconfig.IComponentPreferenceType. It defines the edit control that will appear on the Edit Composite Properties tab and, optionally, a button, such as a browse button or a color picker. The edit control can be a composite that contains multiple controls.

When you define a property with a custom type in the com.ibm.rcp.ca.utils.properties extension point, the property gtypeIdh attribute should reference the ID of the custom type.

Adding properties to groups

You can group related component property controls on the Component Settings tab of the Edit Component Properties dialog box.

You can add properties to groups in two ways.


In the Composite Application Editor, on the Component Settings tab of the Edit Component Properties dialog box, the group name appears before the set of properties assigned to that group. Any properties that have not been assigned a group appear after any grouped properties.

Contributing tabs to the Component Settings dialog box

To highlight properties specific to a view part component, you can display them on a tab you contribute to the Component Settings dialog box in the Composite Application Editor.

To contribute a tab for your component, your view part must implement the com.ibm.rcp.ca.utils.componentconfig.IPropertyTabsProvider interface.

This interface provides a getTabs() method (com.ibm.rcp.ca.utils.componentconfig.IPropertyTab [] getTabs), which the Composite Application Editor uses to add your tabs to the Component Settings dialog box. Each tab has access to com.ibm.rcp.ca.utils.componentconfig.IPropertyManager methods and is responsible for the following:


Consider a component created by extending the existing Managed Browser component and implementing the com.ibm.rcp.ca.utils.componentconfig.IPropertyTabsProvider interface, as shown in the following fragment:

public class MyBrowserView

  extends PAABrowserView

  implements IPropertyTabsProvider { c

The component creates new tabs by implementing the com.ibm.rcp.ca.utils.componentconfig.IPropertyTab interface to define the tab user interface:

public class BrowserTab implements IPropertyTab { c

public class LayoutTab implements IPropertyTab { c

Note Your custom tab can also extend com.ibm.rcp.ca.utils.componentconfig.AbstractPropertyTab, which provides default implementations of some methods.

The code also implements the getTabs() method in MyBrowserView to return the tabs when requested:

public IPropertyTab[] getTabs() {

IPropertyTab[] _tabs = new IPropertyTab[2];

_tabs[0] = new BrowserTab();

_tabs[1] = new LayoutTab();

return _tabs;

}

In the Composite Application Editor, the new Browser tab appears in the Component Settings dialog box

Adding property setting controls directly to components

To make your component's properties even more obvious to application assemblers, you can provide controls for setting the properties that are visible in the user interface of the component itself, when the application assembler is editing it in the Composite Application Editor.

To add this additional user interface, do the following in the code for your component class:


Note In practice, you could include a member variable of type ISaveablePropertyManager in your ViewPart class and set that variable in the implemented setSaveablePropertyManager method. However, note that the variable will be null until the view user interface has been created. This is why you must check the editingApplication property as noted above, to know whether you must display the additional user interface.

For complete information on the tasks described as well as how to use the Composite Application Editor and Lotus Expeditor, refer to the product documentation that comes with each tool. The Composite Application Editor is installed as an option when you install the IBMR LotusR NotesR Standard client.

Additional details may also be found on the Lotus Expeditor product wiki (http://www-10.lotus.com/ldd/lewiki.nsf)