4.1.1 Format of the user-created plug-in
The user-created plug-in is written in JavaScript and provides its functionality in the CommonJS module format. The following example shows the format of a user-created plug-in and how to write a method called when configuration information is retrieved.
- Format
module.exports = { operations-of-the-user-created-plug-in };
- Example
module.exports = { // Operations performed when configuration information is retrieved __configurationGet : function(args) { // Determine if the configuration collection should be processed with args.component if (args.component !== "/HITACHI/JP1/PP/CONFINFO") { return; } // If yes: // When args.data contains configuration information in JSON format, pass it as it is args.setResult(args.data); }, };
The following shows the rules for writing the user-created plug-in:
-
Plug-in file name: product-name.js
Example: jp1pfm.js, jp1ajs.js
-
Encoding: ASCII
-
Language: English
Comments must also be in English.
-
Supported line feed code
CR, LF, CR+LF
- Important
-
When a user creates a new method, the name of the method must not start with an underscore.