A builder is a discrete bundle of functionality in the construction of a WebApp.
Of the builders that are supplied in IBM® WebSphere® Portlet Factory, some are primitive and do very simple things, like adding a page to the WebApp, or putting a button on a page. Others are complex, and can construct an entire form along with the Java code required to move data between the form and a variable.
There are three critical pieces to a builder.
Builder Definition file (bdef)
This XML file defines the builder for the WebSphere Portlet Factory to know both how to invoke it and how to display instances of it to the user of the builder. Among other things, it defines what the inputs are to this builder. In our example, the builder has only two inputs, the name of the builder and the directory which contains the HTML files to which it is going to create links.Builder class
This is a Java class which performs the automation task. It is run at generate time, and it is expected to make some changes to the WebApp.Coordinator class (optional)
This Java class is run when you edit an instance of the builder, a builder call. The coordinator can modify the builder user interface on-the-fly to hide or show input fields, for example, to change the list of choices in a list. Typically, the coordinator is just used to set the initial value of one of the inputs to a value that is calculated. (If the initial value were static, you can set it in the builder definition file.)
Choosing builder base classes and interfaces: wpf7
Depending on how your builder acts on the WebApp, you need to extend or implement a specific base class or interface for your generation class and specify an appropriate GenHandler
class in the builder definition.
Builder input widgets: wpf7
This topic provides details on all builder input widget names and arguments provided by IBM WebSphere Portlet Factory Designer for use by builder authors.
Generation class: wpf7
The generation class implements all the logic to be executed by the builder during generation.
Coordinator class: wpf7
If you need to implement any sort of dynamic behavior for a builder call editor, create a coordinator class for your builder.
About creating builder definitions: wpf7
The builder definition is an XML file that defines the builder characteristics.
Defining inputs for your builder: wpf7
An input definition is a structure in the builder definition that describes the input for a builder in terms of its type, editor widget (for example, text input and select box), the input group to which it belongs and other similar information.
About adding elements to pages in the web application: wpf7
You can add or modify elements on the pages in the model by calling the individual builder APIs.
About modelbased builder creation: wpf7
A model-based builder is a builder that you create and is based on a model.
Multiphase builder generation behavior: wpf7
For some builders, the order of the builder calls can be important.
Setting properties for page automation elements: wpf7
Page automation elements from builders such as Data Page, Data Column Modifier, or Rich Data Definition, have generic properties associated with them.
Using other builders in the generation class: wpf7
You can add builder calls in the Java code for your own builder in two ways:
Parent topic: Creating a custom builder: wpf7