Portlet Factory, Version 6.1.2


 

Bean Master Detail builder inputs

This topic describes the inputs for the Bean Master Detail builder.

 

General Inputs

Table 1. General Inputs
Input Name Description
Name Required. Specify the text string to be applied for the builder call and objects created by the builder.

The name provided is used as a prefix, specified as buildername in the descriptions, to multiple generated model artifacts.

To place another Bean Master Detail builder on the same page, refer to buildername_viewObject in that other builder.

 

Master / Table View

Table 2. Master / Table View inputs
Input Name Description
Collection Required. Object in the WebApp that is to be the source of the data at runtime. This content is under the user's application control and the collection is examined when the page is rendered. Changes made to the set of objects in the collection are reflected in the rendered page.

The object being returned must be an instance of java.util.Collection or java.util.Iterator.

Note: The builder does not take a copy of the collection; it maintains a reference to the collection.

Bean class name Required. Class (or Interface) that is examined at regeneration time and from which the WebApp artifacts are generated.

Note: The class (and its superclasses) must be visible to the Eclipse plugin at design time and to the J2EE context at runtime. To make the class visible to the Eclipse plugin, do one of the following steps.

  • Place the class in a jar that is registered in IBM® WebSphere Portlet Factory (for example, com.bowstreet.designer.core_6.1.0) plugin.xml file.

  • Place the class files in the appropriate place in the /work/source directory structure so that WebSphere Portlet Factory Designer can refer to it. It must be visible to both design time and runtime regeneration actions.
Imported page URL If the Page in model input is not supplied, this input is required.

Page on which the table view of the collection is to be placed. The page is added to the model as buildername_mainPage. And the table view is added at the span tag called data.

(Can be overrode in the Tag location mappings section.)

Page in model If the Imported Page URL input is not supplied, this input is required.

Specify the page on which the table view of the collection is to be placed. The table view is added at the span tag called data. (Can be overrode in the Tag location mappings section.)

Paged data display Optional. When checked, paging buttons are added below the table.
Rows per page Optional. Number of rows per page of data.

 

General UI Options

Table 3. General UI Options inputs
Input Name Description
Auto-generate UI Required. This input interacts with an underlying Data Page builder for the view and edit pages and specifies whether the attribute names and values are shown at specific named (matching) locations on the HTML page, or if the names and values are generated automatically into the HTML page starting at a particular tag location.
Navigation Style Required. The navigation style between pages is selectable, as either buttons or links.

Note: The span tags on which these navigation buttons or links are placed (and their labels) are configurable. For more information, see Tag Location Mappings.

 

View Detail Options

Table 4. View Detail Options inputs
Input Name Description
Allow View Detail Required. This input determines if a view detail page is generated. If it is generated, a link is placed on a selectable column in the main collection table. At runtime when that link is clicked, the page showing the detail view for that chosen object is rendered.

When the link is clicked, the linked Java object in the WebApp called buildername_viewObject, where buildername is the Name input, is set to reference the chosen object in the main collection. Anything else on the rendered page that is sourced from buildername_viewObject in some way shows the correct related data.

Column for link If the Allow View Detail input is selected, this input is required.

When the bean class name is specified in the builder user interface (UI), this builder input is automatically populated by introspecting the specified class. The only attributes shown in this selection are those that are valid for the main collection view.

Imported page URL If the Page in model input is not supplied, this input is required.

Specify the page onto which the detail view of the object is placed. The page is added to the model as buildername_viewPage and the view is added at the span tag called data. (Can be overrode in the Tag location mappings section.)

Page in model If the Imported Page URL input is not supplied, this input is required.

Specify the page on which the detail view of the object is placed. The view is added at the span tag called data. (Can be overrode in the Tag location mappings section.)

Use Detail-specific class Optional. This input enables advanced functionality in this builder. If the object to be displayed in the detail view is a physically different object from the one in the collection, that is, a thicker version with much more detail (more attributes), this checkbox enables the additional inputs needed to allow that detail object to be displayed when the thin object in the collection view is clicked.
Detail class name If the Use Detail-specific class input is selected, this input is required.

Specify the class name or interface of the detail object.

Accessor class If the Use Detail-specific class input is selected, this input is required.

Specify the class name that declares the static method specified in the Accessor method input.

Accessor method If the Use Detail-specific class input is selected, this input is required.

Specify the static method declared in the class specified in the Accessor class input.

When the object in the main collection table is clicked, the generated runtime logic invokes this static method and passes as arguments the values (named in the Field names input) from the selected object.

