getPlugin( ) method
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Returns a reference to the registered JSDO plugin object with the specified name.
Return type:
Object
Applies to: progress.data.PluginManager class
Syntax
|
- name
- A
stringexpression that evaluates to the name of the plugin. If a plugin by this name does not exist, the method returnsundefined.
Example
The JSDO provides a built-in "JFP" plugin
with a requestMapping function that supports the
JSON Filter Pattern (JFP). The following example dynamically modifies this built-in
plugin to handle the response from a particular OpenEdge Data Object resource, as
follows:
|
First, the getPlugin( ) method returns a
reference to this built-in plugin as defaultPlugin. A custom
responseMapping function is then dynamically
registered for the plugin that modifies data in the
dsCustomer.eCustomer table returned from the OpenEdge Data
Object resource.
Upon execution, the fill( ) method
performs conversions using the plugin's default requestMapping function, then invokes the resource Read operation on
the server. When the response from the server is
returned, this customized responseMapping function
executes to modify response data before it is
loaded into JSDO memory.
"JFP" plugin, the ABL method that implements the
operation in the Business Entity (the Data Object source) must be annotated with a
mappingType property set to "JFP". For more
information on annotating this property, see the Notes in the description of the
addPlugin( ) method.