- Upgrading jQuery and jQuery UI.
- Replacing all instances of Deferred.then with Deferred.done/fail due to API change introduced in 1.8.
- Restoring line returns between public methods.
- Upgrading jquery.form and jquery.minicolors.
This commit is contained in:
Matt Gilman 2014-12-16 08:42:13 -05:00
parent fc78752e61
commit 2965258e5d
76 changed files with 719 additions and 18072 deletions

View File

@ -25,9 +25,8 @@
<link rel="stylesheet" href="js/jquery/combo/jquery.combo.css?${project.version}" type="text/css" /> <link rel="stylesheet" href="js/jquery/combo/jquery.combo.css?${project.version}" type="text/css" />
<link rel="stylesheet" href="js/jquery/modal/jquery.modal.css?${project.version}" type="text/css" /> <link rel="stylesheet" href="js/jquery/modal/jquery.modal.css?${project.version}" type="text/css" />
<link rel="stylesheet" href="js/jquery/qtip2/jquery.qtip.min.css?" type="text/css" /> <link rel="stylesheet" href="js/jquery/qtip2/jquery.qtip.min.css?" type="text/css" />
<link rel="stylesheet" href="js/jquery/ui-smoothness/jquery-ui-1.10.4.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/ui-smoothness/jquery-ui-1.10.4.min.css" type="text/css" />
<script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="js/jquery/jquery.center.js"></script> <script type="text/javascript" src="js/jquery/jquery.center.js"></script>
<script type="text/javascript" src="js/jquery/combo/jquery.combo.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/combo/jquery.combo.js?${project.version}"></script>
<script type="text/javascript" src="js/jquery/modal/jquery.modal.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/modal/jquery.modal.js?${project.version}"></script>

View File

@ -35,8 +35,7 @@
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" />
<script type="text/javascript" src="js/codemirror/lib/codemirror-compressed.js"></script> <script type="text/javascript" src="js/codemirror/lib/codemirror-compressed.js"></script>
<script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script> <script type="text/javascript" src="js/jquery/ui-smoothness/jquery-ui-1.10.4.min.js"></script>
<script type="text/javascript" src="js/jquery/ui-smoothness/jquery-ui-1.10.4.js"></script>
<script type="text/javascript" src="js/jquery/jquery.center.js"></script> <script type="text/javascript" src="js/jquery/jquery.center.js"></script>
<script type="text/javascript" src="js/jquery/jquery.count.js"></script> <script type="text/javascript" src="js/jquery/jquery.count.js"></script>
<script type="text/javascript" src="js/jquery/jquery.ellipsis.js"></script> <script type="text/javascript" src="js/jquery/jquery.ellipsis.js"></script>

View File

@ -29,7 +29,6 @@
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick.grid.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick.grid.css" type="text/css" />
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" />
<script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="js/jquery/jquery.center.js"></script> <script type="text/javascript" src="js/jquery/jquery.center.js"></script>
<script type="text/javascript" src="js/jquery/combo/jquery.combo.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/combo/jquery.combo.js?${project.version}"></script>
<script type="text/javascript" src="js/jquery/modal/jquery.modal.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/modal/jquery.modal.js?${project.version}"></script>

View File

@ -29,7 +29,6 @@
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick.grid.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick.grid.css" type="text/css" />
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" />
<script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="js/jquery/jquery.center.js"></script> <script type="text/javascript" src="js/jquery/jquery.center.js"></script>
<script type="text/javascript" src="js/jquery/combo/jquery.combo.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/combo/jquery.combo.js?${project.version}"></script>
<script type="text/javascript" src="js/jquery/modal/jquery.modal.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/modal/jquery.modal.js?${project.version}"></script>

View File

@ -29,7 +29,6 @@
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick.grid.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick.grid.css" type="text/css" />
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" />
<script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="js/jquery/jquery.center.js"></script> <script type="text/javascript" src="js/jquery/jquery.center.js"></script>
<script type="text/javascript" src="js/jquery/modal/jquery.modal.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/modal/jquery.modal.js?${project.version}"></script>
<script type="text/javascript" src="js/jquery/combo/jquery.combo.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/combo/jquery.combo.js?${project.version}"></script>

View File

@ -30,7 +30,6 @@
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick.grid.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick.grid.css" type="text/css" />
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" />
<script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="js/jquery/jquery.center.js"></script> <script type="text/javascript" src="js/jquery/jquery.center.js"></script>
<script type="text/javascript" src="js/jquery/modal/jquery.modal.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/modal/jquery.modal.js?${project.version}"></script>
<script type="text/javascript" src="js/jquery/tabbs/jquery.tabbs.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/tabbs/jquery.tabbs.js?${project.version}"></script>

View File

@ -30,7 +30,6 @@
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick.grid.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick.grid.css" type="text/css" />
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" />
<script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="js/jquery/ui-smoothness/jquery-ui-1.10.4.min.js"></script> <script type="text/javascript" src="js/jquery/ui-smoothness/jquery-ui-1.10.4.min.js"></script>
<script type="text/javascript" src="js/jquery/jquery.center.js"></script> <script type="text/javascript" src="js/jquery/jquery.center.js"></script>
<script type="text/javascript" src="js/jquery/tabbs/jquery.tabbs.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/tabbs/jquery.tabbs.js?${project.version}"></script>

View File

@ -29,9 +29,8 @@
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick.grid.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick.grid.css" type="text/css" />
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" />
<script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="js/jquery/jquery.center.js"></script> <script type="text/javascript" src="js/jquery/jquery.center.js"></script>
<script type="text/javascript" src="js/jquery/jquery.form.js"></script> <script type="text/javascript" src="js/jquery/jquery.form.min.js"></script>
<script type="text/javascript" src="js/jquery/combo/jquery.combo.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/combo/jquery.combo.js?${project.version}"></script>
<script type="text/javascript" src="js/jquery/modal/jquery.modal.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/modal/jquery.modal.js?${project.version}"></script>
<script type="text/javascript" src="js/jquery/jquery.ellipsis.js"></script> <script type="text/javascript" src="js/jquery/jquery.ellipsis.js"></script>

View File

@ -30,7 +30,6 @@
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick.grid.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick.grid.css" type="text/css" />
<link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" /> <link rel="stylesheet" href="js/jquery/slickgrid/css/slick-default-theme.css" type="text/css" />
<script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="js/jquery/jquery-2.1.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
<script type="text/javascript" src="js/jquery/jquery.center.js"></script> <script type="text/javascript" src="js/jquery/jquery.center.js"></script>
<script type="text/javascript" src="js/jquery/tabbs/jquery.tabbs.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/tabbs/jquery.tabbs.js?${project.version}"></script>
<script type="text/javascript" src="js/jquery/combo/jquery.combo.js?${project.version}"></script> <script type="text/javascript" src="js/jquery/combo/jquery.combo.js?${project.version}"></script>

File diff suppressed because one or more lines are too long

View File

@ -112,14 +112,14 @@ nf.BulletinBoard = (function () {
type: 'GET', type: 'GET',
url: config.urls.controllerAbout, url: config.urls.controllerAbout,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var aboutDetails = response.about; var aboutDetails = response.about;
var bulletinBoardTitle = aboutDetails.title + ' Bulletin Board'; var bulletinBoardTitle = aboutDetails.title + ' Bulletin Board';
// set the document title and the about title // set the document title and the about title
document.title = bulletinBoardTitle; document.title = bulletinBoardTitle;
$('#bulletin-board-header-text').text(bulletinBoardTitle); $('#bulletin-board-header-text').text(bulletinBoardTitle);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
// get the banners if we're not in the shell // get the banners if we're not in the shell
var loadBanners = $.Deferred(function (deferred) { var loadBanners = $.Deferred(function (deferred) {
@ -128,7 +128,7 @@ nf.BulletinBoard = (function () {
type: 'GET', type: 'GET',
url: config.urls.banners, url: config.urls.banners,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// ensure the banners response is specified // ensure the banners response is specified
if (nf.Common.isDefinedAndNotNull(response.banners)) { if (nf.Common.isDefinedAndNotNull(response.banners)) {
if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
@ -160,7 +160,7 @@ nf.BulletinBoard = (function () {
} }
deferred.resolve(); deferred.resolve();
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
deferred.reject(); deferred.reject();
}); });
@ -170,9 +170,9 @@ nf.BulletinBoard = (function () {
}); });
return $.Deferred(function (deferred) { return $.Deferred(function (deferred) {
$.when(getTitle, loadBanners).then(function () { $.when(getTitle, loadBanners).done(function () {
deferred.resolve(); deferred.resolve();
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
}).promise(); }).promise();
@ -294,7 +294,7 @@ nf.BulletinBoard = (function () {
url: config.urls.bulletinBoard, url: config.urls.bulletinBoard,
data: data, data: data,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// ensure the bulletin board was specified // ensure the bulletin board was specified
if (nf.Common.isDefinedAndNotNull(response.bulletinBoard)) { if (nf.Common.isDefinedAndNotNull(response.bulletinBoard)) {
var bulletinBoard = response.bulletinBoard; var bulletinBoard = response.bulletinBoard;
@ -369,7 +369,7 @@ nf.BulletinBoard = (function () {
bulletinContainer.prepend('<div class="bulletin-action">&#8230;</div>'); bulletinContainer.prepend('<div class="bulletin-action">&#8230;</div>');
} }
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
// likely caused by a invalid regex // likely caused by a invalid regex
if (xhr.status === 404) { if (xhr.status === 404) {
$('#bulletin-error-message').text(xhr.responseText).show(); $('#bulletin-error-message').text(xhr.responseText).show();

View File

@ -40,10 +40,10 @@ nf.Actions = (function () {
url: uri, url: uri,
data: data, data: data,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) { if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({ nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText), dialogContent: nf.Common.escapeHtml(xhr.responseText),
@ -86,12 +86,14 @@ nf.Actions = (function () {
nf.CanvasUtils.enterGroup(selectionData.component.id); nf.CanvasUtils.enterGroup(selectionData.component.id);
} }
}, },
/** /**
* Exits the current process group but entering the parent group. * Exits the current process group but entering the parent group.
*/ */
leaveGroup: function () { leaveGroup: function () {
nf.CanvasUtils.enterGroup(nf.Canvas.getParentGroupId()); nf.CanvasUtils.enterGroup(nf.Canvas.getParentGroupId());
}, },
/** /**
* Refresh the flow of the remote process group in the specified selection. * Refresh the flow of the remote process group in the specified selection.
* *
@ -153,6 +155,7 @@ nf.Actions = (function () {
poll(1); poll(1);
} }
}, },
/** /**
* Opens the remote process group in the specified selection. * Opens the remote process group in the specified selection.
* *
@ -172,6 +175,7 @@ nf.Actions = (function () {
} }
} }
}, },
/** /**
* Shows and selects the source of the connection in the specified selection. * Shows and selects the source of the connection in the specified selection.
* *
@ -190,6 +194,7 @@ nf.Actions = (function () {
} }
} }
}, },
/** /**
* Shows and selects the destination of the connection in the specified selection. * Shows and selects the destination of the connection in the specified selection.
* *
@ -208,6 +213,7 @@ nf.Actions = (function () {
} }
} }
}, },
/** /**
* Shows the downstream components from the specified selection. * Shows the downstream components from the specified selection.
* *
@ -230,6 +236,7 @@ nf.Actions = (function () {
} }
} }
}, },
/** /**
* Shows the upstream components from the specified selection. * Shows the upstream components from the specified selection.
* *
@ -252,6 +259,7 @@ nf.Actions = (function () {
} }
} }
}, },
/** /**
* Shows and selects the component in the specified selection. * Shows and selects the component in the specified selection.
* *
@ -268,6 +276,7 @@ nf.Actions = (function () {
nf.Actions.center(selection); nf.Actions.center(selection);
} }
}, },
/** /**
* Selects all components in the specified selection. * Selects all components in the specified selection.
* *
@ -276,12 +285,14 @@ nf.Actions = (function () {
select: function (selection) { select: function (selection) {
selection.classed('selected', true); selection.classed('selected', true);
}, },
/** /**
* Selects all components. * Selects all components.
*/ */
selectAll: function () { selectAll: function () {
nf.Actions.select(d3.selectAll('g.component, g.connection')); nf.Actions.select(d3.selectAll('g.component, g.connection'));
}, },
/** /**
* Centers the component in the specified selection. * Centers the component in the specified selection.
* *
@ -331,6 +342,7 @@ nf.Actions = (function () {
}); });
} }
}, },
/** /**
* Enables all eligible selected components. * Enables all eligible selected components.
*/ */
@ -360,6 +372,7 @@ nf.Actions = (function () {
}); });
} }
}, },
/** /**
* Disables all eligible selected components. * Disables all eligible selected components.
*/ */
@ -389,6 +402,7 @@ nf.Actions = (function () {
}); });
} }
}, },
/** /**
* Starts the components in the specified selection. * Starts the components in the specified selection.
* *
@ -443,6 +457,7 @@ nf.Actions = (function () {
} }
} }
}, },
/** /**
* Stops the components in the specified selection. * Stops the components in the specified selection.
* *
@ -496,6 +511,7 @@ nf.Actions = (function () {
} }
} }
}, },
/** /**
* Enables transmission for the components in the specified selection. * Enables transmission for the components in the specified selection.
* *
@ -513,6 +529,7 @@ nf.Actions = (function () {
}); });
}); });
}, },
/** /**
* Disables transmission for the components in the specified selection. * Disables transmission for the components in the specified selection.
* *
@ -530,6 +547,7 @@ nf.Actions = (function () {
}); });
}); });
}, },
/** /**
* Shows the configuration dialog for the specified selection. * Shows the configuration dialog for the specified selection.
* *
@ -557,6 +575,7 @@ nf.Actions = (function () {
} }
} }
}, },
// Defines an action for showing component details (like configuration but read only). // Defines an action for showing component details (like configuration but read only).
showDetails: function (selection) { showDetails: function (selection) {
if (selection.size() === 1) { if (selection.size() === 1) {
@ -579,6 +598,7 @@ nf.Actions = (function () {
} }
} }
}, },
/** /**
* Shows the usage documentation for the component in the specified selection. * Shows the usage documentation for the component in the specified selection.
* *
@ -592,6 +612,7 @@ nf.Actions = (function () {
})); }));
} }
}, },
/** /**
* Shows the stats for the specified selection. * Shows the stats for the specified selection.
* *
@ -623,6 +644,7 @@ nf.Actions = (function () {
} }
} }
}, },
/** /**
* Opens the remote ports dialog for the remote process group in the specified selection. * Opens the remote ports dialog for the remote process group in the specified selection.
* *
@ -633,6 +655,7 @@ nf.Actions = (function () {
nf.RemoteProcessGroupPorts.showPorts(selection); nf.RemoteProcessGroupPorts.showPorts(selection);
} }
}, },
/** /**
* Hides and open cancellable dialogs. * Hides and open cancellable dialogs.
*/ */
@ -646,12 +669,14 @@ nf.Actions = (function () {
} }
}); });
}, },
/** /**
* Reloads the status for the entire canvas (components and flow.) * Reloads the status for the entire canvas (components and flow.)
*/ */
reloadStatus: function () { reloadStatus: function () {
nf.Canvas.reloadStatus(); nf.Canvas.reloadStatus();
}, },
/** /**
* Deletes the component in the specified selection. * Deletes the component in the specified selection.
* *
@ -675,7 +700,7 @@ nf.Actions = (function () {
clientId: revision.clientId clientId: revision.clientId
}), }),
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -723,15 +748,15 @@ nf.Actions = (function () {
// refresh the birdseye/toolbar // refresh the birdseye/toolbar
nf.Birdseye.refresh(); nf.Birdseye.refresh();
nf.CanvasToolbar.refresh(); nf.CanvasToolbar.refresh();
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} else { } else {
// create a snippet for the specified component and link to the data flow // create a snippet for the specified component and link to the data flow
var snippetDetails = nf.Snippet.marshal(selection, true); var snippetDetails = nf.Snippet.marshal(selection, true);
nf.Snippet.create(snippetDetails).then(function (response) { nf.Snippet.create(snippetDetails).done(function (response) {
var snippet = response.snippet; var snippet = response.snippet;
// remove the snippet, effectively removing the components // remove the snippet, effectively removing the components
nf.Snippet.remove(snippet.id).then(function () { nf.Snippet.remove(snippet.id).done(function () {
var components = d3.map(); var components = d3.map();
// add the id to the type's array // add the id to the type's array
@ -797,7 +822,7 @@ nf.Actions = (function () {
// refresh the birdseye/toolbar // refresh the birdseye/toolbar
nf.Birdseye.refresh(); nf.Birdseye.refresh();
nf.CanvasToolbar.refresh(); nf.CanvasToolbar.refresh();
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
// unable to acutally remove the components so attempt to // unable to acutally remove the components so attempt to
// unlink and remove just the snippet - if unlinking fails // unlink and remove just the snippet - if unlinking fails
// just ignore // just ignore
@ -807,10 +832,11 @@ nf.Actions = (function () {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
}); });
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
} }
}, },
/** /**
* Opens the fill color dialog for the component in the specified selection. * Opens the fill color dialog for the component in the specified selection.
* *
@ -842,6 +868,7 @@ nf.Actions = (function () {
$('#fill-color-dialog').modal('show'); $('#fill-color-dialog').modal('show');
} }
}, },
/** /**
* Groups the currently selected components into a new group. * Groups the currently selected components into a new group.
*/ */
@ -865,6 +892,7 @@ nf.Actions = (function () {
}); });
}); });
}, },
/** /**
* Creates a new template based off the currently selected components. If no components * Creates a new template based off the currently selected components. If no components
* are selected, a template of the entire canvas is made. * are selected, a template of the entire canvas is made.
@ -914,7 +942,7 @@ nf.Actions = (function () {
var snippetDetails = nf.Snippet.marshal(selection, false); var snippetDetails = nf.Snippet.marshal(selection, false);
// create the snippet // create the snippet
nf.Snippet.create(snippetDetails).then(function (response) { nf.Snippet.create(snippetDetails).done(function (response) {
var snippet = response.snippet; var snippet = response.snippet;
// create the template // create the template
@ -927,21 +955,21 @@ nf.Actions = (function () {
snippetId: snippet.id snippetId: snippet.id
}, },
dataType: 'json' dataType: 'json'
}).then(function () { }).done(function () {
// show the confirmation dialog // show the confirmation dialog
nf.Dialog.showOkDialog({ nf.Dialog.showOkDialog({
dialogContent: "Template '" + nf.Common.escapeHtml(templateName) + "' was successfully created.", dialogContent: "Template '" + nf.Common.escapeHtml(templateName) + "' was successfully created.",
overlayBackground: false overlayBackground: false
}); });
}, nf.Common.handleAjaxError).always(function () { }).always(function () {
// remove the snippet // remove the snippet
nf.Snippet.remove(snippet.id); nf.Snippet.remove(snippet.id);
// clear the template dialog fields // clear the template dialog fields
$('#new-template-name').val(''); $('#new-template-name').val('');
$('#new-template-description').val(''); $('#new-template-description').val('');
}); }).fail(nf.Common.handleAjaxError);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
} }
}, { }, {
@ -956,6 +984,7 @@ nf.Actions = (function () {
// auto focus on the template name // auto focus on the template name
$('#new-template-name').focus(); $('#new-template-name').focus();
}, },
/** /**
* Copies the component in the specified selection. * Copies the component in the specified selection.
* *
@ -975,6 +1004,7 @@ nf.Actions = (function () {
origin: origin origin: origin
}); });
}, },
/** /**
* Pastes the currently copied selection. * Pastes the currently copied selection.
* *
@ -1009,7 +1039,7 @@ nf.Actions = (function () {
}; };
// create a snippet from the details // create a snippet from the details
nf.Snippet.create(data['snippet']).then(function (createResponse) { nf.Snippet.create(data['snippet']).done(function (createResponse) {
var snippet = createResponse.snippet; var snippet = createResponse.snippet;
// determine the origin of the bounding box of the copy // determine the origin of the bounding box of the copy
@ -1024,7 +1054,7 @@ nf.Actions = (function () {
} }
// copy the snippet to the new location // copy the snippet to the new location
nf.Snippet.copy(snippet.id, nf.Canvas.getGroupId(), origin).then(function (copyResponse) { nf.Snippet.copy(snippet.id, nf.Canvas.getGroupId(), origin).done(function (copyResponse) {
var snippetContents = copyResponse.contents; var snippetContents = copyResponse.contents;
// update the graph accordingly // update the graph accordingly
@ -1039,7 +1069,7 @@ nf.Actions = (function () {
// remove the original snippet // remove the original snippet
nf.Snippet.remove(snippet.id).fail(reject); nf.Snippet.remove(snippet.id).fail(reject);
}, function () { }).fail(function () {
// an error occured while performing the copy operation, reload the // an error occured while performing the copy operation, reload the
// graph in case it was a partial success // graph in case it was a partial success
nf.Canvas.reload().done(function () { nf.Canvas.reload().done(function () {
@ -1054,7 +1084,7 @@ nf.Actions = (function () {
// reject the deferred // reject the deferred
reject(); reject();
}); });
}, reject); }).fail(reject);
}).promise(); }).promise();
// show the appropriate message is the copy fails // show the appropriate message is the copy fails
@ -1067,6 +1097,7 @@ nf.Actions = (function () {
}); });
}); });
}, },
/** /**
* Moves the connection in the specified selection to the front. * Moves the connection in the specified selection to the front.
* *

View File

@ -335,6 +335,7 @@ nf.Birdseye = (function () {
}) })
.call(brush); .call(brush);
}, },
/** /**
* Handles rendering of the birdseye tool. * Handles rendering of the birdseye tool.
*/ */

View File

