Portlet Factory, Version 6.1.2
About creating builder definitions
The builder definition is an XML file that defines the builder characteristics; for example, the builder generation class, help file, domain type, and builder picker category.
The builder definition also defines the inputs to the builder and the editors with which users can specify the builder inputs.
The following code sample shows the builder definition file for a Hello World builder:
<?xml version="1.0"?> <BuilderDef id="com.bowstreet.examples.builders.webapp.HelloWorldBuilder" xmlns="http://www.bowstreet.com/2001/Schemas"> <ReadableName>Hello World</ReadableName> <GenHandlerClassName> com.bowstreet.builders.webapp.foundation.WebAppControlGenHandler </GenHandlerClassName> <HelpFile>help/fileName.html</HelpFile> <RequiredFactoryVersion>5.8.2</RequiredFactoryVersion> <Description>Hello World Builder</Description> <Domains> <Domain>WebApp</Domain> </Domains> <!-- Add the Hello World builder to the Pages Category in the builder picker --> <Category>Page and Layout</Category> <BuilderData> <BuilderDataEntry name="BuilderClassName"> com.bowstreet.examples.builders.webapp.HelloWorldBuilder </BuilderDataEntry> </BuilderData> <InputDefinitions> <InputDefinition name="Name" base="com.bowstreet.core.Base.BuilderName" /> <!-- Add a page location widget to the Builder Call Editor --> <InputDefinition name="PageLocation" base="com.bowstreet.core.WebAppBase.PageLocation" /> <!-- Add a text input box that can also use the Reference Chooser to populate the value --> <InputDefinition name="DisplayText" base="com.bowstreet.core.Base.IndirectValue"> <Prompt>Hello World Text</Prompt> <HelpText>Enter a String value or Indirect Reference to a String that you want to display as the "Hello, world" text.</HelpText> </InputDefinition> </InputDefinitions> </BuilderDefNote: To learn more about builder definitions, install the Tutorials and Samples - Builders feature set.
Parent topic: Overview of builder architecture Related concepts
- Inheriting input and coordinator behavior
An input definition can inherit from any other input definition in the system, by setting the base attribute of the InputDefinition to the builder ID followed by the input name.
- Suppressing the display of an input
You can designate an input definition to be hidden from the builder call editor by adding (or setting) the input definition <Visible /> value to false.
- Defining inputs for your builder
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.
- Creating your own builder input groups
You can create your own input groups by creating a group definition and setting the <Group/> value for the input definitions you want to display as a group. The XML below shows the syntax for a group definition:
- Inheriting input definitions from the Base builder definition
This topic describes each of the input types defined in the Base builder definition.
- Inheriting input definitions from the WebAppBase builder definition
The following table describes some of the input types defined in the WebAppBase builder definition. Refer to the WebAppBase.bdef file in the WEB-INF/builders/com/bowstreet/core directory:
- Grouping inputs
You can organize inputs by including the common groups such as Advanced, HTML Attributes, or Arguments, shown in the IBM® WebSphere Portlet Factory builder call editors or by creating your own input groups.
- Abstract builder input widget classes
The following are abstract classes for builder input widgets.
Implementation of generation behavior
About model-based builder creation
About implementing a coordinator
Library | Support |