Advantages:
- Plugin can be developed by any software engineer (Java/C++/C#/Python/PHP/Node.js etc)
- Plugin can be easily debugged
- Create directory with meaningful name. Name of the directory will be used as formatter name.
- Implement script or executable which meets protocol described below.
- Add file
usage.json
with usage shell command
For example for python script it will be:['python', 'my_super_formatter.py']
- Test your formatter in RDM!
CMD: <executable> info
STDOUT (json):
{
"version": "1.0.0",
"description": "Formatter description"
}
CMD: <executable> validate
STDIN: <binary-data-encoded-with-base64>
STDOUT (json):
{
“valid”: “false”,
“error”: “input is not gziped data” // if valid is false
}
CMD: <executable> decode
STDIN: <binary-data-encoded-with-base64>
STDOUT (json):
{
“output”: “<decoded data for human-friendly edit>”,
“read-only”: “false”,
“format”: “plain_text” // or “json”
}
Required only for formatters which return “read-only”: false
in decode
method
CMD: <executable> encode
STDIN : <edited-string-representation-encoded-with-base64>
STDOUT (json):
{
“output”: “<binary-data-encoded-with-base64>”,
}
If formatter cannot decode/encode value error response should be returned:
OUT (json):
{
“error”: “Invalid CBOR data”,
}