You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mc...@apache.org on 2015/03/26 20:12:34 UTC
incubator-nifi git commit: NIFI-250: - Fixing issues when clicking
Add before selecting the type of controller service and reporting task to
create.
Repository: incubator-nifi
Updated Branches:
refs/heads/NIFI-250 5b56982d2 -> b51af3cb7
NIFI-250:
- Fixing issues when clicking Add before selecting the type of controller service and reporting task to create.
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/b51af3cb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/b51af3cb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/b51af3cb
Branch: refs/heads/NIFI-250
Commit: b51af3cb7a60fb11ddc2dedd328e35a92d39f0e3
Parents: 5b56982
Author: Matt Gilman <ma...@gmail.com>
Authored: Thu Mar 26 15:12:09 2015 -0400
Committer: Matt Gilman <ma...@gmail.com>
Committed: Thu Mar 26 15:12:09 2015 -0400
----------------------------------------------------------------------
.../nifi/web/api/ControllerServiceResource.java | 10 ++++++---
.../apache/nifi/web/api/ProcessorResource.java | 4 ++++
.../nifi/web/api/ReportingTaskResource.java | 10 ++++++---
.../src/main/webapp/js/nf/canvas/nf-settings.js | 22 ++++++++++++++++++--
4 files changed, 38 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b51af3cb/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.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/api/ControllerServiceResource.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java
index 85b2ea1..1711f3c 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ControllerServiceResource.java
@@ -258,13 +258,17 @@ public class ControllerServiceResource extends ApplicationResource {
throw new IllegalArgumentException("Revision must be specified.");
}
- // get the revision
- final RevisionDTO revision = controllerServiceEntity.getRevision();
-
if (controllerServiceEntity.getControllerService().getId() != null) {
throw new IllegalArgumentException("Controller service ID cannot be specified.");
}
+ if (StringUtils.isBlank(controllerServiceEntity.getControllerService().getType())) {
+ throw new IllegalArgumentException("The type of controller service to create must be specified.");
+ }
+
+ // get the revision
+ final RevisionDTO revision = controllerServiceEntity.getRevision();
+
// if cluster manager, convert POST to PUT (to maintain same ID across nodes) and replicate
if (properties.isClusterManager() && Availability.NODE.equals(avail)) {
// create ID for resource
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b51af3cb/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.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/api/ProcessorResource.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java
index eede48b..31ab10b 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessorResource.java
@@ -262,6 +262,10 @@ public class ProcessorResource extends ApplicationResource {
if (processorEntity.getProcessor().getId() != null) {
throw new IllegalArgumentException("Processor ID cannot be specified.");
}
+
+ if (StringUtils.isBlank(processorEntity.getProcessor().getType())) {
+ throw new IllegalArgumentException("The type of processor to create must be specified.");
+ }
// if cluster manager, convert POST to PUT (to maintain same ID across nodes) and replicate
if (properties.isClusterManager()) {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b51af3cb/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.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/api/ReportingTaskResource.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java
index 5f5ce42..38ddc36 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ReportingTaskResource.java
@@ -254,12 +254,16 @@ public class ReportingTaskResource extends ApplicationResource {
throw new IllegalArgumentException("Revision must be specified.");
}
- // get the revision
- final RevisionDTO revision = reportingTaskEntity.getRevision();
-
if (reportingTaskEntity.getReportingTask().getId() != null) {
throw new IllegalArgumentException("Reporting task ID cannot be specified.");
}
+
+ if (StringUtils.isBlank(reportingTaskEntity.getReportingTask().getType())) {
+ throw new IllegalArgumentException("The type of reporting task to create must be specified.");
+ }
+
+ // get the revision
+ final RevisionDTO revision = reportingTaskEntity.getRevision();
// if cluster manager, convert POST to PUT (to maintain same ID across nodes) and replicate
if (properties.isClusterManager() && Availability.NODE.equals(avail)) {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/b51af3cb/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js
index ab1e65d..9e04cc4 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js
@@ -652,7 +652,16 @@ nf.Settings = (function () {
handler: {
click: function () {
var selectedServiceType = $('#selected-controller-service-type').text();
- addControllerService(selectedServiceType);
+
+ // ensure something was selected
+ if (selectedServiceType === '') {
+ nf.Dialog.showOkDialog({
+ dialogContent: 'The type of controller service to create must be selected.',
+ overlayBackground: false
+ });
+ } else {
+ addControllerService(selectedServiceType);
+ }
}
}
}, {
@@ -1297,7 +1306,16 @@ nf.Settings = (function () {
handler: {
click: function () {
var selectedTaskType = $('#selected-reporting-task-type').text();
- addReportingTask(selectedTaskType);
+
+ // ensure something was selected
+ if (selectedTaskType === '') {
+ nf.Dialog.showOkDialog({
+ dialogContent: 'The type of reporting task to create must be selected.',
+ overlayBackground: false
+ });
+ } else {
+ addReportingTask(selectedTaskType);
+ }
}
}
}, {