Repository: incubator-nifi
Updated Branches:
  refs/heads/NIFI-250 448121384 -> 40e250667


NIFI-250:
- Reloading components that reference controller services when appropriate.
- Created an icon for enabling a controller service.

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

Branch: refs/heads/NIFI-250
Commit: 40e25066742f910a2c34881eb216a18d5233cdf1
Parents: 4481213
Author: Matt Gilman <matt.c.gil...@gmail.com>
Authored: Mon Feb 9 14:56:22 2015 -0500
Committer: Matt Gilman <matt.c.gil...@gmail.com>
Committed: Mon Feb 9 14:56:22 2015 -0500

----------------------------------------------------------------------
 .../src/main/webapp/images/iconEnable.png       | Bin 0 -> 472 bytes
 .../main/webapp/js/nf/canvas/nf-canvas-utils.js |  26 +++++++++++++++++++
 .../nf-controller-service-configuration.js      |  11 +-------
 .../src/main/webapp/js/nf/canvas/nf-settings.js |  10 ++++++-
 4 files changed, 36 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/40e25066/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/images/iconEnable.png
----------------------------------------------------------------------
diff --git 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/images/iconEnable.png
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/images/iconEnable.png
new file mode 100644
index 0000000..154403f
Binary files /dev/null and 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/images/iconEnable.png
 differ

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/40e25066/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.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-canvas-utils.js
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
index 83a3117..42de660 100644
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas-utils.js
@@ -400,6 +400,32 @@ nf.CanvasUtils = (function () {
         },
         
         /**
+         * Reloads components that reference this controller service.
+         * 
+         * @param {object} controllerService
+         */
+        reloadControllerServiceReferences: function (controllerService) {
+            var reloadOther = false;
+
+            // reload all dependent processors if they are currently visible
+            $.each(controllerService.references, function(_, reference) {
+                if (reference.referenceType === 'Processor') {
+                    if (nf.Canvas.getGroupId() === reference.groupId) {
+                        var processor = nf.Processor.get(reference.id);
+                        nf.Processor.reload(processor.component);
+                    }
+                } else {
+                    reloadOther = true;
+                }
+            });
+
+            // reload the controller services and reporting tasks if necessary
+            if (reloadOther) {
+                nf.Settings.loadSettings();
+            }
+        },
+        
+        /**
          * Handles component bulletins.
          * 
          * @param {selection} selection                    The component

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/40e25066/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service-configuration.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-controller-service-configuration.js
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service-configuration.js
index 1064090..c43b017 100644
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service-configuration.js
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service-configuration.js
@@ -139,7 +139,7 @@ nf.ControllerServiceConfiguration = (function () {
         controllerServiceData.updateItem(controllerService.id, 
controllerService);
 
         // reload the controller service references
-        reloadControllerServiceReferences(controllerService);
+        nf.CanvasUtils.reloadControllerServiceReferences(controllerService);
     };
     
     /**
@@ -248,15 +248,6 @@ nf.ControllerServiceConfiguration = (function () {
         updateReferencesBorder();
     };
     
-    /**
-     * Reloads components that reference this controller service.
-     * 
-     * @param {object} controllerService
-     */
-    var reloadControllerServiceReferences = function (controllerService) {
-        
-    };
-
     return {
         /**
          * Initializes the controller service configuration dialog.

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/40e25066/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 87560dd..543e587 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
@@ -684,6 +684,9 @@ nf.Settings = (function () {
             var controllerServicesGrid = 
$('#controller-services-table').data('gridInstance');
             var controllerServicesData = controllerServicesGrid.getData();
             controllerServicesData.updateItem(controllerService.id, 
response.controllerService);
+            
+            // update references as necessary
+            
nf.CanvasUtils.reloadControllerServiceReferences(response.controllerService);
         }).fail(nf.Common.handleAjaxError);
     };
     
@@ -787,7 +790,7 @@ nf.Settings = (function () {
                 if (dataContext.enabled === true) {
                     markup += '<img src="images/iconDisable.png" 
title="Disable" class="pointer disable-controller-service" style="margin-top: 
2px;" />&nbsp;';
                 } else {
-                    markup += '<img src="images/iconEdit.png" title="Edit" 
class="pointer edit-controller-service" style="margin-top: 2px;" />&nbsp;<img 
src="images/iconRun.png" title="Enable" class="pointer 
enable-controller-service" style="margin-top: 2px;"/>&nbsp;<img 
src="images/iconDelete.png" title="Remove" class="pointer 
delete-controller-service" style="margin-top: 2px;" />&nbsp;';
+                    markup += '<img src="images/iconEdit.png" title="Edit" 
class="pointer edit-controller-service" style="margin-top: 2px;" />&nbsp;<img 
src="images/iconEnable.png" title="Enable" class="pointer 
enable-controller-service" style="margin-top: 2px;"/>&nbsp;<img 
src="images/iconDelete.png" title="Remove" class="pointer 
delete-controller-service" style="margin-top: 2px;" />&nbsp;';
                 }
 
                 return markup;
@@ -837,6 +840,8 @@ nf.Settings = (function () {
                         showDisableControllerServiceDialog(controllerService);
                     }
                 } else if (target.hasClass('delete-controller-service')) {
+                    // prompt for removal?
+                    
                     var revision = nf.Client.getRevision();
                     return $.ajax({
                         type: 'DELETE',
@@ -851,6 +856,9 @@ nf.Settings = (function () {
                         
                         // remove the service
                         
controllerServicesData.deleteItem(controllerService.id);
+                        
+                        // reload the as necessary
+                        
nf.CanvasUtils.reloadControllerServiceReferences(controllerService);
                     }).fail(nf.Common.handleAjaxError);
                 }
             } else if (controllerServicesGrid.getColumns()[args.cell].id === 
'moreDetails') {

Reply via email to