@ -103,7 +103,7 @@ nf.CanvasHeader = (function () {
// setup the refresh link actions // setup the refresh link actions
$('#refresh-required-link').click(function () { $('#refresh-required-link').click(function () {
nf.Canvas.reload().then(function () { nf.Canvas.reload().done(function () {
// update component visibility // update component visibility
nf.Canvas.View.updateVisibility(); nf.Canvas.View.updateVisibility();
@ -113,7 +113,7 @@ nf.CanvasHeader = (function () {
// hide the refresh link // hide the refresh link
$('#stats-last-refreshed').removeClass('alert'); $('#stats-last-refreshed').removeClass('alert');
$('#refresh-required-container').hide(); $('#refresh-required-container').hide();
}, function () { }).fail(function () {
nf.Dialog.showOkDialog({ nf.Dialog.showOkDialog({
dialogContent: 'Unable to refresh the current group.', dialogContent: 'Unable to refresh the current group.',
overlayBackground: true overlayBackground: true
@ -126,12 +126,12 @@ nf.CanvasHeader = (function () {
type: 'GET', type: 'GET',
url: config.urls.controllerAbout, url: config.urls.controllerAbout,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var aboutDetails = response.about; var aboutDetails = response.about;
// set the document title and the about title // set the document title and the about title
document.title = aboutDetails.title; document.title = aboutDetails.title;
$('#nf-version').text(aboutDetails.version); $('#nf-version').text(aboutDetails.version);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
// configure the about dialog // configure the about dialog
$('#nf-about').modal({ $('#nf-about').modal({
@ -192,7 +192,7 @@ nf.CanvasHeader = (function () {
'style[background-color]': color 'style[background-color]': color
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -202,7 +202,7 @@ nf.CanvasHeader = (function () {
} else { } else {
nf.Label.set(response.label); nf.Label.set(response.label);
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) { if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({ nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText), dialogContent: nf.Common.escapeHtml(xhr.responseText),

View File

@ -95,6 +95,7 @@ nf.CanvasToolbar = (function () {
}); });
} }
}, },
/** /**
* Called when the selection changes to update the toolbar appropriately. * Called when the selection changes to update the toolbar appropriately.
*/ */

View File

@ -394,7 +394,7 @@ nf.CanvasToolbox = (function () {
y: pt.y y: pt.y
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.processor)) { if (nf.Common.isDefinedAndNotNull(response.processor)) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -410,7 +410,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye // update the birdseye
nf.Birdseye.refresh(); nf.Birdseye.refresh();
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -481,7 +481,7 @@ nf.CanvasToolbox = (function () {
y: pt.y y: pt.y
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.inputPort)) { if (nf.Common.isDefinedAndNotNull(response.inputPort)) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -497,7 +497,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye // update the birdseye
nf.Birdseye.refresh(); nf.Birdseye.refresh();
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -568,7 +568,7 @@ nf.CanvasToolbox = (function () {
y: pt.y y: pt.y
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.outputPort)) { if (nf.Common.isDefinedAndNotNull(response.outputPort)) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -584,7 +584,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye // update the birdseye
nf.Birdseye.refresh(); nf.Birdseye.refresh();
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -608,7 +608,7 @@ nf.CanvasToolbox = (function () {
y: pt.y y: pt.y
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.processGroup)) { if (nf.Common.isDefinedAndNotNull(response.processGroup)) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -624,7 +624,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye // update the birdseye
nf.Birdseye.refresh(); nf.Birdseye.refresh();
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -692,7 +692,7 @@ nf.CanvasToolbox = (function () {
y: pt.y y: pt.y
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.remoteProcessGroup)) { if (nf.Common.isDefinedAndNotNull(response.remoteProcessGroup)) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -708,7 +708,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye // update the birdseye
nf.Birdseye.refresh(); nf.Birdseye.refresh();
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -730,7 +730,7 @@ nf.CanvasToolbox = (function () {
y: pt.y y: pt.y
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.funnel)) { if (nf.Common.isDefinedAndNotNull(response.funnel)) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -743,7 +743,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye // update the birdseye
nf.Birdseye.refresh(); nf.Birdseye.refresh();
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -756,7 +756,7 @@ nf.CanvasToolbox = (function () {
type: 'GET', type: 'GET',
url: config.urls.templates, url: config.urls.templates,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var templates = response.templates; var templates = response.templates;
if (nf.Common.isDefinedAndNotNull(templates) && templates.length > 0) { if (nf.Common.isDefinedAndNotNull(templates) && templates.length > 0) {
var options = []; var options = [];
@ -809,7 +809,7 @@ nf.CanvasToolbox = (function () {
}); });
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -833,7 +833,7 @@ nf.CanvasToolbox = (function () {
originY: pt.y originY: pt.y
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -845,7 +845,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye // update the birdseye
nf.Birdseye.refresh(); nf.Birdseye.refresh();
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -869,7 +869,7 @@ nf.CanvasToolbox = (function () {
height: nf.Label.config.height height: nf.Label.config.height
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.label)) { if (nf.Common.isDefinedAndNotNull(response.label)) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -880,7 +880,7 @@ nf.CanvasToolbox = (function () {
// update the birdseye // update the birdseye
nf.Birdseye.refresh(); nf.Birdseye.refresh();
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
return { return {
@ -987,7 +987,7 @@ nf.CanvasToolbox = (function () {
type: 'GET', type: 'GET',
url: config.urls.processorTypes, url: config.urls.processorTypes,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var tagCloud = {}; var tagCloud = {};
var tags = []; var tags = [];
@ -1090,7 +1090,7 @@ nf.CanvasToolbox = (function () {
processorTypesGrid.render(); processorTypesGrid.render();
}); });
processorTypesData.syncGridSelection(processorTypesGrid, false); processorTypesData.syncGridSelection(processorTypesGrid, false);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
// define the function for filtering the list // define the function for filtering the list
$('#processor-type-filter').keyup(function () { $('#processor-type-filter').keyup(function () {
@ -1146,6 +1146,7 @@ nf.CanvasToolbox = (function () {
$('<div/>').attr('title', nf.Common.config.type.label).addClass('label-icon-disable').addClass('toolbox-icon').appendTo(toolbox); $('<div/>').attr('title', nf.Common.config.type.label).addClass('label-icon-disable').addClass('toolbox-icon').appendTo(toolbox);
} }
}, },
/** /**
* Prompts the user to enter the name for the group. * Prompts the user to enter the name for the group.
* *
@ -1162,9 +1163,9 @@ nf.CanvasToolbox = (function () {
$('#new-process-group-name').val(''); $('#new-process-group-name').val('');
// create the group and resolve the deferred accordingly // create the group and resolve the deferred accordingly
$.when(createGroup(groupName, pt)).then(function (response) { createGroup(groupName, pt).done(function (response) {
deferred.resolve(response.processGroup); deferred.resolve(response.processGroup);
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
}; };

View File

@ -91,6 +91,7 @@ nf.CanvasUtils = (function () {
} }
} }
}, },
/** /**
* Calculates the point on the specified bounding box that is closest to the * Calculates the point on the specified bounding box that is closest to the
* specified point. * specified point.
@ -151,6 +152,7 @@ nf.CanvasUtils = (function () {
}; };
} }
}, },
/** /**
* Shows the specified component in the specified group. * Shows the specified component in the specified group.
* *
@ -165,9 +167,9 @@ nf.CanvasUtils = (function () {
// load a different group if necessary // load a different group if necessary
if (groupId !== nf.Canvas.getGroupId()) { if (groupId !== nf.Canvas.getGroupId()) {
nf.Canvas.setGroupId(groupId); nf.Canvas.setGroupId(groupId);
nf.Canvas.reload().then(function () { nf.Canvas.reload().done(function () {
deferred.resolve(); deferred.resolve();
}, function () { }).fail(function () {
nf.Dialog.showOkDialog({ nf.Dialog.showOkDialog({
dialogContent: 'Unable to load the group for the specified component.', dialogContent: 'Unable to load the group for the specified component.',
overlayBackground: false overlayBackground: false
@ -194,6 +196,7 @@ nf.CanvasUtils = (function () {
}); });
} }
}, },
/** /**
* Gets the currently selected components and connections. * Gets the currently selected components and connections.
* *
@ -221,6 +224,7 @@ nf.CanvasUtils = (function () {
// calculate the difference between the center point and the position of this component and convert to screen space // calculate the difference between the center point and the position of this component and convert to screen space
nf.Canvas.View.translate([(center[0] - boundingBox.x) * scale, (center[1] - boundingBox.y) * scale]); nf.Canvas.View.translate([(center[0] - boundingBox.x) * scale, (center[1] - boundingBox.y) * scale]);
}, },
/** /**
* Position the component accordingly. * Position the component accordingly.
* *
@ -236,6 +240,7 @@ nf.CanvasUtils = (function () {
return 'translate(' + d.component.position.x + ', ' + d.component.position.y + ')'; return 'translate(' + d.component.position.x + ', ' + d.component.position.y + ')';
}); });
}, },
/** /**
* Applies single line ellipsis to the component in the specified selection if necessary. * Applies single line ellipsis to the component in the specified selection if necessary.
* *
@ -271,6 +276,7 @@ nf.CanvasUtils = (function () {
selection.text(text.substring(0, i) + String.fromCharCode(8230)); selection.text(text.substring(0, i) + String.fromCharCode(8230));
} }
}, },
/** /**
* Applies multiline ellipsis to the component in the specified seleciton. Text will * Applies multiline ellipsis to the component in the specified seleciton. Text will
* wrap for the specified number of lines. The last line will be ellipsis if necessary. * wrap for the specified number of lines. The last line will be ellipsis if necessary.
@ -343,6 +349,7 @@ nf.CanvasUtils = (function () {
word = words.pop(); word = words.pop();
} }
}, },
/** /**
* Updates the active thread count on the specified selection. * Updates the active thread count on the specified selection.
* *
@ -388,6 +395,7 @@ nf.CanvasUtils = (function () {
selection.selectAll('text.active-thread-count, rect.active-thread-count-background').style('display', 'none'); selection.selectAll('text.active-thread-count, rect.active-thread-count-background').style('display', 'none');
} }
}, },
/** /**
* Disables the default browser behavior of following image href when control clicking. * Disables the default browser behavior of following image href when control clicking.
* *
@ -400,6 +408,7 @@ nf.CanvasUtils = (function () {
} }
}); });
}, },
/** /**
* Handles component bulletins. * Handles component bulletins.
* *
@ -456,6 +465,7 @@ nf.CanvasUtils = (function () {
selection.selectAll('image.bulletin-icon').style('display', 'none'); selection.selectAll('image.bulletin-icon').style('display', 'none');
} }
}, },
/** /**
* Adds the specified tooltip to the specified target. * Adds the specified tooltip to the specified target.
* *
@ -473,6 +483,7 @@ nf.CanvasUtils = (function () {
tip.style('display', 'none'); tip.style('display', 'none');
}); });
}, },
/** /**
* Determines if the specified selection is a connection. * Determines if the specified selection is a connection.
* *
@ -481,6 +492,7 @@ nf.CanvasUtils = (function () {
isConnection: function (selection) { isConnection: function (selection) {
return selection.classed('connection'); return selection.classed('connection');
}, },
/** /**
* Determines if the specified selection is a remote process group. * Determines if the specified selection is a remote process group.
* *
@ -489,6 +501,7 @@ nf.CanvasUtils = (function () {
isRemoteProcessGroup: function (selection) { isRemoteProcessGroup: function (selection) {
return selection.classed('remote-process-group'); return selection.classed('remote-process-group');
}, },
/** /**
* Determines if the specified selection is a processor. * Determines if the specified selection is a processor.
* *
@ -497,6 +510,7 @@ nf.CanvasUtils = (function () {
isProcessor: function (selection) { isProcessor: function (selection) {
return selection.classed('processor'); return selection.classed('processor');
}, },
/** /**
* Determines if the specified selection is a label. * Determines if the specified selection is a label.
* *
@ -505,6 +519,7 @@ nf.CanvasUtils = (function () {
isLabel: function (selection) { isLabel: function (selection) {
return selection.classed('label'); return selection.classed('label');
}, },
/** /**
* Determines if the specified selection is an input port. * Determines if the specified selection is an input port.
* *
@ -513,6 +528,7 @@ nf.CanvasUtils = (function () {
isInputPort: function (selection) { isInputPort: function (selection) {
return selection.classed('input-port'); return selection.classed('input-port');
}, },
/** /**
* Determines if the specified selection is an output port. * Determines if the specified selection is an output port.
* *
@ -521,6 +537,7 @@ nf.CanvasUtils = (function () {
isOutputPort: function (selection) { isOutputPort: function (selection) {
return selection.classed('output-port'); return selection.classed('output-port');
}, },
/** /**
* Determines if the specified selection is a process group. * Determines if the specified selection is a process group.
* *
@ -529,6 +546,7 @@ nf.CanvasUtils = (function () {
isProcessGroup: function (selection) { isProcessGroup: function (selection) {
return selection.classed('process-group'); return selection.classed('process-group');
}, },
/** /**
* Determines if the specified selection is a funnel. * Determines if the specified selection is a funnel.
* *
@ -537,6 +555,7 @@ nf.CanvasUtils = (function () {
isFunnel: function (selection) { isFunnel: function (selection) {
return selection.classed('funnel'); return selection.classed('funnel');
}, },
/** /**
* Determines if the components in the specified selection are runnable. * Determines if the components in the specified selection are runnable.
* *
@ -558,6 +577,7 @@ nf.CanvasUtils = (function () {
return runnable; return runnable;
}, },
/** /**
* Determines if the component in the specified selection is runnable. * Determines if the component in the specified selection is runnable.
* *
@ -578,6 +598,7 @@ nf.CanvasUtils = (function () {
return runnable; return runnable;
}, },
/** /**
* Determines if the components in the specified selection are stoppable. * Determines if the components in the specified selection are stoppable.
* *
@ -599,6 +620,7 @@ nf.CanvasUtils = (function () {
return stoppable; return stoppable;
}, },
/** /**
* Determines if the component in the specified selection is runnable. * Determines if the component in the specified selection is runnable.
* *
@ -617,6 +639,7 @@ nf.CanvasUtils = (function () {
return stoppable; return stoppable;
}, },
/** /**
* Determines if the specified selection can all start transmitting. * Determines if the specified selection can all start transmitting.
* *
@ -637,6 +660,7 @@ nf.CanvasUtils = (function () {
}); });
return canStartTransmitting; return canStartTransmitting;
}, },
/** /**
* Determines if the specified selection supports starting transmission. * Determines if the specified selection supports starting transmission.
* *
@ -645,6 +669,7 @@ nf.CanvasUtils = (function () {
canStartTransmitting: function (selection) { canStartTransmitting: function (selection) {
return nf.CanvasUtils.isRemoteProcessGroup(selection); return nf.CanvasUtils.isRemoteProcessGroup(selection);
}, },
/** /**
* Determines if the specified selection can all stop transmitting. * Determines if the specified selection can all stop transmitting.
* *
@ -665,6 +690,7 @@ nf.CanvasUtils = (function () {
}); });
return canStopTransmitting; return canStopTransmitting;
}, },
/** /**
* Determines if the specified selection can stop transmission. * Determines if the specified selection can stop transmission.
* *
@ -673,6 +699,7 @@ nf.CanvasUtils = (function () {
canStopTransmitting: function (selection) { canStopTransmitting: function (selection) {
return nf.CanvasUtils.isRemoteProcessGroup(selection); return nf.CanvasUtils.isRemoteProcessGroup(selection);
}, },
/** /**
* Determines whether the components in the specified selection are deletable. * Determines whether the components in the specified selection are deletable.
* *
@ -686,6 +713,7 @@ nf.CanvasUtils = (function () {
return nf.CanvasUtils.supportsModification(selection); return nf.CanvasUtils.supportsModification(selection);
}, },
/** /**
* Determines whether the specified selection is in a state to support modification. * Determines whether the specified selection is in a state to support modification.
* *
@ -741,6 +769,7 @@ nf.CanvasUtils = (function () {
} }
return supportsModification; return supportsModification;
}, },
/** /**
* Determines the connectable type for the specified source selection. * Determines the connectable type for the specified source selection.
* *
@ -761,6 +790,7 @@ nf.CanvasUtils = (function () {
} }
return type; return type;
}, },
/** /**
* Determines the connectable type for the specified destination selection. * Determines the connectable type for the specified destination selection.
* *
@ -781,6 +811,7 @@ nf.CanvasUtils = (function () {
} }
return type; return type;
}, },
/** /**
* Determines if the graph is currently in a state to copy. * Determines if the graph is currently in a state to copy.
* *
@ -813,12 +844,14 @@ nf.CanvasUtils = (function () {
// ensure everything selected is copyable // ensure everything selected is copyable
return selection.size() === copyable.size(); return selection.size() === copyable.size();
}, },
/** /**
* Determines if something is currently pastable. * Determines if something is currently pastable.
*/ */
isPastable: function () { isPastable: function () {
return nf.Clipboard.isCopied(); return nf.Clipboard.isCopied();
}, },
/** /**
* Persists the current user view. * Persists the current user view.
*/ */
@ -836,6 +869,7 @@ nf.CanvasUtils = (function () {
// store the item // store the item
nf.Storage.setItem(name, item); nf.Storage.setItem(name, item);
}, },
/** /**
* Gets the name for this connection. * Gets the name for this connection.
* *
@ -849,6 +883,7 @@ nf.CanvasUtils = (function () {
} }
return ''; return '';
}, },
/** /**
* Returns the component id of the source of this processor. If the connection is attached * Returns the component id of the source of this processor. If the connection is attached
* to a port in a [sub|remote] group, the component id will be that of the group. Otherwise * to a port in a [sub|remote] group, the component id will be that of the group. Otherwise
@ -863,6 +898,7 @@ nf.CanvasUtils = (function () {
} }
return sourceId; return sourceId;
}, },
/** /**
* Returns the component id of the source of this processor. If the connection is attached * Returns the component id of the source of this processor. If the connection is attached
* to a port in a [sub|remote] group, the component id will be that of the group. Otherwise * to a port in a [sub|remote] group, the component id will be that of the group. Otherwise
@ -877,6 +913,7 @@ nf.CanvasUtils = (function () {
} }
return destinationId; return destinationId;
}, },
/** /**
* Attempts to restore a persisted view. Returns a flag that indicates if the * Attempts to restore a persisted view. Returns a flag that indicates if the
* view was restored. * view was restored.
@ -911,6 +948,7 @@ nf.CanvasUtils = (function () {
return viewRestored; return viewRestored;
}, },
/** /**
* Enters the specified group. * Enters the specified group.
* *
@ -944,6 +982,7 @@ nf.CanvasUtils = (function () {
}); });
}); });
}, },
/** /**
* Gets the origin of the bounding box for the specified selection. * Gets the origin of the bounding box for the specified selection.
* *
@ -966,6 +1005,7 @@ nf.CanvasUtils = (function () {
return origin; return origin;
}, },
/** /**
* Moves the specified components into the specified group. * Moves the specified components into the specified group.
* *
@ -979,11 +1019,11 @@ nf.CanvasUtils = (function () {
nf.CanvasUtils.eligibleForMove(components, group).done(function () { nf.CanvasUtils.eligibleForMove(components, group).done(function () {
// create a snippet for the specified components and link to the data flow // create a snippet for the specified components and link to the data flow
var snippetDetails = nf.Snippet.marshal(components, true); var snippetDetails = nf.Snippet.marshal(components, true);
nf.Snippet.create(snippetDetails).then(function (response) { nf.Snippet.create(snippetDetails).done(function (response) {
var snippet = response.snippet; var snippet = response.snippet;
// move the snippet into the target // move the snippet into the target
nf.Snippet.move(snippet.id, groupData.component.id).then(function () { nf.Snippet.move(snippet.id, groupData.component.id).done(function () {
var componentMap = d3.map(); var componentMap = d3.map();
// add the id to the type's array // add the id to the type's array
@ -1006,16 +1046,17 @@ nf.CanvasUtils = (function () {
// reload the target group // reload the target group
nf.ProcessGroup.reload(groupData.component); nf.ProcessGroup.reload(groupData.component);
}, nf.Common.handleAjaxError).always(function () { }).fail(nf.Common.handleAjaxError).always(function () {
// unable to acutally move the components so attempt to // unable to acutally move the components so attempt to
// unlink and remove just the snippet // unlink and remove just the snippet
nf.Snippet.unlink(snippet.id).done(function () { nf.Snippet.unlink(snippet.id).done(function () {
nf.Snippet.remove(snippet.id); nf.Snippet.remove(snippet.id);
}); });
}); });
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}); });
}, },
/** /**
* Removes any dangling edges. All components are retained as well as any * Removes any dangling edges. All components are retained as well as any
* edges whose source and destination are also retained. * edges whose source and destination are also retained.
@ -1053,6 +1094,7 @@ nf.CanvasUtils = (function () {
} }
}); });
}, },
/** /**
* Determines if the specified selection is disconnected from other nodes. * Determines if the specified selection is disconnected from other nodes.
* *
@ -1098,6 +1140,7 @@ nf.CanvasUtils = (function () {
return isDisconnected; return isDisconnected;
}, },
/** /**
* Ensures components are eligible to be moved. The new target can be optionally specified. * Ensures components are eligible to be moved. The new target can be optionally specified.
* *
@ -1138,7 +1181,7 @@ nf.CanvasUtils = (function () {
type: 'GET', type: 'GET',
url: config.urls.controller + '/process-groups/' + encodeURIComponent(nf.Canvas.getParentGroupId()) + '/connections', url: config.urls.controller + '/process-groups/' + encodeURIComponent(nf.Canvas.getParentGroupId()) + '/connections',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var connections = response.connections; var connections = response.connections;
var conflictingPorts = []; var conflictingPorts = [];
@ -1173,7 +1216,7 @@ nf.CanvasUtils = (function () {
portConnectionDeferred.resolve(); portConnectionDeferred.resolve();
} }
}, function () { }).fail(function () {
portConnectionDeferred.reject(); portConnectionDeferred.reject();
}); });
} }
@ -1193,7 +1236,7 @@ nf.CanvasUtils = (function () {
verbose: true verbose: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var processGroup = response.processGroup; var processGroup = response.processGroup;
var processGroupContents = processGroup.contents; var processGroupContents = processGroup.contents;
@ -1224,24 +1267,24 @@ nf.CanvasUtils = (function () {
} else { } else {
portNameDeferred.resolve(); portNameDeferred.resolve();
} }
}, function () { }).fail(function () {
portNameDeferred.reject(); portNameDeferred.reject();
}); });
}).promise(); }).promise();
}; };
// execute the checks in order // execute the checks in order
$.when(portConnectionCheck()).then(function () { portConnectionCheck().done(function () {
if (nf.Common.isDefinedAndNotNull(group)) { if (nf.Common.isDefinedAndNotNull(group)) {
$.when(portNameCheck()).then(function () { $.when(portNameCheck()).done(function () {
deferred.resolve(); deferred.resolve();
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
} else { } else {
deferred.resolve(); deferred.resolve();
} }
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
} else { } else {
@ -1249,6 +1292,7 @@ nf.CanvasUtils = (function () {
} }
}).promise(); }).promise();
}, },
/** /**
* Determines if the component in the specified selection is a valid connection source. * Determines if the component in the specified selection is a valid connection source.
* *
@ -1264,6 +1308,7 @@ nf.CanvasUtils = (function () {
nf.CanvasUtils.isRemoteProcessGroup(selection) || nf.CanvasUtils.isInputPort(selection) || nf.CanvasUtils.isRemoteProcessGroup(selection) || nf.CanvasUtils.isInputPort(selection) ||
nf.CanvasUtils.isFunnel(selection); nf.CanvasUtils.isFunnel(selection);
}, },
/** /**
* Determines if the component in the specified selection is a valid connection destination. * Determines if the component in the specified selection is a valid connection destination.
* *

View File

@ -170,7 +170,7 @@ nf.Canvas = (function () {
type: 'GET', type: 'GET',
url: config.urls.revision, url: config.urls.revision,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.revision)) { if (nf.Common.isDefinedAndNotNull(response.revision)) {
var revision = response.revision; var revision = response.revision;
var currentRevision = nf.Client.getRevision(); var currentRevision = nf.Client.getRevision();
@ -187,7 +187,7 @@ nf.Canvas = (function () {
} }
} }
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -534,7 +534,7 @@ nf.Canvas = (function () {
type: 'GET', type: 'GET',
url: config.urls.banners, url: config.urls.banners,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// ensure the banners response is specified // ensure the banners response is specified
if (nf.Common.isDefinedAndNotNull(response.banners)) { if (nf.Common.isDefinedAndNotNull(response.banners)) {
if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
@ -558,7 +558,7 @@ nf.Canvas = (function () {
// update the graph dimensions // update the graph dimensions
updateGraphSize(); updateGraphSize();
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -614,7 +614,7 @@ nf.Canvas = (function () {
type: 'GET', type: 'GET',
url: config.urls.status, url: config.urls.status,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// report the updated status // report the updated status
if (nf.Common.isDefinedAndNotNull(response.controllerStatus)) { if (nf.Common.isDefinedAndNotNull(response.controllerStatus)) {
var controllerStatus = response.controllerStatus; var controllerStatus = response.controllerStatus;
@ -712,7 +712,7 @@ nf.Canvas = (function () {
$('#has-pending-accounts').hide(); $('#has-pending-accounts').hide();
} }
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -729,7 +729,7 @@ nf.Canvas = (function () {
verbose: true verbose: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (processGroupResponse) { }).done(function (processGroupResponse) {
// set the revision // set the revision
nf.Client.setRevision(processGroupResponse.revision); nf.Client.setRevision(processGroupResponse.revision);
@ -759,7 +759,7 @@ nf.Canvas = (function () {
// update the toolbar // update the toolbar
nf.CanvasToolbar.refresh(); nf.CanvasToolbar.refresh();
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -777,7 +777,7 @@ nf.Canvas = (function () {
recursive: false recursive: false
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// report the updated stats // report the updated stats
if (nf.Common.isDefinedAndNotNull(response.processGroupStatus)) { if (nf.Common.isDefinedAndNotNull(response.processGroupStatus)) {
var processGroupStatus = response.processGroupStatus; var processGroupStatus = response.processGroupStatus;
@ -789,7 +789,7 @@ nf.Canvas = (function () {
$('#stats-last-refreshed').text(processGroupStatus.statsLastRefreshed); $('#stats-last-refreshed').text(processGroupStatus.statsLastRefreshed);
} }
deferred.resolve(); deferred.resolve();
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
// if clustered, a 404 likely means the flow status at the ncm is stale // if clustered, a 404 likely means the flow status at the ncm is stale
if (!nf.Canvas.isClustered() || xhr.status !== 404) { if (!nf.Canvas.isClustered() || xhr.status !== 404) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
@ -857,9 +857,9 @@ nf.Canvas = (function () {
} }
// don't load the status until the graph is loaded // don't load the status until the graph is loaded
reloadStatus(nf.Canvas.getGroupId()).then(function () { reloadStatus(nf.Canvas.getGroupId()).done(function () {
deferred.resolve(processGroupResult); deferred.resolve(processGroupResult);
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
}); });
@ -871,9 +871,9 @@ nf.Canvas = (function () {
reloadStatus: function () { reloadStatus: function () {
return $.Deferred(function (deferred) { return $.Deferred(function (deferred) {
// refresh the status and check any bulletins // refresh the status and check any bulletins
$.when(reloadStatus(nf.Canvas.getGroupId()), reloadFlowStatus()).then(function () { $.when(reloadStatus(nf.Canvas.getGroupId()), reloadFlowStatus()).done(function () {
deferred.resolve(); deferred.resolve();
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
}).promise(); }).promise();
@ -900,13 +900,13 @@ nf.Canvas = (function () {
url: config.urls.cluster url: config.urls.cluster
}).done(function (response, status, xhr) { }).done(function (response, status, xhr) {
clustered = true; clustered = true;
deferred.resolveWith(xhr, [response, status, xhr]); deferred.resolve(response, status, xhr);
}).fail(function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 404) { if (xhr.status === 404) {
clustered = false; clustered = false;
deferred.resolveWith(xhr, ['', 'success', xhr]); deferred.resolve('', 'success', xhr);
} else { } else {
deferred.rejectWith(xhr, [xhr, status, error]); deferred.reject(xhr, status, error);
} }
}); });
}).promise(); }).promise();
@ -919,7 +919,7 @@ nf.Canvas = (function () {
}); });
// ensure the authorities and config request is processed first // ensure the authorities and config request is processed first
$.when(authoritiesXhr, configXhr).then(function (authoritiesResult, configResult) { $.when(authoritiesXhr, configXhr).done(function (authoritiesResult, configResult) {
var authoritiesResponse = authoritiesResult[0]; var authoritiesResponse = authoritiesResult[0];
var configResponse = configResult[0]; var configResponse = configResult[0];
@ -934,7 +934,7 @@ nf.Canvas = (function () {
var configDetails = configResponse.config; var configDetails = configResponse.config;
// when both request complete, load the application // when both request complete, load the application
isClusteredRequest.then(function () { isClusteredRequest.done(function () {
// get the auto refresh interval // get the auto refresh interval
var autoRefreshIntervalSeconds = parseInt(configDetails.autoRefreshIntervalSeconds, 10); var autoRefreshIntervalSeconds = parseInt(configDetails.autoRefreshIntervalSeconds, 10);
@ -942,7 +942,7 @@ nf.Canvas = (function () {
secureSiteToSite = configDetails.siteToSiteSecure; secureSiteToSite = configDetails.siteToSiteSecure;
// load d3 // load d3
loadD3().then(function () { loadD3().done(function () {
nf.Storage.init(); nf.Storage.init();
// initialize the application // initialize the application
@ -982,7 +982,7 @@ nf.Canvas = (function () {
nf.ConnectionDetails.init(); nf.ConnectionDetails.init();
nf.RemoteProcessGroupDetails.init(); nf.RemoteProcessGroupDetails.init();
nf.GoTo.init(); nf.GoTo.init();
nf.Graph.init().then(function () { nf.Graph.init().done(function () {
// determine the split between the polling // determine the split between the polling
var pollingSplit = autoRefreshIntervalSeconds / 2; var pollingSplit = autoRefreshIntervalSeconds / 2;
@ -994,10 +994,10 @@ nf.Canvas = (function () {
// hide the splash screen // hide the splash screen
nf.Canvas.hideSplash(); nf.Canvas.hideSplash();
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Defines the gradient colors used to render processors. * Defines the gradient colors used to render processors.
@ -1214,6 +1214,7 @@ nf.Canvas = (function () {
// add the behavior to the canvas and disable dbl click zoom // add the behavior to the canvas and disable dbl click zoom
svg.call(behavior).on('dblclick.zoom', null); svg.call(behavior).on('dblclick.zoom', null);
}, },
/** /**
* Whether or not a component should be rendered based solely on the current scale. * Whether or not a component should be rendered based solely on the current scale.
* *
@ -1222,6 +1223,7 @@ nf.Canvas = (function () {
shouldRenderPerScale: function () { shouldRenderPerScale: function () {
return nf.Canvas.View.scale() >= MIN_SCALE_TO_RENDER; return nf.Canvas.View.scale() >= MIN_SCALE_TO_RENDER;
}, },
/** /**
* Updates component visibility based on the current translation/scale. * Updates component visibility based on the current translation/scale.
*/ */
@ -1229,6 +1231,7 @@ nf.Canvas = (function () {
updateComponentVisibility(); updateComponentVisibility();
nf.Graph.pan(); nf.Graph.pan();
}, },
/** /**
* Sets/gets the current translation. * Sets/gets the current translation.
* *
@ -1241,6 +1244,7 @@ nf.Canvas = (function () {
behavior.translate(translate); behavior.translate(translate);
} }
}, },
/** /**
* Sets/gets the current scale. * Sets/gets the current scale.
* *
@ -1253,6 +1257,7 @@ nf.Canvas = (function () {
behavior.scale(scale); behavior.scale(scale);
} }
}, },
/** /**
* Zooms in a single zoom increment. * Zooms in a single zoom increment.
*/ */
@ -1277,6 +1282,7 @@ nf.Canvas = (function () {
height: 1 height: 1
}); });
}, },
/** /**
* Zooms out a single zoom increment. * Zooms out a single zoom increment.
*/ */
@ -1301,6 +1307,7 @@ nf.Canvas = (function () {
height: 1 height: 1
}); });
}, },
/** /**
* Zooms to fit the entire graph on the canvas. * Zooms to fit the entire graph on the canvas.
*/ */
@ -1347,6 +1354,7 @@ nf.Canvas = (function () {
height: canvasHeight / newScale height: canvasHeight / newScale
}); });
}, },
/** /**
* Zooms to the actual size (1 to 1). * Zooms to the actual size (1 to 1).
*/ */
@ -1395,6 +1403,7 @@ nf.Canvas = (function () {
// center as appropriate // center as appropriate
nf.CanvasUtils.centerBoundingBox(box); nf.CanvasUtils.centerBoundingBox(box);
}, },
/** /**
* Refreshes the view based on the configured translation and scale. * Refreshes the view based on the configured translation and scale.
* *

View File

@ -34,6 +34,7 @@ nf.Clipboard = (function () {
addListener: function (listener, funct) { addListener: function (listener, funct) {
listeners[listener] = funct; listeners[listener] = funct;
}, },
/** /**
* Remove the specified listener. * Remove the specified listener.
* *
@ -44,6 +45,7 @@ nf.Clipboard = (function () {
delete listeners[listener]; delete listeners[listener];
} }
}, },
/** /**
* Copy the specified data. * Copy the specified data.
* *
@ -57,12 +59,14 @@ nf.Clipboard = (function () {
listeners[listener].call(listener, COPY, data); listeners[listener].call(listener, COPY, data);
} }
}, },
/** /**
* Checks to see if any data has been copied. * Checks to see if any data has been copied.
*/ */
isCopied: function () { isCopied: function () {
return nf.Common.isDefinedAndNotNull(data); return nf.Common.isDefinedAndNotNull(data);
}, },
/** /**
* Gets the most recent data thats copied. This operation * Gets the most recent data thats copied. This operation
* will remove the corresponding data from the clipboard. * will remove the corresponding data from the clipboard.

View File

@ -157,6 +157,7 @@ nf.Connectable = (function () {
d3.select(this).remove(); d3.select(this).remove();
}); });
}, },
activate: function (components) { activate: function (components) {
components components
.on('mouseenter.connectable', function (d) { .on('mouseenter.connectable', function (d) {

View File

@ -250,7 +250,7 @@ nf.ConnectionConfiguration = (function () {
verbose: true verbose: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var processGroup = response.processGroup; var processGroup = response.processGroup;
var processGroupContents = processGroup.contents; var processGroupContents = processGroup.contents;
@ -301,7 +301,7 @@ nf.ConnectionConfiguration = (function () {
deferred.reject(); deferred.reject();
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
// handle the error // handle the error
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
@ -327,7 +327,7 @@ nf.ConnectionConfiguration = (function () {
verbose: true verbose: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var remoteProcessGroup = response.remoteProcessGroup; var remoteProcessGroup = response.remoteProcessGroup;
var remoteProcessGroupContents = remoteProcessGroup.contents; var remoteProcessGroupContents = remoteProcessGroup.contents;
@ -379,7 +379,7 @@ nf.ConnectionConfiguration = (function () {
deferred.reject(); deferred.reject();
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
// handle the error // handle the error
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
@ -475,7 +475,7 @@ nf.ConnectionConfiguration = (function () {
verbose: true verbose: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var processGroup = response.processGroup; var processGroup = response.processGroup;
var processGroupContents = processGroup.contents; var processGroupContents = processGroup.contents;
@ -526,7 +526,7 @@ nf.ConnectionConfiguration = (function () {
deferred.reject(); deferred.reject();
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
// handle the error // handle the error
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
@ -551,7 +551,7 @@ nf.ConnectionConfiguration = (function () {
verbose: true verbose: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var remoteProcessGroup = response.remoteProcessGroup; var remoteProcessGroup = response.remoteProcessGroup;
var remoteProcessGroupContents = remoteProcessGroup.contents; var remoteProcessGroupContents = remoteProcessGroup.contents;
@ -603,7 +603,7 @@ nf.ConnectionConfiguration = (function () {
deferred.reject(); deferred.reject();
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
// handle the error // handle the error
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
@ -848,7 +848,7 @@ nf.ConnectionConfiguration = (function () {
destinationType: destinationType destinationType: destinationType
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -876,7 +876,7 @@ nf.ConnectionConfiguration = (function () {
// update the birdseye // update the birdseye
nf.Birdseye.refresh(); nf.Birdseye.refresh();
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
// handle the error // handle the error
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
}); });
@ -935,7 +935,7 @@ nf.ConnectionConfiguration = (function () {
destinationGroupId: destinationGroupId destinationGroupId: destinationGroupId
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.connection)) { if (nf.Common.isDefinedAndNotNull(response.connection)) {
var connection = response.connection; var connection = response.connection;
@ -959,7 +959,7 @@ nf.ConnectionConfiguration = (function () {
nf.RemoteProcessGroup.reload(destinationData.component); nf.RemoteProcessGroup.reload(destinationData.component);
} }
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) { if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({ nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText), dialogContent: nf.Common.escapeHtml(xhr.responseText),
@ -1128,7 +1128,7 @@ nf.ConnectionConfiguration = (function () {
type: 'GET', type: 'GET',
url: config.urls.prioritizers, url: config.urls.prioritizers,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// create an element for each available prioritizer // create an element for each available prioritizer
$.each(response.prioritizerTypes, function (i, documentedType) { $.each(response.prioritizerTypes, function (i, documentedType) {
nf.ConnectionConfiguration.addAvailablePrioritizer('#prioritizer-available', documentedType); nf.ConnectionConfiguration.addAvailablePrioritizer('#prioritizer-available', documentedType);
@ -1142,8 +1142,9 @@ nf.ConnectionConfiguration = (function () {
opacity: 0.6 opacity: 0.6
}); });
$('#prioritizer-available, #prioritizer-selected').disableSelection(); $('#prioritizer-available, #prioritizer-selected').disableSelection();
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Adds the specified prioritizer to the specified container. * Adds the specified prioritizer to the specified container.
* *
@ -1165,6 +1166,7 @@ nf.ConnectionConfiguration = (function () {
})); }));
} }
}, },
/** /**
* Shows the dialog for creating a new connection. * Shows the dialog for creating a new connection.
* *
@ -1209,6 +1211,7 @@ nf.ConnectionConfiguration = (function () {
removeTempEdge(); removeTempEdge();
}); });
}, },
/** /**
* Shows the configuration for the specified connection. If a destination is * Shows the configuration for the specified connection. If a destination is
* specified it will be considered a new destination. * specified it will be considered a new destination.
@ -1232,7 +1235,7 @@ nf.ConnectionConfiguration = (function () {
} }
// initialize the connection dialog // initialize the connection dialog
$.when(initializeSourceEditConnectionDialog(source), initializeDestinationEditConnectionDialog(destination)).then(function () { $.when(initializeSourceEditConnectionDialog(source), initializeDestinationEditConnectionDialog(destination)).done(function () {
var availableRelationships = connection.availableRelationships; var availableRelationships = connection.availableRelationships;
var selectedRelationships = connection.selectedRelationships; var selectedRelationships = connection.selectedRelationships;
@ -1311,9 +1314,9 @@ nf.ConnectionConfiguration = (function () {
if (nf.CanvasUtils.isProcessor(source)) { if (nf.CanvasUtils.isProcessor(source)) {
if (selectedRelationships.length > 0) { if (selectedRelationships.length > 0) {
// if there are relationships selected update // if there are relationships selected update
updateConnection(selectedRelationships).then(function () { updateConnection(selectedRelationships).done(function () {
deferred.resolve(); deferred.resolve();
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
} else { } else {
@ -1328,9 +1331,9 @@ nf.ConnectionConfiguration = (function () {
} }
} else { } else {
// there are no relationships, but the source wasn't a processor, so update anyway // there are no relationships, but the source wasn't a processor, so update anyway
updateConnection(undefined).then(function () { updateConnection(undefined).done(function () {
deferred.resolve(); deferred.resolve();
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
} }
@ -1366,7 +1369,7 @@ nf.ConnectionConfiguration = (function () {
if (relationshipNames.is(':visible') && relationshipNames.get(0).scrollHeight > relationshipNames.innerHeight()) { if (relationshipNames.is(':visible') && relationshipNames.get(0).scrollHeight > relationshipNames.innerHeight()) {
relationshipNames.css('border-width', '1px'); relationshipNames.css('border-width', '1px');
} }
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
}).promise(); }).promise();

View File

@ -945,13 +945,13 @@ nf.Connection = (function () {
data: JSON.stringify(entity), data: JSON.stringify(entity),
dataType: 'json', dataType: 'json',
contentType: 'application/json' contentType: 'application/json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
// request was successful, update the entry // request was successful, update the entry
nf.Connection.set(response.connection); nf.Connection.set(response.connection);
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) { if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({ nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText), dialogContent: nf.Common.escapeHtml(xhr.responseText),
@ -973,6 +973,7 @@ nf.Connection = (function () {
selfLoopXOffset: (dimensions.width / 2) + 5, selfLoopXOffset: (dimensions.width / 2) + 5,
selfLoopYOffset: 25 selfLoopYOffset: 25
}, },
init: function () { init: function () {
connectionMap = d3.map(); connectionMap = d3.map();
@ -1122,7 +1123,7 @@ nf.Connection = (function () {
url: connectionData.component.uri, url: connectionData.component.uri,
data: updatedConnectionData, data: updatedConnectionData,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var connectionData = response.connection; var connectionData = response.connection;
// update the revision // update the revision
@ -1130,7 +1131,7 @@ nf.Connection = (function () {
// refresh to update the label // refresh to update the label
nf.Connection.set(connectionData); nf.Connection.set(connectionData);
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) { if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({ nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText), dialogContent: nf.Common.escapeHtml(xhr.responseText),
@ -1268,6 +1269,7 @@ nf.Connection = (function () {
d3.event.sourceEvent.stopPropagation(); d3.event.sourceEvent.stopPropagation();
}); });
}, },
/** /**
* Populates the graph with the specified connections. * Populates the graph with the specified connections.
* *
@ -1304,12 +1306,14 @@ nf.Connection = (function () {
// apply the selection and handle all new connection // apply the selection and handle all new connection
select().enter().call(renderConnections, selectAll); select().enter().call(renderConnections, selectAll);
}, },
/** /**
* Reorders the connections based on their current z index. * Reorders the connections based on their current z index.
*/ */
reorder: function () { reorder: function () {
d3.selectAll('g.connection').call(sort); d3.selectAll('g.connection').call(sort);
}, },
/** /**
* Sets the value of the specified connection. * Sets the value of the specified connection.
* *
@ -1343,6 +1347,7 @@ nf.Connection = (function () {
set(connection); set(connection);
} }
}, },
/** /**
* Sets the connection status using the specified status. * Sets the connection status using the specified status.
* *
@ -1364,6 +1369,7 @@ nf.Connection = (function () {
// update the visible connections // update the visible connections
d3.selectAll('g.connection.visible').call(updateConnectionStatus); d3.selectAll('g.connection.visible').call(updateConnectionStatus);
}, },
/** /**
* Refreshes the connection in the UI. * Refreshes the connection in the UI.
* *
@ -1376,12 +1382,14 @@ nf.Connection = (function () {
d3.selectAll('g.connection').call(updateConnections, true, true); d3.selectAll('g.connection').call(updateConnections, true, true);
} }
}, },
/** /**
* Refreshes the components necessary after a pan event. * Refreshes the components necessary after a pan event.
*/ */
pan: function () { pan: function () {
d3.selectAll('g.connection.entering, g.connection.leaving').call(updateConnections, false, true); d3.selectAll('g.connection.entering, g.connection.leaving').call(updateConnections, false, true);
}, },
/** /**
* Removes the specified connection. * Removes the specified connection.
* *
@ -1399,12 +1407,14 @@ nf.Connection = (function () {
// apply the selection and handle all removed connections // apply the selection and handle all removed connections
select().exit().call(removeConnections); select().exit().call(removeConnections);
}, },
/** /**
* Removes all processors. * Removes all processors.
*/ */
removeAll: function () { removeAll: function () {
nf.Connection.remove(connectionMap.keys()); nf.Connection.remove(connectionMap.keys());
}, },
/** /**
* Reloads the connection state from the server and refreshes the UI. * Reloads the connection state from the server and refreshes the UI.
* *
@ -1421,6 +1431,7 @@ nf.Connection = (function () {
}); });
} }
}, },
/** /**
* Gets the connection that have a source or destination component with the specified id. * Gets the connection that have a source or destination component with the specified id.
* *
@ -1439,6 +1450,7 @@ nf.Connection = (function () {
}); });
return connections; return connections;
}, },
/** /**
* If the connection id is specified it is returned. If no connection id * If the connection id is specified it is returned. If no connection id
* specified, all connections are returned. * specified, all connections are returned.

View File

@ -417,12 +417,14 @@ nf.ContextMenu = (function () {
'y': position[1] 'y': position[1]
}); });
}, },
/** /**
* Hides the context menu. * Hides the context menu.
*/ */
hide: function () { hide: function () {
$('#context-menu').hide(); $('#context-menu').hide();
}, },
/** /**
* Activates the context menu for the components in the specified selection. * Activates the context menu for the components in the specified selection.
* *

View File

@ -57,7 +57,7 @@ nf.Draggable = (function () {
y: newPosition.y y: newPosition.y
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -69,7 +69,7 @@ nf.Draggable = (function () {
type: d.type, type: d.type,
id: d.component.id id: d.component.id
}); });
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) { if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({ nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText), dialogContent: nf.Common.escapeHtml(xhr.responseText),
@ -114,7 +114,7 @@ nf.Draggable = (function () {
data: JSON.stringify(entity), data: JSON.stringify(entity),
dataType: 'json', dataType: 'json',
contentType: 'application/json' contentType: 'application/json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -132,7 +132,7 @@ nf.Draggable = (function () {
type: d.type, type: d.type,
id: d.component.id id: d.component.id
}); });
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) { if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({ nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText), dialogContent: nf.Common.escapeHtml(xhr.responseText),
@ -300,6 +300,7 @@ nf.Draggable = (function () {
dragSelection.remove(); dragSelection.remove();
}); });
}, },
/** /**
* Activates the drag behavior for the components in the specified selection. * Activates the drag behavior for the components in the specified selection.
* *

View File

@ -135,6 +135,7 @@ nf.Funnel = (function () {
'class': 'funnels' 'class': 'funnels'
}); });
}, },
/** /**
* Populates the graph with the specified funnels. * Populates the graph with the specified funnels.
* *
@ -165,6 +166,7 @@ nf.Funnel = (function () {
// apply the selection and handle all new processors // apply the selection and handle all new processors
select().enter().call(renderFunnels, selectAll); select().enter().call(renderFunnels, selectAll);
}, },
/** /**
* If the funnel id is specified it is returned. If no funnel id * If the funnel id is specified it is returned. If no funnel id
* specified, all funnels are returned. * specified, all funnels are returned.
@ -178,6 +180,7 @@ nf.Funnel = (function () {
return funnelMap.get(id); return funnelMap.get(id);
} }
}, },
/** /**
* If the funnel id is specified it is refresh according to the current * If the funnel id is specified it is refresh according to the current
* state. If not funnel id is specified, all funnels are refreshed. * state. If not funnel id is specified, all funnels are refreshed.
@ -191,6 +194,7 @@ nf.Funnel = (function () {
d3.selectAll('g.funnel').call(updateFunnels); d3.selectAll('g.funnel').call(updateFunnels);
} }
}, },
/** /**
* Reloads the funnel state from the server and refreshes the UI. * Reloads the funnel state from the server and refreshes the UI.
* If the funnel is currently unknown, this function just returns. * If the funnel is currently unknown, this function just returns.
@ -208,6 +212,7 @@ nf.Funnel = (function () {
}); });
} }
}, },
/** /**
* Positions the component. * Positions the component.
* *
@ -216,6 +221,7 @@ nf.Funnel = (function () {
position: function (id) { position: function (id) {
d3.select('#id-' + id).call(nf.CanvasUtils.position); d3.select('#id-' + id).call(nf.CanvasUtils.position);
}, },
/** /**
* Sets the specified funnel(s). If the is an array, it * Sets the specified funnel(s). If the is an array, it
* will set each funnel. If it is not an array, it will * will set each funnel. If it is not an array, it will
@ -244,6 +250,7 @@ nf.Funnel = (function () {
set(funnels); set(funnels);
} }
}, },
/** /**
* Removes the specified funnel. * Removes the specified funnel.
* *
@ -261,6 +268,7 @@ nf.Funnel = (function () {
// apply the selection and handle all removed funnels // apply the selection and handle all removed funnels
select().exit().call(removeFunnels); select().exit().call(removeFunnels);
}, },
/** /**
* Removes all processors. * Removes all processors.
*/ */

View File

@ -336,6 +336,7 @@ nf.GoTo = (function () {
} }
}); });
}, },
/** /**
* Shows components downstream from a processor. * Shows components downstream from a processor.
* *
@ -348,7 +349,7 @@ nf.GoTo = (function () {
type: 'GET', type: 'GET',
url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections', url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var connections = response.connections; var connections = response.connections;
// populate the downstream dialog // populate the downstream dialog
@ -372,8 +373,9 @@ nf.GoTo = (function () {
// show the downstream dialog // show the downstream dialog
$('#connections-dialog').modal('setHeaderText', 'Downstream Connections').modal('show'); $('#connections-dialog').modal('setHeaderText', 'Downstream Connections').modal('show');
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows components upstream from a processor. * Shows components upstream from a processor.
* *
@ -386,7 +388,7 @@ nf.GoTo = (function () {
type: 'GET', type: 'GET',
url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections', url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var connections = response.connections; var connections = response.connections;
// populate the upstream dialog // populate the upstream dialog
@ -410,8 +412,9 @@ nf.GoTo = (function () {
// show the upstream dialog // show the upstream dialog
$('#connections-dialog').modal('setHeaderText', 'Upstream Connections').modal('show'); $('#connections-dialog').modal('setHeaderText', 'Upstream Connections').modal('show');
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows components downstream from a process group or a remote process group. * Shows components downstream from a process group or a remote process group.
* *
@ -424,7 +427,7 @@ nf.GoTo = (function () {
type: 'GET', type: 'GET',
url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections', url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var connections = response.connections; var connections = response.connections;
// populate the downstream dialog // populate the downstream dialog
@ -448,8 +451,9 @@ nf.GoTo = (function () {
// show the downstream dialog // show the downstream dialog
$('#connections-dialog').modal('setHeaderText', 'Downstream Connections').modal('show'); $('#connections-dialog').modal('setHeaderText', 'Downstream Connections').modal('show');
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows components upstream from a process group or a remote process group. * Shows components upstream from a process group or a remote process group.
* *
@ -462,7 +466,7 @@ nf.GoTo = (function () {
type: 'GET', type: 'GET',
url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections', url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var connections = response.connections; var connections = response.connections;
// populate the upstream dialog // populate the upstream dialog
@ -486,8 +490,9 @@ nf.GoTo = (function () {
// show the dialog // show the dialog
$('#connections-dialog').modal('setHeaderText', 'Downstream Connections').modal('show'); $('#connections-dialog').modal('setHeaderText', 'Downstream Connections').modal('show');
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows components downstream from an input port. * Shows components downstream from an input port.
* *
@ -500,7 +505,7 @@ nf.GoTo = (function () {
type: 'GET', type: 'GET',
url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections', url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var connections = response.connections; var connections = response.connections;
// populate the downstream dialog // populate the downstream dialog
@ -524,8 +529,9 @@ nf.GoTo = (function () {
// show the downstream dialog // show the downstream dialog
$('#connections-dialog').modal('setHeaderText', 'Downstream Connections').modal('show'); $('#connections-dialog').modal('setHeaderText', 'Downstream Connections').modal('show');
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows components upstream from an input port. * Shows components upstream from an input port.
* *
@ -538,7 +544,7 @@ nf.GoTo = (function () {
type: 'GET', type: 'GET',
url: config.urls.controller + '/process-groups/' + encodeURIComponent(nf.Canvas.getParentGroupId()) + '/connections', url: config.urls.controller + '/process-groups/' + encodeURIComponent(nf.Canvas.getParentGroupId()) + '/connections',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var connections = response.connections; var connections = response.connections;
// populate the upstream dialog // populate the upstream dialog
@ -565,8 +571,9 @@ nf.GoTo = (function () {
// show the upstream dialog // show the upstream dialog
$('#connections-dialog').modal('setHeaderText', 'Upstream Connections').modal('show'); $('#connections-dialog').modal('setHeaderText', 'Upstream Connections').modal('show');
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows components downstream from an output port. * Shows components downstream from an output port.
* *
@ -579,7 +586,7 @@ nf.GoTo = (function () {
type: 'GET', type: 'GET',
url: config.urls.controller + '/process-groups/' + encodeURIComponent(nf.Canvas.getParentGroupId()) + '/connections', url: config.urls.controller + '/process-groups/' + encodeURIComponent(nf.Canvas.getParentGroupId()) + '/connections',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var connections = response.connections; var connections = response.connections;
// populate the downstream dialog // populate the downstream dialog
@ -606,8 +613,9 @@ nf.GoTo = (function () {
// show the downstream dialog // show the downstream dialog
$('#connections-dialog').modal('setHeaderText', 'Downstream Connections').modal('show'); $('#connections-dialog').modal('setHeaderText', 'Downstream Connections').modal('show');
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows components upstream from an output port. * Shows components upstream from an output port.
* *
@ -620,7 +628,7 @@ nf.GoTo = (function () {
type: 'GET', type: 'GET',
url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections', url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var connections = response.connections; var connections = response.connections;
// populate the upstream dialog // populate the upstream dialog
@ -644,8 +652,9 @@ nf.GoTo = (function () {
// show the upstream dialog // show the upstream dialog
$('#connections-dialog').modal('setHeaderText', 'Upstream Connections').modal('show'); $('#connections-dialog').modal('setHeaderText', 'Upstream Connections').modal('show');
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows components downstream from a funnel. * Shows components downstream from a funnel.
* *
@ -658,7 +667,7 @@ nf.GoTo = (function () {
type: 'GET', type: 'GET',
url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections', url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var connections = response.connections; var connections = response.connections;
// populate the downstream dialog // populate the downstream dialog
@ -679,8 +688,9 @@ nf.GoTo = (function () {
// show the downstream dialog // show the downstream dialog
$('#connections-dialog').modal('setHeaderText', 'Downstream Connections').modal('show'); $('#connections-dialog').modal('setHeaderText', 'Downstream Connections').modal('show');
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows components upstream from a funnel. * Shows components upstream from a funnel.
* *
@ -693,7 +703,7 @@ nf.GoTo = (function () {
type: 'GET', type: 'GET',
url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections', url: config.urls.controller + '/process-groups/' + encodeURIComponent(selectionData.component.parentGroupId) + '/connections',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var connections = response.connections; var connections = response.connections;
// populate the upstream dialog // populate the upstream dialog
@ -714,7 +724,7 @@ nf.GoTo = (function () {
// show the upstream dialog // show the upstream dialog
$('#connections-dialog').modal('setHeaderText', 'Upstream Connections').modal('show'); $('#connections-dialog').modal('setHeaderText', 'Upstream Connections').modal('show');
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
}; };
}()); }());

View File

@ -55,6 +55,7 @@ nf.Graph = (function () {
// load the graph // load the graph
return nf.CanvasUtils.enterGroup(nf.Canvas.getGroupId()); return nf.CanvasUtils.enterGroup(nf.Canvas.getGroupId());
}, },
/** /**
* Populates the graph with the resources defined in the response. * Populates the graph with the resources defined in the response.
* *
@ -96,6 +97,7 @@ nf.Graph = (function () {
nf.Connection.add(processGroupContents.connections, selectAll); nf.Connection.add(processGroupContents.connections, selectAll);
} }
}, },
/** /**
* Gets the components currently on the canvas. * Gets the components currently on the canvas.
*/ */
@ -110,6 +112,7 @@ nf.Graph = (function () {
connections: nf.Connection.get() connections: nf.Connection.get()
}; };
}, },
/** /**
* Sets the components contained within the specified process group. * Sets the components contained within the specified process group.
* *
@ -142,6 +145,7 @@ nf.Graph = (function () {
nf.Connection.set(processGroupContents.connections); nf.Connection.set(processGroupContents.connections);
} }
}, },
/** /**
* Populates the status for the components specified. This will update the content * Populates the status for the components specified. This will update the content
* of the existing components on the graph and will not cause them to be repainted. * of the existing components on the graph and will not cause them to be repainted.
@ -160,6 +164,7 @@ nf.Graph = (function () {
nf.Processor.setStatus(processGroupStatus.processorStatus); nf.Processor.setStatus(processGroupStatus.processorStatus);
nf.Connection.setStatus(processGroupStatus.connectionStatus); nf.Connection.setStatus(processGroupStatus.connectionStatus);
}, },
/** /**
* Clears all the components currently on the canvas. This function does not automatically refresh. * Clears all the components currently on the canvas. This function does not automatically refresh.
*/ */
@ -173,6 +178,7 @@ nf.Graph = (function () {
nf.Processor.removeAll(); nf.Processor.removeAll();
nf.Connection.removeAll(); nf.Connection.removeAll();
}, },
/** /**
* Refreshes all components currently on the canvas. * Refreshes all components currently on the canvas.
*/ */

View File

@ -41,13 +41,13 @@ nf.LabelConfiguration = (function () {
'style[font-size]': fontSize.value 'style[font-size]': fontSize.value
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
// get the label out of the response // get the label out of the response
nf.Label.set(response.label); nf.Label.set(response.label);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
// reset and hide the dialog // reset and hide the dialog
@ -92,6 +92,7 @@ nf.LabelConfiguration = (function () {
} }
}); });
}, },
/** /**
* Shows the configuration for the specified label. * Shows the configuration for the specified label.
* *

View File

@ -283,6 +283,7 @@ nf.Label = (function () {
width: dimensions.width, width: dimensions.width,
height: dimensions.height height: dimensions.height
}, },
/** /**
* Initializes of the Processor handler. * Initializes of the Processor handler.
*/ */
@ -342,13 +343,13 @@ nf.Label = (function () {
'height': labelData.dimensions.height 'height': labelData.dimensions.height
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
// request was successful, update the entry // request was successful, update the entry
nf.Label.set(response.label); nf.Label.set(response.label);
}, function () { }).fail(function () {
// determine the previous width // determine the previous width
var width = dimensions.width; var width = dimensions.width;
if (nf.Common.isDefinedAndNotNull(labelData.component.width)) { if (nf.Common.isDefinedAndNotNull(labelData.component.width)) {
@ -376,6 +377,7 @@ nf.Label = (function () {
d3.event.sourceEvent.stopPropagation(); d3.event.sourceEvent.stopPropagation();
}); });
}, },
/** /**
* Populates the graph with the specified labels. * Populates the graph with the specified labels.
* *
@ -421,6 +423,7 @@ nf.Label = (function () {
// apply the selection and handle all new labels // apply the selection and handle all new labels
select().enter().call(renderLabels, selectAll); select().enter().call(renderLabels, selectAll);
}, },
/** /**
* If the label id is specified it is returned. If no label id * If the label id is specified it is returned. If no label id
* specified, all labels are returned. * specified, all labels are returned.
@ -434,6 +437,7 @@ nf.Label = (function () {
return labelMap.get(id); return labelMap.get(id);
} }
}, },
/** /**
* If the label id is specified it is refresh according to the current * If the label id is specified it is refresh according to the current
* state. If not label id is specified, all labels are refreshed. * state. If not label id is specified, all labels are refreshed.
@ -447,6 +451,7 @@ nf.Label = (function () {
d3.selectAll('g.label').call(updateLabels); d3.selectAll('g.label').call(updateLabels);
} }
}, },
/** /**
* Reloads the label state from the server and refreshes the UI. * Reloads the label state from the server and refreshes the UI.
* If the label is currently unknown, this function just returns. * If the label is currently unknown, this function just returns.
@ -464,6 +469,7 @@ nf.Label = (function () {
}); });
} }
}, },
/** /**
* Positions the component. * Positions the component.
* *
@ -472,6 +478,7 @@ nf.Label = (function () {
position: function (id) { position: function (id) {
d3.select('#id-' + id).call(position); d3.select('#id-' + id).call(position);
}, },
/** /**
* Sets the specified label(s). If the is an array, it * Sets the specified label(s). If the is an array, it
* will set each label. If it is not an array, it will * will set each label. If it is not an array, it will
@ -516,6 +523,7 @@ nf.Label = (function () {
set(labels); set(labels);
} }
}, },
/** /**
* Removes the specified label. * Removes the specified label.
* *
@ -533,12 +541,14 @@ nf.Label = (function () {
// apply the selection and handle all removed labels // apply the selection and handle all removed labels
select().exit().call(removeLabels); select().exit().call(removeLabels);
}, },
/** /**
* Removes all label. * Removes all label.
*/ */
removeAll: function () { removeAll: function () {
nf.Label.remove(labelMap.keys()); nf.Label.remove(labelMap.keys());
}, },
/** /**
* Returns the default color that should be used when drawing a label. * Returns the default color that should be used when drawing a label.
*/ */

View File

@ -58,7 +58,7 @@ nf.PortConfiguration = (function () {
data: data, data: data,
url: portData.component.uri, url: portData.component.uri,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -74,7 +74,7 @@ nf.PortConfiguration = (function () {
// close the details panel // close the details panel
$('#port-configuration').modal('hide'); $('#port-configuration').modal('hide');
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
// handle bad request locally to keep the dialog open, allowing the user // handle bad request locally to keep the dialog open, allowing the user
// to make changes. if the request fails for another reason, the dialog // to make changes. if the request fails for another reason, the dialog
// should be closed so the issue can be addressed (stale flow for instance) // should be closed so the issue can be addressed (stale flow for instance)
@ -128,6 +128,7 @@ nf.PortConfiguration = (function () {
init: function () { init: function () {
initPortConfigurationDialog(); initPortConfigurationDialog();
}, },
/** /**
* Shows the details for the specified selection. * Shows the details for the specified selection.
* *

View File

@ -41,6 +41,7 @@ nf.PortDetails = (function () {
} }
}); });
}, },
showDetails: function (selection) { showDetails: function (selection) {
// if the specified component is a processor, load its properties // if the specified component is a processor, load its properties
if (nf.CanvasUtils.isInputPort(selection) || nf.CanvasUtils.isOutputPort(selection)) { if (nf.CanvasUtils.isInputPort(selection) || nf.CanvasUtils.isOutputPort(selection)) {

View File

@ -446,6 +446,7 @@ nf.Port = (function () {
'class': 'ports' 'class': 'ports'
}); });
}, },
/** /**
* Populates the graph with the specified ports. * Populates the graph with the specified ports.
* *
@ -485,6 +486,7 @@ nf.Port = (function () {
// apply the selection and handle all new ports // apply the selection and handle all new ports
select().enter().call(renderPorts, selectAll); select().enter().call(renderPorts, selectAll);
}, },
/** /**
* If the port id is specified it is returned. If no port id * If the port id is specified it is returned. If no port id
* specified, all ports are returned. * specified, all ports are returned.
@ -498,6 +500,7 @@ nf.Port = (function () {
return portMap.get(id); return portMap.get(id);
} }
}, },
/** /**
* If the port id is specified it is refresh according to the current * If the port id is specified it is refresh according to the current
* state. If not port id is specified, all ports are refreshed. * state. If not port id is specified, all ports are refreshed.
@ -511,12 +514,14 @@ nf.Port = (function () {
d3.selectAll('g.input-port, g.output-port').call(updatePorts); d3.selectAll('g.input-port, g.output-port').call(updatePorts);
} }
}, },
/** /**
* Refreshes the components necessary after a pan event. * Refreshes the components necessary after a pan event.
*/ */
pan: function () { pan: function () {
d3.selectAll('g.input-port.entering, g.output-port.entering, g.input-port.leaving, g.output-port.leaving').call(updatePorts); d3.selectAll('g.input-port.entering, g.output-port.entering, g.input-port.leaving, g.output-port.leaving').call(updatePorts);
}, },
/** /**
* Reloads the port state from the server and refreshes the UI. * Reloads the port state from the server and refreshes the UI.
* If the port is currently unknown, this function just returns. * If the port is currently unknown, this function just returns.
@ -538,6 +543,7 @@ nf.Port = (function () {
}); });
} }
}, },
/** /**
* Positions the component. * Positions the component.
* *
@ -546,6 +552,7 @@ nf.Port = (function () {
position: function (id) { position: function (id) {
d3.select('#id-' + id).call(nf.CanvasUtils.position); d3.select('#id-' + id).call(nf.CanvasUtils.position);
}, },
/** /**
* Sets the specified port(s). If the is an array, it * Sets the specified port(s). If the is an array, it
* will set each port. If it is not an array, it will * will set each port. If it is not an array, it will
@ -574,6 +581,7 @@ nf.Port = (function () {
set(ports); set(ports);
} }
}, },
/** /**
* Sets the port status using the specified status. * Sets the port status using the specified status.
* *
@ -595,6 +603,7 @@ nf.Port = (function () {
// update the visible ports // update the visible ports
d3.selectAll('g.input-port.visible, g.output-port.visible').call(updatePortStatus); d3.selectAll('g.input-port.visible, g.output-port.visible').call(updatePortStatus);
}, },
/** /**
* Removes the specified port. * Removes the specified port.
* *
@ -612,6 +621,7 @@ nf.Port = (function () {
// apply the selection and handle all removed ports // apply the selection and handle all removed ports
select().exit().call(removePorts); select().exit().call(removePorts);
}, },
/** /**
* Removes all ports.. * Removes all ports..
*/ */

View File

@ -42,7 +42,7 @@ nf.ProcessGroupConfiguration = (function () {
}, },
url: processGroupData.component.uri, url: processGroupData.component.uri,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.processGroup)) { if (nf.Common.isDefinedAndNotNull(response.processGroup)) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -53,7 +53,7 @@ nf.ProcessGroupConfiguration = (function () {
// close the details panel // close the details panel
$('#process-group-configuration').modal('hide'); $('#process-group-configuration').modal('hide');
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
// close the details panel // close the details panel
$('#process-group-configuration').modal('hide'); $('#process-group-configuration').modal('hide');
@ -80,6 +80,7 @@ nf.ProcessGroupConfiguration = (function () {
} }
}); });
}, },
/** /**
* Shows the details for the specified selection. * Shows the details for the specified selection.
* *

View File

@ -40,6 +40,7 @@ nf.ProcessGroupDetails = (function () {
} }
}); });
}, },
showDetails: function (selection) { showDetails: function (selection) {
// if the specified selection is a process group // if the specified selection is a process group
if (nf.CanvasUtils.isProcessGroup(selection)) { if (nf.CanvasUtils.isProcessGroup(selection)) {

View File

@ -888,6 +888,7 @@ nf.ProcessGroup = (function () {
'class': 'process-groups' 'class': 'process-groups'
}); });
}, },
/** /**
* Populates the graph with the specified process groups. * Populates the graph with the specified process groups.
* *
@ -918,6 +919,7 @@ nf.ProcessGroup = (function () {
// apply the selection and handle all new process group // apply the selection and handle all new process group
select().enter().call(renderProcessGroups, selectAll); select().enter().call(renderProcessGroups, selectAll);
}, },
/** /**
* If the process group id is specified it is returned. If no process group id * If the process group id is specified it is returned. If no process group id
* specified, all process groups are returned. * specified, all process groups are returned.
@ -931,6 +933,7 @@ nf.ProcessGroup = (function () {
return processGroupMap.get(id); return processGroupMap.get(id);
} }
}, },
/** /**
* If the process group id is specified it is refresh according to the current * If the process group id is specified it is refresh according to the current
* state. If no process group id is specified, all process groups are refreshed. * state. If no process group id is specified, all process groups are refreshed.
@ -944,12 +947,14 @@ nf.ProcessGroup = (function () {
d3.selectAll('g.process-group').call(updateProcessGroups); d3.selectAll('g.process-group').call(updateProcessGroups);
} }
}, },
/** /**
* Refreshes the components necessary after a pan event. * Refreshes the components necessary after a pan event.
*/ */
pan: function () { pan: function () {
d3.selectAll('g.process-group.entering, g.process-group.leaving').call(updateProcessGroups); d3.selectAll('g.process-group.entering, g.process-group.leaving').call(updateProcessGroups);
}, },
/** /**
* Reloads the process group state from the server and refreshes the UI. * Reloads the process group state from the server and refreshes the UI.
* If the process group is currently unknown, this function just returns. * If the process group is currently unknown, this function just returns.
@ -967,6 +972,7 @@ nf.ProcessGroup = (function () {
}); });
} }
}, },
/** /**
* Positions the component. * Positions the component.
* *
@ -975,6 +981,7 @@ nf.ProcessGroup = (function () {
position: function (id) { position: function (id) {
d3.select('#id-' + id).call(nf.CanvasUtils.position); d3.select('#id-' + id).call(nf.CanvasUtils.position);
}, },
/** /**
* Sets the specified process group(s). If the is an array, it * Sets the specified process group(s). If the is an array, it
* will set each process group. If it is not an array, it will * will set each process group. If it is not an array, it will
@ -1003,6 +1010,7 @@ nf.ProcessGroup = (function () {
set(processGroups); set(processGroups);
} }
}, },
/** /**
* Sets the process group status using the specified status. * Sets the process group status using the specified status.
* *
@ -1024,6 +1032,7 @@ nf.ProcessGroup = (function () {
// update the visible process groups // update the visible process groups
d3.selectAll('g.process-group.visible').call(updateProcessGroupStatus); d3.selectAll('g.process-group.visible').call(updateProcessGroupStatus);
}, },
/** /**
* Removes the specified process group. * Removes the specified process group.
* *
@ -1041,6 +1050,7 @@ nf.ProcessGroup = (function () {
// apply the selection and handle all removed process groups // apply the selection and handle all removed process groups
select().exit().call(removeProcessGroups); select().exit().call(removeProcessGroups);
}, },
/** /**
* Removes all process groups. * Removes all process groups.
*/ */

View File

@ -454,6 +454,7 @@ nf.ProcessorConfiguration = (function () {
// initialize the property table // initialize the property table
nf.ProcessorPropertyTable.init(); nf.ProcessorPropertyTable.init();
}, },
/** /**
* Shows the configuration dialog for the specified processor. * Shows the configuration dialog for the specified processor.
* *
@ -586,7 +587,7 @@ nf.ProcessorConfiguration = (function () {
dataType: 'json', dataType: 'json',
processData: false, processData: false,
contentType: 'application/json' contentType: 'application/json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.processor)) { if (nf.Common.isDefinedAndNotNull(response.processor)) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -597,7 +598,7 @@ nf.ProcessorConfiguration = (function () {
// close the details panel // close the details panel
$('#processor-configuration').modal('hide'); $('#processor-configuration').modal('hide');
} }
}, handleProcessorConfigurationError); }).fail(handleProcessorConfigurationError);
} }
} }
} }
@ -650,7 +651,7 @@ nf.ProcessorConfiguration = (function () {
dataType: 'json', dataType: 'json',
processData: false, processData: false,
contentType: 'application/json' contentType: 'application/json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.processor)) { if (nf.Common.isDefinedAndNotNull(response.processor)) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -658,7 +659,7 @@ nf.ProcessorConfiguration = (function () {
// open the custom ui // open the custom ui
openCustomUi(); openCustomUi();
} }
}, handleProcessorConfigurationError); }).fail(handleProcessorConfigurationError);
} }
} }
}); });
@ -679,7 +680,7 @@ nf.ProcessorConfiguration = (function () {
type: 'GET', type: 'GET',
url: '../nifi-api/controller/history/processors/' + encodeURIComponent(processor.id), url: '../nifi-api/controller/history/processors/' + encodeURIComponent(processor.id),
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var processorHistory = response.processorHistory; var processorHistory = response.processorHistory;
// record the processor history // record the processor history
@ -696,7 +697,7 @@ nf.ProcessorConfiguration = (function () {
if (processorRelationships.is(':visible') && processorRelationships.get(0).scrollHeight > processorRelationships.innerHeight()) { if (processorRelationships.is(':visible') && processorRelationships.get(0).scrollHeight > processorRelationships.innerHeight()) {
processorRelationships.css('border-width', '1px'); processorRelationships.css('border-width', '1px');
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
} }
}; };

View File

@ -325,6 +325,7 @@ nf.ProcessorPropertyTable = (function () {
config: { config: {
sensitiveText: 'Sensitive value set' sensitiveText: 'Sensitive value set'
}, },
/** /**
* Initializes the property table. * Initializes the property table.
*/ */
@ -332,6 +333,7 @@ nf.ProcessorPropertyTable = (function () {
initNewPropertyDialog(); initNewPropertyDialog();
initProcessorPropertiesTable(); initProcessorPropertiesTable();
}, },
/** /**
* Determines if the specified property is sensitive. * Determines if the specified property is sensitive.
* *
@ -344,6 +346,7 @@ nf.ProcessorPropertyTable = (function () {
return false; return false;
} }
}, },
/** /**
* Determines if the specified property is required. * Determines if the specified property is required.
* *
@ -356,6 +359,7 @@ nf.ProcessorPropertyTable = (function () {
return false; return false;
} }
}, },
/** /**
* Determines if the specified property is required. * Determines if the specified property is required.
* *
@ -368,6 +372,7 @@ nf.ProcessorPropertyTable = (function () {
return false; return false;
} }
}, },
/** /**
* Gets the allowable values for the specified property. * Gets the allowable values for the specified property.
* *
@ -380,6 +385,7 @@ nf.ProcessorPropertyTable = (function () {
return null; return null;
} }
}, },
/** /**
* Returns whether the specified property supports EL. * Returns whether the specified property supports EL.
* *
@ -392,6 +398,7 @@ nf.ProcessorPropertyTable = (function () {
return false; return false;
} }
}, },
/** /**
* Saves the last edited row in the specified grid. * Saves the last edited row in the specified grid.
*/ */
@ -403,6 +410,7 @@ nf.ProcessorPropertyTable = (function () {
editController.commitCurrentEdit(); editController.commitCurrentEdit();
} }
}, },
/** /**
* Cancels the edit in the specified row. * Cancels the edit in the specified row.
*/ */
@ -414,6 +422,7 @@ nf.ProcessorPropertyTable = (function () {
editController.cancelCurrentEdit(); editController.cancelCurrentEdit();
} }
}, },
/** /**
* Deletes the property in the specified row. * Deletes the property in the specified row.
* *
@ -432,6 +441,7 @@ nf.ProcessorPropertyTable = (function () {
propertyData.updateItem(property.id, property); propertyData.updateItem(property.id, property);
} }
}, },
/** /**
* Update the size of the grid based on its container's current size. * Update the size of the grid based on its container's current size.
*/ */
@ -441,6 +451,7 @@ nf.ProcessorPropertyTable = (function () {
propertyGrid.resizeCanvas(); propertyGrid.resizeCanvas();
} }
}, },
/** /**
* Loads the specified properties. * Loads the specified properties.
* *
@ -497,6 +508,7 @@ nf.ProcessorPropertyTable = (function () {
propertyData.endUpdate(); propertyData.endUpdate();
} }
}, },
/** /**
* Determines if a save is required. * Determines if a save is required.
*/ */
@ -515,6 +527,7 @@ nf.ProcessorPropertyTable = (function () {
}); });
return isSaveRequired; return isSaveRequired;
}, },
/** /**
* Marshal's the properties to send to the server. * Marshal's the properties to send to the server.
*/ */
@ -535,6 +548,7 @@ nf.ProcessorPropertyTable = (function () {
return properties; return properties;
}, },
/** /**
* Clears the property table. * Clears the property table.
*/ */

View File

@ -651,6 +651,7 @@ nf.Processor = (function () {
'class': 'processors' 'class': 'processors'
}); });
}, },
/** /**
* Populates the graph with the specified processors. * Populates the graph with the specified processors.
* *
@ -681,6 +682,7 @@ nf.Processor = (function () {
// apply the selection and handle all new processors // apply the selection and handle all new processors
select().enter().call(renderProcessors, selectAll); select().enter().call(renderProcessors, selectAll);
}, },
/** /**
* If the processor id is specified it is returned. If no processor id * If the processor id is specified it is returned. If no processor id
* specified, all processors are returned. * specified, all processors are returned.
@ -694,6 +696,7 @@ nf.Processor = (function () {
return processorMap.get(id); return processorMap.get(id);
} }
}, },
/** /**
* If the processor id is specified it is refresh according to the current * If the processor id is specified it is refresh according to the current
* state. If not processor id is specified, all processors are refreshed. * state. If not processor id is specified, all processors are refreshed.
@ -707,6 +710,7 @@ nf.Processor = (function () {
d3.selectAll('g.processor').call(updateProcessors); d3.selectAll('g.processor').call(updateProcessors);
} }
}, },
/** /**
* Positions the component. * Positions the component.
* *
@ -715,12 +719,14 @@ nf.Processor = (function () {
position: function (id) { position: function (id) {
d3.select('#id-' + id).call(nf.CanvasUtils.position); d3.select('#id-' + id).call(nf.CanvasUtils.position);
}, },
/** /**
* Refreshes the components necessary after a pan event. * Refreshes the components necessary after a pan event.
*/ */
pan: function () { pan: function () {
d3.selectAll('g.processor.entering, g.processor.leaving').call(updateProcessors); d3.selectAll('g.processor.entering, g.processor.leaving').call(updateProcessors);
}, },
/** /**
* Reloads the processor state from the server and refreshes the UI. * Reloads the processor state from the server and refreshes the UI.
* If the processor is currently unknown, this function just returns. * If the processor is currently unknown, this function just returns.
@ -738,6 +744,7 @@ nf.Processor = (function () {
}); });
} }
}, },
/** /**
* Sets the specified processor(s). If the is an array, it * Sets the specified processor(s). If the is an array, it
* will set each processor. If it is not an array, it will * will set each processor. If it is not an array, it will
@ -766,6 +773,7 @@ nf.Processor = (function () {
set(processors); set(processors);
} }
}, },
/** /**
* Removes the specified processor. * Removes the specified processor.
* *
@ -783,12 +791,14 @@ nf.Processor = (function () {
// apply the selection and handle all removed processors // apply the selection and handle all removed processors
select().exit().call(removeProcessors); select().exit().call(removeProcessors);
}, },
/** /**
* Removes all processors. * Removes all processors.
*/ */
removeAll: function () { removeAll: function () {
nf.Processor.remove(processorMap.keys()); nf.Processor.remove(processorMap.keys());
}, },
/** /**
* Sets the processor status using the specified status. * Sets the processor status using the specified status.
* *
@ -810,6 +820,7 @@ nf.Processor = (function () {
// update the visible processor status // update the visible processor status
d3.selectAll('g.processor.visible').call(updateProcessorStatus); d3.selectAll('g.processor.visible').call(updateProcessorStatus);
}, },
/** /**
* Returns the default color that should be used when drawing a processor. * Returns the default color that should be used when drawing a processor.
*/ */

View File

@ -53,7 +53,7 @@ nf.Registration = (function () {
data: { data: {
'justification': justification 'justification': justification
} }
}).then(function (response) { }).done(function (response) {
// hide the registration pane // hide the registration pane
$('#registration-pane').hide(); $('#registration-pane').hide();
@ -61,7 +61,7 @@ nf.Registration = (function () {
$('#message-pane').show(); $('#message-pane').show();
$('#message-title').text('Thanks'); $('#message-title').text('Thanks');
$('#message-content').text('Your request will be processed shortly.'); $('#message-content').text('Your request will be processed shortly.');
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}); });
} }
}; };

