[
https://issues.apache.org/jira/browse/NIFI-6417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16885805#comment-16885805
]
Yolanda M. Davis commented on NIFI-6417:
----------------------------------------
[~tneeley] just wanted to add some details concerning the Advanced UI. It is
written in Angular
*Front End*
[transformjson.view.html|[https://github.com/apache/nifi/blob/c0185ef8ecf5490938bdac63b6d02575a5cd0808/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/webapp/app/transformjson/transformjson.view.html#L32-L37]]
- This file defines the HTML view/layout for the Advanced View. Two dropdowns
should be added for the input/output character sets with models (option values)
populated in the controller (see below).
[transformjson.controller.js|[https://github.com/apache/nifi/blob/c0185ef8ecf5490938bdac63b6d02575a5cd0808/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/webapp/app/transformjson/transformjson.controller.js#L77-L83]]
- This file serves as the controller or glue to bind view to data and
services. Here we'll need to retrieve the options that will populate the
charset values in the view (they should already be part of the existing
processor details call) . Also the existing [joltSpec javascript object
|[https://github.com/apache/nifi/blob/c0185ef8ecf5490938bdac63b6d02575a5cd0808/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/webapp/app/transformjson/transformjson.controller.js#L261-L271]]would
need to be enhanced to send back the selected input and output encoding
selected in the UI.
*Back End:*
[JoltSpecificationDTO|[https://github.com/apache/nifi/blob/c0185ef8ecf5490938bdac63b6d02575a5cd0808/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/java/org/apache/nifi/web/standard/api/transformjson/dto/JoltSpecificationDTO.java]]
- This is the data transfer object that is represented by jsonSpec in
transformjson.controller.js. It needs be changed to represent the new values
added for input/output charsets
[TransformJSONResource|[https://github.com/apache/nifi/blob/c0185ef8ecf5490938bdac63b6d02575a5cd0808/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/java/org/apache/nifi/web/standard/api/transformjson/TransformJSONResource.java]]
- This endpoint is what actually run the test transformation.. The change here
would be to use the values passed in via the JoltSpecificationDTO instead of
the hardcoded DEFAULT_CHARSET value.
One early recommendation is to start on the back end first making changes and
using the TestTransformJSONResource class to confirm, before moving to the
front end (since it can be tedious to test).
> JOLT processors should accept more character encodings
> ------------------------------------------------------
>
> Key: NIFI-6417
> URL: https://issues.apache.org/jira/browse/NIFI-6417
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Extensions
> Reporter: Matt Burgess
> Assignee: Travis Neeley
> Priority: Major
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> Currently JoltTransformJSON and JoltTransformRecord are hard-coded to input
> and output UTF-8 encoding. These processors should be able to at least accept
> a user-configured input encoding such as UTF-16, ISO-8859-1, etc.
> We could retain the behavior of writing out in UTF-8, but I think for
> consistency and flexibility we should add an Output Character Encoding
> property as well. Both would be defaulted to UTF-8 to maintain current
> default behavior.
> *NOTE*: There may be a limitation at present with JoltTransformRecord
> regarding String fields, where they are hard-coded to be UTF-8. If that is
> the case, then both processors should still offer the Input Character
> Encoding, but only JoltTransformJSON would have the Output Character Encoding
> property.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)