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/12/18 21:59:11 UTC

nifi git commit: NIFI-1309: - Addressing issues around remote process groups automatically issuing new account requests. - Ensuring authorization issues are updated with status refresh.

Repository: nifi
Updated Branches:
  refs/heads/master 4249fc943 -> 608287f9f


NIFI-1309:
- Addressing issues around remote process groups automatically issuing new account requests.
- Ensuring authorization issues are updated with status refresh.


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/608287f9
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/608287f9
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/608287f9

Branch: refs/heads/master
Commit: 608287f9fe925acc1257866a34cc40dfd228cbd3
Parents: 4249fc9
Author: Matt Gilman <ma...@gmail.com>
Authored: Fri Dec 18 15:57:38 2015 -0500
Committer: Matt Gilman <ma...@gmail.com>
Committed: Fri Dec 18 15:57:38 2015 -0500

----------------------------------------------------------------------
 .../org/apache/nifi/remote/RemoteNiFiUtils.java |  4 +-
 .../util/RemoteProcessGroupUtils.java           |  4 +-
 .../org/apache/nifi/web/api/UserResource.java   |  9 +-
 .../js/nf/canvas/nf-remote-process-group.js     | 86 ++++++++++----------
 4 files changed, 56 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/608287f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/RemoteNiFiUtils.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/RemoteNiFiUtils.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/RemoteNiFiUtils.java
index e80d383..7498653 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/RemoteNiFiUtils.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/RemoteNiFiUtils.java
@@ -188,7 +188,7 @@ public class RemoteNiFiUtils {
      * @return response
      */
     public ClientResponse issueRegistrationRequest(String baseApiUri) {
-        final URI uri = URI.create(String.format("%s/%s", baseApiUri, "/controller/users"));
+        final URI uri = URI.create(String.format("%s/controller/users", baseApiUri));
 
         // set up the query params
         MultivaluedMapImpl entity = new MultivaluedMapImpl();
@@ -198,6 +198,6 @@ public class RemoteNiFiUtils {
         WebResource webResource = client.resource(uri);
 
         // get the client utils and make the request
-        return webResource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_FORM_URLENCODED).entity(entity).post(ClientResponse.class);
+        return webResource.type(MediaType.APPLICATION_FORM_URLENCODED).entity(entity).post(ClientResponse.class);
     }
 }

http://git-wip-us.apache.org/repos/asf/nifi/blob/608287f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/controller/util/RemoteProcessGroupUtils.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/controller/util/RemoteProcessGroupUtils.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/controller/util/RemoteProcessGroupUtils.java
index 8f1f7f6..6b98d0d 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/controller/util/RemoteProcessGroupUtils.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/controller/util/RemoteProcessGroupUtils.java
@@ -203,7 +203,7 @@ public class RemoteProcessGroupUtils {
      * @return the response of the request
      */
     public ClientResponse issueRegistrationRequest(String baseApiUri) {
-        final URI uri = URI.create(String.format("%s/%s", baseApiUri, "/controller/users"));
+        final URI uri = URI.create(String.format("%s/controller/users", baseApiUri));
 
         // set up the query params
         MultivaluedMapImpl entity = new MultivaluedMapImpl();
@@ -213,6 +213,6 @@ public class RemoteProcessGroupUtils {
         WebResource webResource = client.resource(uri);
 
         // get the client utils and make the request
-        return webResource.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_FORM_URLENCODED).entity(entity).post(ClientResponse.class);
+        return webResource.type(MediaType.APPLICATION_FORM_URLENCODED).entity(entity).post(ClientResponse.class);
     }
 }