View File

@ -45,13 +45,13 @@ nf.RemoteProcessGroupConfiguration = (function () {
dataType: 'json', dataType: 'json',
processData: false, processData: false,
contentType: 'application/json' contentType: 'application/json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
// close the details panel // close the details panel
$('#remote-process-group-configuration').modal('hide'); $('#remote-process-group-configuration').modal('hide');
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 400) { if (xhr.status === 400) {
var errors = xhr.responseText.split('\n'); var errors = xhr.responseText.split('\n');
@ -93,6 +93,7 @@ nf.RemoteProcessGroupConfiguration = (function () {
} }
}); });
}, },
/** /**
* Shows the details for the remote process group in the specified selection. * Shows the details for the remote process group in the specified selection.
* *

View File

@ -39,6 +39,7 @@ nf.RemoteProcessGroupDetails = (function () {
} }
}); });
}, },
/** /**
* Shows the details for the remote process group in the specified selection. * Shows the details for the remote process group in the specified selection.
* *

View File

@ -59,7 +59,7 @@ nf.RemoteProcessGroupPorts = (function () {
dataType: 'json', dataType: 'json',
processData: false, processData: false,
contentType: 'application/json' contentType: 'application/json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -75,7 +75,7 @@ nf.RemoteProcessGroupPorts = (function () {
// set the new values // set the new values
$('#' + remotePortId + '-concurrent-tasks').text(remotePort.concurrentlySchedulableTaskCount); $('#' + remotePortId + '-concurrent-tasks').text(remotePort.concurrentlySchedulableTaskCount);
$('#' + remotePortId + '-compression').text(compressionLabel); $('#' + remotePortId + '-compression').text(compressionLabel);
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 400) { if (xhr.status === 400) {
var errors = xhr.responseText.split('\n'); var errors = xhr.responseText.split('\n');
@ -270,7 +270,7 @@ nf.RemoteProcessGroupPorts = (function () {
dataType: 'json', dataType: 'json',
processData: false, processData: false,
contentType: 'application/json' contentType: 'application/json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -306,7 +306,7 @@ nf.RemoteProcessGroupPorts = (function () {
} }
} }
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 400) { if (xhr.status === 400) {
var errors = xhr.responseText.split('\n'); var errors = xhr.responseText.split('\n');
@ -428,6 +428,7 @@ nf.RemoteProcessGroupPorts = (function () {
initRemotePortConfigurationDialog(); initRemotePortConfigurationDialog();
initRemoteProcessGroupConfigurationDialog(); initRemoteProcessGroupConfigurationDialog();
}, },
/** /**
* Shows the details for the remote process group in the specified selection. * Shows the details for the remote process group in the specified selection.
* *
@ -446,7 +447,7 @@ nf.RemoteProcessGroupPorts = (function () {
verbose: true verbose: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var remoteProcessGroup = response.remoteProcessGroup; var remoteProcessGroup = response.remoteProcessGroup;
// set the model locally // set the model locally
@ -509,7 +510,7 @@ nf.RemoteProcessGroupPorts = (function () {
// show the details // show the details
$('#remote-process-group-ports').modal('show'); $('#remote-process-group-ports').modal('show');
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
} }
}; };

View File

@ -881,6 +881,7 @@ nf.RemoteProcessGroup = (function () {
'class': 'remote-process-groups' 'class': 'remote-process-groups'
}); });
}, },
/** /**
* Populates the graph with the specified remote process groups. * Populates the graph with the specified remote process groups.
* *
@ -911,6 +912,7 @@ nf.RemoteProcessGroup = (function () {
// apply the selection and handle all new remote process groups // apply the selection and handle all new remote process groups
select().enter().call(renderRemoteProcessGroups, selectAll); select().enter().call(renderRemoteProcessGroups, selectAll);
}, },
/** /**
* If the remote process group id is specified it is returned. If no remote process * If the remote process group id is specified it is returned. If no remote process
* group id specified, all remote process groups are returned. * group id specified, all remote process groups are returned.
@ -924,6 +926,7 @@ nf.RemoteProcessGroup = (function () {
return remoteProcessGroupMap.get(id); return remoteProcessGroupMap.get(id);
} }
}, },
/** /**
* If the remote process group id is specified it is refresh according to the current * If the remote process group id is specified it is refresh according to the current
* state. If no remote process group id is specified, all remote process groups are refreshed. * state. If no remote process group id is specified, all remote process groups are refreshed.
@ -937,12 +940,14 @@ nf.RemoteProcessGroup = (function () {
d3.selectAll('g.remote-process-group').call(updateRemoteProcessGroups); d3.selectAll('g.remote-process-group').call(updateRemoteProcessGroups);
} }
}, },
/** /**
* Refreshes the components necessary after a pan event. * Refreshes the components necessary after a pan event.
*/ */
pan: function () { pan: function () {
d3.selectAll('g.remote-process-group.entering, g.remote-process-group.leaving').call(updateRemoteProcessGroups); d3.selectAll('g.remote-process-group.entering, g.remote-process-group.leaving').call(updateRemoteProcessGroups);
}, },
/** /**
* Reloads the remote process group state from the server and refreshes the UI. * Reloads the remote process group state from the server and refreshes the UI.
* If the remote process group is currently unknown, this function just returns. * If the remote process group is currently unknown, this function just returns.
@ -966,6 +971,7 @@ nf.RemoteProcessGroup = (function () {
}); });
} }
}, },
/** /**
* Positions the component. * Positions the component.
* *
@ -974,6 +980,7 @@ nf.RemoteProcessGroup = (function () {
position: function (id) { position: function (id) {
d3.select('#id-' + id).call(nf.CanvasUtils.position); d3.select('#id-' + id).call(nf.CanvasUtils.position);
}, },
/** /**
* Sets the specified remote process group(s). If the is an array, it * Sets the specified remote process group(s). If the is an array, it
* will set each remote process group. If it is not an array, it will * will set each remote process group. If it is not an array, it will
@ -1002,6 +1009,7 @@ nf.RemoteProcessGroup = (function () {
set(remoteProcessGroups); set(remoteProcessGroups);
} }
}, },
/** /**
* Sets the remote process group status using the specified status. * Sets the remote process group status using the specified status.
* *
@ -1023,6 +1031,7 @@ nf.RemoteProcessGroup = (function () {
// only update the visible components // only update the visible components
d3.selectAll('g.remote-process-group.visible').call(updateProcessGroupStatus); d3.selectAll('g.remote-process-group.visible').call(updateProcessGroupStatus);
}, },
/** /**
* Removes the specified process group. * Removes the specified process group.
* *
@ -1040,6 +1049,7 @@ nf.RemoteProcessGroup = (function () {
// apply the selection and handle all removed remote process groups // apply the selection and handle all removed remote process groups
select().exit().call(removeRemoteProcessGroups); select().exit().call(removeRemoteProcessGroups);
}, },
/** /**
* Removes all remote process groups. * Removes all remote process groups.
*/ */

