Designing and Implementing Composite Applications : webMethods CAF and OpenCAF Development Help : Working with Gadgets : Creating a Gadget for a REST Resource
Creating a Gadget for a REST Resource
You can use REST resource descriptors to generate custom webMethods Business Console user interfaces for REST resources, and add those user interfaces to new or existing gadgets.
The high-level steps for creating Business Console user interfaces, based on REST API Descriptors are as follows:
1. Create a REST resource and generate a REST API descriptor for that resource, using the Package Navigation section on the UI Development perspective in Designer. For more information about REST resources and REST API descriptors, see webMethods Service Development Help.
2. Create a CAF web application project, and add a Business Console gadget to that project.
3. Configure the input and output mapping of you REST resources to the Business Console user interface elements, using the REST Connector Wizard in the UI Development perspective.
4. Configure the gadget. For more information, see Developing Gadgets for webMethods Business Console.
5. Deploy your project to My webMethods Server and display the gadget in an AppSpace in Business Console.
To create a Business Console user interface for a REST resource
1. Create a web application project.
For more information about creating a web application project, see Creating a Web Application Project.
Note:  
Skip the actions in Step 1 to Step 3 if you are generating a user interface for a REST resource in an existing gadget.
2. In the Solutions view, right-click the web application project and select Business Console Gadgets > New Business Console Gadget.
3. Configure your gadget as described in New Business Console Gadget Wizard.
4. In the Solutions view, double-click to open the view.xhtml file for your gadget in the view editor.
5. Drag and drop the required REST API Descriptor to the Design Page of the view editor.
Software AG Designer opens the New REST Connector Wizard.
6. On the Project Selection page of the New REST Connector Wizard, click Next.
Note:  
You can edit the Swagger URL field when you start the New REST Connector Wizard using the New > Other > UI Development > REST Connector menu. Specify a publicly available HTTP URL, or a local file path in the Swagger URL field.
7. On the REST Resources Selection page, specify the following:
*The REST resources and operations for which you want to create user interface controls.
*Whether to use Cross-origin resource sharing (CORS) support on host servers, or the Business Console proxy REST service as the REST invocation method.
*Whether to use a global or local URL to display the gadget in Business Console.
8. On the Configure Fields page, configure the form in which the Composite Application Framework will generate user interface controls for the selected REST resources, as follows:
Field/Table
Description
Form Name
The name of the form will be displayed in Business Console.
Input and Output Parameters
For each user interface control in the table, configure the following fields:
*Name - select/clear to specify whether to display the control in Business Console.
*Display label - click to modify the text, displayed on the field label in Business Console.
*Type - applies only to String Arrays. The opions are String Array and String Table.
*Mandatory (only for input parameters) - select/clear to specify whether a form control is required.
*Validation (only for output parameters) - the validation type to apply to the control. This value is populated automatically. The options are Text, E-mail, and Alphanumeric, adn Numeric.
*UI Control - by default, the Composite Application Framework generates an appropriate user interface control type for each REST parameter.
Select Column Count for Input and Output Parameters
Select the number of columns, in which Business Console displays the generated form. The options are: One, Two, and Three.
9. On the Pagination Details page, configure the following pagination options:
Field
Description
Name
Select/clear the parameter, for which to apply pagination.
Type
You cannot modify the data type of the control.
Page Number
Number of pages to display in the Business Console gadget.
Page Size
Number of entries per page.
Total Records
Total number of records to display.
Pagination applies only to path and query parameters. Select the parameter you want to use for each of the available pagination options.
10. Click Finish to generate the gadget.
After Designer generates the gadget, you can configure it further, deploy it to My webMethods Server, and use it in Business Console. For more information about gadget development, see Developing Gadgets for webMethods Business Console. For more information about working with gadgets in the runtime, see Working with webMethods Business Console.
Copyright © 2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback