One way to make a custom builder for Portlet Factory is with a "model-based" builder. With a model-based builder, you first create a "base" model with the functionality you want, then you profile all the builder inputs you want to control from your new builder.
This sample shows a model-based builder for creating a simple view of data from a service provider model. In this sample the base model has six builders and implements a simple service consumer view functionality, with a separate "help" page. A number of builder inputs are profiled so that they can be controlled with inputs in the new builder. For example, the name of the service provider model is profiled, and there is a Text builder that is profiled for providing a title at the top of the page.
This builder has Coordinator code that populates the service operation picker whenever you select a service provider model. Note that the builder regen class has a little bit of custom code: it adds a prefix to the operation name so it will have the format used by the "Action to call" input in the View & Form builder.
Models included are:
- samples/data_view_builder/DataViewBuilderBase - the base model.
- samples/data_view_builder/DataViewOrders - a model that uses the sample builder.
- samples/data_view_builder/DataViewEmployees - a model that uses the sample builder.
Here is a screenshot of a model that uses the sample builder with the sample Orders service.
Here is a screenshot of a model that uses the same builder with the sample Employees service.
Notes on running the sample and prerequisites
Import the attached zip file into your project using the Import WebSphere Portlet Factory Archive command.
These models require the Tutorial and Samples / Applications feature set, for the Orders and Employees services.