View File

@ -80,7 +80,7 @@ nf.SecurePortConfiguration = (function () {
contentType: 'application/json', contentType: 'application/json',
url: portUri, url: portUri,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -96,7 +96,7 @@ nf.SecurePortConfiguration = (function () {
// close the details panel // close the details panel
$('#secure-port-configuration').modal('hide'); $('#secure-port-configuration').modal('hide');
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
// close the details panel // close the details panel
$('#secure-port-configuration').modal('hide'); $('#secure-port-configuration').modal('hide');
@ -322,6 +322,7 @@ nf.SecurePortConfiguration = (function () {
init: function () { init: function () {
initPortConfigurationDialog(); initPortConfigurationDialog();
}, },
/** /**
* Shows the details for the port specified selection. * Shows the details for the port specified selection.
* *

View File

@ -85,6 +85,7 @@ nf.SecurePortDetails = (function () {
} }
}); });
}, },
showDetails: function (selection) { showDetails: function (selection) {
// if the specified component is a port, load its properties // if the specified component is a port, load its properties
if (nf.CanvasUtils.isInputPort(selection) || nf.CanvasUtils.isOutputPort(selection)) { if (nf.CanvasUtils.isInputPort(selection) || nf.CanvasUtils.isOutputPort(selection)) {

View File

@ -20,6 +20,7 @@ nf.Selectable = (function () {
init: function () { init: function () {
}, },
select: function (g) { select: function (g) {
// hide any context menus as necessary // hide any context menus as necessary
nf.ContextMenu.hide(); nf.ContextMenu.hide();
@ -46,6 +47,7 @@ nf.Selectable = (function () {
// stop propagation // stop propagation
d3.event.stopPropagation(); d3.event.stopPropagation();
}, },
activate: function (components) { activate: function (components) {
components.on('mousedown.selection', function () { components.on('mousedown.selection', function () {
// get the clicked component to update selection // get the clicked component to update selection

View File

@ -54,7 +54,7 @@ nf.Settings = (function () {
clientId: revision.clientId clientId: revision.clientId
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -63,7 +63,7 @@ nf.Settings = (function () {
dialogContent: 'A new flow archive was successfully created.', dialogContent: 'A new flow archive was successfully created.',
overlayBackground: false overlayBackground: false
}); });
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
// close the details panel // close the details panel
$('#settings-cancel').click(); $('#settings-cancel').click();
@ -87,7 +87,7 @@ nf.Settings = (function () {
url: config.urls.controllerConfig, url: config.urls.controllerConfig,
data: configuration, data: configuration,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// update the revision // update the revision
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
@ -99,7 +99,7 @@ nf.Settings = (function () {
// close the settings dialog // close the settings dialog
$('#shell-close-button').click(); $('#shell-close-button').click();
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
// close the details panel // close the details panel
$('#settings-cancel').click(); $('#settings-cancel').click();
@ -113,6 +113,7 @@ nf.Settings = (function () {
$('#shell-close-button').click(); $('#shell-close-button').click();
}); });
}, },
/** /**
* Shows the settings dialog. * Shows the settings dialog.
*/ */
@ -121,7 +122,7 @@ nf.Settings = (function () {
type: 'GET', type: 'GET',
url: config.urls.controllerConfig, url: config.urls.controllerConfig,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// ensure the config is present // ensure the config is present
if (nf.Common.isDefinedAndNotNull(response.config)) { if (nf.Common.isDefinedAndNotNull(response.config)) {
// set the header // set the header
@ -139,7 +140,7 @@ nf.Settings = (function () {
// reset button state // reset button state
$('#settings-save, #settings-cancel').mouseout(); $('#settings-save, #settings-cancel').mouseout();
}); });
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
}; };
}()); }());

View File

@ -69,6 +69,7 @@ nf.Snippet = (function () {
return snippet; return snippet;
}, },
/** /**
* Creates a snippet. * Creates a snippet.
* *
@ -90,6 +91,7 @@ nf.Snippet = (function () {
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
}); });
}, },
/** /**
* Copies the snippet to the specified group and origin. * Copies the snippet to the specified group and origin.
* *
@ -116,6 +118,7 @@ nf.Snippet = (function () {
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
}); });
}, },
/** /**
* Removes the specified snippet. * Removes the specified snippet.
* *
@ -135,6 +138,7 @@ nf.Snippet = (function () {
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
}); });
}, },
/** /**
* Moves the snippet into the specified group. * Moves the snippet into the specified group.
* *
@ -158,6 +162,7 @@ nf.Snippet = (function () {
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
}); });
}, },
/** /**
* Unlinks the snippet from the actual data flow. * Unlinks the snippet from the actual data flow.
* *
@ -180,6 +185,7 @@ nf.Snippet = (function () {
nf.Client.setRevision(response.revision); nf.Client.setRevision(response.revision);
}); });
}, },
/** /**
* Links the snippet from the actual data flow. * Links the snippet from the actual data flow.
* *

View File

@ -67,6 +67,7 @@ nf.Storage = (function () {
alternativeStorage = d3.map(); alternativeStorage = d3.map();
} }
}, },
/** /**
* Stores the specified item. If supported, will be persisted * Stores the specified item. If supported, will be persisted
* in localStorage. * in localStorage.
@ -91,6 +92,7 @@ nf.Storage = (function () {
alternativeStorage.set(key, item); alternativeStorage.set(key, item);
} }
}, },
/** /**
* Gets the item with the specified key. If an item with this key does * Gets the item with the specified key. If an item with this key does
* not exist, null is returned. If an item exists but cannot be parsed * not exist, null is returned. If an item exists but cannot be parsed
@ -117,6 +119,7 @@ nf.Storage = (function () {
return alternativeStorage.get(key); return alternativeStorage.get(key);
} }
}, },
/** /**
* Removes the item with the specified key. * Removes the item with the specified key.
* *

View File

@ -95,14 +95,14 @@ nf.ClusterTable = (function () {
status: 'CONNECTING' status: 'CONNECTING'
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var node = response.node; var node = response.node;
// update the node in the table // update the node in the table
var clusterGrid = $('#cluster-table').data('gridInstance'); var clusterGrid = $('#cluster-table').data('gridInstance');
var clusterData = clusterGrid.getData(); var clusterData = clusterGrid.getData();
clusterData.updateItem(node.nodeId, node); clusterData.updateItem(node.nodeId, node);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -118,14 +118,14 @@ nf.ClusterTable = (function () {
status: 'DISCONNECTING' status: 'DISCONNECTING'
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var node = response.node; var node = response.node;
// update the node in the table // update the node in the table
var clusterGrid = $('#cluster-table').data('gridInstance'); var clusterGrid = $('#cluster-table').data('gridInstance');
var clusterData = clusterGrid.getData(); var clusterData = clusterGrid.getData();
clusterData.updateItem(node.nodeId, node); clusterData.updateItem(node.nodeId, node);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -138,12 +138,12 @@ nf.ClusterTable = (function () {
type: 'DELETE', type: 'DELETE',
url: config.urls.nodes + '/' + encodeURIComponent(nodeId), url: config.urls.nodes + '/' + encodeURIComponent(nodeId),
dataType: 'json' dataType: 'json'
}).then(function () { }).done(function () {
// get the table and update the row accordingly // get the table and update the row accordingly
var clusterGrid = $('#cluster-table').data('gridInstance'); var clusterGrid = $('#cluster-table').data('gridInstance');
var clusterData = clusterGrid.getData(); var clusterData = clusterGrid.getData();
clusterData.deleteItem(nodeId); clusterData.deleteItem(nodeId);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -391,6 +391,7 @@ nf.ClusterTable = (function () {
// initialize the number of displayed items // initialize the number of displayed items
$('#displayed-nodes').text('0'); $('#displayed-nodes').text('0');
}, },
/** /**
* Prompts to verify node connection. * Prompts to verify node connection.
* *
@ -413,6 +414,7 @@ nf.ClusterTable = (function () {
} }
}, },
/** /**
* Prompts to verify node disconnection. * Prompts to verify node disconnection.
* *
@ -434,6 +436,7 @@ nf.ClusterTable = (function () {
}); });
} }
}, },
/** /**
* Makes the specified node the primary node of the cluster. * Makes the specified node the primary node of the cluster.
* *
@ -452,7 +455,7 @@ nf.ClusterTable = (function () {
primary: true primary: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var node = response.node; var node = response.node;
var clusterGrid = $('#cluster-table').data('gridInstance'); var clusterGrid = $('#cluster-table').data('gridInstance');
@ -482,9 +485,10 @@ nf.ClusterTable = (function () {
// end the update // end the update
clusterData.endUpdate(); clusterData.endUpdate();
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
}, },
/** /**
* Prompts to verify node disconnection. * Prompts to verify node disconnection.
* *
@ -506,6 +510,7 @@ nf.ClusterTable = (function () {
}); });
} }
}, },
/** /**
* Update the size of the grid based on its container's current size. * Update the size of the grid based on its container's current size.
*/ */
@ -515,6 +520,7 @@ nf.ClusterTable = (function () {
clusterGrid.resizeCanvas(); clusterGrid.resizeCanvas();
} }
}, },
/** /**
* Load the processor cluster table. * Load the processor cluster table.
*/ */
@ -523,7 +529,7 @@ nf.ClusterTable = (function () {
type: 'GET', type: 'GET',
url: config.urls.cluster, url: config.urls.cluster,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var cluster = response.cluster; var cluster = response.cluster;
// ensure there are groups specified // ensure there are groups specified
@ -544,8 +550,9 @@ nf.ClusterTable = (function () {
} else { } else {
$('#total-nodes').text('0'); $('#total-nodes').text('0');
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Populate the expanded row. * Populate the expanded row.
* *
@ -561,7 +568,7 @@ nf.ClusterTable = (function () {
type: 'GET', type: 'GET',
url: config.urls.nodes + '/' + encodeURIComponent(item.nodeId), url: config.urls.nodes + '/' + encodeURIComponent(item.nodeId),
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var node = response.node; var node = response.node;
// update the dialog fields // update the dialog fields
@ -582,7 +589,7 @@ nf.ClusterTable = (function () {
// show the dialog // show the dialog
$('#node-details-dialog').modal('show'); $('#node-details-dialog').modal('show');
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
} }
}; };

View File

@ -41,7 +41,7 @@ nf.Cluster = (function () {
type: 'GET', type: 'GET',
url: config.urls.authorities, url: config.urls.authorities,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.authorities)) { if (nf.Common.isDefinedAndNotNull(response.authorities)) {
// record the users authorities // record the users authorities
nf.Common.setAuthorities(response.authorities); nf.Common.setAuthorities(response.authorities);
@ -49,7 +49,7 @@ nf.Cluster = (function () {
} else { } else {
deferred.reject(); deferred.reject();
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
deferred.reject(); deferred.reject();
}); });
@ -73,7 +73,7 @@ nf.Cluster = (function () {
type: 'GET', type: 'GET',
url: config.urls.banners, url: config.urls.banners,
dataType: 'json' dataType: 'json'
}).then(function (bannerResponse) { }).done(function (bannerResponse) {
// ensure the banners response is specified // ensure the banners response is specified
if (nf.Common.isDefinedAndNotNull(bannerResponse.banners)) { if (nf.Common.isDefinedAndNotNull(bannerResponse.banners)) {
if (nf.Common.isDefinedAndNotNull(bannerResponse.banners.headerText) && bannerResponse.banners.headerText !== '') { if (nf.Common.isDefinedAndNotNull(bannerResponse.banners.headerText) && bannerResponse.banners.headerText !== '') {
@ -105,7 +105,7 @@ nf.Cluster = (function () {
} }
deferred.resolve(); deferred.resolve();
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
deferred.reject(); deferred.reject();
}); });
@ -137,14 +137,14 @@ nf.Cluster = (function () {
type: 'GET', type: 'GET',
url: config.urls.controllerAbout, url: config.urls.controllerAbout,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var aboutDetails = response.about; var aboutDetails = response.about;
var countersTitle = aboutDetails.title + ' Cluster'; var countersTitle = aboutDetails.title + ' Cluster';
// set the document title and the about title // set the document title and the about title
document.title = countersTitle; document.title = countersTitle;
$('#counters-header-text').text(countersTitle); $('#counters-header-text').text(countersTitle);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}); });
}); });
}); });

