webMethods CloudStreams 10.3 | webMethods CloudStreams Documentation 10.3 | Cloud Connections, Services, and Connector Listeners | Understanding REST Parameters | Parameter Formatters for REST Connector Services | Implementing a Custom Parameter Formatter
 
Implementing a Custom Parameter Formatter
In cases where the default parameter formatter is not sufficient to achieve the desired parameter behavior, you can write a custom implementation for the parameter formatter.
Implement a custom formatter as follows:
1. Write an IS service implementation, adhering to the bundled IS specification wm.cloudstreams.service.common.lookup.specs:formatterSpec.
2. The fully-qualified service namespace should be referred with the formatter service attribute under the parameter definition. Ensure that the formatter type attribute is set to "paramFormatter".
3. Optionally, any service arguments can be specified within the formatter element definition.
Example
Consider a custom service implementation:
my.custom.formatter:sample
The parameter definition for a resource using the above, within the Connector Descriptor, would look like this:
<parameter name="SampleParam" dataType="Record"
documentRef="my.custom.document:sample" style="QUERYSTRING_PARAM">
<formatter service = "my.custom.formatter:sample" type = "paramFormatter">
<arg name="separator" value=";" />
</formatter>
</parameter>

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.