Repository: nifi Updated Branches: refs/heads/master 239bbfbb9 -> de6a98618
NIFI-479 Add UI Extension Section to Developer Guide Signed-off-by: Scott Aslan <[email protected]> This closes #1882 Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/de6a9861 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/de6a9861 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/de6a9861 Branch: refs/heads/master Commit: de6a98618abcb6b695c1afe33164ec7d88e76a75 Parents: 239bbfb Author: Andrew Lim <[email protected]> Authored: Wed May 31 11:22:07 2017 -0400 Committer: Scott Aslan <[email protected]> Committed: Fri Jun 2 12:05:20 2017 -0400 ---------------------------------------------------------------------- .../src/main/asciidoc/developer-guide.adoc | 110 +++++++++++++++++++ 1 file changed, 110 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/de6a9861/nifi-docs/src/main/asciidoc/developer-guide.adoc ---------------------------------------------------------------------- diff --git a/nifi-docs/src/main/asciidoc/developer-guide.adoc b/nifi-docs/src/main/asciidoc/developer-guide.adoc index d4195a1..7b31cb5 100644 --- a/nifi-docs/src/main/asciidoc/developer-guide.adoc +++ b/nifi-docs/src/main/asciidoc/developer-guide.adoc @@ -1949,6 +1949,116 @@ ReportingTasks, allowing reports to be generated in many different ways to expose metrics and monitoring capabilities needed for any number of operational concerns. +== UI Extensions + +There are two UI extension points that are available in NiFi: + +- Custom Processor UIs +- Content Viewers + +Custom UIs can be created to provide configuration options beyond the standard property/value tables available in most processor settings. Examples of processors with Custom UIs are link:https://github.com/apache/nifi/tree/master/nifi-nar-bundles/nifi-update-attribute-bundle[UpdateAttribute] and link:https://github.com/apache/nifi/tree/master/nifi-nar-bundles/nifi-standard-bundle[JoltTransformJSON]. + +Content Viewers can be created to extend the types of data that can be viewed within NiFi. NiFi comes with NARs in the lib directory which contain content viewers for data types such as csv, xml, avro, json (standard-nar) and image types such as png, jpeg and gif (media-nar). + +=== Custom Processor UIs + +To add a Custom UI to a processor: + +1. Create your UI. +2. Build and bundle your WAR in a processor NAR. +3. The WAR needs to contain a `nifi-processor-configuration` file in the META-INF directory, which associates the Custom UI with that processor. +4. Place the NAR in the lib directory and it will be discovered when NiFi starts up. +5. In the Configure Processor window for the processor, the Properties tab should now have an `Advanced` button, which will access the Custom UI. + +As an example, here is the NAR layout for UpdateAttribute: + +.Update Attribute NAR Layout +------------------------------------------------------------------------------------------------ +nifi-update-attribute-bundle +â +âââ nifi-update-attribute-model +â +âââ nifi-update-attribute-nar +â +âââ nifi-update-attribute-processor +â +âââ nifi-update-attribute-ui +â âââ pom.xml +â âââ src +â âââ main +â âââ java +â âââ resources +â âââ webapp +â âââ css +â âââ images +â âââ js +â âââ META-INF +â â âââ nifi-processor-configuration +â âââ WEB-INF +â +âââ pom.xml +------------------------------------------------------------------------------------------------ + +with the contents of the `nifi-processor-configuration` as follows: + +`org.apache.nifi.processors.attributes.UpdateAttribute:${project.groupId}:nifi-update-attribute-nar:${project.version}` + +NOTE: Custom UIs can also be implemented for Controller Services and Reporting Tasks. + + +=== Content Viewers + +To add a Content Viewer: + +1. Build and bundle your WAR in a processor NAR. +2. The WAR needs to contain a `nifi-content-viewer` file in the META-INF directory, which lists the supported content types. +3. Place the NAR in the lib directory and it will be discovered when NiFi starts up. +4. When a matching content type is encountered, the content viewer will generate the appropriate view. + +A good example to follow is the NAR layout for the Standard Content Viewer: + +.Standard Content Viewer NAR Layout +------------------------------------------------------------------------------------------------ +nifi-standard-bundle +â +âââ nifi-jolt-transform-json-ui +â +âââ nifi-standard-content-viewer +â âââ pom.xml +â âââ src +â âââ main +â âââ java +â âââ resources +â âââ webapp +â âââ css +â âââ META-INF +â â âââ nifi-content-viewer +â âââ WEB-INF +â +âââ nifi-standard-nar +â +âââ nifi-standard-prioritizers +â +âââ nifi-standard-processors +â +âââ nifi-standard-reporting-tasks +â +âââ nifi-standard-utils +â +âââ pom.xml +------------------------------------------------------------------------------------------------ + +with the contents of `nifi-content-viewer` as follows: +------------------------------------------------------------------------------------------------ +application/xml +application/json +text/plain +text/csv +avro/binary +application/avro-binary +application/avro+binary +------------------------------------------------------------------------------------------------ + == Command Line Tools