View File

@ -222,6 +222,7 @@ nf.CountersTable = (function () {
// initialize the number of display items // initialize the number of display items
$('#displayed-counters').text('0'); $('#displayed-counters').text('0');
}, },
/** /**
* Resets the specified counter. * Resets the specified counter.
* *
@ -237,16 +238,17 @@ nf.CountersTable = (function () {
type: 'PUT', type: 'PUT',
url: config.urls.counters + '/' + encodeURIComponent(item.id), url: config.urls.counters + '/' + encodeURIComponent(item.id),
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var counter = response.counter; var counter = response.counter;
// get the table and update the row accordingly // get the table and update the row accordingly
var countersGrid = $('#counters-table').data('gridInstance'); var countersGrid = $('#counters-table').data('gridInstance');
var countersData = countersGrid.getData(); var countersData = countersGrid.getData();
countersData.updateItem(counter.id, counter); countersData.updateItem(counter.id, counter);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
}, },
/** /**
* Update the size of the grid based on its container's current size. * Update the size of the grid based on its container's current size.
*/ */
@ -256,6 +258,7 @@ nf.CountersTable = (function () {
countersGrid.resizeCanvas(); countersGrid.resizeCanvas();
} }
}, },
/** /**
* Load the processor counters table. * Load the processor counters table.
*/ */
@ -264,7 +267,7 @@ nf.CountersTable = (function () {
type: 'GET', type: 'GET',
url: config.urls.counters, url: config.urls.counters,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var report = response.counters; var report = response.counters;
// ensure there are groups specified // ensure there are groups specified
@ -285,7 +288,7 @@ nf.CountersTable = (function () {
} else { } else {
$('#total-counters').text('0'); $('#total-counters').text('0');
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
}; };
}()); }());

