Portlet Factory, Version 6.1.2
About adding elements to pages in the web application
You can add or modify elements on the pages in the model by calling the individual builder APIs. Individual builder APIs are in the com.bowstreet.builders.webapp.api package. Each builder has the invokeBuilder() method in common, which prompts the builder to execute on the specified pages in the model.
The following code examples show how to create a new builder call, set the inputs on that builder call, and then use the invokeBuilder() method to execute the builder call:
// Insert the a page at the location passed into this builder. InsertedPage connector = new InsertedPage(builderCall, genContext); connector.setPageLocation(builderInputs.getString("PageLocation",null)); connector.setPage(pageName); connector.invokeBuilder(); // Put a button on our page which just re-submits the current page. Button b = new Button(builderCall, genContext); b.setPageLocation("Page " + pageName + " NameSearch increment"); b.setLabel("Increment"); b.setActionType("form"); b.invokeBuilder(); // Put a text builder to display a variable value. Text txt = new Text(builderCall, genContext); txt.setPageLocation("Page " + pageName + " NameSearch display"); txt.setText("${Variables/" + varName + "}"); txt.invokeBuilder();As shown above, you often need to get the inputs to your builder call to perform specific generation actions.
You can get the builder call inputs. The builderInputs object is an XML structure that contains the names and values of the builder call inputs. To get individual input values, use the appropriate get() method in the BuilderInputs API. For example,
String pageLocation = builderInputs.getString("PageLocation", null); boolean modelAction = builderInputs.getBoolean("ModelAction", null); IXml xmlInput = builderInputs.getXml("CustomerList", null); Object xmlInput = builderInputs.getObject("PurchaseOrder", null);
- About adding elements to the web application
The IBM® WebSphere Portlet Factory servlet passes the web application structure to the builder call with the webApp argument.
- Builder definition files
The builder definition file is an XML file that resides in or below the WEB-INF/builders directory.
- Coordinator class
If you need to implement any sort of dynamic behavior for a builder call editor, create a coordinator class for your builder.
- Generation class
The generation class implements all the logic to be executed by the builder during generation.
- Input widgets
The input definitions that you specify in the builder definition determine the input value type (for example, string and boolean) and the user interface component that the IBM WebSphere Portlet Factory servlet generates for your builder call editor.
- Overview of builder architecture
A builder is a discrete bundle of functionality in the construction of a WebApp.
- Runtime logic classes
If you need code to execute at runtime, in your generation class, you can add a linked Java™ object to the WebApp that implements the functionality you need.
- Choosing builder base classes and interfaces
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 definition structure
The builder definition file has a formal structure.
Library | Support |