Field names If the Use Detail-specific class input is selected, this input is required.

Specify the arguments to be passed to the method specified in the Accessor method input.

 

Edit Options

Table 5. Edit Options inputs
Input Name Description
Allow Edit Required. This input determines if an edit page is to be generated.

If an edit page is generated, an Edit link or button is placed on the view page, and optionally an Edit column is added to the main collection table. At runtime, when that link is clicked, the page showing the chosen object in edit mode is rendered.

Only the attributes for which public setters exist are opened up for edit; the other attributes are display-only. When the link is clicked, the linked Java object in the WebApp called buildername_viewObject is set to reference the chosen object in the main collection.

When the edit page is submitted, a generated action list called buildername_doSave is invoked.

Imported page URL If the Page in model input is not supplied, this input is required.

Specify the page on which the edit view of the object is to be placed. The page is added to the model as buildername_editPage, and the view is added at the span tag called data. (Can be overrode in the Tag location mappings section.)

Page in model If the Imported Page URL is not supplied, this input is required.

This is the page onto which the edit view of the object is to be placed. The view is added at the span tag called data. (Can be overrode in the Tag location mappings section.)

PreApply Method Optional. Specify the method to be invoked from the buildername_doSave method at runtime when the page containing the edits is submitted.

The method supplied must take a single object argument. When the method is called, the object passed to it is the edited object before any changes are applied (that is, the buildername_viewObject) as it was when it was rendered on the edit page.

Calling this method provides a hook to start a transaction, acquire a JDO persistence manager, or even apply validation additional to that occurring in the object setter methods.

PostApply Method Optional. Specify the method to be invoked after all the editable values are submitted.

After the method specified in the PreApply Method input runs, the buildername_doSave method invokes buildername_editPage_saveData which applies the submitted values (for all of the editable attributes on the page) to the buildername_viewObject. If no errors occur (either detected by the Data Page validation or in the object setter methods by way of throwing an exception), the method specified in this input is invoked.

As with the PreApply method, this method is expected to take a single object argument which is the buildername_viewObject after the updates have been applied to it.

Calling this method provides a hook to commit a transaction.

Save Error Action Optional. Specify the page to be called if the Validation input selected is to perform validation or catch exceptions.
Validation Optional. This determines the level of validation and error handling to be included in the Edit mechanism (within the generated buildername_editPage_saveData method). The following options are available.

Do not add validation or catch exceptions from setters

Causes exceptions thrown in the PreApply, buidlername_editPage_saveData, or PostApply methods to drive the Save Error Action. If no Save Error Action input is specified, the default error page is rendered, or the error handler specified in the model runs.

Perform field type validation before applying setter

Invokes the regular Data Page validation mechanism to populate a buildername_editPageError variable in the Webapp with any data type errors identified in the inputs. When an error occurs, the edit page is re-rendered and the detected errors are displayed on the page next to the fields that caused them.

Catch exceptions thrown from the setter

Omits the initial Data Page type validation but catches any exceptions thrown from the setter methods, populates the buildername_editPageError object and re-renders the edit page.

Perform validation prior to setter and catch any exceptions thrown

Invokes Data Page type validation, catches exceptions thrown from the setter methods, and populates the error variable. If an error is determined to have occurred, the edit page is re-rendered.
Allow Edit From Table Optional. If selected, an Edit column is added to the main collection table

 

Delete Options

Table 6. Delete Options inputs
Input Name Description
Allow Delete Required. This input determines if delete functionality is to be generated.

If Delete is generated, a Delete link or button is placed on the view page, and, optionally, a Delete column is added to the main collection table. At runtime, when that link is clicked, a user-supplied Delete method in the model is invoked.

Delete method Required. Specify the method to be invoked when a delete link or button is clicked.

The method is expected to accept a single object as argument, which is the object selected for deletion. Typical user action in this delete method might be to invoke an SQL call or to remove the object from the collection.

Delete Error Action Optional. If an exception occurs in the Delete method, this error action is invoked.
Allow Delete From Table Optional. If this input is selected, a Delete column is added to the main collection table.
Add Delete Confirmation Dialog Optional. If this input is selected, a JavaScript routine is generated in the Delete HTML code to popup a window to confirm the delete.

 

Create Options

Table 7. Create Options inputs
Input Name Description
Allow Create Required. This input determines if create functionality is to be generated.

Create functionality places a Create button or link on the main collection page which invokes a user-supplied instantiate method and then invokes a save mechanism similar to that generated for Edit.