View File

@ -41,7 +41,7 @@ nf.Counters = (function () {
type: 'GET', type: 'GET',
url: config.urls.authorities, url: config.urls.authorities,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.authorities)) { if (nf.Common.isDefinedAndNotNull(response.authorities)) {
// record the users authorities // record the users authorities
nf.Common.setAuthorities(response.authorities); nf.Common.setAuthorities(response.authorities);
@ -49,7 +49,7 @@ nf.Counters = (function () {
} else { } else {
deferred.reject(); deferred.reject();
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
deferred.reject(); deferred.reject();
}); });
@ -73,7 +73,7 @@ nf.Counters = (function () {
type: 'GET', type: 'GET',
url: config.urls.banners, url: config.urls.banners,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// ensure the banners response is specified // ensure the banners response is specified
if (nf.Common.isDefinedAndNotNull(response.banners)) { if (nf.Common.isDefinedAndNotNull(response.banners)) {
if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
@ -105,7 +105,7 @@ nf.Counters = (function () {
} }
deferred.resolve(); deferred.resolve();
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
deferred.reject(); deferred.reject();
}); });
@ -137,14 +137,14 @@ nf.Counters = (function () {
type: 'GET', type: 'GET',
url: config.urls.controllerAbout, url: config.urls.controllerAbout,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var aboutDetails = response.about; var aboutDetails = response.about;
var countersTitle = aboutDetails.title + ' Counters'; var countersTitle = aboutDetails.title + ' Counters';
// set the document title and the about title // set the document title and the about title
document.title = countersTitle; document.title = countersTitle;
$('#counters-header-text').text(countersTitle); $('#counters-header-text').text(countersTitle);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}); });
}); });
}); });

View File

@ -123,7 +123,7 @@
url: '../nifi-api/controller/history', url: '../nifi-api/controller/history',
data: query, data: query,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var history = response.history; var history = response.history;
// calculate the indices // calculate the indices
@ -160,7 +160,7 @@
from: from, from: from,
to: to to: to
}); });
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
xhr.fromPage = fromPage; xhr.fromPage = fromPage;
xhr.toPage = toPage; xhr.toPage = toPage;

View File

