http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-global-menu-controller.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-global-menu-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-global-menu-controller.js index b28d5b1..28d818e 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-global-menu-controller.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-global-menu-controller.js @@ -28,8 +28,8 @@ 'nf.ErrorHandler', 'nf.Settings', 'nf.CanvasUtils'], - function ($, common, queueListing, shell, policyManagement, clusterSummary, errorHandler, settings, canvasUtils) { - return (nf.ng.Canvas.GlobalMenuCtrl = factory($, common, queueListing, shell, policyManagement, clusterSummary, errorHandler, settings, canvasUtils)); + function ($, nfCommon, nfQueueListing, nfShell, nfPolicyManagement, nfClusterSummary, nfErrorHandler, nfSettings, nfCanvasUtils) { + return (nf.ng.Canvas.GlobalMenuCtrl = factory($, nfCommon, nfQueueListing, nfShell, nfPolicyManagement, nfClusterSummary, nfErrorHandler, nfSettings, nfCanvasUtils)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.Canvas.GlobalMenuCtrl = @@ -53,7 +53,7 @@ root.nf.Settings, root.nf.CanvasUtils); } -}(this, function ($, common, queueListing, shell, policyManagement, clusterSummary, errorHandler, settings, canvasUtils) { +}(this, function ($, nfCommon, nfQueueListing, nfShell, nfPolicyManagement, nfClusterSummary, nfErrorHandler, nfSettings, nfCanvasUtils) { 'use strict'; return function (serviceProvider) { @@ -82,7 +82,7 @@ * Launch the summary shell. */ launch: function () { - shell.showPage('summary'); + nfShell.showPage('summary'); } } }; @@ -101,8 +101,8 @@ * Launch the counters shell. */ launch: function () { - if (common.canAccessCounters()) { - shell.showPage('counters'); + if (nfCommon.canAccessCounters()) { + nfShell.showPage('counters'); } } } @@ -122,7 +122,7 @@ * Launch the bulletin board shell. */ launch: function () { - shell.showPage('bulletin-board'); + nfShell.showPage('bulletin-board'); } } }; @@ -141,8 +141,8 @@ * Launch the data provenance shell. */ launch: function () { - if (common.canAccessProvenance()) { - shell.showPage('provenance'); + if (nfCommon.canAccessProvenance()) { + nfShell.showPage('provenance'); } } } @@ -162,7 +162,7 @@ * Launch the settings shell. */ launch: function () { - settings.showSettings(); + nfSettings.showSettings(); } } }; @@ -178,7 +178,7 @@ * @returns {*|boolean} */ visible: function () { - return clusterSummary.isConnectedToCluster(); + return nfClusterSummary.isConnectedToCluster(); }, /** @@ -190,8 +190,8 @@ * Launch the cluster shell. */ launch: function () { - if (common.canAccessController()) { - shell.showPage('cluster'); + if (nfCommon.canAccessController()) { + nfShell.showPage('cluster'); } } } @@ -211,7 +211,7 @@ * Launch the history shell. */ launch: function () { - shell.showPage('history'); + nfShell.showPage('history'); } } }; @@ -230,8 +230,8 @@ * Launch the users shell. */ launch: function () { - if (common.canAccessTenants()) { - shell.showPage('users'); + if (nfCommon.canAccessTenants()) { + nfShell.showPage('users'); } } } @@ -251,8 +251,8 @@ * Launch the policies shell. */ launch: function () { - if (common.canModifyPolicies() && common.canAccessTenants()) { - policyManagement.showGlobalPolicies(); + if (nfCommon.canModifyPolicies() && nfCommon.canAccessTenants()) { + nfPolicyManagement.showGlobalPolicies(); } } } @@ -272,8 +272,8 @@ * Launch the templates shell. */ launch: function () { - shell.showPage('templates?' + $.param({ - groupId: canvasUtils.getGroupId() + nfShell.showPage('templates?' + $.param({ + groupId: nfCanvasUtils.getGroupId() })); } } @@ -293,7 +293,7 @@ * Launch the help documentation shell. */ launch: function () { - shell.showPage(config.urls.helpDocument); + nfShell.showPage(config.urls.helpDocument); } } }; @@ -339,11 +339,11 @@ } // store the content viewer url if available - if (!common.isBlank(aboutDetails.contentViewerUrl)) { + if (!nfCommon.isBlank(aboutDetails.contentViewerUrl)) { $('#nifi-content-viewer-url').text(aboutDetails.contentViewerUrl); - queueListing.initFlowFileDetailsDialog(); + nfQueueListing.initFlowFileDetailsDialog(); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); this.modal.init(); },
http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-graph-controls-controller.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-graph-controls-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-graph-controls-controller.js index 3274a48..2835972 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-graph-controls-controller.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-graph-controls-controller.js @@ -24,10 +24,9 @@ 'nf.Birdseye', 'nf.Storage', 'nf.CanvasUtils', - 'nf.Common', 'nf.ProcessGroupConfiguration'], - function ($, action, birdseye, storage, canvasUtils, common, processGroupConfiguration) { - return (nf.ng.Canvas.GraphControlsCtrl = factory($, action, birdseye, storage, canvasUtils, common, processGroupConfiguration)); + function ($, nfActions, nfBirdseye, nfStorage, nfCanvasUtils, nfProcessGroupConfiguration) { + return (nf.ng.Canvas.GraphControlsCtrl = factory($, nfActions, nfBirdseye, nfStorage, nfCanvasUtils, nfProcessGroupConfiguration)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.Canvas.GraphControlsCtrl = @@ -36,7 +35,6 @@ require('nf.Birdseye'), require('nf.Storage'), require('nf.CanvasUtils'), - require('nf.Common'), require('nf.ProcessGroupConfiguration'))); } else { nf.ng.Canvas.GraphControlsCtrl = factory(root.$, @@ -44,10 +42,9 @@ root.nf.Birdseye, root.nf.Storage, root.nf.CanvasUtils, - root.nf.Common, root.nf.ProcessGroupConfiguration); } -}(this, function ($, actions, birdseye, storage, canvasUtils, common, processGroupConfiguration) { +}(this, function ($, nfActions, nfBirdseye, nfStorage, nfCanvasUtils, nfProcessGroupConfiguration) { 'use strict'; return function (serviceProvider, navigateCtrl, operateCtrl) { @@ -72,11 +69,11 @@ // handle specific actions as necessary if (graphControl.attr('id') === 'navigation-control') { - birdseye.updateBirdseyeVisibility(true); + nfBirdseye.updateBirdseyeVisibility(true); } // get the current visibility - var graphControlVisibility = storage.getItem('graph-control-visibility'); + var graphControlVisibility = nfStorage.getItem('graph-control-visibility'); if (graphControlVisibility === null) { graphControlVisibility = {}; } @@ -84,7 +81,7 @@ // update the visibility for this graph control var graphControlId = graphControl.attr('id'); graphControlVisibility[graphControlId] = true; - storage.setItem('graph-control-visibility', graphControlVisibility); + nfStorage.setItem('graph-control-visibility', graphControlVisibility); }; /** @@ -106,11 +103,11 @@ // handle specific actions as necessary if (graphControl.attr('id') === 'navigation-control') { - birdseye.updateBirdseyeVisibility(false); + nfBirdseye.updateBirdseyeVisibility(false); } // get the current visibility - var graphControlVisibility = storage.getItem('graph-control-visibility'); + var graphControlVisibility = nfStorage.getItem('graph-control-visibility'); if (graphControlVisibility === null) { graphControlVisibility = {}; } @@ -118,7 +115,7 @@ // update the visibility for this graph control var graphControlId = graphControl.attr('id'); graphControlVisibility[graphControlId] = false; - storage.setItem('graph-control-visibility', graphControlVisibility); + nfStorage.setItem('graph-control-visibility', graphControlVisibility); }; function GraphControlsCtrl(navigateCtrl, operateCtrl) { @@ -144,7 +141,7 @@ init: function () { this.operateCtrl.init(); // initial the graph control visibility - var graphControlVisibility = storage.getItem('graph-control-visibility'); + var graphControlVisibility = nfStorage.getItem('graph-control-visibility'); if (graphControlVisibility !== null) { $.each(graphControlVisibility, function (id, isVisible) { var graphControl = $('#' + id); @@ -187,31 +184,31 @@ * Gets the icon to show for the selection context. */ getContextIcon: function () { - var selection = canvasUtils.getSelection(); + var selection = nfCanvasUtils.getSelection(); if (selection.empty()) { - if (canvasUtils.getParentGroupId() === null) { + if (nfCanvasUtils.getParentGroupId() === null) { return 'icon-drop'; } else { return 'icon-group'; } } else { if (selection.size() === 1) { - if (canvasUtils.isProcessor(selection)) { + if (nfCanvasUtils.isProcessor(selection)) { return 'icon-processor'; - } else if (canvasUtils.isProcessGroup(selection)) { + } else if (nfCanvasUtils.isProcessGroup(selection)) { return 'icon-group'; - } else if (canvasUtils.isInputPort(selection)) { + } else if (nfCanvasUtils.isInputPort(selection)) { return 'icon-port-in'; - } else if (canvasUtils.isOutputPort(selection)) { + } else if (nfCanvasUtils.isOutputPort(selection)) { return 'icon-port-out'; - } else if (canvasUtils.isRemoteProcessGroup(selection)) { + } else if (nfCanvasUtils.isRemoteProcessGroup(selection)) { return 'icon-group-remote'; - } else if (canvasUtils.isFunnel(selection)) { + } else if (nfCanvasUtils.isFunnel(selection)) { return 'icon-funnel'; - } else if (canvasUtils.isLabel(selection)) { + } else if (nfCanvasUtils.isLabel(selection)) { return 'icon-label'; - } else if (canvasUtils.isConnection(selection)) { + } else if (nfCanvasUtils.isConnection(selection)) { return 'icon-connect'; } } else { @@ -224,7 +221,7 @@ * Will hide target when appropriate. */ hide: function () { - var selection = canvasUtils.getSelection(); + var selection = nfCanvasUtils.getSelection(); if (selection.size() > 1) { return 'invisible' } else { @@ -236,27 +233,27 @@ * Gets the name to show for the selection context. */ getContextName: function () { - var selection = canvasUtils.getSelection(); - var canRead = canvasUtils.canReadFromGroup(); + var selection = nfCanvasUtils.getSelection(); + var canRead = nfCanvasUtils.canReadFromGroup(); if (selection.empty()) { if (canRead) { - return canvasUtils.getGroupName(); + return nfCanvasUtils.getGroupName(); } else { - return canvasUtils.getGroupId(); + return nfCanvasUtils.getGroupId(); } } else { if (selection.size() === 1) { var d = selection.datum(); if (d.permissions.canRead) { - if (canvasUtils.isLabel(selection)) { + if (nfCanvasUtils.isLabel(selection)) { if ($.trim(d.component.label) !== '') { return d.component.label; } else { return ''; } - } else if (canvasUtils.isConnection(selection)) { - return canvasUtils.formatConnectionName(d.component); + } else if (nfCanvasUtils.isConnection(selection)) { + return nfCanvasUtils.formatConnectionName(d.component); } else { return d.component.name; } @@ -273,27 +270,27 @@ * Gets the type to show for the selection context. */ getContextType: function () { - var selection = canvasUtils.getSelection(); + var selection = nfCanvasUtils.getSelection(); if (selection.empty()) { return 'Process Group'; } else { if (selection.size() === 1) { - if (canvasUtils.isProcessor(selection)) { + if (nfCanvasUtils.isProcessor(selection)) { return 'Processor'; - } else if (canvasUtils.isProcessGroup(selection)) { + } else if (nfCanvasUtils.isProcessGroup(selection)) { return 'Process Group'; - } else if (canvasUtils.isInputPort(selection)) { + } else if (nfCanvasUtils.isInputPort(selection)) { return 'Input Port'; - } else if (canvasUtils.isOutputPort(selection)) { + } else if (nfCanvasUtils.isOutputPort(selection)) { return 'Output Port'; - } else if (canvasUtils.isRemoteProcessGroup(selection)) { + } else if (nfCanvasUtils.isRemoteProcessGroup(selection)) { return 'Remote Process Group'; - } else if (canvasUtils.isFunnel(selection)) { + } else if (nfCanvasUtils.isFunnel(selection)) { return 'Funnel'; - } else if (canvasUtils.isLabel(selection)) { + } else if (nfCanvasUtils.isLabel(selection)) { return 'Label'; - } else if (canvasUtils.isConnection(selection)) { + } else if (nfCanvasUtils.isConnection(selection)) { return 'Connection'; } } else { @@ -306,10 +303,10 @@ * Gets the id to show for the selection context. */ getContextId: function () { - var selection = canvasUtils.getSelection(); + var selection = nfCanvasUtils.getSelection(); if (selection.empty()) { - return canvasUtils.getGroupId(); + return nfCanvasUtils.getGroupId(); } else { if (selection.size() === 1) { var d = selection.datum(); @@ -324,29 +321,29 @@ * Determines whether the user can configure or open the details dialog. */ canConfigureOrOpenDetails: function () { - var selection = canvasUtils.getSelection(); + var selection = nfCanvasUtils.getSelection(); if (selection.empty()) { return true; } - return canvasUtils.isConfigurable(selection) || canvasUtils.hasDetails(selection); + return nfCanvasUtils.isConfigurable(selection) || nfCanvasUtils.hasDetails(selection); }, /** * Opens either the configuration or details view based on the current state. */ openConfigureOrDetailsView: function () { - var selection = canvasUtils.getSelection(); + var selection = nfCanvasUtils.getSelection(); if (selection.empty()) { - processGroupConfiguration.showConfiguration(canvasUtils.getGroupId()); + nfProcessGroupConfiguration.showConfiguration(nfCanvasUtils.getGroupId()); } - if (canvasUtils.isConfigurable(selection)) { - actions.showConfiguration(selection); - } else if (canvasUtils.hasDetails(selection)) { - actions.showDetails(selection); + if (nfCanvasUtils.isConfigurable(selection)) { + nfActions.showConfiguration(selection); + } else if (nfCanvasUtils.hasDetails(selection)) { + nfActions.showDetails(selection); } } } http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-header-controller.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-header-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-header-controller.js index 2ad8895..6e4a30b 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-header-controller.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-header-controller.js @@ -24,8 +24,8 @@ 'nf.Storage', 'nf.Shell', 'nf.ErrorHandler'], - function ($, common, storage, shell, errorHandler) { - return (nf.ng.Canvas.HeaderCtrl = factory($, common, storage, shell, errorHandler)); + function ($, nfCommon, nfStorage, nfShell, nfErrorHandler) { + return (nf.ng.Canvas.HeaderCtrl = factory($, nfCommon, nfStorage, nfShell, nfErrorHandler)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.Canvas.HeaderCtrl = @@ -41,7 +41,7 @@ root.nf.Shell, root.nf.ErrorHandler); } -}(this, function ($, common, storage, shell, errorHandler) { +}(this, function ($, nfCommon, nfStorage, nfShell, nfErrorHandler) { 'use strict'; return function (serviceProvider, toolboxCtrl, globalMenuCtrl, flowStatusCtrl) { @@ -72,7 +72,7 @@ var loginCtrl = this; // if the user is not anonymous or accessing via http - if ($('#current-user').text() !== common.ANONYMOUS_USER_TEXT || location.protocol === 'http:') { + if ($('#current-user').text() !== nfCommon.ANONYMOUS_USER_TEXT || location.protocol === 'http:') { $('#login-link-container').css('display', 'none'); } @@ -90,7 +90,7 @@ $.when(loginXhr).done(function (loginResult) { loginCtrl.supportsLogin = loginResult.config.supportsLogin; - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); }, /** @@ -107,7 +107,7 @@ * Launch the login shell. */ launch: function () { - shell.showPage('login', false); + nfShell.showPage('login', false); } } }; @@ -117,7 +117,7 @@ */ this.logoutCtrl = { logout: function () { - storage.removeItem("jwt"); + nfStorage.removeItem("jwt"); window.location = '/nifi'; } }; http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-navigate-controller.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-navigate-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-navigate-controller.js index ca0b226..46dc70f 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-navigate-controller.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-navigate-controller.js @@ -21,8 +21,8 @@ if (typeof define === 'function' && define.amd) { define(['nf.CanvasUtils', 'nf.ContextMenu'], - function (canvasUtils, contextMenu) { - return (nf.ng.Canvas.NavigateCtrl = factory(canvasUtils, contextMenu)); + function (nfCanvasUtils, nfContextMenu) { + return (nf.ng.Canvas.NavigateCtrl = factory(nfCanvasUtils, nfContextMenu)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.Canvas.NavigateCtrl = @@ -32,7 +32,7 @@ nf.ng.Canvas.NavigateCtrl = factory(root.nf.CanvasUtils, root.nf.ContextMenu); } -}(this, function (canvasUtils, contextMenu) { +}(this, function (nfCanvasUtils, nfContextMenu) { 'use strict'; return function () { @@ -44,13 +44,13 @@ * Zoom in on the canvas. */ this.zoomIn = function () { - canvasUtils.zoomCanvasViewIn(); + nfCanvasUtils.zoomCanvasViewIn(); // hide the context menu - contextMenu.hide(); + nfContextMenu.hide(); // refresh the canvas - canvasUtils.refreshCanvasView({ + nfCanvasUtils.refreshCanvasView({ transition: true }); }; @@ -59,13 +59,13 @@ * Zoom out on the canvas. */ this.zoomOut = function () { - canvasUtils.zoomCanvasViewOut(); + nfCanvasUtils.zoomCanvasViewOut(); // hide the context menu - contextMenu.hide(); + nfContextMenu.hide(); // refresh the canvas - canvasUtils.refreshCanvasView({ + nfCanvasUtils.refreshCanvasView({ transition: true }); }; @@ -74,13 +74,13 @@ * Zoom fit on the canvas. */ this.zoomFit = function () { - canvasUtils.fitCanvasView(); + nfCanvasUtils.fitCanvasView(); // hide the context menu - contextMenu.hide(); + nfContextMenu.hide(); // refresh the canvas - canvasUtils.refreshCanvasView({ + nfCanvasUtils.refreshCanvasView({ transition: true }); }; @@ -89,13 +89,13 @@ * Zoom actual size on the canvas. */ this.zoomActualSize = function () { - canvasUtils.actualSizeCanvasView(); + nfCanvasUtils.actualSizeCanvasView(); // hide the context menu - contextMenu.hide(); + nfContextMenu.hide(); // refresh the canvas - canvasUtils.refreshCanvasView({ + nfCanvasUtils.refreshCanvasView({ transition: true }); }; http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-operate-controller.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-operate-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-operate-controller.js index ed01f10..c1068bb 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-operate-controller.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-operate-controller.js @@ -27,8 +27,8 @@ 'nf.Common', 'nf.Client', 'nf.Processor'], - function ($, d3, dialog, birdseye, canvasUtils, common, client, processor) { - return (nf.ng.Canvas.OperateCtrl = factory($, d3, dialog, birdseye, canvasUtils, common, client, processor)); + function ($, d3, nfDialog, nfBirdseye, nfCanvasUtils, nfCommon, nfClient, nfProcessor) { + return (nf.ng.Canvas.OperateCtrl = factory($, d3, nfDialog, nfBirdseye, nfCanvasUtils, nfCommon, nfClient, nfProcessor)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.Canvas.OperateCtrl = @@ -50,7 +50,7 @@ root.nf.Client, root.nf.Processor); } -}(this, function ($, d3, dialog, birdseye, canvasUtils, common, client, processor) { +}(this, function ($, d3, nfDialog, nfBirdseye, nfCanvasUtils, nfCommon, nfClient, nfProcessor) { 'use strict'; return function () { @@ -154,12 +154,12 @@ dataType: 'xml', beforeSubmit: function (formData, $form, options) { // ensure uploading to the current process group - options.url += (encodeURIComponent(canvasUtils.getGroupId()) + '/templates/upload'); + options.url += (encodeURIComponent(nfCanvasUtils.getGroupId()) + '/templates/upload'); }, success: function (response, statusText, xhr, form) { // see if the import was successful and inform the user if (response.documentElement.tagName === 'templateEntity') { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Success', dialogContent: 'Template successfully imported.' }); @@ -169,23 +169,23 @@ if (response.documentElement.tagName === 'errorResponse') { // if a more specific error was given, use it var errorMessage = response.documentElement.getAttribute('statusText'); - if (!common.isBlank(errorMessage)) { + if (!nfCommon.isBlank(errorMessage)) { statusText = errorMessage; } } // show reason - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Unable to Upload', - dialogContent: common.escapeHtml(statusText) + dialogContent: nfCommon.escapeHtml(statusText) }); } }, error: function (xhr, statusText, error) { // request failed - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Unable to Upload', - dialogContent: common.escapeHtml(xhr.responseText) + dialogContent: nfCommon.escapeHtml(xhr.responseText) }); } }); @@ -205,7 +205,7 @@ var selectedTemplate = $('#selected-template-name').text(); // submit the template if necessary - if (common.isBlank(selectedTemplate)) { + if (nfCommon.isBlank(selectedTemplate)) { $('#upload-template-status').text('No template selected. Please browse to select a template.'); } else { templateForm.submit(); @@ -248,7 +248,7 @@ // add a handler for the change file input chain event $('#template-file-field').on('change', function (e) { var filename = $(this).val(); - if (!common.isBlank(filename)) { + if (!nfCommon.isBlank(filename)) { filename = filename.replace(/^.*[\\\/]/, ''); } @@ -320,7 +320,7 @@ }, handler: { click: function () { - var selection = canvasUtils.getSelection(); + var selection = nfCanvasUtils.getSelection(); // color the selected components selection.each(function (d) { @@ -334,7 +334,7 @@ if (color !== selectedData.component.style['background-color']) { // build the request entity var entity = { - 'revision': client.getRevision(selectedData), + 'revision': nfClient.getRevision(selectedData), 'component': { 'id': selectedData.id, 'style': { @@ -352,16 +352,16 @@ contentType: 'application/json' }).done(function (response) { // update the component - canvasUtils.getComponentByType(selectedData.type).set(response); + nfCanvasUtils.getComponentByType(selectedData.type).set(response); }).fail(function (xhr, status, error) { if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Error', - dialogContent: common.escapeHtml(xhr.responseText) + dialogContent: nfCommon.escapeHtml(xhr.responseText) }); } }).always(function () { - birdseye.refresh(); + nfBirdseye.refresh(); }); } }); @@ -448,13 +448,13 @@ if (hex.toLowerCase() === '#ffffff') { //special case #ffffff implies default fill $('#fill-color-processor-preview-icon').css({ - 'color': processor.defaultIconColor(), + 'color': nfProcessor.defaultIconColor(), 'background-color': hex }); } else { $('#fill-color-processor-preview-icon').css({ - 'color': common.determineContrastColor( - common.substringAfterLast( + 'color': nfCommon.determineContrastColor( + nfCommon.substringAfterLast( hex, '#')), 'background-color': hex }); @@ -472,7 +472,7 @@ 'background': hex }); $('#fill-color-label-preview-value').css('color', - common.determineContrastColor(common.substringAfterLast(hex, '#')) + nfCommon.determineContrastColor(nfCommon.substringAfterLast(hex, '#')) ); } }); http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-toolbox-controller.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-toolbox-controller.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-toolbox-controller.js index 212ecc3..f6b45f9 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-toolbox-controller.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/controllers/nf-ng-canvas-toolbox-controller.js @@ -21,8 +21,8 @@ if (typeof define === 'function' && define.amd) { define(['nf.CanvasUtils', 'nf.ContextMenu'], - function (canvasUtils, contextMenu) { - return (nf.ng.Canvas.ToolboxCtrl = factory(canvasUtils, contextMenu)); + function (nfCanvasUtils, nfContextMenu) { + return (nf.ng.Canvas.ToolboxCtrl = factory(nfCanvasUtils, nfContextMenu)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.Canvas.ToolboxCtrl = @@ -32,7 +32,7 @@ nf.ng.Canvas.ToolboxCtrl = factory(root.nf.CanvasUtils, root.nf.ContextMenu); } -}(this, function (canvasUtils, contextMenu) { +}(this, function (nfCanvasUtils, nfContextMenu) { 'use strict'; return function (processorComponent, @@ -127,14 +127,14 @@ cursor: '-webkit-grabbing', start: function (e, ui) { // hide the context menu if necessary - contextMenu.hide(); + nfContextMenu.hide(); }, stop: function (e, ui) { - var translate = canvasUtils.translateCanvasView(); - var scale = canvasUtils.scaleCanvasView(); + var translate = nfCanvasUtils.translateCanvasView(); + var scale = nfCanvasUtils.scaleCanvasView(); var mouseX = e.originalEvent.pageX; - var mouseY = e.originalEvent.pageY - canvasUtils.getCanvasOffset(); + var mouseY = e.originalEvent.pageY - nfCanvasUtils.getCanvasOffset(); // invoke the drop handler if we're over the canvas if (mouseX >= 0 && mouseY >= 0) { http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-funnel-component.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-funnel-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-funnel-component.js index c324a8d..94db750 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-funnel-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-funnel-component.js @@ -25,8 +25,8 @@ 'nf.Graph', 'nf.CanvasUtils', 'nf.ErrorHandler'], - function ($, client, birdseye, graph, canvasUtils, errorHandler) { - return (nf.ng.FunnelComponent = factory($, client, birdseye, graph, canvasUtils, errorHandler)); + function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) { + return (nf.ng.FunnelComponent = factory($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.FunnelComponent = @@ -44,7 +44,7 @@ root.nf.CanvasUtils, root.nf.ErrorHandler); } -}(this, function ($, client, birdseye, graph, canvasUtils, errorHandler) { +}(this, function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) { 'use strict'; return function (serviceProvider) { @@ -108,7 +108,7 @@ */ createFunnel: function (pt) { var outputPortEntity = { - 'revision': client.getRevision({ + 'revision': nfClient.getRevision({ 'revision': { 'version': 0 } @@ -124,21 +124,21 @@ // create a new funnel $.ajax({ type: 'POST', - url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/funnels', + url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/funnels', data: JSON.stringify(outputPortEntity), dataType: 'json', contentType: 'application/json' }).done(function (response) { // add the funnel to the graph - graph.add({ + nfGraph.add({ 'funnels': [response] }, { 'selectAll': true }); // update the birdseye - birdseye.refresh(); - }).fail(errorHandler.handleAjaxError); + nfBirdseye.refresh(); + }).fail(nfErrorHandler.handleAjaxError); } } http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-group-component.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-group-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-group-component.js index 5e7463a..fcd4aba 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-group-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-group-component.js @@ -25,8 +25,8 @@ 'nf.Graph', 'nf.CanvasUtils', 'nf.ErrorHandler'], - function ($, client, birdseye, graph, canvasUtils, errorHandler) { - return (nf.ng.GroupComponent = factory($, client, birdseye, graph, canvasUtils, errorHandler)); + function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) { + return (nf.ng.GroupComponent = factory($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.GroupComponent = @@ -44,7 +44,7 @@ root.nf.CanvasUtils, root.nf.ErrorHandler); } -}(this, function ($, client, birdseye, graph, canvasUtils, errorHandler) { +}(this, function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) { 'use strict'; return function (serviceProvider) { @@ -58,7 +58,7 @@ */ var createGroup = function (groupName, pt) { var processGroupEntity = { - 'revision': client.getRevision({ + 'revision': nfClient.getRevision({ 'revision': { 'version': 0 } @@ -75,24 +75,24 @@ // create a new processor of the defined type return $.ajax({ type: 'POST', - url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/process-groups', + url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/process-groups', data: JSON.stringify(processGroupEntity), dataType: 'json', contentType: 'application/json' }).done(function (response) { // add the process group to the graph - graph.add({ + nfGraph.add({ 'processGroups': [response] }, { 'selectAll': true }); // update component visibility - graph.updateVisibility(); + nfGraph.updateVisibility(); // update the birdseye - birdseye.refresh(); - }).fail(errorHandler.handleAjaxError); + nfBirdseye.refresh(); + }).fail(nfErrorHandler.handleAjaxError); }; function GroupComponent() { http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-input-port-component.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-input-port-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-input-port-component.js index 9aab07b..3c682a9 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-input-port-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-input-port-component.js @@ -25,8 +25,8 @@ 'nf.Graph', 'nf.CanvasUtils', 'nf.ErrorHandler'], - function ($, client, birdseye, graph, canvasUtils, errorHandler) { - return (nf.ng.InputPortComponent = factory($, client, birdseye, graph, canvasUtils, errorHandler)); + function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) { + return (nf.ng.InputPortComponent = factory($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.InputPortComponent = @@ -44,7 +44,7 @@ root.nf.CanvasUtils, root.nf.ErrorHandler); } -}(this, function ($, client, birdseye, graph, canvasUtils, errorHandler) { +}(this, function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) { 'use strict'; return function (serviceProvider) { @@ -58,7 +58,7 @@ */ var createInputPort = function (portName, pt) { var inputPortEntity = { - 'revision': client.getRevision({ + 'revision': nfClient.getRevision({ 'revision': { 'version': 0 } @@ -75,24 +75,24 @@ // create a new processor of the defined type $.ajax({ type: 'POST', - url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/input-ports', + url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/input-ports', data: JSON.stringify(inputPortEntity), dataType: 'json', contentType: 'application/json' }).done(function (response) { // add the port to the graph - graph.add({ + nfGraph.add({ 'inputPorts': [response] }, { 'selectAll': true }); // update component visibility - graph.updateVisibility(); + nfGraph.updateVisibility(); // update the birdseye - birdseye.refresh(); - }).fail(errorHandler.handleAjaxError); + nfBirdseye.refresh(); + }).fail(nfErrorHandler.handleAjaxError); }; function InputPortComponent() { http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-label-component.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-label-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-label-component.js index f3c4263..9562109 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-label-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-label-component.js @@ -26,8 +26,8 @@ 'nf.CanvasUtils', 'nf.ErrorHandler', 'nf.Label'], - function ($, client, birdseye, graph, canvasUtils, errorHandler, label) { - return (nf.ng.LabelComponent = factory($, client, birdseye, graph, canvasUtils, errorHandler, label)); + function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfLabel) { + return (nf.ng.LabelComponent = factory($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfLabel)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.LabelComponent = @@ -47,7 +47,7 @@ root.nf.ErrorHandler, root.nf.Label); } -}(this, function ($, client, birdseye, graph, canvasUtils, errorHandler, label) { +}(this, function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfLabel) { 'use strict'; return function (serviceProvider) { @@ -111,14 +111,14 @@ */ createLabel: function (pt) { var labelEntity = { - 'revision': client.getRevision({ + 'revision': nfClient.getRevision({ 'revision': { 'version': 0 } }), 'component': { - 'width': label.config.width, - 'height': label.config.height, + 'width': nfLabel.config.width, + 'height': nfLabel.config.height, 'position': { 'x': pt.x, 'y': pt.y @@ -129,21 +129,21 @@ // create a new label $.ajax({ type: 'POST', - url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/labels', + url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/labels', data: JSON.stringify(labelEntity), dataType: 'json', contentType: 'application/json' }).done(function (response) { // add the label to the graph - graph.add({ + nfGraph.add({ 'labels': [response] }, { 'selectAll': true }); // update the birdseye - birdseye.refresh(); - }).fail(errorHandler.handleAjaxError); + nfBirdseye.refresh(); + }).fail(nfErrorHandler.handleAjaxError); } } http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-output-port-component.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-output-port-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-output-port-component.js index 8b4c637..6bb1752 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-output-port-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-output-port-component.js @@ -25,8 +25,8 @@ 'nf.Graph', 'nf.CanvasUtils', 'nf.ErrorHandler'], - function ($, client, birdseye, graph, canvasUtils, errorHandler) { - return (nf.ng.OutputPortComponent = factory($, client, birdseye, graph, canvasUtils, errorHandler)); + function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) { + return (nf.ng.OutputPortComponent = factory($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.OutputPortComponent = @@ -44,7 +44,7 @@ root.nf.CanvasUtils, root.nf.ErrorHandler); } -}(this, function ($, client, birdseye, graph, canvasUtils, errorHandler) { +}(this, function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) { 'use strict'; return function (serviceProvider) { @@ -58,7 +58,7 @@ */ var createOutputPort = function (portName, pt) { var outputPortEntity = { - 'revision': client.getRevision({ + 'revision': nfClient.getRevision({ 'revision': { 'version': 0 } @@ -75,24 +75,24 @@ // create a new processor of the defined type $.ajax({ type: 'POST', - url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/output-ports', + url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/output-ports', data: JSON.stringify(outputPortEntity), dataType: 'json', contentType: 'application/json' }).done(function (response) { // add the port to the graph - graph.add({ + nfGraph.add({ 'outputPorts': [response] }, { 'selectAll': true }); // update component visibility - graph.updateVisibility(); + nfGraph.updateVisibility(); // update the birdseye - birdseye.refresh(); - }).fail(errorHandler.handleAjaxError); + nfBirdseye.refresh(); + }).fail(nfErrorHandler.handleAjaxError); }; function OutputPortComponent() { http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js index 257de23..87bb580 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js @@ -28,8 +28,8 @@ 'nf.ErrorHandler', 'nf.Dialog', 'nf.Common'], - function ($, Slick, client, birdseye, graph, canvasUtils, errorHandler, dialog, common) { - return (nf.ng.ProcessorComponent = factory($, Slick, client, birdseye, graph, canvasUtils, errorHandler, dialog, common)); + function ($, Slick, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon) { + return (nf.ng.ProcessorComponent = factory($, Slick, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.ProcessorComponent = @@ -53,7 +53,7 @@ root.nf.Dialog, root.nf.Common); } -}(this, function ($, Slick, client, birdseye, graph, canvasUtils, errorHandler, dialog, common) { +}(this, function ($, Slick, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon) { 'use strict'; return function (serviceProvider) { @@ -67,7 +67,7 @@ var processorTypesGrid = $('#processor-types-table').data('gridInstance'); // ensure the grid has been initialized - if (common.isDefinedAndNotNull(processorTypesGrid)) { + if (nfCommon.isDefinedAndNotNull(processorTypesGrid)) { var processorTypesData = processorTypesGrid.getData(); // update the search criteria @@ -187,8 +187,8 @@ var sort = function (sortDetails, data) { // defines a function for sorting var comparer = function (a, b) { - var aString = common.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : ''; - var bString = common.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : ''; + var aString = nfCommon.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : ''; + var bString = nfCommon.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : ''; return aString === bString ? 0 : aString > bString ? 1 : -1; }; @@ -239,7 +239,7 @@ */ var createProcessor = function (name, processorType, pt) { var processorEntity = { - 'revision': client.getRevision({ + 'revision': nfClient.getRevision({ 'revision': { 'version': 0 } @@ -257,24 +257,24 @@ // create a new processor of the defined type $.ajax({ type: 'POST', - url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/processors', + url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/processors', data: JSON.stringify(processorEntity), dataType: 'json', contentType: 'application/json' }).done(function (response) { // add the processor to the graph - graph.add({ + nfGraph.add({ 'processors': [response] }, { 'selectAll': true }); // update component visibility - graph.updateVisibility(); + nfGraph.updateVisibility(); // update the birdseye - birdseye.refresh(); - }).fail(errorHandler.handleAjaxError); + nfBirdseye.refresh(); + }).fail(nfErrorHandler.handleAjaxError); }; /** @@ -283,7 +283,7 @@ * @param item process type */ var isSelectable = function (item) { - return common.isBlank(item.usageRestriction) || common.canAccessRestrictedComponents(); + return nfCommon.isBlank(item.usageRestriction) || nfCommon.canAccessRestrictedComponents(); }; function ProcessorComponent() { @@ -312,7 +312,7 @@ id: 'type', name: 'Type', field: 'label', - formatter: common.typeFormatter, + formatter: nfCommon.typeFormatter, sortable: true, resizable: true }, @@ -368,8 +368,8 @@ var processorType = processorTypesGrid.getDataItem(processorTypeIndex); // set the processor type description - if (common.isDefinedAndNotNull(processorType)) { - if (common.isBlank(processorType.description)) { + if (nfCommon.isDefinedAndNotNull(processorType)) { + if (nfCommon.isBlank(processorType.description)) { $('#processor-type-description') .attr('title', '') .html('<span class="unset">No description specified</span>'); @@ -391,7 +391,7 @@ } }); processorTypesGrid.onViewportChanged.subscribe(function (e, args) { - common.cleanUpTooltips($('#processor-types-table'), 'div.view-usage-restriction'); + nfCommon.cleanUpTooltips($('#processor-types-table'), 'div.view-usage-restriction'); }); // wire up the dataview to the grid @@ -418,8 +418,8 @@ var item = processorTypesData.getItemById(rowId); // show the tooltip - if (common.isDefinedAndNotNull(item.usageRestriction)) { - usageRestriction.qtip($.extend({}, common.config.tooltipConfig, { + if (nfCommon.isDefinedAndNotNull(item.usageRestriction)) { + usageRestriction.qtip($.extend({}, nfCommon.config.tooltipConfig, { content: item.usageRestriction, position: { container: $('#summary'), @@ -454,10 +454,10 @@ // create the row for the processor type processorTypesData.addItem({ id: i, - label: common.substringAfterLast(type, '.'), + label: nfCommon.substringAfterLast(type, '.'), type: type, - description: common.escapeHtml(documentedType.description), - usageRestriction: common.escapeHtml(documentedType.usageRestriction), + description: nfCommon.escapeHtml(documentedType.description), + usageRestriction: nfCommon.escapeHtml(documentedType.usageRestriction), tags: documentedType.tags.join(', ') }); @@ -479,7 +479,7 @@ select: applyFilter, remove: applyFilter }); - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); } }, @@ -600,7 +600,7 @@ // ensure something was selected if (name === '' || processorType === '') { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Add Processor', dialogContent: 'The type of processor to create must be selected.' }); http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-remote-process-group-component.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-remote-process-group-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-remote-process-group-component.js index d911ece..5e6e116 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-remote-process-group-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-remote-process-group-component.js @@ -27,8 +27,8 @@ 'nf.ErrorHandler', 'nf.Dialog', 'nf.Common'], - function ($, client, birdseye, graph, canvasUtils, errorHandler, dialog, common) { - return (nf.ng.RemoteProcessGroupComponent = factory($, client, birdseye, graph, canvasUtils, errorHandler, dialog, common)); + function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon) { + return (nf.ng.RemoteProcessGroupComponent = factory($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.RemoteProcessGroupComponent = @@ -50,7 +50,7 @@ root.nf.Dialog, root.nf.Common); } -}(this, function ($, client, birdseye, graph, canvasUtils, errorHandler, dialog, common) { +}(this, function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon) { 'use strict'; return function (serviceProvider) { @@ -64,7 +64,7 @@ var createRemoteProcessGroup = function (pt) { var remoteProcessGroupEntity = { - 'revision': client.getRevision({ + 'revision': nfClient.getRevision({ 'revision': { 'version': 0 } @@ -88,13 +88,13 @@ // create a new processor of the defined type $.ajax({ type: 'POST', - url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/remote-process-groups', + url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/remote-process-groups', data: JSON.stringify(remoteProcessGroupEntity), dataType: 'json', contentType: 'application/json' }).done(function (response) { // add the processor to the graph - graph.add({ + nfGraph.add({ 'remoteProcessGroups': [response] }, { 'selectAll': true @@ -104,10 +104,10 @@ $('#new-remote-process-group-dialog').modal('hide'); // update component visibility - graph.updateVisibility(); + nfGraph.updateVisibility(); // update the birdseye - birdseye.refresh(); + nfBirdseye.refresh(); }).fail(function (xhr, status, error) { if (xhr.status === 400) { var errors = xhr.responseText.split('\n'); @@ -116,15 +116,15 @@ if (errors.length === 1) { content = $('<span></span>').text(errors[0]); } else { - content = common.formatUnorderedList(errors); + content = nfCommon.formatUnorderedList(errors); } - dialog.showOkDialog({ + nfDialog.showOkDialog({ dialogContent: content, headerText: 'Configuration Error' }); } else { - errorHandler.handleAjaxError(xhr, status, error); + nfErrorHandler.handleAjaxError(xhr, status, error); } }); }; http://git-wip-us.apache.org/repos/asf/nifi/blob/2c374baf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-template-component.js ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-template-component.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-template-component.js index 7dc3b8b..99fe0ec 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-template-component.js +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-template-component.js @@ -27,8 +27,8 @@ 'nf.ErrorHandler', 'nf.Dialog', 'nf.Common'], - function ($, client, birdseye, graph, canvasUtils, errorHandler, dialog, common) { - return (nf.ng.TemplateComponent = factory($, client, birdseye, graph, canvasUtils, errorHandler, dialog, common)); + function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon) { + return (nf.ng.TemplateComponent = factory($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon)); }); } else if (typeof exports === 'object' && typeof module === 'object') { module.exports = (nf.ng.TemplateComponent = @@ -50,7 +50,7 @@ root.nf.Dialog, root.nf.Common); } -}(this, function ($, client, birdseye, graph, canvasUtils, errorHandler, dialog, common) { +}(this, function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon) { 'use strict'; return function (serviceProvider) { @@ -72,22 +72,22 @@ // create a new instance of the new template $.ajax({ type: 'POST', - url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/template-instance', + url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/template-instance', data: JSON.stringify(instantiateTemplateInstance), dataType: 'json', contentType: 'application/json' }).done(function (response) { // populate the graph accordingly - graph.add(response.flow, { + nfGraph.add(response.flow, { 'selectAll': true }); // update component visibility - graph.updateVisibility(); + nfGraph.updateVisibility(); // update the birdseye - birdseye.refresh(); - }).fail(errorHandler.handleAjaxError); + nfBirdseye.refresh(); + }).fail(nfErrorHandler.handleAjaxError); }; function TemplateComponent() { @@ -205,11 +205,11 @@ dataType: 'json' }).done(function (response) { var templates = response.templates; - if (common.isDefinedAndNotNull(templates) && templates.length > 0) { + if (nfCommon.isDefinedAndNotNull(templates) && templates.length > 0) { // sort the templates templates = templates.sort(function (one, two) { - var oneDate = common.parseDateTime(one.template.timestamp); - var twoDate = common.parseDateTime(two.template.timestamp); + var oneDate = nfCommon.parseDateTime(one.template.timestamp); + var twoDate = nfCommon.parseDateTime(two.template.timestamp); // newest templates first return twoDate.getTime() - oneDate.getTime(); @@ -221,7 +221,7 @@ options.push({ text: templateEntity.template.name, value: templateEntity.id, - description: common.escapeHtml(templateEntity.template.description) + description: nfCommon.escapeHtml(templateEntity.template.description) }); } }); @@ -271,13 +271,13 @@ // show the dialog templateComponent.modal.show(); } else { - dialog.showOkDialog({ + nfDialog.showOkDialog({ headerText: 'Instantiate Template', dialogContent: 'No templates have been loaded into this NiFi.' }); } - }).fail(errorHandler.handleAjaxError); + }).fail(nfErrorHandler.handleAjaxError); } }