Instantiate Method Required. Specify the method to be invoked when the create button or link is clicked.

This method is expected to take no arguments, and to return a single object of the specified bean class name (or detail class name if different). The returned object reference is passed to the buildername_doSaveForCreate action list, which invokes the PreApply, buildername_createPage_saveData, and PostApply methods.

Imported page URL If the Page in model input is not supplied, this input is required.

Specify the page onto which the create view of the object is placed. The page is added to the model as buildername_createPage and the view is added at the span tag called data. (Can be overrode in the Tag location mappings section.)

Page in model If the Imported Page URL input is not supplied, this input is required.

Specify the page onto which the create view of the object is placed. The view is added at the span tag called data. (Can be overrode in the Tag location mappings section.)

PreApply Method Optional. Specify the method to be invoked from the buildername_doSaveForCreate method at runtime when the page containing the edits is submitted.

The method supplied must take a single object argument. When the method is called, the object passed to it is the edited object before any changes have been applied (that is, the buildername_viewObject as it was when it was rendered on the create page).

Calling this method provides a hook to start a transaction, acquire a JDO persistence manager, or even apply validation additional to that occurring in the object setter methods.

PostApply Method Optional.

Specify the method to be invoked after the submitted values are supplied.

After the method specified in the PreApply Method input runs, the _doSaveForCreate method invokes buildername_createPage_saveData which applies the submitted values (for all of the editable attributes on the page) to the buildername_viewObject. If no errors occurred (either detected by the Data Page validation or in the object setter methods by way of throwing an exception), the method specified here is invoked.

As with the PreApply Method, this method is expected to take a single object argument which is the buildername_viewObject after the updates are applied to it.

Calling this method provides a hook to commit a transaction.

Save Error Action Optional. Specify the page to be called if the Validation style input selected is to perform validation or to catch exceptions.
Validation Optional. This determines the level of validation and error handling to be included in the Create mechanism (within the generated buildername_createPage_saveData method). The following options are available.

Do not add validation or catch exceptions from setters

Causes exceptions thrown in the PreApply, buildername_editPage_saveData or PostApply methods to drive the Save Error Action. If a Save Error Action is not specified, either the error handler specified in the model is rendered, or, if nothing has been specified, the Default Error page is rendered.

Perform field type validation before applying setter

Invokes the regular Data Page validation mechanism to populate a buildername_editPageError variable in the web application with any datatype errors identified in the inputs. When an error occurs, the edit page is re-rendered and the detected errors are displayed on the page next to the fields that caused them.

Catch exceptions thrown from the setter

Omit the initial Data Page type validation but catch any exceptions thrown from the setter methods, populate the buildername_editPageError, and re-render the edit page.

Perform validation prior to setter and catch any exceptions thrown

Invokes Data Page type validation, catches exceptions thrown from the setter methods, and populates the error variable. If an error is determined to have occurred, the edit page is re-rendered.

 

Tag Location Mappings

Table 8. Tag Location Mappings inputs
Input Name Description
Tag on page for collection display location Required. Tag on page for collection display location
Tag on page for paging buttons location Required. Tag on view page for paging buttons location
Tag on page for view display location Required. Tag on page for view display location.
back (from view) button tag Required. Tag on View page for back button/link location.
back (from view) button/link label Required. back (from view) button label.
Tag on page for edit display location Tag on page for edit display location
Tag on page for create display location Tag on page for create display location
edit (from view) button tag Required. Tag on View page for edit button location.
edit (from view) button label Required. edit button label.
delete (from view) button tag Required. Tag on View page for delete button location
delete (from view) button/link label Required. delete (from view) button/link label.
Tag on edit page for edit display location Required. Tag on page for edit display location.
save (from edit) button tag Required. Tag on Edit page for save button location.
save (from edit) button label Required. save button text.
back (from edit) tag Required. Tag on Edit page for back button location.
back (from edit) button label Required. back (from edit) button text.
cancel (from edit) tag Required. Tag on Edit page for cancel button location
cancel (from edit) button label Required. cancel (from edit) button text
create button tag Required. Tag on Main page for create button location
create button label Required. Create button text
Tag on create page for create display location Required. Tag on Create page for create button location
back (from create) tag Required. Tag on Create page for back button location
back (from create) button label Required. back (from create) button text
cancel (from create) tag Required. Tag on Create page for cancel button location
cancel (from create) button label Required. cancel (from create) button text
save (from create) tag Required. Tag on Create page for save button location
save (from create) button label Required. save (from create) button text

Parent topic: Bean Master Detail builder


Library | Support |