http://git-wip-us.apache.org/repos/asf/nifi/blob/608287f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/UserResource.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/UserResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/UserResource.java
index 4b9d2ae..1426999 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/UserResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/UserResource.java
@@ -88,8 +88,13 @@ public class UserResource extends ApplicationResource {
     private NiFiProperties properties;
     private NiFiServiceFacade serviceFacade;
 
+    /**
+     * Creates a new user account request.
+     *
+     * @return A string
+     */
     @POST
-    @Consumes(MediaType.WILDCARD)
+    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
     @Produces(MediaType.TEXT_PLAIN)
     @Path("") // necessary due to a bug in swagger
     @ApiOperation(
@@ -109,7 +114,7 @@ public class UserResource extends ApplicationResource {
         // create an account request for the current user
         final UserDTO user = serviceFacade.createUser();
 
-        final String uri = generateResourceUri("controller", "templates", user.getId());
+        final String uri = generateResourceUri("controller", "users", user.getId());
         return generateCreatedResponse(URI.create(uri), "Not authorized. User account created. Authorization pending.").build();
     }
 

http://git-wip-us.apache.org/repos/asf/nifi/blob/608287f9/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js
index 8bbd772..3084843 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-remote-process-group.js
@@ -546,47 +546,6 @@ nf.RemoteProcessGroup = (function () {
                 }
 
                 // update the process groups transmission status
-                details.select('image.remote-process-group-transmission-status')
-                        .attr('xlink:href', function (d) {
-                            var img = '';
-                            if (nf.Common.isDefinedAndNotNull(d.status) && !nf.Common.isEmpty(d.status.authorizationIssues)) {
-                                img = 'images/iconAlert.png';
-                            } else if (d.component.transmitting === true) {
-                                img = 'images/iconTransmissionActive.png';
-                            } else {
-                                img = 'images/iconTransmissionInactive.png';
-                            }
-                            return img;
-                        })
-                        .each(function (d) {
-                            // remove the existing tip if necessary
-                            var tip = d3.select('#authorization-issues-' + d.component.id);
-                            if (!tip.empty()) {
-                                tip.remove();
-                            }
-
-                            // if there are validation errors generate a tooltip
-                            if (nf.Common.isDefinedAndNotNull(d.status) && !nf.Common.isEmpty(d.status.authorizationIssues)) {
-                                tip = d3.select('#remote-process-group-tooltips').append('div')
-                                        .attr('id', function () {
-                                            return 'authorization-issues-' + d.component.id;
-                                        })
-                                        .attr('class', 'tooltip nifi-tooltip')
-                                        .html(function () {
-                                            var list = nf.Common.formatUnorderedList(d.status.authorizationIssues);
-                                            if (list === null || list.length === 0) {
-                                                return '';
-                                            } else {
-                                                return $('<div></div>').append(list).html();
-                                            }
-                                        });
-
-                                // add the tooltip
-                                nf.CanvasUtils.canvasTooltip(tip, d3.select(this));
-                            }
-                        });
-
-                // update the process groups transmission status
                 details.select('image.remote-process-group-transmission-secure')
                         .attr('xlink:href', function (d) {
                             var img = '';
@@ -821,6 +780,51 @@ nf.RemoteProcessGroup = (function () {
                     }
                 });
 
+        // --------------------
+        // authorization issues
+        // --------------------
+
+        // update the process groups transmission status
+        updated.select('image.remote-process-group-transmission-status')
+            .attr('xlink:href', function (d) {
+                var img = '';
+                if (nf.Common.isDefinedAndNotNull(d.status) && !nf.Common.isEmpty(d.status.authorizationIssues)) {
+                    img = 'images/iconAlert.png';
+                } else if (d.component.transmitting === true) {
+                    img = 'images/iconTransmissionActive.png';
+                } else {
+                    img = 'images/iconTransmissionInactive.png';
+                }
+                return img;
+            })
+            .each(function (d) {
+                // remove the existing tip if necessary
+                var tip = d3.select('#authorization-issues-' + d.component.id);
+                if (!tip.empty()) {
+                    tip.remove();
+                }
+
+                // if there are validation errors generate a tooltip
+                if (nf.Common.isDefinedAndNotNull(d.status) && !nf.Common.isEmpty(d.status.authorizationIssues)) {
+                    tip = d3.select('#remote-process-group-tooltips').append('div')
+                        .attr('id', function () {
+                            return 'authorization-issues-' + d.component.id;
+                        })
+                        .attr('class', 'tooltip nifi-tooltip')
+                        .html(function () {
+                            var list = nf.Common.formatUnorderedList(d.status.authorizationIssues);
+                            if (list === null || list.length === 0) {
+                                return '';
+                            } else {
+                                return $('<div></div>').append(list).html();
+                            }
+                        });
+
+                    // add the tooltip
+                    nf.CanvasUtils.canvasTooltip(tip, d3.select(this));
+                }
+            });
+
         updated.each(function (d) {
             var remoteProcessGroup = d3.select(this);
             var offset = 0;