@ -321,9 +321,9 @@ nf.HistoryTable = (function () {
endDate: endDateTime endDate: endDateTime
}), }),
dataType: 'json' dataType: 'json'
}).then(function () { }).done(function () {
nf.HistoryTable.loadHistoryTable(); nf.HistoryTable.loadHistoryTable();
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
return { return {
@ -333,6 +333,7 @@ nf.HistoryTable = (function () {
initPurgeDialog(); initPurgeDialog();
initHistoryTable(); initHistoryTable();
}, },
/** /**
* Update the size of the grid based on its container's current size. * Update the size of the grid based on its container's current size.
*/ */
@ -342,6 +343,7 @@ nf.HistoryTable = (function () {
historyGrid.resizeCanvas(); historyGrid.resizeCanvas();
} }
}, },
/** /**
* Load the processor status table. * Load the processor status table.
*/ */
@ -355,6 +357,7 @@ nf.HistoryTable = (function () {
// request refresh of the current 'page' // request refresh of the current 'page'
historyGrid.onViewportChanged.notify(); historyGrid.onViewportChanged.notify();
}, },
/** /**
* Shows the details for the specified action. * Shows the details for the specified action.
* *

View File

@ -42,7 +42,7 @@ nf.History = (function () {
type: 'GET', type: 'GET',
url: config.urls.authorities, url: config.urls.authorities,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.authorities)) { if (nf.Common.isDefinedAndNotNull(response.authorities)) {
// record the users authorities // record the users authorities
nf.Common.setAuthorities(response.authorities); nf.Common.setAuthorities(response.authorities);
@ -50,7 +50,7 @@ nf.History = (function () {
} else { } else {
deferred.reject(); deferred.reject();
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
deferred.reject(); deferred.reject();
}); });
@ -74,7 +74,7 @@ nf.History = (function () {
type: 'GET', type: 'GET',
url: config.urls.banners, url: config.urls.banners,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// ensure the banners response is specified // ensure the banners response is specified
if (nf.Common.isDefinedAndNotNull(response.banners)) { if (nf.Common.isDefinedAndNotNull(response.banners)) {
if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
@ -106,7 +106,7 @@ nf.History = (function () {
} }
deferred.resolve(); deferred.resolve();
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
deferred.reject(); deferred.reject();
}); });
@ -139,14 +139,14 @@ nf.History = (function () {
type: 'GET', type: 'GET',
url: config.urls.controllerAbout, url: config.urls.controllerAbout,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var aboutDetails = response.about; var aboutDetails = response.about;
var historyTitle = aboutDetails.title + ' History'; var historyTitle = aboutDetails.title + ' History';
// set the document title and the about title // set the document title and the about title
document.title = historyTitle; document.title = historyTitle;
$('#history-header-text').text(historyTitle); $('#history-header-text').text(historyTitle);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}); });
}); });
} }

View File

@ -72,14 +72,17 @@ nf.Common = {
} }
} }
}, },
/** /**
* Determines if the current broswer supports SVG. * Determines if the current broswer supports SVG.
*/ */
SUPPORTS_SVG: !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect, SUPPORTS_SVG: !!document.createElementNS && !!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect,
/** /**
* The authorities for the current user. * The authorities for the current user.
*/ */
authorities: undefined, authorities: undefined,
/** /**
* Sets the authorities for the current user. * Sets the authorities for the current user.
* *
@ -88,6 +91,7 @@ nf.Common = {
setAuthorities: function (roles) { setAuthorities: function (roles) {
nf.Common.authorities = roles; nf.Common.authorities = roles;
}, },
/** /**
* Loads a script at the specified URL. Supports caching the script on the browser. * Loads a script at the specified URL. Supports caching the script on the browser.
* *
@ -100,6 +104,7 @@ nf.Common = {
url: url url: url
}); });
}, },
/** /**
* Determines whether the current user can access provenance. * Determines whether the current user can access provenance.
* *
@ -117,6 +122,7 @@ nf.Common = {
} }
return canAccessProvenance; return canAccessProvenance;
}, },
/** /**
* Returns whether or not the current user is a DFM. * Returns whether or not the current user is a DFM.
*/ */
@ -132,6 +138,7 @@ nf.Common = {
} }
return dfm; return dfm;
}, },
/** /**
* Returns whether or not the current user is a DFM. * Returns whether or not the current user is a DFM.
*/ */
@ -147,6 +154,7 @@ nf.Common = {
} }
return admin; return admin;
}, },
/** /**
* Adds a mouse over effect for the specified selector using * Adds a mouse over effect for the specified selector using
* the specified styles. * the specified styles.
@ -163,6 +171,7 @@ nf.Common = {
}); });
return $(selector).addClass(normalStyle); return $(selector).addClass(normalStyle);
}, },
/** /**
* Method for handling ajax errors. * Method for handling ajax errors.
* *
@ -237,6 +246,7 @@ nf.Common = {
nf.Common.closeCanvas(); nf.Common.closeCanvas();
} }
}, },
/** /**
* Closes the canvas by removing the splash screen and stats poller. * Closes the canvas by removing the splash screen and stats poller.
*/ */
@ -256,6 +266,7 @@ nf.Common = {
nf.Canvas.stopStatusPolling(); nf.Canvas.stopStatusPolling();
} }
}, },
/** /**
* Populates the specified field with the specified value. If the value is * Populates the specified field with the specified value. If the value is
* undefined, the field will read 'No value set.' If the value is an empty * undefined, the field will read 'No value set.' If the value is an empty
@ -273,6 +284,7 @@ nf.Common = {
return $('#' + target).text(value); return $('#' + target).text(value);
} }
}, },
/** /**
* Clears the specified field. Removes any style that may have been applied * Clears the specified field. Removes any style that may have been applied
* by a preceeding call to populateField. * by a preceeding call to populateField.
@ -282,6 +294,7 @@ nf.Common = {
clearField: function (target) { clearField: function (target) {
return $('#' + target).removeClass('unset blank').text(''); return $('#' + target).removeClass('unset blank').text('');
}, },
/** /**
* Formats the tooltip for the specified property. * Formats the tooltip for the specified property.
* *
@ -321,6 +334,7 @@ nf.Common = {
return null; return null;
} }
}, },
/** /**
* Formats the specified property (name and value) accordingly. * Formats the specified property (name and value) accordingly.
* *
@ -330,6 +344,7 @@ nf.Common = {
formatProperty: function (name, value) { formatProperty: function (name, value) {
return '<div><span class="label">' + nf.Common.formatValue(name) + ': </span>' + nf.Common.formatValue(value) + '</div>'; return '<div><span class="label">' + nf.Common.formatValue(name) + ': </span>' + nf.Common.formatValue(value) + '</div>';
}, },
/** /**
* Formats the specified value accordingly. * Formats the specified value accordingly.
* *
@ -346,6 +361,7 @@ nf.Common = {
return '<span class="unset">No value set</span>'; return '<span class="unset">No value set</span>';
} }
}, },
/** /**
* HTML escapes the specified string. If the string is null * HTML escapes the specified string. If the string is null
* or undefined, an empty string is returned. * or undefined, an empty string is returned.
@ -372,6 +388,7 @@ nf.Common = {
} }
}; };
}()), }()),
/** /**
* Creates a form inline in order to submit the specified params to the specified URL * Creates a form inline in order to submit the specified params to the specified URL
* using the specified method. * using the specified method.
@ -407,6 +424,7 @@ nf.Common = {
window.onbeforeunload = previousBeforeUnload; window.onbeforeunload = previousBeforeUnload;
} }
}, },
/** /**
* Formats the specified array as an unordered list. If the array is not an * Formats the specified array as an unordered list. If the array is not an
* array, null is returned. * array, null is returned.
@ -429,6 +447,7 @@ nf.Common = {
return null; return null;
} }
}, },
/** /**
* Extracts the contents of the specified str after the strToFind. If the * Extracts the contents of the specified str after the strToFind. If the
* strToFind is not found or the last part of the str, an empty string is * strToFind is not found or the last part of the str, an empty string is
@ -448,6 +467,7 @@ nf.Common = {
} }
return result; return result;
}, },
/** /**
* Updates the mouse pointer. * Updates the mouse pointer.
* *
@ -461,6 +481,7 @@ nf.Common = {
$('#' + domId).removeClass('pointer'); $('#' + domId).removeClass('pointer');
} }
}, },
/** /**
* Constants for time duration formatting. * Constants for time duration formatting.
*/ */
@ -468,6 +489,7 @@ nf.Common = {
MILLIS_PER_HOUR: 3600000, MILLIS_PER_HOUR: 3600000,
MILLIS_PER_MINUTE: 60000, MILLIS_PER_MINUTE: 60000,
MILLIS_PER_SECOND: 1000, MILLIS_PER_SECOND: 1000,
/** /**
* Formats the specified duration. * Formats the specified duration.
* *
@ -515,6 +537,7 @@ nf.Common = {
return time; return time;
} }
}, },
/** /**
* Constants for formatting data size. * Constants for formatting data size.
*/ */
@ -522,6 +545,7 @@ nf.Common = {
BYTES_IN_MEGABYTE: 1048576, BYTES_IN_MEGABYTE: 1048576,
BYTES_IN_GIGABYTE: 1073741824, BYTES_IN_GIGABYTE: 1073741824,
BYTES_IN_TERABYTE: 1099511627776, BYTES_IN_TERABYTE: 1099511627776,
/** /**
* Formats the specified number of bytes into a human readable string. * Formats the specified number of bytes into a human readable string.
* *
@ -556,6 +580,7 @@ nf.Common = {
// default to bytes // default to bytes
return parseFloat(dataSize).toFixed(2) + " bytes"; return parseFloat(dataSize).toFixed(2) + " bytes";
}, },
/** /**
* Formats the specified integer as a string (adding commas). At this * Formats the specified integer as a string (adding commas). At this
* point this does not take into account any locales. * point this does not take into account any locales.
@ -570,6 +595,7 @@ nf.Common = {
} }
return string; return string;
}, },
/** /**
* Formats the specified float using two demical places. * Formats the specified float using two demical places.
* *
@ -581,6 +607,7 @@ nf.Common = {
} }
return f.toFixed(2) + ''; return f.toFixed(2) + '';
}, },
/** /**
* Pads the specified value to the specified width with the specified character. * Pads the specified value to the specified width with the specified character.
* If the specified value is already wider than the specified width, the original * If the specified value is already wider than the specified width, the original
@ -601,6 +628,7 @@ nf.Common = {
return s; return s;
}, },
/** /**
* Formats the specified DateTime. * Formats the specified DateTime.
* *
@ -622,6 +650,7 @@ nf.Common = {
'.' + '.' +
nf.Common.pad(date.getMilliseconds(), 3, '0'); nf.Common.pad(date.getMilliseconds(), 3, '0');
}, },
/** /**
* Parses the specified date time into a Date object. The resulting * Parses the specified date time into a Date object. The resulting
* object does not account for timezone and should only be used for * object does not account for timezone and should only be used for
@ -667,6 +696,7 @@ nf.Common = {
return new Date(parseInt(date[2], 10), parseInt(date[0], 10), parseInt(date[1], 10), parseInt(time[0], 10), parseInt(time[1], 10), parseInt(time[2], 10), 0); return new Date(parseInt(date[2], 10), parseInt(date[0], 10), parseInt(date[1], 10), parseInt(time[0], 10), parseInt(time[1], 10), parseInt(time[2], 10), 0);
} }
}, },
/** /**
* Parses the specified duration and returns the total number of millis. * Parses the specified duration and returns the total number of millis.
* *
@ -689,6 +719,7 @@ nf.Common = {
return new Date(1970, 0, 1, parseInt(duration[0], 10), parseInt(duration[1], 10), parseInt(duration[2], 10), 0).getTime(); return new Date(1970, 0, 1, parseInt(duration[0], 10), parseInt(duration[1], 10), parseInt(duration[2], 10), 0).getTime();
} }
}, },
/** /**
* Parses the specified size. * Parses the specified size.
* *
@ -712,6 +743,7 @@ nf.Common = {
return size; return size;
} }
}, },
/** /**
* Parses the specified count. * Parses the specified count.
* *
@ -736,6 +768,7 @@ nf.Common = {
} }
return intCount; return intCount;
}, },
/** /**
* Determines if the specified object is defined and not null. * Determines if the specified object is defined and not null.
* *
@ -744,6 +777,7 @@ nf.Common = {
isDefinedAndNotNull: function (obj) { isDefinedAndNotNull: function (obj) {
return !nf.Common.isUndefined(obj) && !nf.Common.isNull(obj); return !nf.Common.isUndefined(obj) && !nf.Common.isNull(obj);
}, },
/** /**
* Determines if the specified object is undefined or null. * Determines if the specified object is undefined or null.
* *
@ -752,6 +786,7 @@ nf.Common = {
isUndefinedOrNull: function (obj) { isUndefinedOrNull: function (obj) {
return nf.Common.isUndefined(obj) || nf.Common.isNull(obj); return nf.Common.isUndefined(obj) || nf.Common.isNull(obj);
}, },
/** /**
* Determines if the specified object is undefined. * Determines if the specified object is undefined.
* *
@ -760,6 +795,7 @@ nf.Common = {
isUndefined: function (obj) { isUndefined: function (obj) {
return typeof obj === 'undefined'; return typeof obj === 'undefined';
}, },
/** /**
* Determines whether the specified string is blank (or null or undefined). * Determines whether the specified string is blank (or null or undefined).
* *
@ -768,6 +804,7 @@ nf.Common = {
isBlank: function (str) { isBlank: function (str) {
return nf.Common.isUndefined(str) || nf.Common.isNull(str) || $.trim(str) === ''; return nf.Common.isUndefined(str) || nf.Common.isNull(str) || $.trim(str) === '';
}, },
/** /**
* Determines if the specified object is null. * Determines if the specified object is null.
* *
@ -776,6 +813,7 @@ nf.Common = {
isNull: function (obj) { isNull: function (obj) {
return obj === null; return obj === null;
}, },
/** /**
* Determines if the specified array is empty. If the specified arg is not an * Determines if the specified array is empty. If the specified arg is not an
* array, then true is returned. * array, then true is returned.
@ -785,6 +823,7 @@ nf.Common = {
isEmpty: function (arr) { isEmpty: function (arr) {
return $.isArray(arr) ? arr.length === 0 : true; return $.isArray(arr) ? arr.length === 0 : true;
}, },
/** /**
* Determines if these are the same bulletins. If both arguments are not * Determines if these are the same bulletins. If both arguments are not
* arrays, false is returned. * arrays, false is returned.
@ -809,6 +848,7 @@ nf.Common = {
} }
return false; return false;
}, },
/** /**
* Formats the specified bulletin list. * Formats the specified bulletin list.
* *

View File

@ -47,7 +47,7 @@ nf.ConnectionDetails = (function () {
type: 'GET', type: 'GET',
url: '../nifi-api/controller/process-groups/' + encodeURIComponent(groupId) + '/processors/' + encodeURIComponent(source.id), url: '../nifi-api/controller/process-groups/' + encodeURIComponent(groupId) + '/processors/' + encodeURIComponent(source.id),
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var processor = response.processor; var processor = response.processor;
var processorName = $('<div class="label"></div>').text(processor.name); var processorName = $('<div class="label"></div>').text(processor.name);
var processorType = $('<div></div>').text(nf.Common.substringAfterLast(processor.type, '.')); var processorType = $('<div></div>').text(nf.Common.substringAfterLast(processor.type, '.'));
@ -124,7 +124,7 @@ nf.ConnectionDetails = (function () {
verbose: true verbose: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var processGroup = response.processGroup; var processGroup = response.processGroup;
// populate source port details // populate source port details
@ -133,7 +133,7 @@ nf.ConnectionDetails = (function () {
$('#read-only-connection-source-group-name').text(processGroup.name); $('#read-only-connection-source-group-name').text(processGroup.name);
deferred.resolve(); deferred.resolve();
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
} }
@ -172,7 +172,7 @@ nf.ConnectionDetails = (function () {
type: 'GET', type: 'GET',
url: '../nifi-api/controller/process-groups/' + encodeURIComponent(groupId) + '/processors/' + encodeURIComponent(destination.id), url: '../nifi-api/controller/process-groups/' + encodeURIComponent(groupId) + '/processors/' + encodeURIComponent(destination.id),
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var processor = response.processor; var processor = response.processor;
var processorName = $('<div class="label"></div>').text(processor.name); var processorName = $('<div class="label"></div>').text(processor.name);
var processorType = $('<div></div>').text(nf.Common.substringAfterLast(processor.type, '.')); var processorType = $('<div></div>').text(nf.Common.substringAfterLast(processor.type, '.'));
@ -183,7 +183,7 @@ nf.ConnectionDetails = (function () {
$('#read-only-connection-target-group-name').text(groupName); $('#read-only-connection-target-group-name').text(groupName);
deferred.resolve(); deferred.resolve();
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
}).promise(); }).promise();
@ -254,7 +254,7 @@ nf.ConnectionDetails = (function () {
verbose: true verbose: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var processGroup = response.processGroup; var processGroup = response.processGroup;
// populate destination port details // populate destination port details
@ -263,7 +263,7 @@ nf.ConnectionDetails = (function () {
$('#read-only-connection-target-group-name').text(processGroup.name); $('#read-only-connection-target-group-name').text(processGroup.name);
deferred.resolve(); deferred.resolve();
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
} }
@ -346,6 +346,7 @@ nf.ConnectionDetails = (function () {
} }
}); });
}, },
/** /**
* Shows the details for the specified edge. * Shows the details for the specified edge.
* *
@ -368,7 +369,7 @@ nf.ConnectionDetails = (function () {
}); });
// populate the dialog once get have all necessary details // populate the dialog once get have all necessary details
$.when(groupXhr, connectionXhr).then(function (groupResult, connectionResult) { $.when(groupXhr, connectionXhr).done(function (groupResult, connectionResult) {
var groupResponse = groupResult[0]; var groupResponse = groupResult[0];
var connectionResponse = connectionResult[0]; var connectionResponse = connectionResult[0];
@ -453,7 +454,7 @@ nf.ConnectionDetails = (function () {
} }
}); });
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
}; };
}()); }());

View File

@ -78,6 +78,7 @@ nf.Dialog = (function () {
// show the dialog // show the dialog
$('#nf-ok-dialog').modal('setHeaderText', options.headerText).modal('setOverlayBackground', options.overlayBackground).modal('show'); $('#nf-ok-dialog').modal('setHeaderText', options.headerText).modal('setOverlayBackground', options.overlayBackground).modal('show');
}, },
/** /**
* Shows an general dialog with Yes and No buttons populated with the * Shows an general dialog with Yes and No buttons populated with the
* specified dialog content. * specified dialog content.

View File

@ -381,6 +381,7 @@ nf.ProcessorDetails = (function () {
} }
}); });
}, },
/** /**
* Shows the details for the specified processor. * Shows the details for the specified processor.
* *
@ -508,7 +509,7 @@ nf.ProcessorDetails = (function () {
}); });
// show the dialog once we have the processor and its history // show the dialog once we have the processor and its history
$.when(getProcessor, getProcessorHistory).then(function (response) { $.when(getProcessor, getProcessorHistory).done(function (response) {
var processorResponse = response[0]; var processorResponse = response[0];
var processor = processorResponse.processor; var processor = processorResponse.processor;
@ -549,7 +550,7 @@ nf.ProcessorDetails = (function () {
if (processorRelationships.is(':visible') && processorRelationships.get(0).scrollHeight > processorRelationships.innerHeight()) { if (processorRelationships.is(':visible') && processorRelationships.get(0).scrollHeight > processorRelationships.innerHeight()) {
processorRelationships.css('border-width', '1px'); processorRelationships.css('border-width', '1px');
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) { if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
nf.Dialog.showOkDialog({ nf.Dialog.showOkDialog({
dialogContent: nf.Common.escapeHtml(xhr.responseText), dialogContent: nf.Common.escapeHtml(xhr.responseText),

View File

@ -100,6 +100,7 @@ nf.Shell = (function () {
}); });
}).promise(); }).promise();
}, },
/** /**
* Shows the specified content in the shell. When the shell is closed, the content * Shows the specified content in the shell. When the shell is closed, the content
* will be hidden and returned to its previous location in the dom. * will be hidden and returned to its previous location in the dom.

View File

@ -1175,6 +1175,7 @@ nf.StatusHistory = (function () {
instances = null; instances = null;
}); });
}, },
/** /**
* Shows the status history for the specified connection across the cluster. * Shows the status history for the specified connection across the cluster.
* *
@ -1187,10 +1188,11 @@ nf.StatusHistory = (function () {
type: 'GET', type: 'GET',
url: config.urls.clusterConnection + encodeURIComponent(connectionId) + '/status/history', url: config.urls.clusterConnection + encodeURIComponent(connectionId) + '/status/history',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
handleClusteredStatusHistoryResponse(groupId, connectionId, response.clusterStatusHistory, config.type.connection, selectedDescriptor); handleClusteredStatusHistoryResponse(groupId, connectionId, response.clusterStatusHistory, config.type.connection, selectedDescriptor);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows the status history for the specified processor across the cluster. * Shows the status history for the specified processor across the cluster.
* *
@ -1203,10 +1205,11 @@ nf.StatusHistory = (function () {
type: 'GET', type: 'GET',
url: config.urls.clusterProcessor + encodeURIComponent(processorId) + '/status/history', url: config.urls.clusterProcessor + encodeURIComponent(processorId) + '/status/history',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
handleClusteredStatusHistoryResponse(groupId, processorId, response.clusterStatusHistory, config.type.processor, selectedDescriptor); handleClusteredStatusHistoryResponse(groupId, processorId, response.clusterStatusHistory, config.type.processor, selectedDescriptor);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows the status history for the specified process group across the cluster. * Shows the status history for the specified process group across the cluster.
* *
@ -1219,10 +1222,11 @@ nf.StatusHistory = (function () {
type: 'GET', type: 'GET',
url: config.urls.clusterProcessGroup + encodeURIComponent(processGroupId) + '/status/history', url: config.urls.clusterProcessGroup + encodeURIComponent(processGroupId) + '/status/history',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
handleClusteredStatusHistoryResponse(groupId, processGroupId, response.clusterStatusHistory, config.type.processGroup, selectedDescriptor); handleClusteredStatusHistoryResponse(groupId, processGroupId, response.clusterStatusHistory, config.type.processGroup, selectedDescriptor);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows the status history for the specified remote process group across the cluster. * Shows the status history for the specified remote process group across the cluster.
* *
@ -1235,10 +1239,11 @@ nf.StatusHistory = (function () {
type: 'GET', type: 'GET',
url: config.urls.clusterRemoteProcessGroup + encodeURIComponent(remoteProcessGroupId) + '/status/history', url: config.urls.clusterRemoteProcessGroup + encodeURIComponent(remoteProcessGroupId) + '/status/history',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
handleClusteredStatusHistoryResponse(groupId, remoteProcessGroupId, response.clusterStatusHistory, config.type.remoteProcessGroup, selectedDescriptor); handleClusteredStatusHistoryResponse(groupId, remoteProcessGroupId, response.clusterStatusHistory, config.type.remoteProcessGroup, selectedDescriptor);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows the status history for the specified connection in this instance. * Shows the status history for the specified connection in this instance.
* *
@ -1251,10 +1256,11 @@ nf.StatusHistory = (function () {
type: 'GET', type: 'GET',
url: config.urls.processGroups + encodeURIComponent(groupId) + '/connections/' + encodeURIComponent(connectionId) + '/status/history', url: config.urls.processGroups + encodeURIComponent(groupId) + '/connections/' + encodeURIComponent(connectionId) + '/status/history',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
handleStandaloneStatusHistoryResponse(groupId, connectionId, response.statusHistory, config.type.connection, selectedDescriptor); handleStandaloneStatusHistoryResponse(groupId, connectionId, response.statusHistory, config.type.connection, selectedDescriptor);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows the status history for the specified processor in this instance. * Shows the status history for the specified processor in this instance.
* *
@ -1267,10 +1273,11 @@ nf.StatusHistory = (function () {
type: 'GET', type: 'GET',
url: config.urls.processGroups + encodeURIComponent(groupId) + '/processors/' + encodeURIComponent(processorId) + '/status/history', url: config.urls.processGroups + encodeURIComponent(groupId) + '/processors/' + encodeURIComponent(processorId) + '/status/history',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
handleStandaloneStatusHistoryResponse(groupId, processorId, response.statusHistory, config.type.processor, selectedDescriptor); handleStandaloneStatusHistoryResponse(groupId, processorId, response.statusHistory, config.type.processor, selectedDescriptor);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows the status history for the specified process group in this instance. * Shows the status history for the specified process group in this instance.
* *
@ -1283,10 +1290,11 @@ nf.StatusHistory = (function () {
type: 'GET', type: 'GET',
url: config.urls.processGroups + encodeURIComponent(processGroupId) + '/status/history', url: config.urls.processGroups + encodeURIComponent(processGroupId) + '/status/history',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
handleStandaloneStatusHistoryResponse(groupId, processGroupId, response.statusHistory, config.type.processGroup, selectedDescriptor); handleStandaloneStatusHistoryResponse(groupId, processGroupId, response.statusHistory, config.type.processGroup, selectedDescriptor);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows the status history for the specified remote process group in this instance. * Shows the status history for the specified remote process group in this instance.
* *
@ -1299,9 +1307,9 @@ nf.StatusHistory = (function () {
type: 'GET', type: 'GET',
url: config.urls.processGroups + encodeURIComponent(groupId) + '/remote-process-groups/' + encodeURIComponent(remoteProcessGroupId) + '/status/history', url: config.urls.processGroups + encodeURIComponent(groupId) + '/remote-process-groups/' + encodeURIComponent(remoteProcessGroupId) + '/status/history',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
handleStandaloneStatusHistoryResponse(groupId, remoteProcessGroupId, response.statusHistory, config.type.remoteProcessGroup, selectedDescriptor); handleStandaloneStatusHistoryResponse(groupId, remoteProcessGroupId, response.statusHistory, config.type.remoteProcessGroup, selectedDescriptor);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
}; };
}()); }());

View File

@ -864,12 +864,12 @@ nf.ProvenanceLineage = (function () {
// polls for the event lineage // polls for the event lineage
var pollLineage = function (nextDelay) { var pollLineage = function (nextDelay) {
getLineage(lineage).then(function (response) { getLineage(lineage).done(function (response) {
lineage = response.lineage; lineage = response.lineage;
// process the lineage, if its not done computing wait delay seconds before checking again // process the lineage, if its not done computing wait delay seconds before checking again
processLineage(nextDelay); processLineage(nextDelay);
}, closeDialog); }).fail(closeDialog);
}; };
// processes the event lineage // processes the event lineage
@ -929,12 +929,12 @@ nf.ProvenanceLineage = (function () {
}; };
// once the query is submitted wait until its finished // once the query is submitted wait until its finished
submitLineage(lineageRequest).then(function (response) { submitLineage(lineageRequest).done(function (response) {
lineage = response.lineage; lineage = response.lineage;
// process the lineage, if its not done computing wait 1 second before checking again // process the lineage, if its not done computing wait 1 second before checking again
processLineage(1); processLineage(1);
}, closeDialog); }).fail(closeDialog);
}; };
// handles updating the lineage graph // handles updating the lineage graph
@ -1284,6 +1284,7 @@ nf.ProvenanceLineage = (function () {
initLineageQueryDialog(); initLineageQueryDialog();
}, },
/** /**
* Shows the lineage for the specified flowfile uuid. * Shows the lineage for the specified flowfile uuid.
* *
@ -1347,12 +1348,12 @@ nf.ProvenanceLineage = (function () {
// polls the server for the status of the lineage, if the lineage is not // polls the server for the status of the lineage, if the lineage is not
// done wait nextDelay seconds before trying again // done wait nextDelay seconds before trying again
var pollLineage = function (nextDelay) { var pollLineage = function (nextDelay) {
getLineage(lineage).then(function (response) { getLineage(lineage).done(function (response) {
lineage = response.lineage; lineage = response.lineage;
// process the lineage, if its not done computing wait delay seconds before checking again // process the lineage, if its not done computing wait delay seconds before checking again
processLineage(nextDelay); processLineage(nextDelay);
}, closeDialog); }).fail(closeDialog);
}; };
var processLineage = function (delay) { var processLineage = function (delay) {
@ -1401,12 +1402,12 @@ nf.ProvenanceLineage = (function () {
}; };
// once the query is submitted wait until its finished // once the query is submitted wait until its finished
submitLineage(lineageRequest).then(function (response) { submitLineage(lineageRequest).done(function (response) {
lineage = response.lineage; lineage = response.lineage;
// process the results, if they are not done wait 1 second before trying again // process the results, if they are not done wait 1 second before trying again
processLineage(1); processLineage(1);
}, closeDialog); }).fail(closeDialog);
} }
}; };
}()); }());

View File

@ -49,15 +49,15 @@ nf.ProvenanceTable = (function () {
var loadLineageCapabilities = function () { var loadLineageCapabilities = function () {
return $.Deferred(function (deferred) { return $.Deferred(function (deferred) {
if (nf.Common.SUPPORTS_SVG) { if (nf.Common.SUPPORTS_SVG) {
nf.Common.cachedScript(config.urls.d3Script).then(function () { nf.Common.cachedScript(config.urls.d3Script).done(function () {
nf.Common.cachedScript(config.urls.lineageScript).then(function () { nf.Common.cachedScript(config.urls.lineageScript).done(function () {
// initialize the lineage graph // initialize the lineage graph
nf.ProvenanceLineage.init(); nf.ProvenanceLineage.init();
deferred.resolve(); deferred.resolve();
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
} else { } else {
@ -210,12 +210,12 @@ nf.ProvenanceTable = (function () {
url: config.urls.replays, url: config.urls.replays,
data: parameters, data: parameters,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
nf.Dialog.showOkDialog({ nf.Dialog.showOkDialog({
dialogContent: 'Successfully submitted replay request.', dialogContent: 'Successfully submitted replay request.',
overlayBackground: false overlayBackground: false
}); });
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
$('#event-details-dialog').modal('hide'); $('#event-details-dialog').modal('hide');
}); });
@ -294,7 +294,7 @@ nf.ProvenanceTable = (function () {
type: 'GET', type: 'GET',
url: config.urls.cluster, url: config.urls.cluster,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var cluster = response.cluster; var cluster = response.cluster;
var nodes = cluster.nodes; var nodes = cluster.nodes;
@ -323,7 +323,7 @@ nf.ProvenanceTable = (function () {
$('#provenance-search-location').combo({ $('#provenance-search-location').combo({
options: searchableOptions options: searchableOptions
}); });
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
// show the node search combo // show the node search combo
$('#provenance-search-location-container').show(); $('#provenance-search-location-container').show();
@ -888,23 +888,26 @@ nf.ProvenanceTable = (function () {
* The max delay between requests. * The max delay between requests.
*/ */
MAX_DELAY: 4, MAX_DELAY: 4,
/** /**
* The server time offset * The server time offset
*/ */
serverTimeOffset: null, serverTimeOffset: null,
/** /**
* Initializes the provenance table. Returns a deferred that will indicate when/if the table has initialized successfully. * Initializes the provenance table. Returns a deferred that will indicate when/if the table has initialized successfully.
* *
* @param {boolean} isClustered Whether or not this instance is clustered * @param {boolean} isClustered Whether or not this instance is clustered
*/ */
init: function (isClustered) { init: function (isClustered) {
return loadLineageCapabilities().then(function () { return loadLineageCapabilities().done(function () {
initDetailsDialog(); initDetailsDialog();
initProvenanceQueryDialog(); initProvenanceQueryDialog();
initSearchDialog(isClustered); initSearchDialog(isClustered);
initProvenanceTable(isClustered); initProvenanceTable(isClustered);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Goes to the specified component if possible. * Goes to the specified component if possible.
* *
@ -929,6 +932,7 @@ nf.ProvenanceTable = (function () {
} }
} }
}, },
/** /**
* Update the size of the grid based on its container's current size. * Update the size of the grid based on its container's current size.
*/ */
@ -938,6 +942,7 @@ nf.ProvenanceTable = (function () {
provenanceGrid.resizeCanvas(); provenanceGrid.resizeCanvas();
} }
}, },
/** /**
* Updates the value of the specified progress bar. * Updates the value of the specified progress bar.
* *
@ -953,6 +958,7 @@ nf.ProvenanceTable = (function () {
var label = $('<div class="progress-label"></div>').text(value + '%'); var label = $('<div class="progress-label"></div>').text(value + '%');
progressBar.progressbar('value', value).append(label); progressBar.progressbar('value', value).append(label);
}, },
/** /**
* Loads the provenance table with events according to the specified optional * Loads the provenance table with events according to the specified optional
* query. If not query is specified or it is empty, the most recent entries will * query. If not query is specified or it is empty, the most recent entries will
@ -1025,13 +1031,13 @@ nf.ProvenanceTable = (function () {
// polls the server for the status of the provenance, if the provenance is not // polls the server for the status of the provenance, if the provenance is not
// done wait nextDelay seconds before trying again // done wait nextDelay seconds before trying again
var pollProvenance = function (nextDelay) { var pollProvenance = function (nextDelay) {
getProvenance(provenance).then(function (response) { getProvenance(provenance).done(function (response) {
// update the provenance // update the provenance
provenance = response.provenance; provenance = response.provenance;
// process the provenance // process the provenance
processProvenanceResponse(nextDelay); processProvenanceResponse(nextDelay);
}, closeDialog); }).fail(closeDialog);
}; };
// processes the provenance, if the provenance is not done wait delay // processes the provenance, if the provenance is not done wait delay
@ -1079,14 +1085,15 @@ nf.ProvenanceTable = (function () {
}; };
// once the query is submitted wait until its finished // once the query is submitted wait until its finished
submitProvenance(query).then(function (response) { submitProvenance(query).done(function (response) {
// update the provenance // update the provenance
provenance = response.provenance; provenance = response.provenance;
// process the results, if they are not done wait 1 second before trying again // process the results, if they are not done wait 1 second before trying again
processProvenanceResponse(1); processProvenanceResponse(1);
}, closeDialog); }).fail(closeDialog);
}, },
/** /**
* Shows the lineage for the event in the specified row. * Shows the lineage for the event in the specified row.
* *
@ -1100,6 +1107,7 @@ nf.ProvenanceTable = (function () {
nf.ProvenanceLineage.showLineage(item.flowFileUuid, item.eventId.toString(), item.clusterNodeId); nf.ProvenanceLineage.showLineage(item.flowFileUuid, item.eventId.toString(), item.clusterNodeId);
} }
}, },
/** /**
* Gets the event details and shows the details dialog. * Gets the event details and shows the details dialog.
* *
@ -1115,6 +1123,7 @@ nf.ProvenanceTable = (function () {
nf.ProvenanceTable.showEventDetails(event); nf.ProvenanceTable.showEventDetails(event);
} }
}, },
/** /**
* Shows the details for the specified action. * Shows the details for the specified action.
* *

View File

@ -47,10 +47,10 @@ nf.Provenance = (function () {
$.ajax({ $.ajax({
type: 'HEAD', type: 'HEAD',
url: config.urls.cluster url: config.urls.cluster
}).then(function () { }).done(function () {
isClustered = true; isClustered = true;
deferred.resolve(); deferred.resolve();
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 404) { if (xhr.status === 404) {
isClustered = false; isClustered = false;
deferred.resolve(); deferred.resolve();
@ -70,7 +70,7 @@ nf.Provenance = (function () {
type: 'GET', type: 'GET',
url: config.urls.config, url: config.urls.config,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var config = response.config; var config = response.config;
// store the controller name // store the controller name
@ -80,7 +80,7 @@ nf.Provenance = (function () {
if (!nf.Common.isBlank(config.contentViewerUrl)) { if (!nf.Common.isBlank(config.contentViewerUrl)) {
$('#nifi-content-viewer-url').text(config.contentViewerUrl); $('#nifi-content-viewer-url').text(config.contentViewerUrl);
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -92,7 +92,7 @@ nf.Provenance = (function () {
type: 'GET', type: 'GET',
url: config.urls.authorities, url: config.urls.authorities,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.authorities)) { if (nf.Common.isDefinedAndNotNull(response.authorities)) {
// record the users authorities // record the users authorities
nf.Common.setAuthorities(response.authorities); nf.Common.setAuthorities(response.authorities);
@ -100,7 +100,7 @@ nf.Provenance = (function () {
} else { } else {
deferred.reject(); deferred.reject();
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
deferred.reject(); deferred.reject();
}); });
@ -124,7 +124,7 @@ nf.Provenance = (function () {
type: 'GET', type: 'GET',
url: config.urls.banners, url: config.urls.banners,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// ensure the banners response is specified // ensure the banners response is specified
if (nf.Common.isDefinedAndNotNull(response.banners)) { if (nf.Common.isDefinedAndNotNull(response.banners)) {
if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
@ -156,7 +156,7 @@ nf.Provenance = (function () {
} }
deferred.resolve(); deferred.resolve();
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
deferred.reject(); deferred.reject();
}); });
@ -188,14 +188,14 @@ nf.Provenance = (function () {
type: 'GET', type: 'GET',
url: config.urls.controllerAbout, url: config.urls.controllerAbout,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var aboutDetails = response.about; var aboutDetails = response.about;
var provenanceTitle = aboutDetails.title + ' Data Provenance'; var provenanceTitle = aboutDetails.title + ' Data Provenance';
// set the document title and the about title // set the document title and the about title
document.title = provenanceTitle; document.title = provenanceTitle;
$('#provenance-header-text').text(provenanceTitle); $('#provenance-header-text').text(provenanceTitle);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}); });
}); });
}); });

View File

@ -45,7 +45,7 @@ nf.SummaryTable = (function () {
var loadChartCapabilities = function () { var loadChartCapabilities = function () {
return $.Deferred(function (deferred) { return $.Deferred(function (deferred) {
if (nf.Common.SUPPORTS_SVG) { if (nf.Common.SUPPORTS_SVG) {
nf.Common.cachedScript(config.urls.d3Script).then(function () { nf.Common.cachedScript(config.urls.d3Script).done(function () {
// get the controller config to get the server offset // get the controller config to get the server offset
var configRequest = $.ajax({ var configRequest = $.ajax({
type: 'GET', type: 'GET',
@ -54,17 +54,17 @@ nf.SummaryTable = (function () {
}); });
// get the config details and load the chart script // get the config details and load the chart script
$.when(configRequest, nf.Common.cachedScript(config.urls.statusHistory)).then(function (response) { $.when(configRequest, nf.Common.cachedScript(config.urls.statusHistory)).done(function (response) {
var configResponse = response[0]; var configResponse = response[0];
var configDetails = configResponse.config; var configDetails = configResponse.config;
// initialize the chart // initialize the chart
nf.StatusHistory.init(configDetails.timeOffset); nf.StatusHistory.init(configDetails.timeOffset);
deferred.resolve(); deferred.resolve();
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
} else { } else {
@ -1549,7 +1549,7 @@ nf.SummaryTable = (function () {
type: 'GET', type: 'GET',
url: nf.SummaryTable.systemDiagnosticsUrl, url: nf.SummaryTable.systemDiagnosticsUrl,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var systemDiagnostics = response.systemDiagnostics; var systemDiagnostics = response.systemDiagnostics;
// heap // heap
@ -1588,7 +1588,7 @@ nf.SummaryTable = (function () {
// update the stats last refreshed timestamp // update the stats last refreshed timestamp
$('#system-diagnostics-last-refreshed').text(systemDiagnostics.statsLastRefreshed); $('#system-diagnostics-last-refreshed').text(systemDiagnostics.statsLastRefreshed);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -1717,7 +1717,7 @@ nf.SummaryTable = (function () {
verbose: true verbose: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.clusterProcessorStatus)) { if (nf.Common.isDefinedAndNotNull(response.clusterProcessorStatus)) {
var clusterProcessorStatus = response.clusterProcessorStatus; var clusterProcessorStatus = response.clusterProcessorStatus;
@ -1755,7 +1755,7 @@ nf.SummaryTable = (function () {
// update the stats last refreshed timestamp // update the stats last refreshed timestamp
$('#cluster-processor-summary-last-refreshed').text(clusterProcessorStatus.statsLastRefreshed); $('#cluster-processor-summary-last-refreshed').text(clusterProcessorStatus.statsLastRefreshed);
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -1772,7 +1772,7 @@ nf.SummaryTable = (function () {
verbose: true verbose: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.clusterConnectionStatus)) { if (nf.Common.isDefinedAndNotNull(response.clusterConnectionStatus)) {
var clusterConnectionStatus = response.clusterConnectionStatus; var clusterConnectionStatus = response.clusterConnectionStatus;
@ -1807,7 +1807,7 @@ nf.SummaryTable = (function () {
// update the stats last refreshed timestamp // update the stats last refreshed timestamp
$('#cluster-connection-summary-last-refreshed').text(clusterConnectionStatus.statsLastRefreshed); $('#cluster-connection-summary-last-refreshed').text(clusterConnectionStatus.statsLastRefreshed);
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -1824,7 +1824,7 @@ nf.SummaryTable = (function () {
verbose: true verbose: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.clusterPortStatus)) { if (nf.Common.isDefinedAndNotNull(response.clusterPortStatus)) {
var clusterInputPortStatus = response.clusterPortStatus; var clusterInputPortStatus = response.clusterPortStatus;
@ -1856,7 +1856,7 @@ nf.SummaryTable = (function () {
// update the stats last refreshed timestamp // update the stats last refreshed timestamp
$('#cluster-input-port-summary-last-refreshed').text(clusterInputPortStatus.statsLastRefreshed); $('#cluster-input-port-summary-last-refreshed').text(clusterInputPortStatus.statsLastRefreshed);
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -1873,7 +1873,7 @@ nf.SummaryTable = (function () {
verbose: true verbose: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.clusterPortStatus)) { if (nf.Common.isDefinedAndNotNull(response.clusterPortStatus)) {
var clusterOutputPortStatus = response.clusterPortStatus; var clusterOutputPortStatus = response.clusterPortStatus;
@ -1905,7 +1905,7 @@ nf.SummaryTable = (function () {
// update the stats last refreshed timestamp // update the stats last refreshed timestamp
$('#cluster-output-port-summary-last-refreshed').text(clusterOutputPortStatus.statsLastRefreshed); $('#cluster-output-port-summary-last-refreshed').text(clusterOutputPortStatus.statsLastRefreshed);
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -1922,7 +1922,7 @@ nf.SummaryTable = (function () {
verbose: true verbose: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.clusterRemoteProcessGroupStatus)) { if (nf.Common.isDefinedAndNotNull(response.clusterRemoteProcessGroupStatus)) {
var clusterRemoteProcessGroupStatus = response.clusterRemoteProcessGroupStatus; var clusterRemoteProcessGroupStatus = response.clusterRemoteProcessGroupStatus;
@ -1957,7 +1957,7 @@ nf.SummaryTable = (function () {
// update the stats last refreshed timestamp // update the stats last refreshed timestamp
$('#cluster-remote-process-group-summary-last-refreshed').text(clusterRemoteProcessGroupStatus.statsLastRefreshed); $('#cluster-remote-process-group-summary-last-refreshed').text(clusterRemoteProcessGroupStatus.statsLastRefreshed);
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
return { return {
@ -1965,10 +1965,12 @@ nf.SummaryTable = (function () {
* URL for loading system diagnostics. * URL for loading system diagnostics.
*/ */
systemDiagnosticsUrl: null, systemDiagnosticsUrl: null,
/** /**
* URL for loading the summary. * URL for loading the summary.
*/ */
url: null, url: null,
/** /**
* Initializes the status table. * Initializes the status table.
* *
@ -1980,18 +1982,19 @@ nf.SummaryTable = (function () {
nf.SummaryTable.systemDiagnosticsUrl = config.urls.systemDiagnostics; nf.SummaryTable.systemDiagnosticsUrl = config.urls.systemDiagnostics;
return $.Deferred(function (deferred) { return $.Deferred(function (deferred) {
loadChartCapabilities().then(function () { loadChartCapabilities().done(function () {
// initialize the processor/connection details dialog // initialize the processor/connection details dialog
nf.ProcessorDetails.init(false); nf.ProcessorDetails.init(false);
nf.ConnectionDetails.init(false); nf.ConnectionDetails.init(false);
initSummaryTable(isClustered); initSummaryTable(isClustered);
deferred.resolve(); deferred.resolve();
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
}).promise(); }).promise();
}, },
/** /**
* Update the size of the grid based on its container's current size. * Update the size of the grid based on its container's current size.
*/ */
@ -2021,6 +2024,7 @@ nf.SummaryTable = (function () {
remoteProcessGroupGrid.resizeCanvas(); remoteProcessGroupGrid.resizeCanvas();
} }
}, },
/** /**
* Load the processor status table. * Load the processor status table.
*/ */
@ -2032,7 +2036,7 @@ nf.SummaryTable = (function () {
recursive: true recursive: true
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var processGroupStatus = response.processGroupStatus; var processGroupStatus = response.processGroupStatus;
if (nf.Common.isDefinedAndNotNull(processGroupStatus)) { if (nf.Common.isDefinedAndNotNull(processGroupStatus)) {
@ -2103,8 +2107,9 @@ nf.SummaryTable = (function () {
} else { } else {
$('#total-items').text('0'); $('#total-items').text('0');
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
// processor actions // processor actions
/** /**
@ -2120,6 +2125,7 @@ nf.SummaryTable = (function () {
nf.ProcessorDetails.showDetails(item.groupId, item.id); nf.ProcessorDetails.showDetails(item.groupId, item.id);
} }
}, },
/** /**
* Goes to the specified processor. * Goes to the specified processor.
* *
@ -2133,6 +2139,7 @@ nf.SummaryTable = (function () {
goTo(item.groupId, item.id); goTo(item.groupId, item.id);
} }
}, },
/** /**
* Shows the processor status history for a cluster. * Shows the processor status history for a cluster.
* *
@ -2146,6 +2153,7 @@ nf.SummaryTable = (function () {
nf.StatusHistory.showClusterProcessorChart(item.groupId, item.id); nf.StatusHistory.showClusterProcessorChart(item.groupId, item.id);
} }
}, },
/** /**
* Shows the processor status history. * Shows the processor status history.
* *
@ -2159,6 +2167,7 @@ nf.SummaryTable = (function () {
nf.StatusHistory.showStandaloneProcessorChart(item.groupId, item.id); nf.StatusHistory.showStandaloneProcessorChart(item.groupId, item.id);
} }
}, },
/** /**
* Shows the cluster processor details dialog for the specified processor. * Shows the cluster processor details dialog for the specified processor.
* *
@ -2180,6 +2189,7 @@ nf.SummaryTable = (function () {
$('#cluster-processor-summary-dialog').modal('show'); $('#cluster-processor-summary-dialog').modal('show');
} }
}, },
// connection actions // connection actions
/** /**
@ -2195,6 +2205,7 @@ nf.SummaryTable = (function () {
nf.ConnectionDetails.showDetails(item.groupId, item.id); nf.ConnectionDetails.showDetails(item.groupId, item.id);
} }
}, },
/** /**
* Goes to the specified connection. * Goes to the specified connection.
* *
@ -2208,6 +2219,7 @@ nf.SummaryTable = (function () {
goTo(item.groupId, item.id); goTo(item.groupId, item.id);
} }
}, },
/** /**
* Shows the connection status history for a cluster. * Shows the connection status history for a cluster.
* *
@ -2221,6 +2233,7 @@ nf.SummaryTable = (function () {
nf.StatusHistory.showClusterConnectionChart(item.groupId, item.id); nf.StatusHistory.showClusterConnectionChart(item.groupId, item.id);
} }
}, },
/** /**
* Shows the connection status history. * Shows the connection status history.
* *
@ -2234,6 +2247,7 @@ nf.SummaryTable = (function () {
nf.StatusHistory.showStandaloneConnectionChart(item.groupId, item.id); nf.StatusHistory.showStandaloneConnectionChart(item.groupId, item.id);
} }
}, },
/** /**
* Shows the cluster connection details dialog for the specified connection. * Shows the cluster connection details dialog for the specified connection.
* *
@ -2255,6 +2269,7 @@ nf.SummaryTable = (function () {
$('#cluster-connection-summary-dialog').modal('show'); $('#cluster-connection-summary-dialog').modal('show');
} }
}, },
// input actions // input actions
/** /**
@ -2270,6 +2285,7 @@ nf.SummaryTable = (function () {
goTo(item.groupId, item.id); goTo(item.groupId, item.id);
} }
}, },
/** /**
* Shows the cluster input port details dialog for the specified connection. * Shows the cluster input port details dialog for the specified connection.
* *
@ -2291,6 +2307,7 @@ nf.SummaryTable = (function () {
$('#cluster-input-port-summary-dialog').modal('show'); $('#cluster-input-port-summary-dialog').modal('show');
} }
}, },
// output actions // output actions
/** /**
@ -2306,6 +2323,7 @@ nf.SummaryTable = (function () {
goTo(item.groupId, item.id); goTo(item.groupId, item.id);
} }
}, },
/** /**
* Shows the cluster output port details dialog for the specified connection. * Shows the cluster output port details dialog for the specified connection.
* *
@ -2327,6 +2345,7 @@ nf.SummaryTable = (function () {
$('#cluster-output-port-summary-dialog').modal('show'); $('#cluster-output-port-summary-dialog').modal('show');
} }
}, },
// remote process group actions // remote process group actions
/** /**
@ -2342,6 +2361,7 @@ nf.SummaryTable = (function () {
goTo(item.groupId, item.id); goTo(item.groupId, item.id);
} }
}, },
/** /**
* Shows the remote process group status history for a cluster. * Shows the remote process group status history for a cluster.
* *
@ -2355,6 +2375,7 @@ nf.SummaryTable = (function () {
nf.StatusHistory.showClusterRemoteProcessGroupChart(item.groupId, item.id); nf.StatusHistory.showClusterRemoteProcessGroupChart(item.groupId, item.id);
} }
}, },
/** /**
* Shows the remote process group status history. * Shows the remote process group status history.
* *
@ -2368,6 +2389,7 @@ nf.SummaryTable = (function () {
nf.StatusHistory.showStandaloneRemoteProcessGroupChart(item.groupId, item.id); nf.StatusHistory.showStandaloneRemoteProcessGroupChart(item.groupId, item.id);
} }
}, },
/** /**
* Shows the cluster remote process group details dialog for the specified connection. * Shows the cluster remote process group details dialog for the specified connection.
* *

View File

@ -40,17 +40,17 @@ nf.Summary = (function () {
$.ajax({ $.ajax({
type: 'HEAD', type: 'HEAD',
url: config.urls.cluster url: config.urls.cluster
}).then(function () { }).done(function () {
nf.SummaryTable.init(true).then(function () { nf.SummaryTable.init(true).done(function () {
deferred.resolve(); deferred.resolve();
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
if (xhr.status === 404) { if (xhr.status === 404) {
nf.SummaryTable.init(false).then(function () { nf.SummaryTable.init(false).done(function () {
deferred.resolve(); deferred.resolve();
}, function () { }).fail(function () {
deferred.reject(); deferred.reject();
}); });
} else { } else {
@ -84,7 +84,7 @@ nf.Summary = (function () {
type: 'GET', type: 'GET',
url: config.urls.banners, url: config.urls.banners,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// ensure the banners response is specified // ensure the banners response is specified
if (nf.Common.isDefinedAndNotNull(response.banners)) { if (nf.Common.isDefinedAndNotNull(response.banners)) {
if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
@ -116,7 +116,7 @@ nf.Summary = (function () {
} }
deferred.resolve(); deferred.resolve();
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
deferred.reject(); deferred.reject();
}); });
@ -145,14 +145,14 @@ nf.Summary = (function () {
type: 'GET', type: 'GET',
url: config.urls.controllerAbout, url: config.urls.controllerAbout,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var aboutDetails = response.about; var aboutDetails = response.about;
var statusTitle = aboutDetails.title + ' Summary'; var statusTitle = aboutDetails.title + ' Summary';
// set the document title and the about title // set the document title and the about title
document.title = statusTitle; document.title = statusTitle;
$('#status-header-text').text(statusTitle); $('#status-header-text').text(statusTitle);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
var setBodySize = function () { var setBodySize = function () {
$('body').css({ $('body').css({

View File

@ -63,11 +63,11 @@ nf.TemplatesTable = (function () {
type: 'DELETE', type: 'DELETE',
url: config.urls.templates + '/' + encodeURIComponent(templateId), url: config.urls.templates + '/' + encodeURIComponent(templateId),
dataType: 'json' dataType: 'json'
}).then(function () { }).done(function () {
var templatesGrid = $('#templates-table').data('gridInstance'); var templatesGrid = $('#templates-table').data('gridInstance');
var templatesData = templatesGrid.getData(); var templatesData = templatesGrid.getData();
templatesData.deleteItem(templateId); templatesData.deleteItem(templateId);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}; };
/** /**
@ -249,6 +249,7 @@ nf.TemplatesTable = (function () {
// initialize the number of displayed items // initialize the number of displayed items
$('#displayed-templates').text('0'); $('#displayed-templates').text('0');
}, },
/** /**
* Update the size of the grid based on its container's current size. * Update the size of the grid based on its container's current size.
*/ */
@ -258,6 +259,7 @@ nf.TemplatesTable = (function () {
templateGrid.resizeCanvas(); templateGrid.resizeCanvas();
} }
}, },
/** /**
* Exports the specified template. * Exports the specified template.
* *
@ -271,6 +273,7 @@ nf.TemplatesTable = (function () {
nf.Common.submit('GET', config.urls.templates + '/' + encodeURIComponent(item.id)); nf.Common.submit('GET', config.urls.templates + '/' + encodeURIComponent(item.id));
} }
}, },
/** /**
* Prompts the user before attempting to delete the specified template. * Prompts the user before attempting to delete the specified template.
* *
@ -292,6 +295,7 @@ nf.TemplatesTable = (function () {
}); });
} }
}, },
/** /**
* Load the processor templates table. * Load the processor templates table.
*/ */
@ -303,7 +307,7 @@ nf.TemplatesTable = (function () {
verbose: false verbose: false
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// ensure there are groups specified // ensure there are groups specified
if (nf.Common.isDefinedAndNotNull(response.templates)) { if (nf.Common.isDefinedAndNotNull(response.templates)) {
var templatesGrid = $('#templates-table').data('gridInstance'); var templatesGrid = $('#templates-table').data('gridInstance');
@ -322,7 +326,7 @@ nf.TemplatesTable = (function () {
} else { } else {
$('#total-templates').text('0'); $('#total-templates').text('0');
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
}; };
}()); }());

View File

@ -41,7 +41,7 @@ nf.Templates = (function () {
type: 'GET', type: 'GET',
url: config.urls.authorities, url: config.urls.authorities,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.authorities)) { if (nf.Common.isDefinedAndNotNull(response.authorities)) {
// record the users authorities // record the users authorities
nf.Common.setAuthorities(response.authorities); nf.Common.setAuthorities(response.authorities);
@ -49,7 +49,7 @@ nf.Templates = (function () {
} else { } else {
deferred.reject(); deferred.reject();
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
deferred.reject(); deferred.reject();
}); });
@ -154,7 +154,7 @@ nf.Templates = (function () {
type: 'GET', type: 'GET',
url: config.urls.banners, url: config.urls.banners,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// ensure the banners response is specified // ensure the banners response is specified
if (nf.Common.isDefinedAndNotNull(response.banners)) { if (nf.Common.isDefinedAndNotNull(response.banners)) {
if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') { if (nf.Common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
@ -186,7 +186,7 @@ nf.Templates = (function () {
} }
deferred.resolve(); deferred.resolve();
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
deferred.reject(); deferred.reject();
}); });
@ -219,14 +219,14 @@ nf.Templates = (function () {
type: 'GET', type: 'GET',
url: config.urls.controllerAbout, url: config.urls.controllerAbout,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var aboutDetails = response.about; var aboutDetails = response.about;
var templatesTitle = aboutDetails.title + ' Templates'; var templatesTitle = aboutDetails.title + ' Templates';
// set the document title and the about title // set the document title and the about title
document.title = templatesTitle; document.title = templatesTitle;
$('#templates-header-text').text(templatesTitle); $('#templates-header-text').text(templatesTitle);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}); });
}); });
}); });

