NIFI-295: - Considering the default value when a property is unset. Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/600a47be Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/600a47be Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/600a47be
Branch: refs/heads/NIFI-250 Commit: 600a47be166e942b64bcc7c624af5db7b5c17cc2 Parents: 94b3903 Author: Matt Gilman <[email protected]> Authored: Mon Feb 2 13:40:07 2015 -0500 Committer: Matt Gilman <[email protected]> Committed: Mon Feb 2 13:40:07 2015 -0500 ---------------------------------------------------------------------- .../apache/nifi/web/controller/ControllerFacade.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/600a47be/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java index b2a1ae4..b009581 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java @@ -1190,17 +1190,24 @@ public class ControllerFacade implements ControllerServiceProvider { for (final Map.Entry<PropertyDescriptor, String> entry : procNode.getProperties().entrySet()) { final PropertyDescriptor descriptor = entry.getKey(); - addIfAppropriate(searchStr, descriptor.getName(), "Property", matches); - addIfAppropriate(searchStr, descriptor.getDescription(), "Property", matches); + addIfAppropriate(searchStr, descriptor.getName(), "Property name", matches); + addIfAppropriate(searchStr, descriptor.getDescription(), "Property description", matches); // never include sensitive properties values in search results if (descriptor.isSensitive()) { continue; } - final String value = entry.getValue(); + String value = entry.getValue(); + + // if unset consider default value + if (value == null) { + value = descriptor.getDefaultValue(); + } + + // evaluate if the value matches the search criteria if (StringUtils.containsIgnoreCase(value, searchStr)) { - matches.add("Property: " + descriptor.getName() + " - " + value); + matches.add("Property value: " + descriptor.getName() + " - " + value); } }
