From d094130a2694c1e0d3aa0538a01ed733f943d2e7 Mon Sep 17 00:00:00 2001 From: Joe Skora Date: Sun, 7 Aug 2016 22:13:13 -0400 Subject: [PATCH] NIFI-2237: Extend template handling to read only properties. * Add read only property handling to type.hbs template. * Add flag to ProcessorDTO.getRelationships to reflect read only nature of the property. * Remove explicit "read only" message from ConnectionDTO.getAvailableRelationships to avoid duplicate text. * This closes #806 --- .../main/java/org/apache/nifi/web/api/dto/ConnectionDTO.java | 2 +- .../main/java/org/apache/nifi/web/api/dto/ProcessorDTO.java | 3 ++- .../nifi-web-api/src/main/resources/templates/type.hbs | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ConnectionDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ConnectionDTO.java index f2388c0afe..79e3cdf84f 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ConnectionDTO.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ConnectionDTO.java @@ -149,7 +149,7 @@ public class ConnectionDTO extends ComponentDTO { * @return relationships that the source of the connection currently supports. This property is read only */ @ApiModelProperty( - value = "The relationships that the source of the connection currently supports. This property is read only.", + value = "The relationships that the source of the connection currently supports.", readOnly = true ) public Set getAvailableRelationships() { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorDTO.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorDTO.java index dbd06a3ede..6a2b22c018 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorDTO.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorDTO.java @@ -185,7 +185,8 @@ public class ProcessorDTO extends ComponentDTO { * @return The available relationships */ @ApiModelProperty( - value = "The available relationships that the processor currently supports." + value = "The available relationships that the processor currently supports.", + readOnly = true ) public List getRelationships() { return relationships; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/type.hbs b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/type.hbs index d64610d21e..f6f117b586 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/type.hbs +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/type.hbs @@ -43,7 +43,9 @@ {{/ifeq}} {{#required}}required{{/required}}{{^required}}optional{{/required}} - {{#description}}{{{description}}}{{/description}}{{#if enum}} Allowable values: {{join enum ", "}}{{/if}} + {{#description}}{{{description}}}{{/description}} + {{#if enum}} Allowable values: {{join enum ", "}}{{/if}} + {{#if readOnly}} This property is read only.{{/if}} {{/each}}