View File

@ -114,7 +114,7 @@ nf.UsersTable = (function () {
data: JSON.stringify(userEntity), data: JSON.stringify(userEntity),
contentType: 'application/json', contentType: 'application/json',
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.user)) { if (nf.Common.isDefinedAndNotNull(response.user)) {
var user = response.user; var user = response.user;
@ -123,7 +123,7 @@ nf.UsersTable = (function () {
var usersData = usersGrid.getData(); var usersData = usersGrid.getData();
usersData.updateItem(user.id, user); usersData.updateItem(user.id, user);
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
// hide the dialog // hide the dialog
$('#user-roles-dialog').modal('hide'); $('#user-roles-dialog').modal('hide');
@ -203,9 +203,9 @@ nf.UsersTable = (function () {
data: JSON.stringify(userGroupEntity), data: JSON.stringify(userGroupEntity),
contentType: 'application/json', contentType: 'application/json',
dataType: 'json' dataType: 'json'
}).then(function () { }).done(function () {
nf.UsersTable.loadUsersTable(); nf.UsersTable.loadUsersTable();
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
// hide the dialog // hide the dialog
$('#group-roles-dialog').modal('hide'); $('#group-roles-dialog').modal('hide');
@ -244,9 +244,9 @@ nf.UsersTable = (function () {
type: 'DELETE', type: 'DELETE',
url: config.urls.users + '/' + encodeURIComponent(userId), url: config.urls.users + '/' + encodeURIComponent(userId),
dataType: 'json' dataType: 'json'
}).then(function () { }).done(function () {
nf.UsersTable.loadUsersTable(); nf.UsersTable.loadUsersTable();
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
// hide the dialog // hide the dialog
$('#user-delete-dialog').modal('hide'); $('#user-delete-dialog').modal('hide');
@ -291,7 +291,7 @@ nf.UsersTable = (function () {
'status': 'DISABLED' 'status': 'DISABLED'
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.user)) { if (nf.Common.isDefinedAndNotNull(response.user)) {
var user = response.user; var user = response.user;
@ -300,7 +300,7 @@ nf.UsersTable = (function () {
var usersData = usersGrid.getData(); var usersData = usersGrid.getData();
usersData.updateItem(user.id, user); usersData.updateItem(user.id, user);
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
// hide the dialog // hide the dialog
$('#user-revoke-dialog').modal('hide'); $('#user-revoke-dialog').modal('hide');
@ -345,9 +345,9 @@ nf.UsersTable = (function () {
'status': 'DISABLED' 'status': 'DISABLED'
}, },
dataType: 'json' dataType: 'json'
}).then(function () { }).done(function () {
nf.UsersTable.loadUsersTable(); nf.UsersTable.loadUsersTable();
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
// hide the dialog // hide the dialog
$('#group-revoke-dialog').modal('hide'); $('#group-revoke-dialog').modal('hide');
@ -407,9 +407,9 @@ nf.UsersTable = (function () {
data: JSON.stringify(userGroupEntity), data: JSON.stringify(userGroupEntity),
contentType: 'application/json', contentType: 'application/json',
dataType: 'json' dataType: 'json'
}).then(function () { }).done(function () {
nf.UsersTable.loadUsersTable(); nf.UsersTable.loadUsersTable();
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
// hide the dialog // hide the dialog
@ -815,6 +815,7 @@ nf.UsersTable = (function () {
initGroupRevokeDialog(); initGroupRevokeDialog();
initUsersTable(); initUsersTable();
}, },
/** /**
* Disables the specified user's account. * Disables the specified user's account.
* *
@ -834,6 +835,7 @@ nf.UsersTable = (function () {
$('#user-revoke-dialog').modal('show'); $('#user-revoke-dialog').modal('show');
} }
}, },
/** /**
* Delete's the specified user's account. * Delete's the specified user's account.
* *
@ -853,6 +855,7 @@ nf.UsersTable = (function () {
$('#user-delete-dialog').modal('show'); $('#user-delete-dialog').modal('show');
} }
}, },
/** /**
* Disables the specified group's account. * Disables the specified group's account.
* *
@ -871,6 +874,7 @@ nf.UsersTable = (function () {
$('#group-revoke-dialog').modal('show'); $('#group-revoke-dialog').modal('show');
} }
}, },
/** /**
* Updates the specified users's level of access. * Updates the specified users's level of access.
* *
@ -913,6 +917,7 @@ nf.UsersTable = (function () {
$('#user-roles-dialog').modal('show'); $('#user-roles-dialog').modal('show');
} }
}, },
/** /**
* Updates the specified groups level of access. * Updates the specified groups level of access.
* *
@ -931,6 +936,7 @@ nf.UsersTable = (function () {
$('#group-roles-dialog').modal('show'); $('#group-roles-dialog').modal('show');
} }
}, },
/** /**
* Prompts to verify group removal. * Prompts to verify group removal.
* *
@ -951,13 +957,14 @@ nf.UsersTable = (function () {
type: 'DELETE', type: 'DELETE',
url: config.urls.userGroups + '/' + encodeURIComponent(item.userGroup) + '/users/' + encodeURIComponent(item.id), url: config.urls.userGroups + '/' + encodeURIComponent(item.userGroup) + '/users/' + encodeURIComponent(item.id),
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
nf.UsersTable.loadUsersTable(); nf.UsersTable.loadUsersTable();
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
}); });
} }
}, },
/** /**
* Ungroups the specified group. * Ungroups the specified group.
* *
@ -978,13 +985,14 @@ nf.UsersTable = (function () {
type: 'DELETE', type: 'DELETE',
url: config.urls.userGroups + '/' + encodeURIComponent(item.userGroup), url: config.urls.userGroups + '/' + encodeURIComponent(item.userGroup),
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
nf.UsersTable.loadUsersTable(); nf.UsersTable.loadUsersTable();
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
} }
}); });
} }
}, },
/** /**
* Update the size of the grid based on its container's current size. * Update the size of the grid based on its container's current size.
*/ */
@ -994,6 +1002,7 @@ nf.UsersTable = (function () {
grid.resizeCanvas(); grid.resizeCanvas();
} }
}, },
/** /**
* Load the processor status table. * Load the processor status table.
*/ */
@ -1005,7 +1014,7 @@ nf.UsersTable = (function () {
'grouped': $('#group-collaspe-checkbox').hasClass('checkbox-checked') 'grouped': $('#group-collaspe-checkbox').hasClass('checkbox-checked')
}, },
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
// ensure there are users // ensure there are users
if (nf.Common.isDefinedAndNotNull(response.users)) { if (nf.Common.isDefinedAndNotNull(response.users)) {
var usersGrid = $('#users-table').data('gridInstance'); var usersGrid = $('#users-table').data('gridInstance');
@ -1027,8 +1036,9 @@ nf.UsersTable = (function () {
} else { } else {
$('#total-users').text('0'); $('#total-users').text('0');
} }
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}, },
/** /**
* Shows details for the specified user. * Shows details for the specified user.
* *

View File

@ -41,7 +41,7 @@ nf.Users = (function () {
type: 'GET', type: 'GET',
url: config.urls.authorities, url: config.urls.authorities,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
if (nf.Common.isDefinedAndNotNull(response.authorities)) { if (nf.Common.isDefinedAndNotNull(response.authorities)) {
// record the users authorities // record the users authorities
nf.Common.setAuthorities(response.authorities); nf.Common.setAuthorities(response.authorities);
@ -49,7 +49,7 @@ nf.Users = (function () {
} else { } else {
deferred.reject(); deferred.reject();
} }
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
deferred.reject(); deferred.reject();
}); });
@ -69,7 +69,7 @@ nf.Users = (function () {
type: 'GET', type: 'GET',
url: config.urls.banners, url: config.urls.banners,
dataType: 'json' dataType: 'json'
}).then(function (bannerResponse) { }).done(function (bannerResponse) {
// ensure the banners response is specified // ensure the banners response is specified
if (nf.Common.isDefinedAndNotNull(bannerResponse.banners)) { if (nf.Common.isDefinedAndNotNull(bannerResponse.banners)) {
if (nf.Common.isDefinedAndNotNull(bannerResponse.banners.headerText) && bannerResponse.banners.headerText !== '') { if (nf.Common.isDefinedAndNotNull(bannerResponse.banners.headerText) && bannerResponse.banners.headerText !== '') {
@ -101,7 +101,7 @@ nf.Users = (function () {
} }
deferred.resolve(); deferred.resolve();
}, function (xhr, status, error) { }).fail(function (xhr, status, error) {
nf.Common.handleAjaxError(xhr, status, error); nf.Common.handleAjaxError(xhr, status, error);
deferred.reject(); deferred.reject();
}); });
@ -133,14 +133,14 @@ nf.Users = (function () {
type: 'GET', type: 'GET',
url: config.urls.controllerAbout, url: config.urls.controllerAbout,
dataType: 'json' dataType: 'json'
}).then(function (response) { }).done(function (response) {
var aboutDetails = response.about; var aboutDetails = response.about;
var countersTitle = aboutDetails.title + ' Users'; var countersTitle = aboutDetails.title + ' Users';
// set the document title and the about title // set the document title and the about title
document.title = countersTitle; document.title = countersTitle;
$('#users-header-text').text(countersTitle); $('#users-header-text').text(countersTitle);
}, nf.Common.handleAjaxError); }).fail(nf.Common.handleAjaxError);
}); });
}); });
}); });