update sample docs for JSON metadata
Custom Processor Templates
Kylo allows you to code your own custom angular template for a NiFi Processor
-The Java ``ProcessorTemplate`` interface
-1. Create a new Java Class that implements the ProcessorTemplate interface
+1. Create a JSON file with the suffix "processor-template-definition.json". Usually its good to prefix this file with the name of the processor (i.e. "get-file-processor-template-definition.json")
- - The getProcessorTypes() needs to return an Array of the fully qualified NiFi Processor class name(s)
- - The getStepperUrl() needs to return the html file to be used when creating the Feed. Return null to have the system use its default rendering
- - The getFeedDetailsTemplateUrl() needs to return the html file to be used when editing a feed. Return null to have the system use its default rendering
-
-```java
-
-@Component
-public class GetFileTemplate implements ProcessorTemplate {
-
- @Override
- public List getProcessorTypes() {
- return Lists.newArrayList("org.apache.nifi.processors.standard.GetFile");
- }
-
- @Nullable
- @Override
- public String getStepperTemplateUrl() {
- return "js/plugin/processor-templates/GetFile/get-file-processor.html";
+```json
+{
+ "processorTypes":[ Array of the fully qualified NiFi Processor class name(s)],
+ "stepperTemplateUrl":"the html file to be used when creating the Feed. Return null to have the system use its default rendering",
+ "feedDetailsTemplateUrl":"the html file to be used when editing a feed. Return null to have the system use its default rendering"
}
+```
- @Nullable
- @Override
- public String getFeedDetailsTemplateUrl() {
- return "js/plugin/processor-templates/GetFile/get-file-processor.html";
- }
-}
+An example JSON file is here:
+```json
+{
+ "processorTypes":["org.apache.nifi.processors.standard.GetFile"],
+ "stepperTemplateUrl":"js/plugin/processor-templates/GetFile/get-file-processor.html",
+ "feedDetailsTemplateUrl":"js/plugin/processor-templates/GetFile/get-file-processor.html"
+}
```
+
2. The angular code
- Each template is provided 2 objects in its scope
- processor: the current processor with its properties (see example JSON below)
