Plugin-Typen - Data source

Page / - last modified by gru on 28.04.2020, 11:32

Data source

last modified by gru

on 28.04.2020, 11:32

Table of Contents

Interface IPluginDataSource

Use cases

Method signature

Parameters

Return value

Content [ Hide ]

Interface IPluginDataSource

Use cases

Method signature

Parameters

Return value

After the plugin has been installed, go to the Xima® Formcycle Designer and add a form element of type select. You can then select the plugin as the data source in the values panel.

Interface IPluginDataSource

Position of data source plugins in Xima® Formcycle's program flow. They are run during the form rendering process.

Use cases

This type of plugin can be used to provide select fields with custom data from external web services, such as a list of countries, zip codes, etc.

Method signature

IPluginDataSourceRetVal resolve(IPluginDataSourceParams params) throws FCPluginException

Parameters

The method resolve is passed an object implementing IPluginDataSourceParams, which contains getters for the following properties:

Projekt
The form for which this plugin has been called.

Mandant
The client to which the form belongs to.

SessionAttributes

RequestParameters

Return value

The method must return an object implementing IPluginDataSourceRetVal. The class PluginDataSourceRetVal provides a reference implementation.

This object allows you to return a serializable JSON array containing the value that should be shown in the select field. The array must consist of objects, each object must contain the properties text and value. The text is what is displayed as the text of the select option, the value is the value that is sent when the form is submitted. Optionally, the object may also have the property title, which is used as the title attribute of the select option.

The exception FCPluginException will be thrown when an exception occurs while the plugin is being processed.