[NIFI-3358] update naming conventions to avoid conflicts. This closes #1533

This commit is contained in:
Scott Aslan 2017-02-22 15:37:45 -05:00 committed by Matt Gilman
parent 64379d2007
commit 2c374bafaa
No known key found for this signature in database
GPG Key ID: DF61EC19432AEE37
85 changed files with 2738 additions and 2700 deletions

View File

@ -167,37 +167,37 @@
var dialog = $(this).addClass('dialog cancellable modal');
dialog.css('display', 'none');
var nfDialog = {};
var nfDialogData = {};
if (isDefinedAndNotNull(dialog.data('nf-dialog'))) {
nfDialog = dialog.data('nf-dialog');
nfDialogData = dialog.data('nf-dialog');
}
// ensure the options have been properly specified
if (isDefinedAndNotNull(options)) {
$.extend(nfDialog, options);
$.extend(nfDialogData, options);
//persist data attribute
dialog.data('nfDialog', nfDialog);
dialog.data('nfDialog', nfDialogData);
}
// determine if dialog needs a header
if (!isDefinedAndNotNull(nfDialog.header) || nfDialog.header) {
if (!isDefinedAndNotNull(nfDialogData.header) || nfDialogData.header) {
var dialogHeaderText = $('<span class="dialog-header-text"></span>');
var dialogHeader = $('<div class="dialog-header"></div>').prepend(dialogHeaderText);
// determine if the specified header text is null
if (!isBlank(nfDialog.headerText)) {
dialogHeaderText.text(nfDialog.headerText);
if (!isBlank(nfDialogData.headerText)) {
dialogHeaderText.text(nfDialogData.headerText);
}
dialog.prepend(dialogHeader);
}
// determine if dialog needs footer/buttons
if (!isDefinedAndNotNull(nfDialog.footer) || nfDialog.footer) {
if (!isDefinedAndNotNull(nfDialogData.footer) || nfDialogData.footer) {
// add the buttons
addButtons(dialog, nfDialog.buttons);
addButtons(dialog, nfDialogData.buttons);
}
});
},
@ -210,17 +210,17 @@
setCloseHandler: function (handler) {
return this.each(function (index, dialog) {
var nfDialog = {};
var nfDialogData = {};
if (isDefinedAndNotNull($(this).data('nf-dialog'))) {
nfDialog = $(dialog).data('nf-dialog');
nfDialogData = $(dialog).data('nf-dialog');
}
if (!isDefinedAndNotNull(nfDialog.handler)){
nfDialog.handler = {};
if (!isDefinedAndNotNull(nfDialogData.handler)){
nfDialogData.handler = {};
}
nfDialog.handler.close = handler;
nfDialogData.handler.close = handler;
//persist data attribute
$(dialog).data('nfDialog', nfDialog);
$(dialog).data('nfDialog', nfDialogData);
});
},
@ -232,17 +232,17 @@
setOpenHandler: function (handler) {
return this.each(function (index, dialog) {
var nfDialog = {};
var nfDialogData = {};
if (isDefinedAndNotNull($(this).data('nf-dialog'))) {
nfDialog = $(dialog).data('nf-dialog');
nfDialogData = $(dialog).data('nf-dialog');
}
if (!isDefinedAndNotNull(nfDialog.handler)){
nfDialog.handler = {};
if (!isDefinedAndNotNull(nfDialogData.handler)){
nfDialogData.handler = {};
}
nfDialog.handler.open = handler;
nfDialogData.handler.open = handler;
//persist data attribute
$(dialog).data('nfDialog', nfDialog);
$(dialog).data('nfDialog', nfDialogData);
});
},
@ -254,17 +254,17 @@
setResizeHandler: function (handler) {
return this.each(function (index, dialog) {
var nfDialog = {};
var nfDialogData = {};
if (isDefinedAndNotNull($(this).data('nf-dialog'))) {
nfDialog = $(dialog).data('nf-dialog');
nfDialogData = $(dialog).data('nf-dialog');
}
if (!isDefinedAndNotNull(nfDialog.handler)){
nfDialog.handler = {};
if (!isDefinedAndNotNull(nfDialogData.handler)){
nfDialogData.handler = {};
}
nfDialog.handler.resize = handler;
nfDialogData.handler.resize = handler;
//persist data attribute
$(dialog).data('nfDialog', nfDialog);
$(dialog).data('nfDialog', nfDialogData);
});
},
@ -318,147 +318,147 @@
var dialog = $(this);
var dialogContent = dialog.find('.dialog-content');
var nfDialog = {};
var nfDialogData = {};
if (isDefinedAndNotNull(dialog.data('nf-dialog'))) {
nfDialog = dialog.data('nf-dialog');
nfDialogData = dialog.data('nf-dialog');
}
//initialize responsive properties
if (!isDefinedAndNotNull(nfDialog.responsive)) {
nfDialog.responsive = {};
if (!isDefinedAndNotNull(nfDialogData.responsive)) {
nfDialogData.responsive = {};
if (!isDefinedAndNotNull(nfDialog.responsive.x)) {
nfDialog.responsive.x = true;
if (!isDefinedAndNotNull(nfDialogData.responsive.x)) {
nfDialogData.responsive.x = true;
}
if (!isDefinedAndNotNull(nfDialog.responsive.y)) {
nfDialog.responsive.y = true;
if (!isDefinedAndNotNull(nfDialogData.responsive.y)) {
nfDialogData.responsive.y = true;
}
} else {
if (!isDefinedAndNotNull(nfDialog.responsive.x)) {
nfDialog.responsive.x = true;
if (!isDefinedAndNotNull(nfDialogData.responsive.x)) {
nfDialogData.responsive.x = true;
} else {
nfDialog.responsive.x = (nfDialog.responsive.x == "true" || nfDialog.responsive.x == true) ? true : false;
nfDialogData.responsive.x = (nfDialogData.responsive.x == "true" || nfDialogData.responsive.x == true) ? true : false;
}
if (!isDefinedAndNotNull(nfDialog.responsive.y)) {
nfDialog.responsive.y = true;
if (!isDefinedAndNotNull(nfDialogData.responsive.y)) {
nfDialogData.responsive.y = true;
} else {
nfDialog.responsive.y = (nfDialog.responsive.y == "true" || nfDialog.responsive.y == true) ? true : false;
nfDialogData.responsive.y = (nfDialogData.responsive.y == "true" || nfDialogData.responsive.y == true) ? true : false;
}
}
if (nfDialog.responsive.y || nfDialog.responsive.x) {
if (nfDialogData.responsive.y || nfDialogData.responsive.x) {
var fullscreenHeight;
var fullscreenWidth;
if (isDefinedAndNotNull(nfDialog.responsive['fullscreen-height'])) {
fullscreenHeight = parseInt(nfDialog.responsive['fullscreen-height'], 10);
if (isDefinedAndNotNull(nfDialogData.responsive['fullscreen-height'])) {
fullscreenHeight = parseInt(nfDialogData.responsive['fullscreen-height'], 10);
} else {
nfDialog.responsive['fullscreen-height'] = dialog.height() + 'px';
nfDialogData.responsive['fullscreen-height'] = dialog.height() + 'px';
fullscreenHeight = parseInt(nfDialog.responsive['fullscreen-height'], 10);
fullscreenHeight = parseInt(nfDialogData.responsive['fullscreen-height'], 10);
}
if (isDefinedAndNotNull(nfDialog.responsive['fullscreen-width'])) {
fullscreenWidth = parseInt(nfDialog.responsive['fullscreen-width'], 10);
if (isDefinedAndNotNull(nfDialogData.responsive['fullscreen-width'])) {
fullscreenWidth = parseInt(nfDialogData.responsive['fullscreen-width'], 10);
} else {
nfDialog.responsive['fullscreen-width'] = dialog.width() + 'px';
nfDialogData.responsive['fullscreen-width'] = dialog.width() + 'px';
fullscreenWidth = parseInt(nfDialog.responsive['fullscreen-width'], 10);
fullscreenWidth = parseInt(nfDialogData.responsive['fullscreen-width'], 10);
}
if (!isDefinedAndNotNull(nfDialog.width)) {
nfDialog.width = dialog.css('width');
if (!isDefinedAndNotNull(nfDialogData.width)) {
nfDialogData.width = dialog.css('width');
}
if (!isDefinedAndNotNull(nfDialog['min-width'])) {
if (!isDefinedAndNotNull(nfDialogData['min-width'])) {
if (parseInt(dialog.css('min-width'), 10) > 0) {
nfDialog['min-width'] = dialog.css('min-width');
nfDialogData['min-width'] = dialog.css('min-width');
} else {
nfDialog['min-width'] = nfDialog.width;
nfDialogData['min-width'] = nfDialogData.width;
}
}
//min-width should always be set in terms of px
if (nfDialog['min-width'].indexOf("%") > 0) {
nfDialog['min-width'] = ($(window).width() * (parseInt(nfDialog['min-width'], 10) / 100)) + 'px';
if (nfDialogData['min-width'].indexOf("%") > 0) {
nfDialogData['min-width'] = ($(window).width() * (parseInt(nfDialogData['min-width'], 10) / 100)) + 'px';
}
if (!isDefinedAndNotNull(nfDialog.height)) {
nfDialog.height = dialog.css('height');
if (!isDefinedAndNotNull(nfDialogData.height)) {
nfDialogData.height = dialog.css('height');
}
if (!isDefinedAndNotNull(nfDialog['min-height'])) {
if (!isDefinedAndNotNull(nfDialogData['min-height'])) {
if (parseInt(dialog.css('min-height'), 10) > 0) {
nfDialog['min-height'] = dialog.css('min-height');
nfDialogData['min-height'] = dialog.css('min-height');
} else {
nfDialog['min-height'] = nfDialog.height;
nfDialogData['min-height'] = nfDialogData.height;
}
}
//min-height should always be set in terms of px
if (nfDialog['min-height'].indexOf("%") > 0) {
nfDialog['min-height'] = ($(window).height() * (parseInt(nfDialog['min-height'], 10) / 100)) + 'px';
if (nfDialogData['min-height'].indexOf("%") > 0) {
nfDialogData['min-height'] = ($(window).height() * (parseInt(nfDialogData['min-height'], 10) / 100)) + 'px';
}
//resize dialog
if ($(window).height() < fullscreenHeight) {
if (nfDialog.responsive.y) {
if (nfDialogData.responsive.y) {
dialog.css('height', '100%');
dialog.css('min-height', '100%');
}
} else {
//set the dialog min-height
dialog.css('min-height', nfDialog['min-height']);
if (nfDialog.responsive.y) {
//make sure nfDialog.height is in terms of %
if (nfDialog.height.indexOf("px") > 0) {
nfDialog.height = (parseInt(nfDialog.height, 10) / $(window).height() * 100) + '%';
dialog.css('min-height', nfDialogData['min-height']);
if (nfDialogData.responsive.y) {
//make sure nfDialogData.height is in terms of %
if (nfDialogData.height.indexOf("px") > 0) {
nfDialogData.height = (parseInt(nfDialogData.height, 10) / $(window).height() * 100) + '%';
}
dialog.css('height', nfDialog.height);
dialog.css('height', nfDialogData.height);
}
}
if ($(window).width() < fullscreenWidth) {
if (nfDialog.responsive.x) {
if (nfDialogData.responsive.x) {
dialog.css('width', '100%');
dialog.css('min-width', '100%');
}
} else {
//set the dialog width
dialog.css('min-width', nfDialog['min-width']);
if (nfDialog.responsive.x) {
//make sure nfDialog.width is in terms of %
if (nfDialog.width.indexOf("px") > 0) {
nfDialog.width = (parseInt(nfDialog.width, 10) / $(window).width() * 100) + '%';
dialog.css('min-width', nfDialogData['min-width']);
if (nfDialogData.responsive.x) {
//make sure nfDialogData.width is in terms of %
if (nfDialogData.width.indexOf("px") > 0) {
nfDialogData.width = (parseInt(nfDialogData.width, 10) / $(window).width() * 100) + '%';
}
dialog.css('width', nfDialog.width);
dialog.css('width', nfDialogData.width);
}
}
dialog.center();
//persist data attribute
dialog.data('nfDialog', nfDialog);
dialog.data('nfDialog', nfDialogData);
}
//apply scrollable style if applicable
if (dialogContent[0].offsetHeight < dialogContent[0].scrollHeight) {
// your element has overflow
if (isDefinedAndNotNull(nfDialog.scrollableContentStyle)) {
dialogContent.addClass(nfDialog.scrollableContentStyle);
if (isDefinedAndNotNull(nfDialogData.scrollableContentStyle)) {
dialogContent.addClass(nfDialogData.scrollableContentStyle);
}
} else {
// your element doesn't have overflow
if (isDefinedAndNotNull(nfDialog.scrollableContentStyle)) {
dialogContent.removeClass(nfDialog.scrollableContentStyle);
if (isDefinedAndNotNull(nfDialogData.scrollableContentStyle)) {
dialogContent.removeClass(nfDialogData.scrollableContentStyle);
}
}
if (isDefinedAndNotNull(nfDialog.handler)) {
var handler = nfDialog.handler.resize;
if (isDefinedAndNotNull(nfDialogData.handler)) {
var handler = nfDialogData.handler.resize;
if (isDefinedAndNotNull(handler) && typeof handler === 'function') {
// invoke the handler
handler.call(dialog);
@ -492,20 +492,20 @@
}
dialog.css('z-index', zIndex);
var nfDialog = {};
var nfDialogData = {};
if (isDefinedAndNotNull(dialog.data('nf-dialog'))) {
nfDialog = dialog.data('nf-dialog');
nfDialogData = dialog.data('nf-dialog');
}
var glasspane;
if (isDefinedAndNotNull(nfDialog.glasspane)) {
glasspane = nfDialog.glasspane;
if (isDefinedAndNotNull(nfDialogData.glasspane)) {
glasspane = nfDialogData.glasspane;
} else {
nfDialog.glasspane = glasspane = dialog.find('.dialog-header').css('background-color'); //default to header color
nfDialogData.glasspane = glasspane = dialog.find('.dialog-header').css('background-color'); //default to header color
}
if(top !== window || !isDefinedAndNotNull(nfDialog.glasspane)) {
nfDialog.glasspane = glasspane = 'transparent';
if(top !== window || !isDefinedAndNotNull(nfDialogData.glasspane)) {
nfDialogData.glasspane = glasspane = 'transparent';
}
if (!$('body').find("[data-nf-dialog-parent='" + dialog.attr('id') + "']").is(':visible')) {
@ -517,7 +517,7 @@
}
//persist data attribute
dialog.data('nfDialog', nfDialog);
dialog.data('nfDialog', nfDialogData);
return this.each(function () {
// show the dialog
@ -526,8 +526,8 @@
dialog.modal('resize');
dialog.center();
if (isDefinedAndNotNull(nfDialog.handler)) {
var handler = nfDialog.handler.open;
if (isDefinedAndNotNull(nfDialogData.handler)) {
var handler = nfDialogData.handler.open;
if (isDefinedAndNotNull(handler) && typeof handler === 'function') {
// invoke the handler
handler.call(dialog);
@ -544,13 +544,13 @@
return this.each(function () {
var dialog = $(this);
var nfDialog = {};
var nfDialogData = {};
if (isDefinedAndNotNull(dialog.data('nf-dialog'))) {
nfDialog = dialog.data('nf-dialog');
nfDialogData = dialog.data('nf-dialog');
}
if (isDefinedAndNotNull(nfDialog.handler)) {
var handler = nfDialog.handler.close;
if (isDefinedAndNotNull(nfDialogData.handler)) {
var handler = nfDialogData.handler.close;
if (isDefinedAndNotNull(handler) && typeof handler === 'function') {
// invoke the handler
handler.call(dialog);

View File

@ -22,8 +22,8 @@
define(['jquery',
'CodeMirror',
'nf'],
function ($, common) {
factory($, common);
function ($, CodeMirror, nf) {
factory($, CodeMirror, nf);
});
} else if (typeof exports === 'object' && typeof module === 'object') {
factory(require('jquery'),

View File

@ -32,22 +32,22 @@
'nf.Settings'],
function ($,
Slick,
common,
universalCapture,
dialog,
client,
errorHandler,
processGroupConfiguration,
settings) {
nfCommon,
nfUniversalCapture,
nfDialog,
nfClient,
nfErrorHandler,
nfProcessGroupConfiguration,
nfSettings) {
factory($,
Slick,
common,
universalCapture,
dialog,
client,
errorHandler,
processGroupConfiguration,
settings);
nfCommon,
nfUniversalCapture,
nfDialog,
nfClient,
nfErrorHandler,
nfProcessGroupConfiguration,
nfSettings);
});
} else if (typeof exports === 'object' && typeof module === 'object') {
factory(require('jquery'),
@ -72,13 +72,13 @@
}
}(this, function ($,
Slick,
common,
universalCapture,
dialog,
client,
errorHandler,
processGroupConfiguration,
settings) {
nfCommon,
nfUniversalCapture,
nfDialog,
nfClient,
nfErrorHandler,
nfProcessGroupConfiguration,
nfSettings) {
var languageId = 'nfel';
var editorClass = languageId + '-editor';
@ -124,7 +124,8 @@
'width': args.position.width + 'px',
'min-width': '212px',
'margin-bottom': '5px',
'margin-top': '10px'
'margin-top': '10px',
'white-space': 'pre'
}).tab().on('keydown', scope.handleKeyDown).appendTo(wrapper);
wrapper.draggable({
@ -219,12 +220,12 @@
this.loadValue = function (item) {
// determine if this is a sensitive property
var isEmptyChecked = false;
var sensitive = common.isSensitiveProperty(propertyDescriptor);
var sensitive = nfCommon.isSensitiveProperty(propertyDescriptor);
// determine the value to use when populating the text field
if (common.isDefinedAndNotNull(item[args.column.field])) {
if (nfCommon.isDefinedAndNotNull(item[args.column.field])) {
if (sensitive) {
initialValue = common.config.sensitiveText;
initialValue = nfCommon.config.sensitiveText;
} else {
initialValue = item[args.column.field];
isEmptyChecked = initialValue === '';
@ -241,7 +242,7 @@
var sensitiveInput = $(this);
if (sensitiveInput.hasClass('sensitive')) {
sensitiveInput.removeClass('sensitive');
if (sensitiveInput.val() === common.config.sensitiveText) {
if (sensitiveInput.val() === nfCommon.config.sensitiveText) {
sensitiveInput.val('');
}
}
@ -260,8 +261,8 @@
return '';
} else {
// otherwise if the property is required
if (common.isRequiredProperty(propertyDescriptor)) {
if (common.isBlank(propertyDescriptor.defaultValue)) {
if (nfCommon.isRequiredProperty(propertyDescriptor)) {
if (nfCommon.isBlank(propertyDescriptor.defaultValue)) {
return previousValue;
} else {
return propertyDescriptor.defaultValue;
@ -322,7 +323,7 @@
propertyDescriptor = descriptors[args.item.property];
// determine if this is a sensitive property
var sensitive = common.isSensitiveProperty(propertyDescriptor);
var sensitive = nfCommon.isSensitiveProperty(propertyDescriptor);
// record the previous value
previousValue = args.item[args.column.field];
@ -439,12 +440,12 @@
this.loadValue = function (item) {
// determine if this is a sensitive property
var isEmptyChecked = false;
var sensitive = common.isSensitiveProperty(propertyDescriptor);
var sensitive = nfCommon.isSensitiveProperty(propertyDescriptor);
// determine the value to use when populating the text field
if (common.isDefinedAndNotNull(item[args.column.field])) {
if (nfCommon.isDefinedAndNotNull(item[args.column.field])) {
if (sensitive) {
initialValue = common.config.sensitiveText;
initialValue = nfCommon.config.sensitiveText;
} else {
initialValue = item[args.column.field];
isEmptyChecked = initialValue === '';
@ -468,8 +469,8 @@
return '';
} else {
// otherwise if the property is required
if (common.isRequiredProperty(propertyDescriptor)) {
if (common.isBlank(propertyDescriptor.defaultValue)) {
if (nfCommon.isRequiredProperty(propertyDescriptor)) {
if (nfCommon.isBlank(propertyDescriptor.defaultValue)) {
return previousValue;
} else {
return propertyDescriptor.defaultValue;
@ -553,7 +554,7 @@
}).appendTo(container);
// check for allowable values which will drive which editor to use
var allowableValues = common.getAllowableValues(propertyDescriptor);
var allowableValues = nfCommon.getAllowableValues(propertyDescriptor);
// show the output port options
var options = [];
@ -571,7 +572,7 @@
text: allowableValue.displayName,
value: allowableValue.value,
disabled: allowableValueEntity.canRead === false && allowableValue.value !== args.item['previousValue'],
description: common.escapeHtml(allowableValue.description)
description: nfCommon.escapeHtml(allowableValue.description)
});
});
}
@ -587,7 +588,7 @@
}
// if this descriptor identifies a controller service, provide a way to create one
if (common.isDefinedAndNotNull(propertyDescriptor.identifiesControllerService)) {
if (nfCommon.isDefinedAndNotNull(propertyDescriptor.identifiesControllerService)) {
options.push({
text: 'Create new service...',
value: undefined,
@ -685,13 +686,13 @@
this.loadValue = function (item) {
// select as appropriate
if (!common.isUndefined(item.value)) {
if (!nfCommon.isUndefined(item.value)) {
initialValue = item.value;
combo.combo('setSelectedOption', {
value: item.value
});
} else if (common.isDefinedAndNotNull(propertyDescriptor.defaultValue)) {
} else if (nfCommon.isDefinedAndNotNull(propertyDescriptor.defaultValue)) {
initialValue = propertyDescriptor.defaultValue;
combo.combo('setSelectedOption', {
@ -735,20 +736,20 @@
*/
var showPropertyValue = function (propertyGrid, descriptors, row, cell) {
// remove any currently open detail dialogs
universalCapture.removeAllPropertyDetailDialogs();
nfUniversalCapture.removeAllPropertyDetailDialogs();
// get the property in question
var propertyData = propertyGrid.getData();
var property = propertyData.getItem(row);
// ensure there is a value
if (common.isDefinedAndNotNull(property.value)) {
if (nfCommon.isDefinedAndNotNull(property.value)) {
// get the descriptor to insert the description tooltip
var propertyDescriptor = descriptors[property.property];
// ensure we're not dealing with a sensitive property
if (!common.isSensitiveProperty(propertyDescriptor)) {
if (!nfCommon.isSensitiveProperty(propertyDescriptor)) {
// get details about the location of the cell
var cellNode = $(propertyGrid.getCellNode(row, cell));
@ -769,7 +770,7 @@
'left': offset.left - 20
}).appendTo('body');
var allowableValues = common.getAllowableValues(propertyDescriptor);
var allowableValues = nfCommon.getAllowableValues(propertyDescriptor);
if ($.isArray(allowableValues)) {
// prevent dragging over the combo
wrapper.draggable({
@ -784,7 +785,7 @@
options.push({
text: allowableValue.displayName,
value: allowableValue.value,
description: common.escapeHtml(allowableValue.description),
description: nfCommon.escapeHtml(allowableValue.description),
disabled: true
});
});
@ -833,7 +834,7 @@
var editor = null;
// so the nfel editor is appropriate
if (common.supportsEl(propertyDescriptor)) {
if (nfCommon.supportsEl(propertyDescriptor)) {
var languageId = 'nfel';
var editorClass = languageId + '-editor';
@ -957,15 +958,15 @@
var options = [];
$.each(response.controllerServiceTypes, function (i, controllerServiceType) {
options.push({
text: common.substringAfterLast(controllerServiceType.type, '.'),
text: nfCommon.substringAfterLast(controllerServiceType.type, '.'),
value: controllerServiceType.type,
description: common.escapeHtml(controllerServiceType.description)
description: nfCommon.escapeHtml(controllerServiceType.description)
});
});
// ensure there are some applicable controller services
if (options.length === 0) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Controller Service',
dialogContent: 'No controller service types found that are applicable for this property.'
});
@ -1053,7 +1054,7 @@
// build the controller service entity
var controllerServiceEntity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': 0,
}
@ -1065,7 +1066,7 @@
// determine the appropriate uri for creating the controller service
var uri = '../nifi-api/controller/controller-services';
if (common.isDefinedAndNotNull(groupId)) {
if (nfCommon.isDefinedAndNotNull(groupId)) {
uri = '../nifi-api/process-groups/' + encodeURIComponent(groupId) + '/controller-services';
}
@ -1083,7 +1084,7 @@
// store the descriptor for use later
var descriptors = gridContainer.data('descriptors');
if (!common.isUndefined(descriptors)) {
if (!nfCommon.isUndefined(descriptors)) {
descriptors[descriptor.name] = descriptor;
}
@ -1101,7 +1102,7 @@
if (typeof configurationOptions.controllerServiceCreatedDeferred === 'function') {
configurationOptions.controllerServiceCreatedDeferred(response);
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
var cancel = function () {
@ -1110,7 +1111,7 @@
newControllerServiceDialog.modal('show');
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
var initPropertiesTable = function (table, options) {
@ -1130,8 +1131,8 @@
var propertyDescriptor = descriptors[dataContext.property];
// show the property description if applicable
if (common.isDefinedAndNotNull(propertyDescriptor)) {
if (!common.isBlank(propertyDescriptor.description) || !common.isBlank(propertyDescriptor.defaultValue) || !common.isBlank(propertyDescriptor.supportsEl)) {
if (nfCommon.isDefinedAndNotNull(propertyDescriptor)) {
if (!nfCommon.isBlank(propertyDescriptor.description) || !nfCommon.isBlank(propertyDescriptor.defaultValue) || !nfCommon.isBlank(propertyDescriptor.supportsEl)) {
$('<div class="fa fa-question-circle" alt="Info" style="float: right; margin-right: 6px; margin-top: 4px;"></div>').appendTo(cellContent);
$('<span class="hidden property-descriptor-name"></span>').text(dataContext.property).appendTo(cellContent);
nameWidthOffset = 46; // 10 + icon width (10) + icon margin (6) + padding (20)
@ -1148,17 +1149,17 @@
// function for formatting the property value
var valueFormatter = function (row, cell, value, columnDef, dataContext) {
var valueMarkup;
if (common.isDefinedAndNotNull(value)) {
if (nfCommon.isDefinedAndNotNull(value)) {
// get the property descriptor
var descriptors = table.data('descriptors');
var propertyDescriptor = descriptors[dataContext.property];
// determine if the property is sensitive
if (common.isSensitiveProperty(propertyDescriptor)) {
if (nfCommon.isSensitiveProperty(propertyDescriptor)) {
valueMarkup = '<span class="table-cell sensitive">Sensitive value set</span>';
} else {
// if there are allowable values, attempt to swap out for the display name
var allowableValues = common.getAllowableValues(propertyDescriptor);
var allowableValues = nfCommon.getAllowableValues(propertyDescriptor);
if ($.isArray(allowableValues)) {
$.each(allowableValues, function (_, allowableValueEntity) {
var allowableValue = allowableValueEntity.allowableValue;
@ -1172,7 +1173,7 @@
if (value === '') {
valueMarkup = '<span class="table-cell blank">Empty string set</span>';
} else {
valueMarkup = '<div class="table-cell value"><pre class="ellipsis">' + common.escapeHtml(value) + '</pre></div>';
valueMarkup = '<div class="table-cell value"><pre class="ellipsis">' + nfCommon.escapeHtml(value) + '</pre></div>';
}
}
} else {
@ -1220,8 +1221,8 @@
var descriptors = table.data('descriptors');
var propertyDescriptor = descriptors[dataContext.property];
var identifiesControllerService = common.isDefinedAndNotNull(propertyDescriptor.identifiesControllerService);
var isConfigured = common.isDefinedAndNotNull(dataContext.value);
var identifiesControllerService = nfCommon.isDefinedAndNotNull(propertyDescriptor.identifiesControllerService);
var isConfigured = nfCommon.isDefinedAndNotNull(dataContext.value);
// check to see if we should provide a button for going to a controller service
if (identifiesControllerService && isConfigured && (options.supportsGoTo === true)) {
@ -1273,7 +1274,7 @@
var propertyDescriptor = descriptors[item.property];
// support el if specified or unsure yet (likely a dynamic property)
if (common.isUndefinedOrNull(propertyDescriptor) || common.supportsEl(propertyDescriptor)) {
if (nfCommon.isUndefinedOrNull(propertyDescriptor) || nfCommon.supportsEl(propertyDescriptor)) {
return {
columns: {
value: {
@ -1283,7 +1284,7 @@
};
} else {
// check for allowable values which will drive which editor to use
var allowableValues = common.getAllowableValues(propertyDescriptor);
var allowableValues = nfCommon.getAllowableValues(propertyDescriptor);
if ($.isArray(allowableValues)) {
return {
columns: {
@ -1320,37 +1321,37 @@
var controllerService = controllerServiceEntity.component;
$.Deferred(function (deferred) {
if (common.isDefinedAndNotNull(controllerService.parentGroupId)) {
if (nfCommon.isDefinedAndNotNull(controllerService.parentGroupId)) {
if ($('#process-group-configuration').is(':visible')) {
processGroupConfiguration.loadConfiguration(controllerService.parentGroupId).done(function () {
nfProcessGroupConfiguration.loadConfiguration(controllerService.parentGroupId).done(function () {
deferred.resolve();
});
} else {
processGroupConfiguration.showConfiguration(controllerService.parentGroupId).done(function () {
nfProcessGroupConfiguration.showConfiguration(controllerService.parentGroupId).done(function () {
deferred.resolve();
});
}
} else {
if ($('#settings').is(':visible')) {
// reload the settings
settings.loadSettings().done(function () {
nfSettings.loadSettings().done(function () {
deferred.resolve();
});
} else {
// reload the settings and show
settings.showSettings().done(function () {
nfSettings.showSettings().done(function () {
deferred.resolve();
});
}
}
}).done(function () {
if (common.isDefinedAndNotNull(controllerService.parentGroupId)) {
processGroupConfiguration.selectControllerService(property.value);
if (nfCommon.isDefinedAndNotNull(controllerService.parentGroupId)) {
nfProcessGroupConfiguration.selectControllerService(property.value);
} else {
settings.selectControllerService(property.value);
nfSettings.selectControllerService(property.value);
}
});
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
// initialize the grid
@ -1433,11 +1434,11 @@
var propertyHistory = history[property];
// format the tooltip
var tooltip = common.formatPropertyTooltip(propertyDescriptor, propertyHistory);
var tooltip = nfCommon.formatPropertyTooltip(propertyDescriptor, propertyHistory);
if (common.isDefinedAndNotNull(tooltip)) {
if (nfCommon.isDefinedAndNotNull(tooltip)) {
infoIcon.qtip($.extend({},
common.config.tooltipConfig,
nfCommon.config.tooltipConfig,
{
content: tooltip
}));
@ -1449,7 +1450,7 @@
var saveRow = function (table) {
// get the property grid to commit the current edit
var propertyGrid = table.data('gridInstance');
if (common.isDefinedAndNotNull(propertyGrid)) {
if (nfCommon.isDefinedAndNotNull(propertyGrid)) {
var editController = propertyGrid.getEditController();
editController.commitCurrentEdit();
}
@ -1486,7 +1487,7 @@
var propertyData = propertyGrid.getData();
// generate the properties
if (common.isDefinedAndNotNull(properties)) {
if (nfCommon.isDefinedAndNotNull(properties)) {
propertyData.beginUpdate();
var i = 0;
@ -1497,10 +1498,10 @@
// determine the property type
var type = 'userDefined';
var displayName = name;
if (common.isDefinedAndNotNull(descriptor)) {
if (common.isRequiredProperty(descriptor)) {
if (nfCommon.isDefinedAndNotNull(descriptor)) {
if (nfCommon.isRequiredProperty(descriptor)) {
type = 'required';
} else if (common.isDynamicProperty(descriptor)) {
} else if (nfCommon.isDynamicProperty(descriptor)) {
type = 'userDefined';
} else {
type = 'optional';
@ -1510,7 +1511,7 @@
displayName = descriptor.displayName;
// determine the value
if (common.isNull(value) && common.isDefinedAndNotNull(descriptor.defaultValue)) {
if (nfCommon.isNull(value) && nfCommon.isDefinedAndNotNull(descriptor.defaultValue)) {
value = descriptor.defaultValue;
}
}
@ -1539,10 +1540,10 @@
var clear = function (propertyTableContainer) {
var options = propertyTableContainer.data('options');
if (options.readOnly === true) {
universalCapture.removeAllPropertyDetailDialogs();
nfUniversalCapture.removeAllPropertyDetailDialogs();
} else {
// clear any existing new property dialogs
if (common.isDefinedAndNotNull(options.dialogContainer)) {
if (nfCommon.isDefinedAndNotNull(options.dialogContainer)) {
$('#new-property-dialog').modal("hide");
}
}
@ -1552,7 +1553,7 @@
table.removeData('descriptors history');
// clean up any tooltips that may have been generated
common.cleanUpTooltips(table, 'div.fa-question-circle');
nfCommon.cleanUpTooltips(table, 'div.fa-question-circle');
// clear the data in the grid
var propertyGrid = table.data('gridInstance');
@ -1586,7 +1587,7 @@
init: function (options) {
return this.each(function () {
// ensure the options have been properly specified
if (common.isDefinedAndNotNull(options)) {
if (nfCommon.isDefinedAndNotNull(options)) {
// get the tag cloud
var propertyTableContainer = $(this);
@ -1601,7 +1602,7 @@
var table = $('<div class="property-table"></div>').appendTo(propertyTableContainer);
// optionally add a add new property button
if (options.readOnly !== true && common.isDefinedAndNotNull(options.dialogContainer)) {
if (options.readOnly !== true && nfCommon.isDefinedAndNotNull(options.dialogContainer)) {
// build the new property dialog
var newPropertyDialogMarkup =
'<div id="new-property-dialog" class="dialog cancellable small-dialog hidden">' +
@ -1673,7 +1674,7 @@
// store the descriptor for use later
var descriptors = table.data('descriptors');
if (!common.isUndefined(descriptors)) {
if (!nfCommon.isUndefined(descriptors)) {
descriptors[descriptor.name] = descriptor;
}
@ -1708,7 +1709,7 @@
propertyGrid.setActiveCell(row, propertyGrid.getColumnIndex('value'));
propertyGrid.editActiveCell();
} else {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Property Exists',
dialogContent: 'A property with this name already exists.'
});
@ -1720,7 +1721,7 @@
}
}
} else {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Property Name',
dialogContent: 'Property name must be specified.'
});
@ -1803,7 +1804,7 @@
return this.each(function () {
var table = $(this).find('div.property-table');
var propertyGrid = table.data('gridInstance');
if (common.isDefinedAndNotNull(propertyGrid)) {
if (nfCommon.isDefinedAndNotNull(propertyGrid)) {
propertyGrid.resizeCanvas();
}
});
@ -1816,7 +1817,7 @@
return this.each(function () {
var table = $(this).find('div.property-table');
var propertyGrid = table.data('gridInstance');
if (common.isDefinedAndNotNull(propertyGrid)) {
if (nfCommon.isDefinedAndNotNull(propertyGrid)) {
var editController = propertyGrid.getEditController();
editController.cancelCurrentEdit();
}
@ -1831,12 +1832,12 @@
var propertyTableContainer = $(this);
var options = propertyTableContainer.data('options');
if (common.isDefinedAndNotNull(options)) {
if (nfCommon.isDefinedAndNotNull(options)) {
// clear the property table container
clear(propertyTableContainer);
// clear any existing new property dialogs
if (common.isDefinedAndNotNull(options.dialogContainer)) {
if (nfCommon.isDefinedAndNotNull(options.dialogContainer)) {
$('#new-property-dialog').modal("hide");
$(options.dialogContainer).children('div.new-inline-controller-service-dialog').remove();
}

View File

@ -30,23 +30,23 @@
'nf.Storage'],
function ($,
angular,
common,
nfCommon,
appConfig,
appCtrl,
serviceProvider,
angularBridge,
errorHandler,
storage) {
nfNgBridge,
nfErrorHandler,
nfStorage) {
return (nf.ng.BulletinBoardCtrl =
factory($,
angular,
common,
nfCommon,
appConfig,
appCtrl,
serviceProvider,
angularBridge,
errorHandler,
storage));
nfNgBridge,
nfErrorHandler,
nfStorage));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.BulletinBoardCtrl =
@ -70,7 +70,7 @@
root.nf.ErrorHandler,
root.nf.Storage);
}
}(this, function ($, angular, common, appConfig, appCtrl, serviceProvider, angularBridge, errorHandler, storage) {
}(this, function ($, angular, nfCommon, appConfig, appCtrl, serviceProvider, nfNgBridge, nfErrorHandler, nfStorage) {
'use strict';
$(document).ready(function () {
@ -95,10 +95,10 @@
app.service('bulletinBoardCtrl', nfBulletinBoard);
//Manually Boostrap Angular App
angularBridge.injector = angular.bootstrap($('body'), ['ngBulletinBoardApp'], {strictDi: true});
nfNgBridge.injector = angular.bootstrap($('body'), ['ngBulletinBoardApp'], {strictDi: true});
// initialize the bulletin board
angularBridge.injector.get('bulletinBoardCtrl').init();
nfNgBridge.injector.get('bulletinBoardCtrl').init();
});
var nfBulletinBoard = function (serviceProvider) {
@ -158,7 +158,7 @@
// set the document title and the about title
document.title = bulletinBoardTitle;
$('#bulletin-board-header-text').text(bulletinBoardTitle);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
// get the banners if we're not in the shell
var loadBanners = $.Deferred(function (deferred) {
@ -169,8 +169,8 @@
dataType: 'json'
}).done(function (response) {
// ensure the banners response is specified
if (common.isDefinedAndNotNull(response.banners)) {
if (common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
if (nfCommon.isDefinedAndNotNull(response.banners)) {
if (nfCommon.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
// update the header text
var bannerHeader = $('#banner-header').text(response.banners.headerText).show();
@ -184,7 +184,7 @@
updateTop('bulletin-board');
}
if (common.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
if (nfCommon.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
// update the footer text and show it
var bannerFooter = $('#banner-footer').text(response.banners.footerText).show();
@ -200,7 +200,7 @@
deferred.resolve();
}).fail(function (xhr, status, error) {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
deferred.reject();
});
} else {
@ -286,7 +286,7 @@
// only attempt this if we're within a frame
if (top !== window) {
// and our parent has canvas utils and shell defined
if (common.isDefinedAndNotNull(parent.nf) && common.isDefinedAndNotNull(parent.nf.CanvasUtils) && common.isDefinedAndNotNull(parent.nf.Shell)) {
if (nfCommon.isDefinedAndNotNull(parent.nf) && nfCommon.isDefinedAndNotNull(parent.nf.CanvasUtils) && nfCommon.isDefinedAndNotNull(parent.nf.Shell)) {
parent.nf.CanvasUtils.showComponent(groupId, sourceId);
parent.$('#shell-close-button').click();
}
@ -333,7 +333,7 @@
});
}
storage.init();
nfStorage.init();
initializePage().done(function () {
start();
@ -347,7 +347,7 @@
var data = {};
// include the timestamp if appropriate
if (common.isDefinedAndNotNull(lastBulletin)) {
if (nfCommon.isDefinedAndNotNull(lastBulletin)) {
data['after'] = lastBulletin;
} else {
data['limit'] = 10;
@ -382,7 +382,7 @@
dataType: 'json'
}).done(function (response) {
// ensure the bulletin board was specified
if (common.isDefinedAndNotNull(response.bulletinBoard)) {
if (nfCommon.isDefinedAndNotNull(response.bulletinBoard)) {
var bulletinBoard = response.bulletinBoard;
// update the stats last refreshed timestamp
@ -407,13 +407,13 @@
// format the source id
var source;
if (common.isDefinedAndNotNull(bulletin.sourceId) && common.isDefinedAndNotNull(bulletin.groupId) && top !== window) {
if (nfCommon.isDefinedAndNotNull(bulletin.sourceId) && nfCommon.isDefinedAndNotNull(bulletin.groupId) && top !== window) {
source = $('<div class="bulletin-source bulletin-link"></div>').text(bulletin.sourceId).on('click', function () {
goToSource(bulletin.groupId, bulletin.sourceId);
});
} else {
var sourceId = bulletin.sourceId;
if (common.isUndefined(sourceId) || common.isNull(sourceId)) {
if (nfCommon.isUndefined(sourceId) || nfCommon.isNull(sourceId)) {
sourceId = '';
}
source = $('<div class="bulletin-source"></div>').text(sourceId);
@ -430,7 +430,7 @@
$('<div class="clear"></div>').appendTo(bulletinInfoMarkup);
// format the node address if applicable
if (common.isDefinedAndNotNull(bulletin.nodeAddress)) {
if (nfCommon.isDefinedAndNotNull(bulletin.nodeAddress)) {
$('<div class="bulletin-node"></div>').text(bulletin.nodeAddress).appendTo(bulletinMarkup);
}
@ -467,7 +467,7 @@
// stop future polling
bulletinBoardCtrl.togglePolling();
} else {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
});
},

View File

@ -21,8 +21,8 @@
if (typeof define === 'function' && define.amd) {
define(['jquery',
'nf.Common'],
function ($, common) {
return (nf.ng.BreadcrumbsCtrl = factory($, common));
function ($, nfCommon) {
return (nf.ng.BreadcrumbsCtrl = factory($, nfCommon));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.BreadcrumbsCtrl =
@ -32,7 +32,7 @@
nf.ng.BreadcrumbsCtrl = factory(root.$,
root.nf.Common);
}
}(this, function ($, common) {
}(this, function ($, nfCommon) {
'use strict';
return function (serviceProvider) {
@ -69,7 +69,7 @@
'label': label
}, breadcrumbEntity));
if (common.isDefinedAndNotNull(breadcrumbEntity.parentBreadcrumb)) {
if (nfCommon.isDefinedAndNotNull(breadcrumbEntity.parentBreadcrumb)) {
this.generateBreadcrumbs(breadcrumbEntity.parentBreadcrumb);
}
},
@ -132,7 +132,7 @@
// still having issues with this in IE :/
element.on('DOMMouseScroll mousewheel', function (evt, d) {
if (common.isUndefinedOrNull(evt.originalEvent)) {
if (nfCommon.isUndefinedOrNull(evt.originalEvent)) {
return;
}
@ -155,9 +155,9 @@
//Chrome and Safari both have evt.originalEvent.detail defined but
//evt.originalEvent.wheelDelta holds the correct value so we must
//check for evt.originalEvent.wheelDelta first!
if (common.isDefinedAndNotNull(evt.originalEvent.wheelDelta)) {
if (nfCommon.isDefinedAndNotNull(evt.originalEvent.wheelDelta)) {
delta = evt.originalEvent.wheelDelta;
} else if (common.isDefinedAndNotNull(evt.originalEvent.detail)) {
} else if (nfCommon.isDefinedAndNotNull(evt.originalEvent.detail)) {
delta = -evt.originalEvent.detail;
}

View File

@ -27,8 +27,8 @@
'nf.ClusterSummary',
'nf.ErrorHandler',
'nf.Settings'],
function ($, common, dialog, canvasUtils, contextMenu, clusterSummary, errorHandler, settings) {
return (nf.ng.Canvas.FlowStatusCtrl = factory($, common, dialog, canvasUtils, contextMenu, clusterSummary, errorHandler, settings));
function ($, nfCommon, nfDialog, nfCanvasUtils, nfContextMenu, nfClusterSummary, nfErrorHandler, nfSettings) {
return (nf.ng.Canvas.FlowStatusCtrl = factory($, nfCommon, nfDialog, nfCanvasUtils, nfContextMenu, nfClusterSummary, nfErrorHandler, nfSettings));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.Canvas.FlowStatusCtrl =
@ -50,7 +50,7 @@
root.nf.ErrorHandler,
root.nf.Settings);
}
}(this, function ($, common, dialog, canvasUtils, contextMenu, clusterSummary, errorHandler, settings) {
}(this, function ($, nfCommon, nfDialog, nfCanvasUtils, nfContextMenu, nfClusterSummary, nfErrorHandler, nfSettings) {
'use strict';
return function (serviceProvider) {
@ -134,7 +134,7 @@
var searchResults = items[0];
// show all processors
if (!common.isEmpty(searchResults.processorResults)) {
if (!nfCommon.isEmpty(searchResults.processorResults)) {
ul.append('<li class="search-header"><div class="search-result-icon icon icon-processor"></div>Processors</li>');
$.each(searchResults.processorResults, function (i, processorMatch) {
nfSearchAutocomplete._renderItem(ul, processorMatch);
@ -142,7 +142,7 @@
}
// show all process groups
if (!common.isEmpty(searchResults.processGroupResults)) {
if (!nfCommon.isEmpty(searchResults.processGroupResults)) {
ul.append('<li class="search-header"><div class="search-result-icon icon icon-group"></div>Process Groups</li>');
$.each(searchResults.processGroupResults, function (i, processGroupMatch) {
nfSearchAutocomplete._renderItem(ul, processGroupMatch);
@ -150,7 +150,7 @@
}
// show all remote process groups
if (!common.isEmpty(searchResults.remoteProcessGroupResults)) {
if (!nfCommon.isEmpty(searchResults.remoteProcessGroupResults)) {
ul.append('<li class="search-header"><div class="search-result-icon icon icon-group-remote"></div>Remote Process Groups</li>');
$.each(searchResults.remoteProcessGroupResults, function (i, remoteProcessGroupMatch) {
nfSearchAutocomplete._renderItem(ul, remoteProcessGroupMatch);
@ -158,7 +158,7 @@
}
// show all connections
if (!common.isEmpty(searchResults.connectionResults)) {
if (!nfCommon.isEmpty(searchResults.connectionResults)) {
ul.append('<li class="search-header"><div class="search-result-icon icon icon-connect"></div>Connections</li>');
$.each(searchResults.connectionResults, function (i, connectionMatch) {
nfSearchAutocomplete._renderItem(ul, connectionMatch);
@ -166,7 +166,7 @@
}
// show all input ports
if (!common.isEmpty(searchResults.inputPortResults)) {
if (!nfCommon.isEmpty(searchResults.inputPortResults)) {
ul.append('<li class="search-header"><div class="search-result-icon icon icon-port-in"></div>Input Ports</li>');
$.each(searchResults.inputPortResults, function (i, inputPortMatch) {
nfSearchAutocomplete._renderItem(ul, inputPortMatch);
@ -174,7 +174,7 @@
}
// show all output ports
if (!common.isEmpty(searchResults.outputPortResults)) {
if (!nfCommon.isEmpty(searchResults.outputPortResults)) {
ul.append('<li class="search-header"><div class="search-result-icon icon icon-port-out"></div>Output Ports</li>');
$.each(searchResults.outputPortResults, function (i, outputPortMatch) {
nfSearchAutocomplete._renderItem(ul, outputPortMatch);
@ -182,7 +182,7 @@
}
// show all funnels
if (!common.isEmpty(searchResults.funnelResults)) {
if (!nfCommon.isEmpty(searchResults.funnelResults)) {
ul.append('<li class="search-header"><div class="search-result-icon icon icon-funnel"></div>Funnels</li>');
$.each(searchResults.funnelResults, function (i, funnelMatch) {
nfSearchAutocomplete._renderItem(ul, funnelMatch);
@ -228,7 +228,7 @@
var item = ui.item;
// show the selected component
canvasUtils.showComponent(item.groupId, item.id);
nfCanvasUtils.showComponent(item.groupId, item.id);
searchCtrl.getInputElement().val('').blur();
@ -262,7 +262,7 @@
var searchCtrl = this;
// hide the context menu if necessary
contextMenu.hide();
nfContextMenu.hide();
var isVisible = searchCtrl.getInputElement().is(':visible');
var display = 'none';
@ -306,11 +306,11 @@
var currentBulletins = bulletinIcon.data('bulletins');
// update the bulletins if necessary
if (common.doBulletinsDiffer(currentBulletins, response.bulletins)) {
if (nfCommon.doBulletinsDiffer(currentBulletins, response.bulletins)) {
bulletinIcon.data('bulletins', response.bulletins);
// get the formatted the bulletins
var bulletins = common.getFormattedBulletins(response.bulletins);
var bulletins = nfCommon.getFormattedBulletins(response.bulletins);
// bulletins for this processor are now gone
if (bulletins.length === 0) {
@ -318,7 +318,7 @@
bulletinIcon.removeClass('has-bulletins').qtip('api').destroy(true);
}
} else {
var newBulletins = common.formatUnorderedList(bulletins);
var newBulletins = nfCommon.formatUnorderedList(bulletins);
// different bulletins, refresh
if (bulletinIcon.data('qtip')) {
@ -326,7 +326,7 @@
} else {
// no bulletins before, show icon and tips
bulletinIcon.addClass('has-bulletins').qtip($.extend({},
canvasUtils.config.systemTooltipConfig,
nfCanvasUtils.config.systemTooltipConfig,
{
content: newBulletins,
position: {
@ -343,7 +343,7 @@
}
// update controller service and reporting task bulletins
settings.setBulletins(response.controllerServiceBulletins, response.reportingTaskBulletins);
nfSettings.setBulletins(response.controllerServiceBulletins, response.reportingTaskBulletins);
}
}
@ -371,10 +371,10 @@
dataType: 'json'
}).done(function (response) {
// report the updated status
if (common.isDefinedAndNotNull(response.controllerStatus)) {
if (nfCommon.isDefinedAndNotNull(response.controllerStatus)) {
flowStatusCtrl.update(response.controllerStatus);
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
},
/**
@ -384,11 +384,11 @@
*/
updateClusterSummary: function (summary) {
// see if this node has been (dis)connected
if (clusterSummary.isConnectedToCluster() !== summary.connectedToCluster) {
if (nfClusterSummary.isConnectedToCluster() !== summary.connectedToCluster) {
if (summary.connectedToCluster) {
dialog.showConnectedToClusterMessage();
nfDialog.showConnectedToClusterMessage();
} else {
dialog.showDisconnectedFromClusterMessage();
nfDialog.showDisconnectedFromClusterMessage();
}
}
@ -396,7 +396,7 @@
// update the connection state
if (summary.connectedToCluster) {
if (common.isDefinedAndNotNull(summary.connectedNodes)) {
if (nfCommon.isDefinedAndNotNull(summary.connectedNodes)) {
var connectedNodes = summary.connectedNodes.split(' / ');
if (connectedNodes.length === 2 && connectedNodes[0] !== connectedNodes[1]) {
this.clusterConnectionWarning = true;
@ -404,7 +404,7 @@
}
}
this.connectedNodesCount =
common.isDefinedAndNotNull(summary.connectedNodes) ? summary.connectedNodes : '-';
nfCommon.isDefinedAndNotNull(summary.connectedNodes) ? summary.connectedNodes : '-';
} else {
this.connectedNodesCount = 'Disconnected';
color = '#BA554A';
@ -420,7 +420,7 @@
* @param status The controller status returned from the `../nifi-api/flow/status` endpoint.
*/
update: function (status) {
var controllerInvalidCount = (common.isDefinedAndNotNull(status.invalidCount)) ? status.invalidCount : 0;
var controllerInvalidCount = (nfCommon.isDefinedAndNotNull(status.invalidCount)) ? status.invalidCount : 0;
if (this.controllerInvalidCount > 0) {
$('#controller-invalid-count').parent().removeClass('zero').addClass('invalid');
@ -447,7 +447,7 @@
// update the component counts
this.controllerTransmittingCount =
common.isDefinedAndNotNull(status.activeRemotePortCount) ?
nfCommon.isDefinedAndNotNull(status.activeRemotePortCount) ?
status.activeRemotePortCount : '-';
if (this.controllerTransmittingCount > 0) {
@ -457,7 +457,7 @@
}
this.controllerNotTransmittingCount =
common.isDefinedAndNotNull(status.inactiveRemotePortCount) ?
nfCommon.isDefinedAndNotNull(status.inactiveRemotePortCount) ?
status.inactiveRemotePortCount : '-';
if (this.controllerNotTransmittingCount > 0) {
@ -467,7 +467,7 @@
}
this.controllerRunningCount =
common.isDefinedAndNotNull(status.runningCount) ? status.runningCount : '-';
nfCommon.isDefinedAndNotNull(status.runningCount) ? status.runningCount : '-';
if (this.controllerRunningCount > 0) {
$('#flow-status-container').find('.fa-play').removeClass('zero').addClass('running');
@ -476,7 +476,7 @@
}
this.controllerStoppedCount =
common.isDefinedAndNotNull(status.stoppedCount) ? status.stoppedCount : '-';
nfCommon.isDefinedAndNotNull(status.stoppedCount) ? status.stoppedCount : '-';
if (this.controllerStoppedCount > 0) {
$('#flow-status-container').find('.fa-stop').removeClass('zero').addClass('stopped');
@ -485,7 +485,7 @@
}
this.controllerInvalidCount =
common.isDefinedAndNotNull(status.invalidCount) ? status.invalidCount : '-';
nfCommon.isDefinedAndNotNull(status.invalidCount) ? status.invalidCount : '-';
if (this.controllerInvalidCount > 0) {
$('#flow-status-container').find('.fa-warning').removeClass('zero').addClass('invalid');
@ -494,7 +494,7 @@
}
this.controllerDisabledCount =
common.isDefinedAndNotNull(status.disabledCount) ? status.disabledCount : '-';
nfCommon.isDefinedAndNotNull(status.disabledCount) ? status.disabledCount : '-';
if (this.controllerDisabledCount > 0) {
$('#flow-status-container').find('.icon-enable-false').removeClass('zero').addClass('disabled');

View File

@ -28,8 +28,8 @@
'nf.ErrorHandler',
'nf.Settings',
'nf.CanvasUtils'],
function ($, common, queueListing, shell, policyManagement, clusterSummary, errorHandler, settings, canvasUtils) {
return (nf.ng.Canvas.GlobalMenuCtrl = factory($, common, queueListing, shell, policyManagement, clusterSummary, errorHandler, settings, canvasUtils));
function ($, nfCommon, nfQueueListing, nfShell, nfPolicyManagement, nfClusterSummary, nfErrorHandler, nfSettings, nfCanvasUtils) {
return (nf.ng.Canvas.GlobalMenuCtrl = factory($, nfCommon, nfQueueListing, nfShell, nfPolicyManagement, nfClusterSummary, nfErrorHandler, nfSettings, nfCanvasUtils));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.Canvas.GlobalMenuCtrl =
@ -53,7 +53,7 @@
root.nf.Settings,
root.nf.CanvasUtils);
}
}(this, function ($, common, queueListing, shell, policyManagement, clusterSummary, errorHandler, settings, canvasUtils) {
}(this, function ($, nfCommon, nfQueueListing, nfShell, nfPolicyManagement, nfClusterSummary, nfErrorHandler, nfSettings, nfCanvasUtils) {
'use strict';
return function (serviceProvider) {
@ -82,7 +82,7 @@
* Launch the summary shell.
*/
launch: function () {
shell.showPage('summary');
nfShell.showPage('summary');
}
}
};
@ -101,8 +101,8 @@
* Launch the counters shell.
*/
launch: function () {
if (common.canAccessCounters()) {
shell.showPage('counters');
if (nfCommon.canAccessCounters()) {
nfShell.showPage('counters');
}
}
}
@ -122,7 +122,7 @@
* Launch the bulletin board shell.
*/
launch: function () {
shell.showPage('bulletin-board');
nfShell.showPage('bulletin-board');
}
}
};
@ -141,8 +141,8 @@
* Launch the data provenance shell.
*/
launch: function () {
if (common.canAccessProvenance()) {
shell.showPage('provenance');
if (nfCommon.canAccessProvenance()) {
nfShell.showPage('provenance');
}
}
}
@ -162,7 +162,7 @@
* Launch the settings shell.
*/
launch: function () {
settings.showSettings();
nfSettings.showSettings();
}
}
};
@ -178,7 +178,7 @@
* @returns {*|boolean}
*/
visible: function () {
return clusterSummary.isConnectedToCluster();
return nfClusterSummary.isConnectedToCluster();
},
/**
@ -190,8 +190,8 @@
* Launch the cluster shell.
*/
launch: function () {
if (common.canAccessController()) {
shell.showPage('cluster');
if (nfCommon.canAccessController()) {
nfShell.showPage('cluster');
}
}
}
@ -211,7 +211,7 @@
* Launch the history shell.
*/
launch: function () {
shell.showPage('history');
nfShell.showPage('history');
}
}
};
@ -230,8 +230,8 @@
* Launch the users shell.
*/
launch: function () {
if (common.canAccessTenants()) {
shell.showPage('users');
if (nfCommon.canAccessTenants()) {
nfShell.showPage('users');
}
}
}
@ -251,8 +251,8 @@
* Launch the policies shell.
*/
launch: function () {
if (common.canModifyPolicies() && common.canAccessTenants()) {
policyManagement.showGlobalPolicies();
if (nfCommon.canModifyPolicies() && nfCommon.canAccessTenants()) {
nfPolicyManagement.showGlobalPolicies();
}
}
}
@ -272,8 +272,8 @@
* Launch the templates shell.
*/
launch: function () {
shell.showPage('templates?' + $.param({
groupId: canvasUtils.getGroupId()
nfShell.showPage('templates?' + $.param({
groupId: nfCanvasUtils.getGroupId()
}));
}
}
@ -293,7 +293,7 @@
* Launch the help documentation shell.
*/
launch: function () {
shell.showPage(config.urls.helpDocument);
nfShell.showPage(config.urls.helpDocument);
}
}
};
@ -339,11 +339,11 @@
}
// store the content viewer url if available
if (!common.isBlank(aboutDetails.contentViewerUrl)) {
if (!nfCommon.isBlank(aboutDetails.contentViewerUrl)) {
$('#nifi-content-viewer-url').text(aboutDetails.contentViewerUrl);
queueListing.initFlowFileDetailsDialog();
nfQueueListing.initFlowFileDetailsDialog();
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
this.modal.init();
},

View File

@ -24,10 +24,9 @@
'nf.Birdseye',
'nf.Storage',
'nf.CanvasUtils',
'nf.Common',
'nf.ProcessGroupConfiguration'],
function ($, action, birdseye, storage, canvasUtils, common, processGroupConfiguration) {
return (nf.ng.Canvas.GraphControlsCtrl = factory($, action, birdseye, storage, canvasUtils, common, processGroupConfiguration));
function ($, nfActions, nfBirdseye, nfStorage, nfCanvasUtils, nfProcessGroupConfiguration) {
return (nf.ng.Canvas.GraphControlsCtrl = factory($, nfActions, nfBirdseye, nfStorage, nfCanvasUtils, nfProcessGroupConfiguration));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.Canvas.GraphControlsCtrl =
@ -36,7 +35,6 @@
require('nf.Birdseye'),
require('nf.Storage'),
require('nf.CanvasUtils'),
require('nf.Common'),
require('nf.ProcessGroupConfiguration')));
} else {
nf.ng.Canvas.GraphControlsCtrl = factory(root.$,
@ -44,10 +42,9 @@
root.nf.Birdseye,
root.nf.Storage,
root.nf.CanvasUtils,
root.nf.Common,
root.nf.ProcessGroupConfiguration);
}
}(this, function ($, actions, birdseye, storage, canvasUtils, common, processGroupConfiguration) {
}(this, function ($, nfActions, nfBirdseye, nfStorage, nfCanvasUtils, nfProcessGroupConfiguration) {
'use strict';
return function (serviceProvider, navigateCtrl, operateCtrl) {
@ -72,11 +69,11 @@
// handle specific actions as necessary
if (graphControl.attr('id') === 'navigation-control') {
birdseye.updateBirdseyeVisibility(true);
nfBirdseye.updateBirdseyeVisibility(true);
}
// get the current visibility
var graphControlVisibility = storage.getItem('graph-control-visibility');
var graphControlVisibility = nfStorage.getItem('graph-control-visibility');
if (graphControlVisibility === null) {
graphControlVisibility = {};
}
@ -84,7 +81,7 @@
// update the visibility for this graph control
var graphControlId = graphControl.attr('id');
graphControlVisibility[graphControlId] = true;
storage.setItem('graph-control-visibility', graphControlVisibility);
nfStorage.setItem('graph-control-visibility', graphControlVisibility);
};
/**
@ -106,11 +103,11 @@
// handle specific actions as necessary
if (graphControl.attr('id') === 'navigation-control') {
birdseye.updateBirdseyeVisibility(false);
nfBirdseye.updateBirdseyeVisibility(false);
}
// get the current visibility
var graphControlVisibility = storage.getItem('graph-control-visibility');
var graphControlVisibility = nfStorage.getItem('graph-control-visibility');
if (graphControlVisibility === null) {
graphControlVisibility = {};
}
@ -118,7 +115,7 @@
// update the visibility for this graph control
var graphControlId = graphControl.attr('id');
graphControlVisibility[graphControlId] = false;
storage.setItem('graph-control-visibility', graphControlVisibility);
nfStorage.setItem('graph-control-visibility', graphControlVisibility);
};
function GraphControlsCtrl(navigateCtrl, operateCtrl) {
@ -144,7 +141,7 @@
init: function () {
this.operateCtrl.init();
// initial the graph control visibility
var graphControlVisibility = storage.getItem('graph-control-visibility');
var graphControlVisibility = nfStorage.getItem('graph-control-visibility');
if (graphControlVisibility !== null) {
$.each(graphControlVisibility, function (id, isVisible) {
var graphControl = $('#' + id);
@ -187,31 +184,31 @@
* Gets the icon to show for the selection context.
*/
getContextIcon: function () {
var selection = canvasUtils.getSelection();
var selection = nfCanvasUtils.getSelection();
if (selection.empty()) {
if (canvasUtils.getParentGroupId() === null) {
if (nfCanvasUtils.getParentGroupId() === null) {
return 'icon-drop';
} else {
return 'icon-group';
}
} else {
if (selection.size() === 1) {
if (canvasUtils.isProcessor(selection)) {
if (nfCanvasUtils.isProcessor(selection)) {
return 'icon-processor';
} else if (canvasUtils.isProcessGroup(selection)) {
} else if (nfCanvasUtils.isProcessGroup(selection)) {
return 'icon-group';
} else if (canvasUtils.isInputPort(selection)) {
} else if (nfCanvasUtils.isInputPort(selection)) {
return 'icon-port-in';
} else if (canvasUtils.isOutputPort(selection)) {
} else if (nfCanvasUtils.isOutputPort(selection)) {
return 'icon-port-out';
} else if (canvasUtils.isRemoteProcessGroup(selection)) {
} else if (nfCanvasUtils.isRemoteProcessGroup(selection)) {
return 'icon-group-remote';
} else if (canvasUtils.isFunnel(selection)) {
} else if (nfCanvasUtils.isFunnel(selection)) {
return 'icon-funnel';
} else if (canvasUtils.isLabel(selection)) {
} else if (nfCanvasUtils.isLabel(selection)) {
return 'icon-label';
} else if (canvasUtils.isConnection(selection)) {
} else if (nfCanvasUtils.isConnection(selection)) {
return 'icon-connect';
}
} else {
@ -224,7 +221,7 @@
* Will hide target when appropriate.
*/
hide: function () {
var selection = canvasUtils.getSelection();
var selection = nfCanvasUtils.getSelection();
if (selection.size() > 1) {
return 'invisible'
} else {
@ -236,27 +233,27 @@
* Gets the name to show for the selection context.
*/
getContextName: function () {
var selection = canvasUtils.getSelection();
var canRead = canvasUtils.canReadFromGroup();
var selection = nfCanvasUtils.getSelection();
var canRead = nfCanvasUtils.canReadFromGroup();
if (selection.empty()) {
if (canRead) {
return canvasUtils.getGroupName();
return nfCanvasUtils.getGroupName();
} else {
return canvasUtils.getGroupId();
return nfCanvasUtils.getGroupId();
}
} else {
if (selection.size() === 1) {
var d = selection.datum();
if (d.permissions.canRead) {
if (canvasUtils.isLabel(selection)) {
if (nfCanvasUtils.isLabel(selection)) {
if ($.trim(d.component.label) !== '') {
return d.component.label;
} else {
return '';
}
} else if (canvasUtils.isConnection(selection)) {
return canvasUtils.formatConnectionName(d.component);
} else if (nfCanvasUtils.isConnection(selection)) {
return nfCanvasUtils.formatConnectionName(d.component);
} else {
return d.component.name;
}
@ -273,27 +270,27 @@
* Gets the type to show for the selection context.
*/
getContextType: function () {
var selection = canvasUtils.getSelection();
var selection = nfCanvasUtils.getSelection();
if (selection.empty()) {
return 'Process Group';
} else {
if (selection.size() === 1) {
if (canvasUtils.isProcessor(selection)) {
if (nfCanvasUtils.isProcessor(selection)) {
return 'Processor';
} else if (canvasUtils.isProcessGroup(selection)) {
} else if (nfCanvasUtils.isProcessGroup(selection)) {
return 'Process Group';
} else if (canvasUtils.isInputPort(selection)) {
} else if (nfCanvasUtils.isInputPort(selection)) {
return 'Input Port';
} else if (canvasUtils.isOutputPort(selection)) {
} else if (nfCanvasUtils.isOutputPort(selection)) {
return 'Output Port';
} else if (canvasUtils.isRemoteProcessGroup(selection)) {
} else if (nfCanvasUtils.isRemoteProcessGroup(selection)) {
return 'Remote Process Group';
} else if (canvasUtils.isFunnel(selection)) {
} else if (nfCanvasUtils.isFunnel(selection)) {
return 'Funnel';
} else if (canvasUtils.isLabel(selection)) {
} else if (nfCanvasUtils.isLabel(selection)) {
return 'Label';
} else if (canvasUtils.isConnection(selection)) {
} else if (nfCanvasUtils.isConnection(selection)) {
return 'Connection';
}
} else {
@ -306,10 +303,10 @@
* Gets the id to show for the selection context.
*/
getContextId: function () {
var selection = canvasUtils.getSelection();
var selection = nfCanvasUtils.getSelection();
if (selection.empty()) {
return canvasUtils.getGroupId();
return nfCanvasUtils.getGroupId();
} else {
if (selection.size() === 1) {
var d = selection.datum();
@ -324,29 +321,29 @@
* Determines whether the user can configure or open the details dialog.
*/
canConfigureOrOpenDetails: function () {
var selection = canvasUtils.getSelection();
var selection = nfCanvasUtils.getSelection();
if (selection.empty()) {
return true;
}
return canvasUtils.isConfigurable(selection) || canvasUtils.hasDetails(selection);
return nfCanvasUtils.isConfigurable(selection) || nfCanvasUtils.hasDetails(selection);
},
/**
* Opens either the configuration or details view based on the current state.
*/
openConfigureOrDetailsView: function () {
var selection = canvasUtils.getSelection();
var selection = nfCanvasUtils.getSelection();
if (selection.empty()) {
processGroupConfiguration.showConfiguration(canvasUtils.getGroupId());
nfProcessGroupConfiguration.showConfiguration(nfCanvasUtils.getGroupId());
}
if (canvasUtils.isConfigurable(selection)) {
actions.showConfiguration(selection);
} else if (canvasUtils.hasDetails(selection)) {
actions.showDetails(selection);
if (nfCanvasUtils.isConfigurable(selection)) {
nfActions.showConfiguration(selection);
} else if (nfCanvasUtils.hasDetails(selection)) {
nfActions.showDetails(selection);
}
}
}

View File

@ -24,8 +24,8 @@
'nf.Storage',
'nf.Shell',
'nf.ErrorHandler'],
function ($, common, storage, shell, errorHandler) {
return (nf.ng.Canvas.HeaderCtrl = factory($, common, storage, shell, errorHandler));
function ($, nfCommon, nfStorage, nfShell, nfErrorHandler) {
return (nf.ng.Canvas.HeaderCtrl = factory($, nfCommon, nfStorage, nfShell, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.Canvas.HeaderCtrl =
@ -41,7 +41,7 @@
root.nf.Shell,
root.nf.ErrorHandler);
}
}(this, function ($, common, storage, shell, errorHandler) {
}(this, function ($, nfCommon, nfStorage, nfShell, nfErrorHandler) {
'use strict';
return function (serviceProvider, toolboxCtrl, globalMenuCtrl, flowStatusCtrl) {
@ -72,7 +72,7 @@
var loginCtrl = this;
// if the user is not anonymous or accessing via http
if ($('#current-user').text() !== common.ANONYMOUS_USER_TEXT || location.protocol === 'http:') {
if ($('#current-user').text() !== nfCommon.ANONYMOUS_USER_TEXT || location.protocol === 'http:') {
$('#login-link-container').css('display', 'none');
}
@ -90,7 +90,7 @@
$.when(loginXhr).done(function (loginResult) {
loginCtrl.supportsLogin = loginResult.config.supportsLogin;
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
},
/**
@ -107,7 +107,7 @@
* Launch the login shell.
*/
launch: function () {
shell.showPage('login', false);
nfShell.showPage('login', false);
}
}
};
@ -117,7 +117,7 @@
*/
this.logoutCtrl = {
logout: function () {
storage.removeItem("jwt");
nfStorage.removeItem("jwt");
window.location = '/nifi';
}
};

View File

@ -21,8 +21,8 @@
if (typeof define === 'function' && define.amd) {
define(['nf.CanvasUtils',
'nf.ContextMenu'],
function (canvasUtils, contextMenu) {
return (nf.ng.Canvas.NavigateCtrl = factory(canvasUtils, contextMenu));
function (nfCanvasUtils, nfContextMenu) {
return (nf.ng.Canvas.NavigateCtrl = factory(nfCanvasUtils, nfContextMenu));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.Canvas.NavigateCtrl =
@ -32,7 +32,7 @@
nf.ng.Canvas.NavigateCtrl = factory(root.nf.CanvasUtils,
root.nf.ContextMenu);
}
}(this, function (canvasUtils, contextMenu) {
}(this, function (nfCanvasUtils, nfContextMenu) {
'use strict';
return function () {
@ -44,13 +44,13 @@
* Zoom in on the canvas.
*/
this.zoomIn = function () {
canvasUtils.zoomCanvasViewIn();
nfCanvasUtils.zoomCanvasViewIn();
// hide the context menu
contextMenu.hide();
nfContextMenu.hide();
// refresh the canvas
canvasUtils.refreshCanvasView({
nfCanvasUtils.refreshCanvasView({
transition: true
});
};
@ -59,13 +59,13 @@
* Zoom out on the canvas.
*/
this.zoomOut = function () {
canvasUtils.zoomCanvasViewOut();
nfCanvasUtils.zoomCanvasViewOut();
// hide the context menu
contextMenu.hide();
nfContextMenu.hide();
// refresh the canvas
canvasUtils.refreshCanvasView({
nfCanvasUtils.refreshCanvasView({
transition: true
});
};
@ -74,13 +74,13 @@
* Zoom fit on the canvas.
*/
this.zoomFit = function () {
canvasUtils.fitCanvasView();
nfCanvasUtils.fitCanvasView();
// hide the context menu
contextMenu.hide();
nfContextMenu.hide();
// refresh the canvas
canvasUtils.refreshCanvasView({
nfCanvasUtils.refreshCanvasView({
transition: true
});
};
@ -89,13 +89,13 @@
* Zoom actual size on the canvas.
*/
this.zoomActualSize = function () {
canvasUtils.actualSizeCanvasView();
nfCanvasUtils.actualSizeCanvasView();
// hide the context menu
contextMenu.hide();
nfContextMenu.hide();
// refresh the canvas
canvasUtils.refreshCanvasView({
nfCanvasUtils.refreshCanvasView({
transition: true
});
};

View File

@ -27,8 +27,8 @@
'nf.Common',
'nf.Client',
'nf.Processor'],
function ($, d3, dialog, birdseye, canvasUtils, common, client, processor) {
return (nf.ng.Canvas.OperateCtrl = factory($, d3, dialog, birdseye, canvasUtils, common, client, processor));
function ($, d3, nfDialog, nfBirdseye, nfCanvasUtils, nfCommon, nfClient, nfProcessor) {
return (nf.ng.Canvas.OperateCtrl = factory($, d3, nfDialog, nfBirdseye, nfCanvasUtils, nfCommon, nfClient, nfProcessor));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.Canvas.OperateCtrl =
@ -50,7 +50,7 @@
root.nf.Client,
root.nf.Processor);
}
}(this, function ($, d3, dialog, birdseye, canvasUtils, common, client, processor) {
}(this, function ($, d3, nfDialog, nfBirdseye, nfCanvasUtils, nfCommon, nfClient, nfProcessor) {
'use strict';
return function () {
@ -154,12 +154,12 @@
dataType: 'xml',
beforeSubmit: function (formData, $form, options) {
// ensure uploading to the current process group
options.url += (encodeURIComponent(canvasUtils.getGroupId()) + '/templates/upload');
options.url += (encodeURIComponent(nfCanvasUtils.getGroupId()) + '/templates/upload');
},
success: function (response, statusText, xhr, form) {
// see if the import was successful and inform the user
if (response.documentElement.tagName === 'templateEntity') {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Success',
dialogContent: 'Template successfully imported.'
});
@ -169,23 +169,23 @@
if (response.documentElement.tagName === 'errorResponse') {
// if a more specific error was given, use it
var errorMessage = response.documentElement.getAttribute('statusText');
if (!common.isBlank(errorMessage)) {
if (!nfCommon.isBlank(errorMessage)) {
statusText = errorMessage;
}
}
// show reason
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Unable to Upload',
dialogContent: common.escapeHtml(statusText)
dialogContent: nfCommon.escapeHtml(statusText)
});
}
},
error: function (xhr, statusText, error) {
// request failed
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Unable to Upload',
dialogContent: common.escapeHtml(xhr.responseText)
dialogContent: nfCommon.escapeHtml(xhr.responseText)
});
}
});
@ -205,7 +205,7 @@
var selectedTemplate = $('#selected-template-name').text();
// submit the template if necessary
if (common.isBlank(selectedTemplate)) {
if (nfCommon.isBlank(selectedTemplate)) {
$('#upload-template-status').text('No template selected. Please browse to select a template.');
} else {
templateForm.submit();
@ -248,7 +248,7 @@
// add a handler for the change file input chain event
$('#template-file-field').on('change', function (e) {
var filename = $(this).val();
if (!common.isBlank(filename)) {
if (!nfCommon.isBlank(filename)) {
filename = filename.replace(/^.*[\\\/]/, '');
}
@ -320,7 +320,7 @@
},
handler: {
click: function () {
var selection = canvasUtils.getSelection();
var selection = nfCanvasUtils.getSelection();
// color the selected components
selection.each(function (d) {
@ -334,7 +334,7 @@
if (color !== selectedData.component.style['background-color']) {
// build the request entity
var entity = {
'revision': client.getRevision(selectedData),
'revision': nfClient.getRevision(selectedData),
'component': {
'id': selectedData.id,
'style': {
@ -352,16 +352,16 @@
contentType: 'application/json'
}).done(function (response) {
// update the component
canvasUtils.getComponentByType(selectedData.type).set(response);
nfCanvasUtils.getComponentByType(selectedData.type).set(response);
}).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Error',
dialogContent: common.escapeHtml(xhr.responseText)
dialogContent: nfCommon.escapeHtml(xhr.responseText)
});
}
}).always(function () {
birdseye.refresh();
nfBirdseye.refresh();
});
}
});
@ -448,13 +448,13 @@
if (hex.toLowerCase() === '#ffffff') {
//special case #ffffff implies default fill
$('#fill-color-processor-preview-icon').css({
'color': processor.defaultIconColor(),
'color': nfProcessor.defaultIconColor(),
'background-color': hex
});
} else {
$('#fill-color-processor-preview-icon').css({
'color': common.determineContrastColor(
common.substringAfterLast(
'color': nfCommon.determineContrastColor(
nfCommon.substringAfterLast(
hex, '#')),
'background-color': hex
});
@ -472,7 +472,7 @@
'background': hex
});
$('#fill-color-label-preview-value').css('color',
common.determineContrastColor(common.substringAfterLast(hex, '#'))
nfCommon.determineContrastColor(nfCommon.substringAfterLast(hex, '#'))
);
}
});

View File

@ -21,8 +21,8 @@
if (typeof define === 'function' && define.amd) {
define(['nf.CanvasUtils',
'nf.ContextMenu'],
function (canvasUtils, contextMenu) {
return (nf.ng.Canvas.ToolboxCtrl = factory(canvasUtils, contextMenu));
function (nfCanvasUtils, nfContextMenu) {
return (nf.ng.Canvas.ToolboxCtrl = factory(nfCanvasUtils, nfContextMenu));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.Canvas.ToolboxCtrl =
@ -32,7 +32,7 @@
nf.ng.Canvas.ToolboxCtrl = factory(root.nf.CanvasUtils,
root.nf.ContextMenu);
}
}(this, function (canvasUtils, contextMenu) {
}(this, function (nfCanvasUtils, nfContextMenu) {
'use strict';
return function (processorComponent,
@ -127,14 +127,14 @@
cursor: '-webkit-grabbing',
start: function (e, ui) {
// hide the context menu if necessary
contextMenu.hide();
nfContextMenu.hide();
},
stop: function (e, ui) {
var translate = canvasUtils.translateCanvasView();
var scale = canvasUtils.scaleCanvasView();
var translate = nfCanvasUtils.translateCanvasView();
var scale = nfCanvasUtils.scaleCanvasView();
var mouseX = e.originalEvent.pageX;
var mouseY = e.originalEvent.pageY - canvasUtils.getCanvasOffset();
var mouseY = e.originalEvent.pageY - nfCanvasUtils.getCanvasOffset();
// invoke the drop handler if we're over the canvas
if (mouseX >= 0 && mouseY >= 0) {

View File

@ -25,8 +25,8 @@
'nf.Graph',
'nf.CanvasUtils',
'nf.ErrorHandler'],
function ($, client, birdseye, graph, canvasUtils, errorHandler) {
return (nf.ng.FunnelComponent = factory($, client, birdseye, graph, canvasUtils, errorHandler));
function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) {
return (nf.ng.FunnelComponent = factory($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.FunnelComponent =
@ -44,7 +44,7 @@
root.nf.CanvasUtils,
root.nf.ErrorHandler);
}
}(this, function ($, client, birdseye, graph, canvasUtils, errorHandler) {
}(this, function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) {
'use strict';
return function (serviceProvider) {
@ -108,7 +108,7 @@
*/
createFunnel: function (pt) {
var outputPortEntity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': 0
}
@ -124,21 +124,21 @@
// create a new funnel
$.ajax({
type: 'POST',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/funnels',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/funnels',
data: JSON.stringify(outputPortEntity),
dataType: 'json',
contentType: 'application/json'
}).done(function (response) {
// add the funnel to the graph
graph.add({
nfGraph.add({
'funnels': [response]
}, {
'selectAll': true
});
// update the birdseye
birdseye.refresh();
}).fail(errorHandler.handleAjaxError);
nfBirdseye.refresh();
}).fail(nfErrorHandler.handleAjaxError);
}
}

View File

@ -25,8 +25,8 @@
'nf.Graph',
'nf.CanvasUtils',
'nf.ErrorHandler'],
function ($, client, birdseye, graph, canvasUtils, errorHandler) {
return (nf.ng.GroupComponent = factory($, client, birdseye, graph, canvasUtils, errorHandler));
function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) {
return (nf.ng.GroupComponent = factory($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.GroupComponent =
@ -44,7 +44,7 @@
root.nf.CanvasUtils,
root.nf.ErrorHandler);
}
}(this, function ($, client, birdseye, graph, canvasUtils, errorHandler) {
}(this, function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) {
'use strict';
return function (serviceProvider) {
@ -58,7 +58,7 @@
*/
var createGroup = function (groupName, pt) {
var processGroupEntity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': 0
}
@ -75,24 +75,24 @@
// create a new processor of the defined type
return $.ajax({
type: 'POST',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/process-groups',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/process-groups',
data: JSON.stringify(processGroupEntity),
dataType: 'json',
contentType: 'application/json'
}).done(function (response) {
// add the process group to the graph
graph.add({
nfGraph.add({
'processGroups': [response]
}, {
'selectAll': true
});
// update component visibility
graph.updateVisibility();
nfGraph.updateVisibility();
// update the birdseye
birdseye.refresh();
}).fail(errorHandler.handleAjaxError);
nfBirdseye.refresh();
}).fail(nfErrorHandler.handleAjaxError);
};
function GroupComponent() {

View File

@ -25,8 +25,8 @@
'nf.Graph',
'nf.CanvasUtils',
'nf.ErrorHandler'],
function ($, client, birdseye, graph, canvasUtils, errorHandler) {
return (nf.ng.InputPortComponent = factory($, client, birdseye, graph, canvasUtils, errorHandler));
function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) {
return (nf.ng.InputPortComponent = factory($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.InputPortComponent =
@ -44,7 +44,7 @@
root.nf.CanvasUtils,
root.nf.ErrorHandler);
}
}(this, function ($, client, birdseye, graph, canvasUtils, errorHandler) {
}(this, function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) {
'use strict';
return function (serviceProvider) {
@ -58,7 +58,7 @@
*/
var createInputPort = function (portName, pt) {
var inputPortEntity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': 0
}
@ -75,24 +75,24 @@
// create a new processor of the defined type
$.ajax({
type: 'POST',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/input-ports',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/input-ports',
data: JSON.stringify(inputPortEntity),
dataType: 'json',
contentType: 'application/json'
}).done(function (response) {
// add the port to the graph
graph.add({
nfGraph.add({
'inputPorts': [response]
}, {
'selectAll': true
});
// update component visibility
graph.updateVisibility();
nfGraph.updateVisibility();
// update the birdseye
birdseye.refresh();
}).fail(errorHandler.handleAjaxError);
nfBirdseye.refresh();
}).fail(nfErrorHandler.handleAjaxError);
};
function InputPortComponent() {

View File

@ -26,8 +26,8 @@
'nf.CanvasUtils',
'nf.ErrorHandler',
'nf.Label'],
function ($, client, birdseye, graph, canvasUtils, errorHandler, label) {
return (nf.ng.LabelComponent = factory($, client, birdseye, graph, canvasUtils, errorHandler, label));
function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfLabel) {
return (nf.ng.LabelComponent = factory($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfLabel));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.LabelComponent =
@ -47,7 +47,7 @@
root.nf.ErrorHandler,
root.nf.Label);
}
}(this, function ($, client, birdseye, graph, canvasUtils, errorHandler, label) {
}(this, function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfLabel) {
'use strict';
return function (serviceProvider) {
@ -111,14 +111,14 @@
*/
createLabel: function (pt) {
var labelEntity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': 0
}
}),
'component': {
'width': label.config.width,
'height': label.config.height,
'width': nfLabel.config.width,
'height': nfLabel.config.height,
'position': {
'x': pt.x,
'y': pt.y
@ -129,21 +129,21 @@
// create a new label
$.ajax({
type: 'POST',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/labels',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/labels',
data: JSON.stringify(labelEntity),
dataType: 'json',
contentType: 'application/json'
}).done(function (response) {
// add the label to the graph
graph.add({
nfGraph.add({
'labels': [response]
}, {
'selectAll': true
});
// update the birdseye
birdseye.refresh();
}).fail(errorHandler.handleAjaxError);
nfBirdseye.refresh();
}).fail(nfErrorHandler.handleAjaxError);
}
}

View File

@ -25,8 +25,8 @@
'nf.Graph',
'nf.CanvasUtils',
'nf.ErrorHandler'],
function ($, client, birdseye, graph, canvasUtils, errorHandler) {
return (nf.ng.OutputPortComponent = factory($, client, birdseye, graph, canvasUtils, errorHandler));
function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) {
return (nf.ng.OutputPortComponent = factory($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.OutputPortComponent =
@ -44,7 +44,7 @@
root.nf.CanvasUtils,
root.nf.ErrorHandler);
}
}(this, function ($, client, birdseye, graph, canvasUtils, errorHandler) {
}(this, function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler) {
'use strict';
return function (serviceProvider) {
@ -58,7 +58,7 @@
*/
var createOutputPort = function (portName, pt) {
var outputPortEntity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': 0
}
@ -75,24 +75,24 @@
// create a new processor of the defined type
$.ajax({
type: 'POST',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/output-ports',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/output-ports',
data: JSON.stringify(outputPortEntity),
dataType: 'json',
contentType: 'application/json'
}).done(function (response) {
// add the port to the graph
graph.add({
nfGraph.add({
'outputPorts': [response]
}, {
'selectAll': true
});
// update component visibility
graph.updateVisibility();
nfGraph.updateVisibility();
// update the birdseye
birdseye.refresh();
}).fail(errorHandler.handleAjaxError);
nfBirdseye.refresh();
}).fail(nfErrorHandler.handleAjaxError);
};
function OutputPortComponent() {

View File

@ -28,8 +28,8 @@
'nf.ErrorHandler',
'nf.Dialog',
'nf.Common'],
function ($, Slick, client, birdseye, graph, canvasUtils, errorHandler, dialog, common) {
return (nf.ng.ProcessorComponent = factory($, Slick, client, birdseye, graph, canvasUtils, errorHandler, dialog, common));
function ($, Slick, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon) {
return (nf.ng.ProcessorComponent = factory($, Slick, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.ProcessorComponent =
@ -53,7 +53,7 @@
root.nf.Dialog,
root.nf.Common);
}
}(this, function ($, Slick, client, birdseye, graph, canvasUtils, errorHandler, dialog, common) {
}(this, function ($, Slick, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon) {
'use strict';
return function (serviceProvider) {
@ -67,7 +67,7 @@
var processorTypesGrid = $('#processor-types-table').data('gridInstance');
// ensure the grid has been initialized
if (common.isDefinedAndNotNull(processorTypesGrid)) {
if (nfCommon.isDefinedAndNotNull(processorTypesGrid)) {
var processorTypesData = processorTypesGrid.getData();
// update the search criteria
@ -187,8 +187,8 @@
var sort = function (sortDetails, data) {
// defines a function for sorting
var comparer = function (a, b) {
var aString = common.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = common.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
var aString = nfCommon.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = nfCommon.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
return aString === bString ? 0 : aString > bString ? 1 : -1;
};
@ -239,7 +239,7 @@
*/
var createProcessor = function (name, processorType, pt) {
var processorEntity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': 0
}
@ -257,24 +257,24 @@
// create a new processor of the defined type
$.ajax({
type: 'POST',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/processors',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/processors',
data: JSON.stringify(processorEntity),
dataType: 'json',
contentType: 'application/json'
}).done(function (response) {
// add the processor to the graph
graph.add({
nfGraph.add({
'processors': [response]
}, {
'selectAll': true
});
// update component visibility
graph.updateVisibility();
nfGraph.updateVisibility();
// update the birdseye
birdseye.refresh();
}).fail(errorHandler.handleAjaxError);
nfBirdseye.refresh();
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -283,7 +283,7 @@
* @param item process type
*/
var isSelectable = function (item) {
return common.isBlank(item.usageRestriction) || common.canAccessRestrictedComponents();
return nfCommon.isBlank(item.usageRestriction) || nfCommon.canAccessRestrictedComponents();
};
function ProcessorComponent() {
@ -312,7 +312,7 @@
id: 'type',
name: 'Type',
field: 'label',
formatter: common.typeFormatter,
formatter: nfCommon.typeFormatter,
sortable: true,
resizable: true
},
@ -368,8 +368,8 @@
var processorType = processorTypesGrid.getDataItem(processorTypeIndex);
// set the processor type description
if (common.isDefinedAndNotNull(processorType)) {
if (common.isBlank(processorType.description)) {
if (nfCommon.isDefinedAndNotNull(processorType)) {
if (nfCommon.isBlank(processorType.description)) {
$('#processor-type-description')
.attr('title', '')
.html('<span class="unset">No description specified</span>');
@ -391,7 +391,7 @@
}
});
processorTypesGrid.onViewportChanged.subscribe(function (e, args) {
common.cleanUpTooltips($('#processor-types-table'), 'div.view-usage-restriction');
nfCommon.cleanUpTooltips($('#processor-types-table'), 'div.view-usage-restriction');
});
// wire up the dataview to the grid
@ -418,8 +418,8 @@
var item = processorTypesData.getItemById(rowId);
// show the tooltip
if (common.isDefinedAndNotNull(item.usageRestriction)) {
usageRestriction.qtip($.extend({}, common.config.tooltipConfig, {
if (nfCommon.isDefinedAndNotNull(item.usageRestriction)) {
usageRestriction.qtip($.extend({}, nfCommon.config.tooltipConfig, {
content: item.usageRestriction,
position: {
container: $('#summary'),
@ -454,10 +454,10 @@
// create the row for the processor type
processorTypesData.addItem({
id: i,
label: common.substringAfterLast(type, '.'),
label: nfCommon.substringAfterLast(type, '.'),
type: type,
description: common.escapeHtml(documentedType.description),
usageRestriction: common.escapeHtml(documentedType.usageRestriction),
description: nfCommon.escapeHtml(documentedType.description),
usageRestriction: nfCommon.escapeHtml(documentedType.usageRestriction),
tags: documentedType.tags.join(', ')
});
@ -479,7 +479,7 @@
select: applyFilter,
remove: applyFilter
});
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
},
@ -600,7 +600,7 @@
// ensure something was selected
if (name === '' || processorType === '') {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Add Processor',
dialogContent: 'The type of processor to create must be selected.'
});

View File

@ -27,8 +27,8 @@
'nf.ErrorHandler',
'nf.Dialog',
'nf.Common'],
function ($, client, birdseye, graph, canvasUtils, errorHandler, dialog, common) {
return (nf.ng.RemoteProcessGroupComponent = factory($, client, birdseye, graph, canvasUtils, errorHandler, dialog, common));
function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon) {
return (nf.ng.RemoteProcessGroupComponent = factory($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.RemoteProcessGroupComponent =
@ -50,7 +50,7 @@
root.nf.Dialog,
root.nf.Common);
}
}(this, function ($, client, birdseye, graph, canvasUtils, errorHandler, dialog, common) {
}(this, function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon) {
'use strict';
return function (serviceProvider) {
@ -64,7 +64,7 @@
var createRemoteProcessGroup = function (pt) {
var remoteProcessGroupEntity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': 0
}
@ -88,13 +88,13 @@
// create a new processor of the defined type
$.ajax({
type: 'POST',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/remote-process-groups',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/remote-process-groups',
data: JSON.stringify(remoteProcessGroupEntity),
dataType: 'json',
contentType: 'application/json'
}).done(function (response) {
// add the processor to the graph
graph.add({
nfGraph.add({
'remoteProcessGroups': [response]
}, {
'selectAll': true
@ -104,10 +104,10 @@
$('#new-remote-process-group-dialog').modal('hide');
// update component visibility
graph.updateVisibility();
nfGraph.updateVisibility();
// update the birdseye
birdseye.refresh();
nfBirdseye.refresh();
}).fail(function (xhr, status, error) {
if (xhr.status === 400) {
var errors = xhr.responseText.split('\n');
@ -116,15 +116,15 @@
if (errors.length === 1) {
content = $('<span></span>').text(errors[0]);
} else {
content = common.formatUnorderedList(errors);
content = nfCommon.formatUnorderedList(errors);
}
dialog.showOkDialog({
nfDialog.showOkDialog({
dialogContent: content,
headerText: 'Configuration Error'
});
} else {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
});
};

View File

@ -27,8 +27,8 @@
'nf.ErrorHandler',
'nf.Dialog',
'nf.Common'],
function ($, client, birdseye, graph, canvasUtils, errorHandler, dialog, common) {
return (nf.ng.TemplateComponent = factory($, client, birdseye, graph, canvasUtils, errorHandler, dialog, common));
function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon) {
return (nf.ng.TemplateComponent = factory($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.TemplateComponent =
@ -50,7 +50,7 @@
root.nf.Dialog,
root.nf.Common);
}
}(this, function ($, client, birdseye, graph, canvasUtils, errorHandler, dialog, common) {
}(this, function ($, nfClient, nfBirdseye, nfGraph, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon) {
'use strict';
return function (serviceProvider) {
@ -72,22 +72,22 @@
// create a new instance of the new template
$.ajax({
type: 'POST',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/template-instance',
url: serviceProvider.headerCtrl.toolboxCtrl.config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/template-instance',
data: JSON.stringify(instantiateTemplateInstance),
dataType: 'json',
contentType: 'application/json'
}).done(function (response) {
// populate the graph accordingly
graph.add(response.flow, {
nfGraph.add(response.flow, {
'selectAll': true
});
// update component visibility
graph.updateVisibility();
nfGraph.updateVisibility();
// update the birdseye
birdseye.refresh();
}).fail(errorHandler.handleAjaxError);
nfBirdseye.refresh();
}).fail(nfErrorHandler.handleAjaxError);
};
function TemplateComponent() {
@ -205,11 +205,11 @@
dataType: 'json'
}).done(function (response) {
var templates = response.templates;
if (common.isDefinedAndNotNull(templates) && templates.length > 0) {
if (nfCommon.isDefinedAndNotNull(templates) && templates.length > 0) {
// sort the templates
templates = templates.sort(function (one, two) {
var oneDate = common.parseDateTime(one.template.timestamp);
var twoDate = common.parseDateTime(two.template.timestamp);
var oneDate = nfCommon.parseDateTime(one.template.timestamp);
var twoDate = nfCommon.parseDateTime(two.template.timestamp);
// newest templates first
return twoDate.getTime() - oneDate.getTime();
@ -221,7 +221,7 @@
options.push({
text: templateEntity.template.name,
value: templateEntity.id,
description: common.escapeHtml(templateEntity.template.description)
description: nfCommon.escapeHtml(templateEntity.template.description)
});
}
});
@ -271,13 +271,13 @@
// show the dialog
templateComponent.modal.show();
} else {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Instantiate Template',
dialogContent: 'No templates have been loaded into this NiFi.'
});
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
}

View File

@ -21,19 +21,17 @@
if (typeof define === 'function' && define.amd) {
define(['jquery',
'd3',
'nf.ErrorHandler',
'nf.Common',
'nf.CanvasUtils',
'nf.ContextMenu',
'nf.Label'],
function ($, d3, errorHandler, common, canvasUtils, contextMenu, label) {
return (nf.Birdseye = factory($, d3, errorHandler, common, canvasUtils, contextMenu, label));
function ($, d3, nfCommon, nfCanvasUtils, nfContextMenu, nfLabel) {
return (nf.Birdseye = factory($, d3, nfCommon, nfCanvasUtils, nfContextMenu, nfLabel));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Birdseye =
factory(require('jquery'),
require('d3'),
require('nf.ErrorHandler'),
require('nf.Common'),
require('nf.CanvasUtils'),
require('nf.ContextMenu'),
@ -41,13 +39,12 @@
} else {
nf.Birdseye = factory(root.$,
root.d3,
root.nf.ErrorHandler,
root.nf.Common,
root.nf.CanvasUtils,
root.nf.ContextMenu,
root.nf.Label);
}
}(this, function ($, d3, errorHandler, common, canvasUtils, contextMenu, label) {
}(this, function ($, d3, nfCommon, nfCanvasUtils, nfContextMenu, nfLabel) {
'use strict';
var nfGraph;
@ -56,8 +53,8 @@
// refreshes the birdseye
var refresh = function (components) {
var translate = canvasUtils.translateCanvasView();
var scale = canvasUtils.scaleCanvasView();
var translate = nfCanvasUtils.translateCanvasView();
var scale = nfCanvasUtils.scaleCanvasView();
// scale the translation
translate = [translate[0] / scale, translate[1] / scale];
@ -65,7 +62,7 @@
// get the bounding box for the graph and convert into canvas space
var graphBox = d3.select('#canvas').node().getBoundingClientRect();
var graphLeft = (graphBox.left / scale) - translate[0];
var graphTop = ((graphBox.top - canvasUtils.getCanvasOffset()) / scale) - translate[1];
var graphTop = ((graphBox.top - nfCanvasUtils.getCanvasOffset()) / scale) - translate[1];
var graphRight = (graphBox.right / scale) - translate[0];
var graphBottom = (graphBox.bottom / scale) - translate[1];
@ -181,11 +178,11 @@
// labels
$.each(components.labels, function (_, d) {
var color = label.defaultColor();
var color = nfLabel.defaultColor();
if (d.permissions.canRead) {
// use the specified color if appropriate
if (common.isDefinedAndNotNull(d.component.style['background-color'])) {
if (nfCommon.isDefinedAndNotNull(d.component.style['background-color'])) {
color = d.component.style['background-color'];
}
}
@ -224,7 +221,7 @@
if (d.permissions.canRead) {
// use the specified color if appropriate
if (common.isDefinedAndNotNull(d.component.style['background-color'])) {
if (nfCommon.isDefinedAndNotNull(d.component.style['background-color'])) {
color = d.component.style['background-color'];
//if the background color is #ffffff use the default instead
@ -245,8 +242,14 @@
var visible = true;
var nfBirdseye = {
init: function (graph) {
nfGraph = graph;
/**
* Initializes of the graph controller.
*
* @param nfGraphRef The nfConnectable module.
*/
init: function (nfGraphRef) {
nfGraph = nfGraphRef;
var birdseye = $('#birdseye');
@ -278,7 +281,7 @@
})
.on('dragstart', function () {
// hide the context menu
contextMenu.hide();
nfContextMenu.hide();
})
.on('drag', function (d) {
d.x += d3.event.dx;
@ -289,17 +292,17 @@
return 'translate(' + d.x + ', ' + d.y + ')';
});
// get the current transformation
var scale = canvasUtils.scaleCanvasView();
var translate = canvasUtils.translateCanvasView();
var scale = nfCanvasUtils.scaleCanvasView();
var translate = nfCanvasUtils.translateCanvasView();
// update the translation according to the delta
translate = [(-d3.event.dx * scale) + translate[0], (-d3.event.dy * scale) + translate[1]];
// record the current transforms
canvasUtils.translateCanvasView(translate);
nfCanvasUtils.translateCanvasView(translate);
// refresh the canvas
canvasUtils.refreshCanvasView({
nfCanvasUtils.refreshCanvasView({
persist: false,
transition: false,
refreshComponents: false,
@ -311,7 +314,7 @@
nfGraph.updateVisibility();
// persist the users view
canvasUtils.persistUserView();
nfCanvasUtils.persistUserView();
// refresh the birdseye
nfBirdseye.refresh();

View File

@ -79,8 +79,8 @@
'nf.ng.Canvas.OperateCtrl',
'nf.ng.BreadcrumbsDirective',
'nf.ng.DraggableDirective'],
function ($, angular, common, canvasUtils, errorHandler, client, clusterSummary, dialog, storage, canvas, graph, contextMenu, shell, settings, actions, snippet, queueListing, componentState, draggable, connectable, statusHistory, birdseye, connectionConfiguration, controllerService, reportingTask, policyManagement, processorConfiguration, processGroupConfiguration, controllerServices, remoteProcessGroupConfiguration, remoteProcessGroupPorts, portConfiguration, labelConfiguration, processorDetails, portDetails, connectionDetails, remoteProcessGroupDetails, nfGoto, angularBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective) {
return factory($, angular, common, canvasUtils, errorHandler, client, clusterSummary, dialog, storage, canvas, graph, contextMenu, shell, settings, actions, snippet, queueListing, componentState, draggable, connectable, statusHistory, birdseye, connectionConfiguration, controllerService, reportingTask, policyManagement, processorConfiguration, processGroupConfiguration, controllerServices, remoteProcessGroupConfiguration, remoteProcessGroupPorts, portConfiguration, labelConfiguration, processorDetails, portDetails, connectionDetails, remoteProcessGroupDetails, nfGoto, angularBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective);
function ($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfClusterSummary, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfShell, nfSettings, nfActions, nfSnippet, nfQueueListing, nfComponentState, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective) {
return factory($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfClusterSummary, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfShell, nfSettings, nfActions, nfSnippet, nfQueueListing, nfComponentState, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective);
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = factory(require('jquery'),
@ -205,7 +205,7 @@
root.nf.ng.BreadcrumbsDirective,
root.nf.ng.DraggableDirective);
}
}(this, function ($, angular, common, canvasUtils, errorHandler, client, clusterSummary, dialog, storage, canvas, graph, contextMenu, shell, settings, actions, snippet, queueListing, componentState, draggable, connectable, statusHistory, birdseye, connectionConfiguration, controllerService, reportingTask, policyManagement, processorConfiguration, processGroupConfiguration, controllerServices, remoteProcessGroupConfiguration, remoteProcessGroupPorts, portConfiguration, labelConfiguration, processorDetails, portDetails, connectionDetails, remoteProcessGroupDetails, nfGoto, angularBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective) {
}(this, function ($, angular, nfCommon, nfCanvasUtils, nfErrorHandler, nfClient, nfClusterSummary, nfDialog, nfStorage, nfCanvas, nfGraph, nfContextMenu, nfShell, nfSettings, nfActions, nfSnippet, nfQueueListing, nfComponentState, nfDraggable, nfConnectable, nfStatusHistory, nfBirdseye, nfConnectionConfiguration, nfControllerService, nfReportingTask, nfPolicyManagement, nfProcessorConfiguration, nfProcessGroupConfiguration, nfControllerServices, nfRemoteProcessGroupConfiguration, nfRemoteProcessGroupPorts, nfPortConfiguration, nfLabelConfiguration, nfProcessorDetails, nfPortDetails, nfConnectionDetails, nfRemoteProcessGroupDetails, nfGoto, nfNgBridge, appCtrl, appConfig, serviceProvider, breadcrumbsCtrl, headerCtrl, flowStatusCtrl, globalMenuCtrl, toolboxCtrl, processorComponent, inputPortComponent, outputPortComponent, processGroupComponent, remoteProcessGroupComponent, funnelComponent, templateComponent, labelComponent, graphControlsCtrl, navigateCtrl, operateCtrl, breadcrumbsDirective, draggableDirective) {
var config = {
urls: {
@ -217,7 +217,7 @@
* Bootstrap the canvas application.
*/
$(document).ready(function () {
if (canvas.SUPPORTS_SVG) {
if (nfCanvas.SUPPORTS_SVG) {
//Create Angular App
var app = angular.module('ngCanvasApp', ['ngResource', 'ngRoute', 'ngMaterial', 'ngMessages']);
@ -283,17 +283,17 @@
// initialize the canvas utils and invert control of the canvas,
// actions, snippet, birdseye, and graph
canvasUtils.init(canvas, actions, snippet, birdseye, graph);
nfCanvasUtils.init(nfCanvas, nfActions, nfSnippet, nfBirdseye, nfGraph);
//Manually Boostrap Angular App
angularBridge.injector = angular.bootstrap($('body'), ['ngCanvasApp'], {strictDi: true});
nfNgBridge.injector = angular.bootstrap($('body'), ['ngCanvasApp'], {strictDi: true});
// initialize the NiFi
var userXhr = canvas.init();
var userXhr = nfCanvas.init();
userXhr.done(function () {
// load the client id
var clientXhr = client.init();
var clientXhr = nfClient.init();
// get the controller config to register the status poller
var configXhr = $.ajax({
@ -303,89 +303,89 @@
});
// ensure the config requests are loaded
$.when(configXhr, clusterSummary.loadClusterSummary(), userXhr, clientXhr).done(function (configResult) {
$.when(configXhr, nfClusterSummary.loadClusterSummary(), userXhr, clientXhr).done(function (configResult) {
var configResponse = configResult[0];
// calculate the canvas offset
var canvasContainer = $('#canvas-container');
canvas.CANVAS_OFFSET = canvasContainer.offset().top;
nfCanvas.CANVAS_OFFSET = canvasContainer.offset().top;
// get the config details
var configDetails = configResponse.flowConfiguration;
// show disconnected message on load if necessary
if (clusterSummary.isClustered() && !clusterSummary.isConnectedToCluster()) {
dialog.showDisconnectedFromClusterMessage();
if (nfClusterSummary.isClustered() && !nfClusterSummary.isConnectedToCluster()) {
nfDialog.showDisconnectedFromClusterMessage();
}
// get the auto refresh interval
var autoRefreshIntervalSeconds = parseInt(configDetails.autoRefreshIntervalSeconds, 10);
// record whether we can configure the authorizer
canvas.setConfigurableAuthorizer(configDetails.supportsConfigurableAuthorizer);
nfCanvas.setConfigurableAuthorizer(configDetails.supportsConfigurableAuthorizer);
// init storage
storage.init();
// init nfStorage
nfStorage.init();
// initialize the application
canvas.initCanvas();
canvas.View.init();
nfCanvas.initCanvas();
nfCanvas.View.init();
// initialize the context menu and invert control of the actions
contextMenu.init(actions);
nfContextMenu.init(nfActions);
// initialize the shell and invert control of the context menu
shell.init(contextMenu);
angularBridge.injector.get('headerCtrl').init();
settings.init();
actions.init();
queueListing.init();
componentState.init();
nfShell.init(nfContextMenu);
nfNgBridge.injector.get('headerCtrl').init();
nfSettings.init();
nfActions.init();
nfQueueListing.init();
nfComponentState.init();
// initialize the component behaviors
draggable.init();
connectable.init();
nfDraggable.init();
nfConnectable.init();
// initialize the chart
statusHistory.init(configDetails.timeOffset);
nfStatusHistory.init(configDetails.timeOffset);
// initialize the birdseye
birdseye.init(graph);
nfBirdseye.init(nfGraph);
// initialize the connection config and invert control of the birdseye and graph
connectionConfiguration.init(birdseye, graph);
controllerService.init();
reportingTask.init(settings);
policyManagement.init();
processorConfiguration.init();
nfConnectionConfiguration.init(nfBirdseye, nfGraph);
nfControllerService.init();
nfReportingTask.init(nfSettings);
nfPolicyManagement.init();
nfProcessorConfiguration.init();
// initialize the PG config and invert control of the controllerServices
processGroupConfiguration.init(controllerServices);
remoteProcessGroupConfiguration.init();
remoteProcessGroupPorts.init();
portConfiguration.init();
labelConfiguration.init();
processorDetails.init(true);
portDetails.init();
connectionDetails.init();
remoteProcessGroupDetails.init();
nfProcessGroupConfiguration.init(nfControllerServices);
nfRemoteProcessGroupConfiguration.init();
nfRemoteProcessGroupPorts.init();
nfPortConfiguration.init();
nfLabelConfiguration.init();
nfProcessorDetails.init(true);
nfPortDetails.init();
nfConnectionDetails.init();
nfRemoteProcessGroupDetails.init();
nfGoto.init();
graph.init().done(function () {
angularBridge.injector.get('graphControlsCtrl').init();
nfGraph.init().done(function () {
nfNgBridge.injector.get('graphControlsCtrl').init();
// determine the split between the polling
var pollingSplit = autoRefreshIntervalSeconds / 2;
// register the polling
setTimeout(function () {
canvas.startPolling(autoRefreshIntervalSeconds);
nfCanvas.startPolling(autoRefreshIntervalSeconds);
}, pollingSplit * 1000);
// hide the splash screen
canvas.hideSplash();
}).fail(errorHandler.handleAjaxError);
}).fail(errorHandler.handleAjaxError);
}).fail(errorHandler.handleAjaxError);
nfCanvas.hideSplash();
}).fail(nfErrorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
//initialize toolbox components tooltips
$('.component-button').qtip($.extend({}, common.config.tooltipConfig));
$('.component-button').qtip($.extend({}, nfCommon.config.tooltipConfig));
} else {
$('#message-title').text('Unsupported Browser');
$('#message-content').text('Flow graphs are shown using SVG. Please use a browser that supports rendering SVG.');
@ -394,7 +394,7 @@
$('#message-pane').show();
// hide the splash screen
canvas.hideSplash();
nfCanvas.hideSplash();
}
});
}));

View File

@ -23,8 +23,8 @@
'nf.Common',
'nf.Canvas',
'nf.ContextMenu'],
function (ajaxErrorHandler, common, canvas, contextMenu) {
return (nf.ErrorHandler = factory(ajaxErrorHandler, common, canvas, contextMenu));
function (ajaxErrorHandler, nfCommon, nfCanvas, nfContextMenu) {
return (nf.ErrorHandler = factory(ajaxErrorHandler, nfCommon, nfCanvas, nfContextMenu));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ErrorHandler =
@ -38,7 +38,7 @@
root.nf.Canvas,
root.nf.ContextMenu);
}
}(this, function (ajaxErrorHandler, common, canvas, contextMenu) {
}(this, function (ajaxErrorHandler, nfCommon, nfCanvas, nfContextMenu) {
'use strict';
return {
@ -52,21 +52,21 @@
*/
handleAjaxError: function (xhr, status, error) {
ajaxErrorHandler.handleAjaxError(xhr, status, error);
common.showLogoutLink();
nfCommon.showLogoutLink();
// hide the splash screen if required
if ($('#splash').is(':visible')) {
canvas.hideSplash();
nfCanvas.hideSplash();
}
// hide the context menu
contextMenu.hide();
nfContextMenu.hide();
// shut off the auto refresh
canvas.stopPolling();
nfCanvas.stopPolling();
// allow page refresh with ctrl-r
canvas.disableRefreshHotKey();
nfCanvas.disableRefreshHotKey();
}
};
}));

View File

@ -24,8 +24,8 @@
'nf.Dialog',
'nf.Clipboard',
'nf.Storage'],
function (d3, $, common, dialog, clipboard, storage) {
return (nf.CanvasUtils = factory(d3, $, common, dialog, clipboard, storage));
function (d3, $, nfCommon, nfDialog, nfClipboard, nfStorage) {
return (nf.CanvasUtils = factory(d3, $, nfCommon, nfDialog, nfClipboard, nfStorage));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.CanvasUtils = factory(
@ -44,7 +44,7 @@
root.nf.Clipboard,
root.nf.Storage);
}
}(this, function (d3, $, common, dialog, clipboard, storage) {
}(this, function (d3, $, nfCommon, nfDialog, nfClipboard, nfStorage) {
'use strict';
var nfCanvas;
@ -116,10 +116,10 @@
nfBirdseye.refresh();
deferred.resolve();
}).fail(common.handleAjaxError).fail(function () {
}).fail(nfCommon.handleAjaxError).fail(function () {
deferred.reject();
});
}).fail(common.handleAjaxError).fail(function () {
}).fail(nfCommon.handleAjaxError).fail(function () {
deferred.reject();
});
}).promise();
@ -130,18 +130,18 @@
/**
* Initialize the canvas utils.
*
* @param canvas The reference to the canvas controller.
* @param actions The reference to the actions controller.
* @param snippet The reference to the snippet controller.
* @param birdseye The reference to the birdseye controller.
* @param graph The reference to the graph controller.
* @param nfCanvasRef The nfCanvas module.
* @param nfActionsRef The nfActions module.
* @param nfSnippetRef The nfSnippet module.
* @param nfBirdseyeRef The nfBirdseye module.
* @param nfGraphRef The nfGraph module.
*/
init: function(canvas, actions, snippet, birdseye, graph){
nfCanvas = canvas;
nfActions = actions;
nfSnippet = snippet;
nfBirdseye = birdseye;
nfGraph = graph;
init: function(nfCanvasRef, nfActionsRef, nfSnippetRef, nfBirdseyeRef, nfGraphRef){
nfCanvas = nfCanvasRef;
nfActions = nfActionsRef;
nfSnippet = nfSnippetRef;
nfBirdseye = nfBirdseyeRef;
nfGraph = nfGraphRef;
},
config: {
@ -241,7 +241,7 @@
*/
showComponent: function (groupId, componentId) {
// ensure the group id is specified
if (common.isDefinedAndNotNull(groupId)) {
if (nfCommon.isDefinedAndNotNull(groupId)) {
// initiate a graph refresh
var refreshGraph = $.Deferred(function (deferred) {
// load a different group if necessary
@ -253,7 +253,7 @@
nfCanvas.reload().done(function () {
deferred.resolve();
}).fail(function () {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Process Group',
dialogContent: 'Unable to load the group for the specified component.'
});
@ -271,7 +271,7 @@
if (!component.empty()) {
nfActions.show(component);
} else {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Process Group',
dialogContent: 'Unable to find the specified component.'
});
@ -313,21 +313,23 @@
* Enables/disables the editable behavior for the specified selection based on their access policies.
*
* @param selection selection
* @param nfConnectableRef The nfConnectable module.
* @param nfDraggableRef The nfDraggable module.
*/
editable: function (selection, connectable, draggable) {
editable: function (selection, nfConnectableRef, nfDraggableRef) {
if (nfCanvasUtils.canModify(selection)) {
if (!selection.classed('connectable')) {
selection.call(connectable.activate);
selection.call(nfConnectableRef.activate);
}
if (!selection.classed('moveable')) {
selection.call(draggable.activate);
selection.call(nfDraggableRef.activate);
}
} else {
if (selection.classed('connectable')) {
selection.call(connectable.deactivate);
selection.call(nfConnectableRef.deactivate);
}
if (selection.classed('moveable')) {
selection.call(draggable.deactivate);
selection.call(nfDraggableRef.deactivate);
}
}
},
@ -425,7 +427,7 @@
// go through each word
var word = words.pop();
while (common.isDefinedAndNotNull(word)) {
while (nfCommon.isDefinedAndNotNull(word)) {
// add the current word
line.push(word);
@ -536,20 +538,20 @@
* @param {function} offset Optional offset
*/
bulletins: function (selection, d, getTooltipContainer, offset) {
offset = common.isDefinedAndNotNull(offset) ? offset : 0;
offset = nfCommon.isDefinedAndNotNull(offset) ? offset : 0;
// get the tip
var tip = d3.select('#bulletin-tip-' + d.id);
var hasBulletins = false;
if (!common.isEmpty(d.bulletins)) {
if (!nfCommon.isEmpty(d.bulletins)) {
// format the bulletins
var bulletins = common.getFormattedBulletins(d.bulletins);
var bulletins = nfCommon.getFormattedBulletins(d.bulletins);
hasBulletins = bulletins.length > 0;
if (hasBulletins) {
// create the unordered list based off the formatted bulletins
var list = common.formatUnorderedList(bulletins);
var list = nfCommon.formatUnorderedList(bulletins);
}
}
@ -1094,7 +1096,7 @@
}
// ensure access to read tenants
return common.canAccessTenants();
return nfCommon.canAccessTenants();
}
return false;
@ -1266,7 +1268,7 @@
* Determines if something is currently pastable.
*/
isPastable: function () {
return nfCanvas.canWrite() && clipboard.isCopied();
return nfCanvas.canWrite() && nfClipboard.isCopied();
},
/**
@ -1284,7 +1286,7 @@
};
// store the item
storage.setItem(name, item);
nfStorage.setItem(name, item);
},
/**
@ -1293,9 +1295,9 @@
* @param {object} connection
*/
formatConnectionName: function (connection) {
if (!common.isBlank(connection.name)) {
if (!nfCommon.isBlank(connection.name)) {
return connection.name;
} else if (common.isDefinedAndNotNull(connection.selectedRelationships)) {
} else if (nfCommon.isDefinedAndNotNull(connection.selectedRelationships)) {
return connection.selectedRelationships.join(', ');
}
return '';
@ -1308,13 +1310,13 @@
* @param {string} destinationComponentId The connection destination id
*/
reloadConnectionSourceAndDestination: function (sourceComponentId, destinationComponentId) {
if (common.isBlank(sourceComponentId) === false) {
if (nfCommon.isBlank(sourceComponentId) === false) {
var source = d3.select('#id-' + sourceComponentId);
if (source.empty() === false) {
nfGraph.reload(source);
}
}
if (common.isBlank(destinationComponentId) === false) {
if (nfCommon.isBlank(destinationComponentId) === false) {
var destination = d3.select('#id-' + destinationComponentId);
if (destination.empty() === false) {
nfGraph.reload(destination);
@ -1362,10 +1364,10 @@
try {
// see if we can restore the view position from storage
var name = config.storage.namePrefix + nfCanvas.getGroupId();
var item = storage.getItem(name);
var item = nfStorage.getItem(name);
// ensure the item is valid
if (common.isDefinedAndNotNull(item)) {
if (nfCommon.isDefinedAndNotNull(item)) {
if (isFinite(item.scale) && isFinite(item.translateX) && isFinite(item.translateY)) {
// restore previous view
nfCanvas.View.translate([item.translateX, item.translateY]);
@ -1398,10 +1400,10 @@
selection.each(function (d) {
var selected = d3.select(this);
if (!nfCanvasUtils.isConnection(selected)) {
if (common.isUndefined(origin.x) || d.position.x < origin.x) {
if (nfCommon.isUndefined(origin.x) || d.position.x < origin.x) {
origin.x = d.position.x;
}
if (common.isUndefined(origin.y) || d.position.y < origin.y) {
if (nfCommon.isUndefined(origin.y) || d.position.y < origin.y) {
origin.y = d.position.y;
}
}
@ -1420,7 +1422,7 @@
// if the group id is null, we're already in the top most group
if (groupId === null) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Process Group',
dialogContent: 'Components are already in the topmost group.'
});

View File

@ -33,8 +33,8 @@
'nf.ContextMenu',
'nf.Actions',
'nf.ProcessGroup'],
function ($, d3, common, nfGraph, nfShell, angularBridge, nfClusterSummary, errorHandler, storage, canvasUtils, birdseye, contextMenu, actions, processGroup) {
return (nf.Canvas = factory($, d3, common, nfGraph, nfShell, angularBridge, nfClusterSummary, errorHandler, storage, canvasUtils, birdseye, contextMenu, actions, processGroup));
function ($, d3, nfCommon, nfGraph, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils, nfBirdseye, nfContextMenu, nfActions, nfProcessGroup) {
return (nf.Canvas = factory($, d3, nfCommon, nfGraph, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils, nfBirdseye, nfContextMenu, nfActions, nfProcessGroup));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Canvas =
@ -68,7 +68,7 @@
root.nf.Actions,
root.nf.ProcessGroup);
}
}(this, function ($, d3, common, nfGraph, nfShell, angularBridge, nfClusterSummary, errorHandler, storage, canvasUtils, birdseye, contextMenu, actions, processGroup) {
}(this, function ($, d3, nfCommon, nfGraph, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils, nfBirdseye, nfContextMenu, nfActions, nfProcessGroup) {
'use strict';
var SCALE = 1;
@ -155,17 +155,17 @@
permissions = flowResponse.permissions;
// update the breadcrumbs
angularBridge.injector.get('breadcrumbsCtrl').resetBreadcrumbs();
nfNgBridge.injector.get('breadcrumbsCtrl').resetBreadcrumbs();
// inform Angular app values have changed
angularBridge.digest();
angularBridge.injector.get('breadcrumbsCtrl').generateBreadcrumbs(breadcrumb);
angularBridge.injector.get('breadcrumbsCtrl').resetScrollPosition();
nfNgBridge.digest();
nfNgBridge.injector.get('breadcrumbsCtrl').generateBreadcrumbs(breadcrumb);
nfNgBridge.injector.get('breadcrumbsCtrl').resetScrollPosition();
// update the timestamp
$('#stats-last-refreshed').text(processGroupFlow.lastRefreshed);
// set the parent id if applicable
if (common.isDefinedAndNotNull(processGroupFlow.parentGroupId)) {
if (nfCommon.isDefinedAndNotNull(processGroupFlow.parentGroupId)) {
nfCanvas.setParentGroupId(processGroupFlow.parentGroupId);
} else {
nfCanvas.setParentGroupId(null);
@ -181,8 +181,8 @@
nfCanvas.View.updateVisibility();
// update the birdseye
birdseye.refresh();
}).fail(errorHandler.handleAjaxError);
nfBirdseye.refresh();
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -198,7 +198,7 @@
dataType: 'json'
}).done(function (currentUser) {
// set the current user
common.setCurrentUser(currentUser);
nfCommon.setCurrentUser(currentUser);
});
};
@ -240,26 +240,26 @@
return $.Deferred(function (deferred) {
// issue the requests
var processGroupXhr = reloadProcessGroup(nfCanvas.getGroupId(), options);
var statusXhr = angularBridge.injector.get('flowStatusCtrl').reloadFlowStatus();
var statusXhr = nfNgBridge.injector.get('flowStatusCtrl').reloadFlowStatus();
var currentUserXhr = loadCurrentUser();
var controllerBulletins = $.ajax({
type: 'GET',
url: config.urls.controllerBulletins,
dataType: 'json'
}).done(function (response) {
angularBridge.injector.get('flowStatusCtrl').updateBulletins(response);
nfNgBridge.injector.get('flowStatusCtrl').updateBulletins(response);
});
var clusterSummary = nfClusterSummary.loadClusterSummary().done(function (response) {
var clusterSummary = response.clusterSummary;
// update the cluster summary
angularBridge.injector.get('flowStatusCtrl').updateClusterSummary(clusterSummary);
nfNgBridge.injector.get('flowStatusCtrl').updateClusterSummary(clusterSummary);
});
// wait for all requests to complete
$.when(processGroupXhr, statusXhr, currentUserXhr, controllerBulletins, clusterSummary).done(function (processGroupResult) {
// inform Angular app values have changed
angularBridge.digest();
nfNgBridge.digest();
// resolve the deferred
deferred.resolve(processGroupResult);
@ -282,10 +282,10 @@
canvasClicked = false;
// since the context menu event propagated back to the canvas, clear the selection
canvasUtils.getSelection().classed('selected', false);
nfCanvasUtils.getSelection().classed('selected', false);
// show the context menu on the canvas
contextMenu.show();
nfContextMenu.show();
// prevent default browser behavior
d3.event.preventDefault();
@ -555,11 +555,11 @@
selectionBox.remove();
} else if (panning === false) {
// deselect as necessary if we are not panning
canvasUtils.getSelection().classed('selected', false);
nfCanvasUtils.getSelection().classed('selected', false);
}
// inform Angular app values have changed
angularBridge.digest();
nfNgBridge.digest();
});
// define a function for update the graph dimensions
@ -587,7 +587,7 @@
});
//breadcrumbs
angularBridge.injector.get('breadcrumbsCtrl').updateBreadcrumbsCss({'bottom': bottom + 'px'});
nfNgBridge.injector.get('breadcrumbsCtrl').updateBreadcrumbsCss({'bottom': bottom + 'px'});
// body
$('#canvas-body').css({
@ -606,16 +606,16 @@
// listen for events to go to components
$('body').on('GoTo:Component', function (e, item) {
canvasUtils.showComponent(item.parentGroupId, item.id);
nfCanvasUtils.showComponent(item.parentGroupId, item.id);
});
// listen for events to go to process groups
$('body').on('GoTo:ProcessGroup', function (e, item) {
processGroup.enterGroup(item.id).done(function () {
canvasUtils.getSelection().classed('selected', false);
nfProcessGroup.enterGroup(item.id).done(function () {
nfCanvasUtils.getSelection().classed('selected', false);
// inform Angular app that values have changed
angularBridge.digest();
nfNgBridge.digest();
});
});
@ -670,7 +670,7 @@
}
}
$.each(tabsContents, function (index, tabsContent) {
common.toggleScrollable(tabsContent.get(0));
nfCommon.toggleScrollable(tabsContent.get(0));
});
}
}).on('keydown', function (evt) {
@ -680,7 +680,7 @@
}
// get the current selection
var selection = canvasUtils.getSelection();
var selection = nfCanvasUtils.getSelection();
// handle shortcuts
var isCtrl = evt.ctrlKey || evt.metaKey;
@ -691,25 +691,25 @@
return;
}
// ctrl-r
actions.reload();
nfActions.reload();
// default prevented in nf-universal-capture.js
} else if (evt.keyCode === 65) {
// ctrl-a
actions.selectAll();
angularBridge.digest();
nfActions.selectAll();
nfNgBridge.digest();
// only want to prevent default if the action was performed, otherwise default select all would be overridden
evt.preventDefault();
} else if (evt.keyCode === 67) {
// ctrl-c
if (nfCanvas.canWrite() && canvasUtils.isCopyable(selection)) {
actions.copy(selection);
if (nfCanvas.canWrite() && nfCanvasUtils.isCopyable(selection)) {
nfActions.copy(selection);
}
} else if (evt.keyCode === 86) {
// ctrl-v
if (nfCanvas.canWrite() && canvasUtils.isPastable()) {
actions.paste(selection);
if (nfCanvas.canWrite() && nfCanvasUtils.isPastable()) {
nfActions.paste(selection);
// only want to prevent default if the action was performed, otherwise default paste would be overridden
evt.preventDefault();
@ -718,8 +718,8 @@
} else {
if (evt.keyCode === 8 || evt.keyCode === 46) {
// backspace or delete
if (nfCanvas.canWrite() && canvasUtils.areDeletable(selection)) {
actions['delete'](selection);
if (nfCanvas.canWrite() && nfCanvasUtils.areDeletable(selection)) {
nfActions['delete'](selection);
}
// default prevented in nf-universal-capture.js
@ -734,14 +734,14 @@
dataType: 'json'
}).done(function (response) {
// ensure the banners response is specified
if (common.isDefinedAndNotNull(response.banners)) {
if (common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
if (nfCommon.isDefinedAndNotNull(response.banners)) {
if (nfCommon.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
// update the header text and show it
$('#banner-header').addClass('banner-header-background').text(response.banners.headerText).show();
$('#canvas-container').css('top', '98px');
}
if (common.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
if (nfCommon.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
// update the footer text and show it
var bannerFooter = $('#banner-footer').text(response.banners.footerText).show();
@ -757,7 +757,7 @@
// update the graph dimensions
updateGraphSize();
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
},
/**
@ -766,7 +766,7 @@
init: function () {
// attempt kerberos authentication
var ticketExchange = $.Deferred(function (deferred) {
if (storage.hasItem('jwt')) {
if (nfStorage.hasItem('jwt')) {
deferred.resolve();
} else {
$.ajax({
@ -775,9 +775,9 @@
dataType: 'text'
}).done(function (jwt) {
// get the payload and store the token with the appropriate expiration
var token = common.getJwtPayload(jwt);
var expiration = parseInt(token['exp'], 10) * common.MILLIS_PER_SECOND;
storage.setItem('jwt', jwt, expiration);
var token = nfCommon.getJwtPayload(jwt);
var expiration = parseInt(token['exp'], 10) * nfCommon.MILLIS_PER_SECOND;
nfStorage.setItem('jwt', jwt, expiration);
deferred.resolve();
}).fail(function () {
deferred.reject();
@ -795,12 +795,12 @@
$('#current-user').text(currentUser.identity).show();
// render the logout button if there is a token locally
if (storage.getItem('jwt') !== null) {
if (nfStorage.getItem('jwt') !== null) {
$('#logout-link-container').show();
}
} else {
// set the anonymous user label
common.setAnonymousUserLabel();
nfCommon.setAnonymousUserLabel();
}
deferred.resolve();
}).fail(function (xhr, status, error) {
@ -1024,7 +1024,7 @@
.scale(SCALE)
.on('zoomstart', function () {
// hide the context menu
contextMenu.hide();
nfContextMenu.hide();
})
.on('zoom', function () {
// if we have zoomed, indicate that we are panning
@ -1050,16 +1050,16 @@
})
.on('zoomend', function () {
// ensure the canvas was actually refreshed
if (common.isDefinedAndNotNull(refreshed)) {
if (nfCommon.isDefinedAndNotNull(refreshed)) {
nfCanvas.View.updateVisibility();
// refresh the birdseye
refreshed.done(function () {
birdseye.refresh();
nfBirdseye.refresh();
});
// persist the users view
canvasUtils.persistUserView();
nfCanvasUtils.persistUserView();
// reset the refreshed deferred
refreshed = null;
@ -1096,7 +1096,7 @@
* @param {array} translate [x, y]
*/
translate: function (translate) {
if (common.isUndefined(translate)) {
if (nfCommon.isUndefined(translate)) {
return behavior.translate();
} else {
behavior.translate(translate);
@ -1109,7 +1109,7 @@
* @param {number} scale The new scale
*/
scale: function (scale) {
if (common.isUndefined(scale)) {
if (nfCommon.isUndefined(scale)) {
return behavior.scale();
} else {
behavior.scale(scale);
@ -1133,7 +1133,7 @@
nfCanvas.View.scale(newScale);
// center around the center of the screen accounting for the translation accordingly
canvasUtils.centerBoundingBox({
nfCanvasUtils.centerBoundingBox({
x: (screenWidth / 2) - (translate[0] / scale),
y: (screenHeight / 2) - (translate[1] / scale),
width: 1,
@ -1158,7 +1158,7 @@
nfCanvas.View.scale(newScale);
// center around the center of the screen accounting for the translation accordingly
canvasUtils.centerBoundingBox({
nfCanvasUtils.centerBoundingBox({
x: (screenWidth / 2) - (translate[0] / scale),
y: (screenHeight / 2) - (translate[1] / scale),
width: 1,
@ -1205,7 +1205,7 @@
nfCanvas.View.scale(newScale);
// center as appropriate
canvasUtils.centerBoundingBox({
nfCanvasUtils.centerBoundingBox({
x: graphLeft - (translate[0] / scale),
y: graphTop - (translate[1] / scale),
width: canvasWidth / newScale,
@ -1221,7 +1221,7 @@
var scale = nfCanvas.View.scale();
// get the first selected component
var selection = canvasUtils.getSelection();
var selection = nfCanvasUtils.getSelection();
// set the updated scale
nfCanvas.View.scale(1);
@ -1259,7 +1259,7 @@
}
// center as appropriate
canvasUtils.centerBoundingBox(box);
nfCanvasUtils.centerBoundingBox(box);
},
/**
@ -1276,11 +1276,11 @@
var refreshBirdseye = true;
// extract the options if specified
if (common.isDefinedAndNotNull(options)) {
persist = common.isDefinedAndNotNull(options.persist) ? options.persist : persist;
transition = common.isDefinedAndNotNull(options.transition) ? options.transition : transition;
refreshComponents = common.isDefinedAndNotNull(options.refreshComponents) ? options.refreshComponents : refreshComponents;
refreshBirdseye = common.isDefinedAndNotNull(options.refreshBirdseye) ? options.refreshBirdseye : refreshBirdseye;
if (nfCommon.isDefinedAndNotNull(options)) {
persist = nfCommon.isDefinedAndNotNull(options.persist) ? options.persist : persist;
transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition;
refreshComponents = nfCommon.isDefinedAndNotNull(options.refreshComponents) ? options.refreshComponents : refreshComponents;
refreshBirdseye = nfCommon.isDefinedAndNotNull(options.refreshBirdseye) ? options.refreshBirdseye : refreshBirdseye;
}
// update component visibility
@ -1290,7 +1290,7 @@
// persist if appropriate
if (persist === true) {
canvasUtils.persistUserView();
nfCanvasUtils.persistUserView();
}
// update the canvas
@ -1303,7 +1303,7 @@
.each('end', function () {
// refresh birdseye if appropriate
if (refreshBirdseye === true) {
birdseye.refresh();
nfBirdseye.refresh();
}
deferred.resolve();
@ -1315,7 +1315,7 @@
// refresh birdseye if appropriate
if (refreshBirdseye === true) {
birdseye.refresh();
nfBirdseye.refresh();
}
deferred.resolve();

View File

@ -24,8 +24,8 @@
if (typeof define === 'function' && define.amd) {
define(['jquery',
'nf.Common'],
function ($, common) {
return (nf.Clipboard = factory($, common));
function ($, nfCommon) {
return (nf.Clipboard = factory($, nfCommon));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Clipboard =
@ -35,7 +35,7 @@
nf.Clipboard = factory(root.$,
root.nf.Common);
}
}(this, function ($, common) {
}(this, function ($, nfCommon) {
'use strict';
var COPY = 'copy';
@ -60,7 +60,7 @@
* @argument {object} listener A clipboard listener
*/
removeListener: function (listener) {
if (common.isDefinedAndNotNull(listeners[listener])) {
if (nfCommon.isDefinedAndNotNull(listeners[listener])) {
delete listeners[listener];
}
},
@ -83,7 +83,7 @@
* Checks to see if any data has been copied.
*/
isCopied: function () {
return common.isDefinedAndNotNull(data);
return nfCommon.isDefinedAndNotNull(data);
},
/**
@ -93,7 +93,7 @@
paste: function () {
return $.Deferred(function (deferred) {
// ensure there was data
if (common.isDefinedAndNotNull(data)) {
if (nfCommon.isDefinedAndNotNull(data)) {
var clipboardData = data;
// resolve the deferred

View File

@ -28,8 +28,8 @@
'nf.ErrorHandler',
'nf.Dialog',
'nf.Common'],
function ($, Slick, clusterSummary, errorHandler, dialog, common) {
return (nf.ComponentState = factory($, Slick, clusterSummary, errorHandler, dialog, common));
function ($, Slick, nfClusterSummary, nfErrorHandler, nfDialog, nfCommon) {
return (nf.ComponentState = factory($, Slick, nfClusterSummary, nfErrorHandler, nfDialog, nfCommon));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ComponentState =
@ -47,7 +47,7 @@
root.nf.Dialog,
root.nf.Common);
}
}(this, function ($, Slick, clusterSummary, errorHandler, dialog, common) {
}(this, function ($, Slick, nfClusterSummary, nfErrorHandler, nfDialog, nfCommon) {
'use strict';
/**
@ -58,7 +58,7 @@
var componentStateTable = $('#component-state-table').data('gridInstance');
// ensure the grid has been initialized
if (common.isDefinedAndNotNull(componentStateTable)) {
if (nfCommon.isDefinedAndNotNull(componentStateTable)) {
var componentStateData = componentStateTable.getData();
// update the search criteria
@ -95,7 +95,7 @@
// conditionally consider the scope
var matchesScope = false;
if (common.isDefinedAndNotNull(item['scope'])) {
if (nfCommon.isDefinedAndNotNull(item['scope'])) {
matchesScope = item['scope'].search(filterExp) >= 0;
}
@ -111,8 +111,8 @@
var sort = function (sortDetails, data) {
// defines a function for sorting
var comparer = function (a, b) {
var aString = common.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = common.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
var aString = nfCommon.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = nfCommon.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
return aString === bString ? 0 : aString > bString ? 1 : -1;
};
@ -162,7 +162,7 @@
componentStateData.beginUpdate();
// local state
if (common.isDefinedAndNotNull(localState)) {
if (nfCommon.isDefinedAndNotNull(localState)) {
$.each(localState.state, function (i, stateEntry) {
componentStateData.addItem($.extend({
id: count++,
@ -171,12 +171,12 @@
});
totalEntries += localState.totalEntryCount;
if (common.isDefinedAndNotNull(localState.state) && localState.totalEntryCount !== localState.state.length) {
if (nfCommon.isDefinedAndNotNull(localState.state) && localState.totalEntryCount !== localState.state.length) {
showPartialDetails = true;
}
}
if (common.isDefinedAndNotNull(clusterState)) {
if (nfCommon.isDefinedAndNotNull(clusterState)) {
$.each(clusterState.state, function (i, stateEntry) {
componentStateData.addItem($.extend({
id: count++,
@ -185,7 +185,7 @@
});
totalEntries += clusterState.totalEntryCount;
if (common.isDefinedAndNotNull(clusterState.state) && clusterState.totalEntryCount !== clusterState.state.length) {
if (nfCommon.isDefinedAndNotNull(clusterState.state) && clusterState.totalEntryCount !== clusterState.state.length) {
showPartialDetails = true;
}
}
@ -199,7 +199,7 @@
}
// update the total number of state entries
$('#total-component-state-entries').text(common.formatInteger(totalEntries));
$('#total-component-state-entries').text(nfCommon.formatInteger(totalEntries));
};
/**
@ -281,9 +281,9 @@
// reload the table with no state
loadComponentState()
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
} else {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Component State',
dialogContent: 'This component has no state to clear.'
});
@ -310,7 +310,7 @@
];
// conditionally show the cluster node identifier
if (clusterSummary.isClustered()) {
if (nfClusterSummary.isClustered()) {
componentStateColumns.push({
id: 'scope',
field: 'scope',
@ -418,7 +418,7 @@
// reset the grid size
var componentStateGrid = componentStateTable.data('gridInstance');
componentStateGrid.resizeCanvas();
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
};
}));

View File

@ -23,8 +23,8 @@
'nf.Connection',
'nf.ConnectionConfiguration',
'nf.CanvasUtils'],
function (d3, connection, connectionConfiguration, canvasUtils) {
return (nf.Connectable = factory(d3, connection, connectionConfiguration, canvasUtils));
function (d3, nfConnection, nfConnectionConfiguration, nfCanvasUtils) {
return (nf.Connectable = factory(d3, nfConnection, nfConnectionConfiguration, nfCanvasUtils));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Connectable =
@ -38,7 +38,7 @@
root.nf.ConnectionConfiguration,
root.nf.CanvasUtils);
}
}(this, function (d3, connection, connectionConfiguration, canvasUtils) {
}(this, function (d3, nfConnection, nfConnectionConfiguration, nfCanvasUtils) {
'use strict';
var connect;
@ -78,7 +78,7 @@
d3.event.sourceEvent.stopPropagation();
// unselect the previous components
canvasUtils.getSelection().classed('selected', false);
nfCanvasUtils.getSelection().classed('selected', false);
// mark the source component has selected
var source = d3.select(this.parentNode).classed('selected', true);
@ -128,7 +128,7 @@
// component to itself. requiring the mouse to have actually moved before
// checking the eligiblity of the destination addresses the issue
return (Math.abs(origin[0] - d3.event.x) > 10 || Math.abs(origin[1] - d3.event.y) > 10) &&
canvasUtils.isValidConnectionDestination(d3.select(this));
nfCanvasUtils.isValidConnectionDestination(d3.select(this));
});
// update the drag line
@ -148,12 +148,12 @@
var x = pathDatum.x;
var y = pathDatum.y;
var componentOffset = pathDatum.sourceWidth / 2;
var xOffset = connection.config.selfLoopXOffset;
var yOffset = connection.config.selfLoopYOffset;
var xOffset = nfConnection.config.selfLoopXOffset;
var yOffset = nfConnection.config.selfLoopYOffset;
return 'M' + x + ' ' + y + 'L' + (x + componentOffset + xOffset) + ' ' + (y - yOffset) + 'L' + (x + componentOffset + xOffset) + ' ' + (y + yOffset) + 'Z';
} else {
// get the position on the destination perimeter
var end = canvasUtils.getPerimeterPoint(pathDatum, {
var end = nfCanvasUtils.getPerimeterPoint(pathDatum, {
'x': destinationData.position.x,
'y': destinationData.position.y,
'width': destinationData.dimensions.width,
@ -212,7 +212,7 @@
// create the connection
var destinationData = destination.datum();
connectionConfiguration.createConnection(connectorData.sourceId, destinationData.id);
nfConnectionConfiguration.createConnection(connectorData.sourceId, destinationData.id);
}
});
},
@ -230,7 +230,7 @@
var selection = d3.select(this);
// ensure the current component supports connection source
if (canvasUtils.isValidConnectionSource(selection)) {
if (nfCanvasUtils.isValidConnectionSource(selection)) {
// see if theres already a connector rendered
var addConnect = d3.select('text.add-connect');
if (addConnect.empty()) {

View File

@ -27,8 +27,8 @@
'nf.Client',
'nf.CanvasUtils',
'nf.Connection'],
function ($, d3, errorHandler, common, dialog, client, canvasUtils, connection) {
return (nf.ConnectionConfiguration = factory($, d3, errorHandler, common, dialog, client, canvasUtils, connection));
function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfConnection) {
return (nf.ConnectionConfiguration = factory($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfConnection));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ConnectionConfiguration =
@ -50,7 +50,7 @@
root.nf.CanvasUtils,
root.nf.Connection);
}
}(this, function ($, d3, errorHandler, common, dialog, client, canvasUtils, connection) {
}(this, function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfConnection) {
'use strict';
var nfBirdseye;
@ -80,11 +80,11 @@
*/
var initializeSourceNewConnectionDialog = function (source) {
// handle the selected source
if (canvasUtils.isProcessor(source)) {
if (nfCanvasUtils.isProcessor(source)) {
return $.Deferred(function (deferred) {
// initialize the source processor
initializeSourceProcessor(source).done(function (processor) {
if (!common.isEmpty(processor.relationships)) {
if (!nfCommon.isEmpty(processor.relationships)) {
// populate the available connections
$.each(processor.relationships, function (i, relationship) {
createRelationshipOption(relationship.name);
@ -114,7 +114,7 @@
addConnection(selectedRelationships);
} else {
// inform users that no relationships were selected
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Connection Configuration',
dialogContent: 'The connection must have at least one relationship selected.'
});
@ -143,9 +143,9 @@
deferred.resolve();
} else {
// there are no relationships for this processor
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Connection Configuration',
dialogContent: '\'' + common.escapeHtml(processor.name) + '\' does not support any relationships.'
dialogContent: '\'' + nfCommon.escapeHtml(processor.name) + '\' does not support any relationships.'
});
// reset the dialog
@ -161,11 +161,11 @@
return $.Deferred(function (deferred) {
// determine how to initialize the source
var connectionSourceDeferred;
if (canvasUtils.isInputPort(source)) {
if (nfCanvasUtils.isInputPort(source)) {
connectionSourceDeferred = initializeSourceInputPort(source);
} else if (canvasUtils.isRemoteProcessGroup(source)) {
} else if (nfCanvasUtils.isRemoteProcessGroup(source)) {
connectionSourceDeferred = initializeSourceRemoteProcessGroup(source);
} else if (canvasUtils.isProcessGroup(source)) {
} else if (nfCanvasUtils.isProcessGroup(source)) {
connectionSourceDeferred = initializeSourceProcessGroup(source);
} else {
connectionSourceDeferred = initializeSourceFunnel(source);
@ -233,8 +233,8 @@
$('#connection-source-component-id').val(inputPortData.id);
// populate the group details
$('#connection-source-group-id').val(canvasUtils.getGroupId());
$('#connection-source-group-name').text(canvasUtils.getGroupName());
$('#connection-source-group-id').val(nfCanvasUtils.getGroupId());
$('#connection-source-group-name').text(nfCanvasUtils.getGroupName());
// resolve the deferred
deferred.resolve();
@ -259,8 +259,8 @@
$('#connection-source-component-id').val(funnelData.id);
// populate the group details
$('#connection-source-group-id').val(canvasUtils.getGroupId());
$('#connection-source-group-name').text(canvasUtils.getGroupName());
$('#connection-source-group-id').val(nfCanvasUtils.getGroupId());
$('#connection-source-group-name').text(nfCanvasUtils.getGroupName());
// resolve the deferred
deferred.resolve();
@ -277,7 +277,7 @@
// get the processor data
var processorData = source.datum();
var processorName = processorData.permissions.canRead ? processorData.component.name : processorData.id;
var processorType = processorData.permissions.canRead ? common.substringAfterLast(processorData.component.type, '.') : 'Processor';
var processorType = processorData.permissions.canRead ? nfCommon.substringAfterLast(processorData.component.type, '.') : 'Processor';
// populate the source processor information
$('#processor-source').show();
@ -289,8 +289,8 @@
$('#connection-source-component-id').val(processorData.id);
// populate the group details
$('#connection-source-group-id').val(canvasUtils.getGroupId());
$('#connection-source-group-name').text(canvasUtils.getGroupName());
$('#connection-source-group-id').val(nfCanvasUtils.getGroupId());
$('#connection-source-group-name').text(nfCanvasUtils.getGroupName());
// show the available relationships
$('#relationship-names-container').show();
@ -327,13 +327,13 @@
options.push({
text: component.name,
value: component.id,
description: common.escapeHtml(component.comments)
description: nfCommon.escapeHtml(component.comments)
});
}
});
// only proceed if there are output ports
if (!common.isEmpty(options)) {
if (!nfCommon.isEmpty(options)) {
$('#output-port-source').show();
// sort the options
@ -359,13 +359,13 @@
deferred.resolve();
} else {
var message = '\'' + common.escapeHtml(processGroupName) + '\' does not have any output ports.';
if (common.isEmpty(processGroupContents.outputPorts) === false) {
message = 'Not authorized for any output ports in \'' + common.escapeHtml(processGroupName) + '\'.';
var message = '\'' + nfCommon.escapeHtml(processGroupName) + '\' does not have any output ports.';
if (nfCommon.isEmpty(processGroupContents.outputPorts) === false) {
message = 'Not authorized for any output ports in \'' + nfCommon.escapeHtml(processGroupName) + '\'.';
}
// there are no output ports for this process group
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Connection Configuration',
dialogContent: message
});
@ -377,7 +377,7 @@
}
}).fail(function (xhr, status, error) {
// handle the error
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
deferred.reject();
});
@ -403,7 +403,7 @@
var remoteProcessGroupContents = remoteProcessGroup.contents;
// only proceed if there are output ports
if (!common.isEmpty(remoteProcessGroupContents.outputPorts)) {
if (!nfCommon.isEmpty(remoteProcessGroupContents.outputPorts)) {
$('#output-port-source').show();
// show the output port options
@ -413,7 +413,7 @@
text: outputPort.name,
value: outputPort.id,
disabled: outputPort.exists === false,
description: common.escapeHtml(outputPort.comments)
description: nfCommon.escapeHtml(outputPort.comments)
});
});
@ -441,9 +441,9 @@
deferred.resolve();
} else {
// there are no relationships for this processor
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Connection Configuration',
dialogContent: '\'' + common.escapeHtml(remoteProcessGroup.name) + '\' does not have any output ports.'
dialogContent: '\'' + nfCommon.escapeHtml(remoteProcessGroup.name) + '\' does not have any output ports.'
});
// reset the dialog
@ -453,7 +453,7 @@
}
}).fail(function (xhr, status, error) {
// handle the error
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
deferred.reject();
});
@ -461,13 +461,13 @@
};
var initializeDestinationNewConnectionDialog = function (destination) {
if (canvasUtils.isOutputPort(destination)) {
if (nfCanvasUtils.isOutputPort(destination)) {
return initializeDestinationOutputPort(destination);
} else if (canvasUtils.isProcessor(destination)) {
} else if (nfCanvasUtils.isProcessor(destination)) {
return initializeDestinationProcessor(destination);
} else if (canvasUtils.isRemoteProcessGroup(destination)) {
} else if (nfCanvasUtils.isRemoteProcessGroup(destination)) {
return initializeDestinationRemoteProcessGroup(destination);
} else if (canvasUtils.isFunnel(destination)) {
} else if (nfCanvasUtils.isFunnel(destination)) {
return initializeDestinationFunnel(destination);
} else {
return initializeDestinationProcessGroup(destination);
@ -487,8 +487,8 @@
$('#connection-destination-component-id').val(outputPortData.id);
// populate the group details
$('#connection-destination-group-id').val(canvasUtils.getGroupId());
$('#connection-destination-group-name').text(canvasUtils.getGroupName());
$('#connection-destination-group-id').val(nfCanvasUtils.getGroupId());
$('#connection-destination-group-name').text(nfCanvasUtils.getGroupName());
deferred.resolve();
}).promise();
@ -505,8 +505,8 @@
$('#connection-destination-component-id').val(funnelData.id);
// populate the group details
$('#connection-destination-group-id').val(canvasUtils.getGroupId());
$('#connection-destination-group-name').text(canvasUtils.getGroupName());
$('#connection-destination-group-id').val(nfCanvasUtils.getGroupId());
$('#connection-destination-group-name').text(nfCanvasUtils.getGroupName());
deferred.resolve();
}).promise();
@ -516,7 +516,7 @@
return $.Deferred(function (deferred) {
var processorData = destination.datum();
var processorName = processorData.permissions.canRead ? processorData.component.name : processorData.id;
var processorType = processorData.permissions.canRead ? common.substringAfterLast(processorData.component.type, '.') : 'Processor';
var processorType = processorData.permissions.canRead ? nfCommon.substringAfterLast(processorData.component.type, '.') : 'Processor';
$('#processor-destination').show();
$('#processor-destination-name').text(processorName).attr('title', processorName);
@ -527,8 +527,8 @@
$('#connection-destination-component-id').val(processorData.id);
// populate the group details
$('#connection-destination-group-id').val(canvasUtils.getGroupId());
$('#connection-destination-group-name').text(canvasUtils.getGroupName());
$('#connection-destination-group-id').val(nfCanvasUtils.getGroupId());
$('#connection-destination-group-name').text(nfCanvasUtils.getGroupName());
deferred.resolve();
}).promise();
@ -558,12 +558,12 @@
options.push({
text: inputPort.permissions.canRead ? inputPort.component.name : inputPort.id,
value: inputPort.id,
description: inputPort.permissions.canRead ? common.escapeHtml(inputPort.component.comments) : null
description: inputPort.permissions.canRead ? nfCommon.escapeHtml(inputPort.component.comments) : null
});
});
// only proceed if there are output ports
if (!common.isEmpty(options)) {
if (!nfCommon.isEmpty(options)) {
$('#input-port-destination').show();
// sort the options
@ -590,9 +590,9 @@
deferred.resolve();
} else {
// there are no relationships for this processor
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Connection Configuration',
dialogContent: '\'' + common.escapeHtml(processGroupName) + '\' does not have any input ports.'
dialogContent: '\'' + nfCommon.escapeHtml(processGroupName) + '\' does not have any input ports.'
});
// reset the dialog
@ -602,7 +602,7 @@
}
}).fail(function (xhr, status, error) {
// handle the error
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
deferred.reject();
});
@ -628,7 +628,7 @@
var remoteProcessGroupContents = remoteProcessGroup.contents;
// only proceed if there are output ports
if (!common.isEmpty(remoteProcessGroupContents.inputPorts)) {
if (!nfCommon.isEmpty(remoteProcessGroupContents.inputPorts)) {
$('#input-port-destination').show();
// show the input port options
@ -638,7 +638,7 @@
text: inputPort.name,
value: inputPort.id,
disabled: inputPort.exists === false,
description: common.escapeHtml(inputPort.comments)
description: nfCommon.escapeHtml(inputPort.comments)
});
});
@ -666,9 +666,9 @@
deferred.resolve();
} else {
// there are no relationships for this processor
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Connection Configuration',
dialogContent: '\'' + common.escapeHtml(remoteProcessGroup.name) + '\' does not have any input ports.'
dialogContent: '\'' + nfCommon.escapeHtml(remoteProcessGroup.name) + '\' does not have any input ports.'
});
// reset the dialog
@ -678,7 +678,7 @@
}
}).fail(function (xhr, status, error) {
// handle the error
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
deferred.reject();
});
@ -716,11 +716,11 @@
* @argument {selection} source The source
*/
var initializeSourceEditConnectionDialog = function (source) {
if (canvasUtils.isProcessor(source)) {
if (nfCanvasUtils.isProcessor(source)) {
return initializeSourceProcessor(source);
} else if (canvasUtils.isInputPort(source)) {
} else if (nfCanvasUtils.isInputPort(source)) {
return initializeSourceInputPort(source);
} else if (canvasUtils.isFunnel(source)) {
} else if (nfCanvasUtils.isFunnel(source)) {
return initializeSourceFunnel(source);
} else {
return initializeSourceReadOnlyGroup(source);
@ -734,13 +734,13 @@
* @argument {object} connectionDestination The connection destination object
*/
var initializeDestinationEditConnectionDialog = function (destination, connectionDestination) {
if (canvasUtils.isProcessor(destination)) {
if (nfCanvasUtils.isProcessor(destination)) {
return initializeDestinationProcessor(destination);
} else if (canvasUtils.isOutputPort(destination)) {
} else if (nfCanvasUtils.isOutputPort(destination)) {
return initializeDestinationOutputPort(destination);
} else if (canvasUtils.isRemoteProcessGroup(destination)) {
} else if (nfCanvasUtils.isRemoteProcessGroup(destination)) {
return initializeDestinationRemoteProcessGroup(destination, connectionDestination);
} else if (canvasUtils.isFunnel(destination)) {
} else if (nfCanvasUtils.isFunnel(destination)) {
return initializeDestinationFunnel(destination);
} else {
return initializeDestinationProcessGroup(destination);
@ -787,8 +787,8 @@
y: sourceData.position.y + (sourceData.dimensions.height / 2)
};
var xOffset = connection.config.selfLoopXOffset;
var yOffset = connection.config.selfLoopYOffset;
var xOffset = nfConnection.config.selfLoopXOffset;
var yOffset = nfConnection.config.selfLoopYOffset;
bends.push({
'x': (rightCenter.x + xOffset),
'y': (rightCenter.y - yOffset)
@ -801,11 +801,11 @@
var existingConnections = [];
// get all connections for the source component
var connectionsForSourceComponent = connection.getComponentConnections(sourceComponentId);
var connectionsForSourceComponent = nfConnection.getComponentConnections(sourceComponentId);
$.each(connectionsForSourceComponent, function (_, connectionForSourceComponent) {
// get the id for the source/destination component
var connectionSourceComponentId = canvasUtils.getConnectionSourceComponentId(connectionForSourceComponent);
var connectionDestinationComponentId = canvasUtils.getConnectionDestinationComponentId(connectionForSourceComponent);
var connectionSourceComponentId = nfCanvasUtils.getConnectionSourceComponentId(connectionForSourceComponent);
var connectionDestinationComponentId = nfCanvasUtils.getConnectionDestinationComponentId(connectionForSourceComponent);
// if the connection is between these same components, consider it for collisions
if ((connectionSourceComponentId === sourceComponentId && connectionDestinationComponentId === destinationComponentId) ||
@ -822,7 +822,7 @@
$.each(existingConnections, function (_, existingConnection) {
// only consider multiple connections with no bend points a collision, the existance of
// bend points suggests that the user has placed the connection into a desired location
if (common.isEmpty(existingConnection.bends)) {
if (nfCommon.isEmpty(existingConnection.bends)) {
avoidCollision = true;
return false;
}
@ -842,7 +842,7 @@
var collides = function (x, y) {
var collides = false;
$.each(existingConnections, function (_, existingConnection) {
if (!common.isEmpty(existingConnection.bends)) {
if (!nfCommon.isEmpty(existingConnection.bends)) {
if (isMoreHorizontal) {
// horizontal lines are adjusted in the y space
if (existingConnection.bends[0].y === y) {
@ -900,8 +900,8 @@
var destinationGroupId = $('#connection-destination-group-id').val();
// determine the source and destination types
var sourceType = canvasUtils.getConnectableTypeForSource(source);
var destinationType = canvasUtils.getConnectableTypeForDestination(destination);
var sourceType = nfCanvasUtils.getConnectableTypeForSource(source);
var destinationType = nfCanvasUtils.getConnectableTypeForDestination(destination);
// get the settings
var connectionName = $('#connection-name').val();
@ -912,7 +912,7 @@
if (validateSettings()) {
var connectionEntity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': 0
}
@ -941,7 +941,7 @@
// create the new connection
$.ajax({
type: 'POST',
url: config.urls.api + '/process-groups/' + encodeURIComponent(canvasUtils.getGroupId()) + '/connections',
url: config.urls.api + '/process-groups/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/connections',
data: JSON.stringify(connectionEntity),
dataType: 'json',
contentType: 'application/json'
@ -954,7 +954,7 @@
});
// reload the connections source/destination components
canvasUtils.reloadConnectionSourceAndDestination(sourceComponentId, destinationComponentId);
nfCanvasUtils.reloadConnectionSourceAndDestination(sourceComponentId, destinationComponentId);
// update component visibility
nfGraph.updateVisibility();
@ -963,7 +963,7 @@
nfBirdseye.refresh();
}).fail(function (xhr, status, error) {
// handle the error
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
});
}
};
@ -984,7 +984,7 @@
// get the destination details
var destinationComponentId = $('#connection-destination-component-id').val();
var destination = d3.select('#id-' + destinationComponentId);
var destinationType = canvasUtils.getConnectableTypeForDestination(destination);
var destinationType = nfCanvasUtils.getConnectableTypeForDestination(destination);
// get the destination details
var destinationId = $('#connection-destination-id').val();
@ -998,9 +998,9 @@
var prioritizers = $('#prioritizer-selected').sortable('toArray');
if (validateSettings()) {
var d = connection.get(connectionId);
var d = nfConnection.get(connectionId);
var connectionEntity = {
'revision': client.getRevision(d),
'revision': nfClient.getRevision(d),
'component': {
'id': connectionId,
'name': connectionName,
@ -1026,18 +1026,18 @@
contentType: 'application/json'
}).done(function (response) {
// update this connection
connection.set(response);
nfConnection.set(response);
// reload the connections source/destination components
canvasUtils.reloadConnectionSourceAndDestination(sourceComponentId, destinationComponentId);
nfCanvasUtils.reloadConnectionSourceAndDestination(sourceComponentId, destinationComponentId);
}).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Connection Configuration',
dialogContent: common.escapeHtml(xhr.responseText),
dialogContent: nfCommon.escapeHtml(xhr.responseText),
});
} else {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
});
} else {
@ -1078,20 +1078,20 @@
var errors = [];
// validate the settings
if (common.isBlank($('#flow-file-expiration').val())) {
if (nfCommon.isBlank($('#flow-file-expiration').val())) {
errors.push('File expiration must be specified');
}
if (!$.isNumeric($('#back-pressure-object-threshold').val())) {
errors.push('Back pressure object threshold must be an integer value');
}
if (common.isBlank($('#back-pressure-data-size-threshold').val())) {
if (nfCommon.isBlank($('#back-pressure-data-size-threshold').val())) {
errors.push('Back pressure data size threshold must be specified');
}
if (errors.length > 0) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Connection Configuration',
dialogContent: common.formatUnorderedList(errors)
dialogContent: nfCommon.formatUnorderedList(errors)
});
return false;
} else {
@ -1130,7 +1130,7 @@
$('#relationship-names-container').hide();
// clear the id field
common.clearField('connection-id');
nfCommon.clearField('connection-id');
// hide all the connection source panels
$('#processor-source').hide();
@ -1168,12 +1168,12 @@
/**
* Initialize the connection configuration.
*
* @param birdseye The reference to the birdseye controller.
* @param graph The reference to the graph controller.
* @param nfBirdseyeRef The nfBirdseye module.
* @param nfGraphRef The nfGraph module.
*/
init: function (birdseye, graph) {
nfBirdseye = birdseye;
nfGraph = graph;
init: function (nfBirdseyeRef, nfGraphRef) {
nfBirdseye = nfBirdseyeRef;
nfGraph = nfGraphRef;
// initially hide the relationship names container
$('#relationship-names-container').hide();
@ -1188,7 +1188,7 @@
resetDialog();
},
open: function () {
common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
}
}
});
@ -1226,7 +1226,7 @@
opacity: 0.6
});
$('#prioritizer-available, #prioritizer-selected').disableSelection();
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
},
/**
@ -1237,17 +1237,17 @@
*/
addAvailablePrioritizer: function (prioritizerContainer, prioritizerType) {
var type = prioritizerType.type;
var name = common.substringAfterLast(type, '.');
var name = nfCommon.substringAfterLast(type, '.');
// add the prioritizers to the available list
var prioritizerList = $(prioritizerContainer);
var prioritizer = $('<li></li>').append($('<span style="float: left;"></span>').text(name)).attr('id', type).addClass('ui-state-default').appendTo(prioritizerList);
// add the description if applicable
if (common.isDefinedAndNotNull(prioritizerType.description)) {
if (nfCommon.isDefinedAndNotNull(prioritizerType.description)) {
$('<div class="fa fa-question-circle" style="float: right; margin-right: 5px;""></div>').appendTo(prioritizer).qtip($.extend({
content: common.escapeHtml(prioritizerType.description)
}, common.config.tooltipConfig));
content: nfCommon.escapeHtml(prioritizerType.description)
}, nfCommon.config.tooltipConfig));
}
},
@ -1283,7 +1283,7 @@
$('#connection-configuration div.relationship-name').ellipsis();
// fill in the connection id
common.populateField('connection-id', null);
nfCommon.populateField('connection-id', null);
// show the border if necessary
var relationshipNames = $('#relationship-names');
@ -1309,12 +1309,12 @@
var connection = connectionEntry.component;
// identify the source component
var sourceComponentId = canvasUtils.getConnectionSourceComponentId(connectionEntry);
var sourceComponentId = nfCanvasUtils.getConnectionSourceComponentId(connectionEntry);
var source = d3.select('#id-' + sourceComponentId);
// identify the destination component
if (common.isUndefinedOrNull(destination)) {
var destinationComponentId = canvasUtils.getConnectionDestinationComponentId(connectionEntry);
if (nfCommon.isUndefinedOrNull(destination)) {
var destinationComponentId = nfCanvasUtils.getConnectionDestinationComponentId(connectionEntry);
destination = d3.select('#id-' + destinationComponentId);
}
@ -1324,7 +1324,7 @@
var selectedRelationships = connection.selectedRelationships;
// show the available relationship if applicable
if (common.isDefinedAndNotNull(availableRelationships) || common.isDefinedAndNotNull(selectedRelationships)) {
if (nfCommon.isDefinedAndNotNull(availableRelationships) || nfCommon.isDefinedAndNotNull(selectedRelationships)) {
// populate the available connections
$.each(availableRelationships, function (i, name) {
createRelationshipOption(name);
@ -1351,14 +1351,14 @@
}
// if the source is a process group or remote process group, select the appropriate port if applicable
if (canvasUtils.isProcessGroup(source) || canvasUtils.isRemoteProcessGroup(source)) {
if (nfCanvasUtils.isProcessGroup(source) || nfCanvasUtils.isRemoteProcessGroup(source)) {
// populate the connection source details
$('#connection-source-id').val(connection.source.id);
$('#read-only-output-port-name').text(connection.source.name).attr('title', connection.source.name);
}
// if the destination is a process gorup or remote process group, select the appropriate port if applicable
if (canvasUtils.isProcessGroup(destination) || canvasUtils.isRemoteProcessGroup(destination)) {
if (nfCanvasUtils.isProcessGroup(destination) || nfCanvasUtils.isRemoteProcessGroup(destination)) {
var destinationData = destination.datum();
// when the group ids differ, its a new destination component so we don't want to preselect any port
@ -1376,7 +1376,7 @@
$('#back-pressure-data-size-threshold').val(connection.backPressureDataSizeThreshold);
// format the connection id
common.populateField('connection-id', connection.id);
nfCommon.populateField('connection-id', connection.id);
// handle each prioritizer
$.each(connection.prioritizers, function (i, type) {
@ -1400,7 +1400,7 @@
var selectedRelationships = getSelectedRelationships();
// see if we're working with a processor as the source
if (canvasUtils.isProcessor(source)) {
if (nfCanvasUtils.isProcessor(source)) {
if (selectedRelationships.length > 0) {
// if there are relationships selected update
updateConnection(selectedRelationships).done(function () {
@ -1410,7 +1410,7 @@
});
} else {
// inform users that no relationships were selected and the source is a processor
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Connection Configuration',
dialogContent: 'The connection must have at least one relationship selected.'
});

View File

@ -26,8 +26,8 @@
'nf.ErrorHandler',
'nf.Client',
'nf.CanvasUtils'],
function ($, d3, common, dialog, errorHandler, client, canvasUtils) {
return (nf.Connection = factory($, d3, common, dialog, errorHandler, client, canvasUtils));
function ($, d3, nfCommon, nfDialog, nfErrorHandler, nfClient, nfCanvasUtils) {
return (nf.Connection = factory($, d3, nfCommon, nfDialog, nfErrorHandler, nfClient, nfCanvasUtils));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Connection =
@ -47,7 +47,7 @@
root.nf.Client,
root.nf.CanvasUtils);
}
}(this, function ($, d3, common, dialog, errorHandler, client, canvasUtils) {
}(this, function ($, d3, nfCommon, nfDialog, nfErrorHandler, nfClient, nfCanvasUtils) {
'use strict';
var nfCanvas;
@ -197,7 +197,7 @@
for (var i = 0; i < line.length; i++) {
if (i + 1 < line.length) {
var distance = distanceToSegment(p, line[i], line[i + 1]);
if (common.isUndefined(minimumDistance) || distance < minimumDistance) {
if (nfCommon.isUndefined(minimumDistance) || distance < minimumDistance) {
minimumDistance = distance;
index = i;
}
@ -232,7 +232,7 @@
* @param {object} terminal
*/
var isGroup = function (terminal) {
return terminal.groupId !== canvasUtils.getGroupId() && (isInputPortType(terminal.type) || isOutputPortType(terminal.type));
return terminal.groupId !== nfCanvasUtils.getGroupId() && (isInputPortType(terminal.type) || isOutputPortType(terminal.type));
};
/**
@ -242,7 +242,7 @@
* @return {boolean} Whether expiration is configured
*/
var isExpirationConfigured = function (connection) {
if (common.isDefinedAndNotNull(connection.flowFileExpiration)) {
if (nfCommon.isDefinedAndNotNull(connection.flowFileExpiration)) {
var match = connection.flowFileExpiration.match(/^(\d+).*/);
if (match !== null && match.length > 0) {
if (parseInt(match[0], 10) > 0) {
@ -319,7 +319,7 @@
var unavailable = false;
// verify each selected relationship is still available
if (common.isDefinedAndNotNull(d.component.selectedRelationships) && common.isDefinedAndNotNull(d.component.availableRelationships)) {
if (nfCommon.isDefinedAndNotNull(d.component.selectedRelationships) && nfCommon.isDefinedAndNotNull(d.component.availableRelationships)) {
$.each(d.component.selectedRelationships, function (_, selectedRelationship) {
if ($.inArray(selectedRelationship, d.component.availableRelationships) === -1) {
unavailable = true;
@ -366,7 +366,7 @@
// determines whether the connection is in warning based on the object count threshold
var isWarningCount = function (d) {
var percentUseCount = d.status.aggregateSnapshot.percentUseCount;
if (common.isDefinedAndNotNull(percentUseCount)) {
if (nfCommon.isDefinedAndNotNull(percentUseCount)) {
return percentUseCount >= 61 && percentUseCount <= 85;
}
@ -376,7 +376,7 @@
// determines whether the connection is in error based on the object count threshold
var isErrorCount = function (d) {
var percentUseCount = d.status.aggregateSnapshot.percentUseCount;
if (common.isDefinedAndNotNull(percentUseCount)) {
if (nfCommon.isDefinedAndNotNull(percentUseCount)) {
return percentUseCount > 85;
}
@ -391,7 +391,7 @@
// determines whether the connection is in warning based on the data size threshold
var isWarningBytes = function (d) {
var percentUseBytes = d.status.aggregateSnapshot.percentUseBytes;
if (common.isDefinedAndNotNull(percentUseBytes)) {
if (nfCommon.isDefinedAndNotNull(percentUseBytes)) {
return percentUseBytes >= 61 && percentUseBytes <= 85;
}
@ -401,7 +401,7 @@
// determines whether the connection is in error based on the data size threshold
var isErrorBytes = function (d) {
var percentUseBytes = d.status.aggregateSnapshot.percentUseBytes;
if (common.isDefinedAndNotNull(percentUseBytes)) {
if (nfCommon.isDefinedAndNotNull(percentUseBytes)) {
return percentUseBytes > 85;
}
@ -419,10 +419,10 @@
var transition = false;
// extract the options if specified
if (common.isDefinedAndNotNull(options)) {
updatePath = common.isDefinedAndNotNull(options.updatePath) ? options.updatePath : updatePath;
updateLabel = common.isDefinedAndNotNull(options.updateLabel) ? options.updateLabel : updateLabel;
transition = common.isDefinedAndNotNull(options.transition) ? options.transition : transition;
if (nfCommon.isDefinedAndNotNull(options)) {
updatePath = nfCommon.isDefinedAndNotNull(options.updatePath) ? options.updatePath : updatePath;
updateLabel = nfCommon.isDefinedAndNotNull(options.updateLabel) ? options.updateLabel : updateLabel;
transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition;
}
if (updatePath === true) {
@ -432,7 +432,7 @@
if (d.permissions.canRead) {
// if there are more than one selected relationship, mark this as grouped
if (common.isDefinedAndNotNull(d.component.selectedRelationships) && d.component.selectedRelationships.length > 1) {
if (nfCommon.isDefinedAndNotNull(d.component.selectedRelationships) && d.component.selectedRelationships.length > 1) {
grouped = true;
}
}
@ -507,7 +507,7 @@
if (updatePath === true) {
// calculate the start and end points
var sourceComponentId = canvasUtils.getConnectionSourceComponentId(d);
var sourceComponentId = nfCanvasUtils.getConnectionSourceComponentId(d);
var sourceData = d3.select('#id-' + sourceComponentId).datum();
var end;
@ -524,7 +524,7 @@
// if we are currently dragging the endpoint to a new target, use that
// position, otherwise we need to calculate it for the current target
if (common.isDefinedAndNotNull(d.end) && d.end.dragging === true) {
if (nfCommon.isDefinedAndNotNull(d.end) && d.end.dragging === true) {
// since we're dragging, use the same object thats bound to the endpoint drag event
end = d.end;
@ -534,7 +534,7 @@
var newDestinationData = newDestination.datum();
// get the position on the new destination perimeter
var newEnd = canvasUtils.getPerimeterPoint(endAnchor, {
var newEnd = nfCanvasUtils.getPerimeterPoint(endAnchor, {
'x': newDestinationData.position.x,
'y': newDestinationData.position.y,
'width': newDestinationData.dimensions.width,
@ -546,11 +546,11 @@
end.y = newEnd.y;
}
} else {
var destinationComponentId = canvasUtils.getConnectionDestinationComponentId(d);
var destinationComponentId = nfCanvasUtils.getConnectionDestinationComponentId(d);
var destinationData = d3.select('#id-' + destinationComponentId).datum();
// get the position on the destination perimeter
end = canvasUtils.getPerimeterPoint(endAnchor, {
end = nfCanvasUtils.getPerimeterPoint(endAnchor, {
'x': destinationData.position.x,
'y': destinationData.position.y,
'width': destinationData.dimensions.width,
@ -567,7 +567,7 @@
}
// get the position on the source perimeter
var start = canvasUtils.getPerimeterPoint(startAnchor, {
var start = nfCanvasUtils.getPerimeterPoint(startAnchor, {
'x': sourceData.position.x,
'y': sourceData.position.y,
'width': sourceData.dimensions.width,
@ -579,21 +579,21 @@
d.end = end;
// update the connection paths
canvasUtils.transition(connection.select('path.connection-path'), transition)
nfCanvasUtils.transition(connection.select('path.connection-path'), transition)
.attr({
'd': function () {
var datum = [d.start].concat(d.bends, [d.end]);
return lineGenerator(datum);
}
});
canvasUtils.transition(connection.select('path.connection-selection-path'), transition)
nfCanvasUtils.transition(connection.select('path.connection-selection-path'), transition)
.attr({
'd': function () {
var datum = [d.start].concat(d.bends, [d.end]);
return lineGenerator(datum);
}
});
canvasUtils.transition(connection.select('path.connection-path-selectable'), transition)
nfCanvasUtils.transition(connection.select('path.connection-path-selectable'), transition)
.attr({
'd': function () {
var datum = [d.start].concat(d.bends, [d.end]);
@ -634,7 +634,7 @@
.call(nfContextMenu.activate);
// update the start point
canvasUtils.transition(startpoints, transition)
nfCanvasUtils.transition(startpoints, transition)
.attr('transform', function (p) {
return 'translate(' + (p.x - 4) + ', ' + (p.y - 4) + ')';
});
@ -664,7 +664,7 @@
.call(nfContextMenu.activate);
// update the end point
canvasUtils.transition(endpoints, transition)
nfCanvasUtils.transition(endpoints, transition)
.attr('transform', function (p) {
return 'translate(' + (p.x - 4) + ', ' + (p.y - 4) + ')';
});
@ -695,10 +695,10 @@
var connectionData = connection.datum();
// if this is a self loop prevent removing the last two bends
var sourceComponentId = canvasUtils.getConnectionSourceComponentId(connectionData);
var destinationComponentId = canvasUtils.getConnectionDestinationComponentId(connectionData);
var sourceComponentId = nfCanvasUtils.getConnectionSourceComponentId(connectionData);
var destinationComponentId = nfCanvasUtils.getConnectionDestinationComponentId(connectionData);
if (sourceComponentId === destinationComponentId && d.component.bends.length <= 2) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Connection',
dialogContent: 'Looping connections must have at least two bend points.'
});
@ -744,7 +744,7 @@
.call(nfContextMenu.activate);
// update the midpoints
canvasUtils.transition(midpoints, transition)
nfCanvasUtils.transition(midpoints, transition)
.attr('transform', function (p) {
return 'translate(' + (p.x - 4) + ', ' + (p.y - 4) + ')';
});
@ -881,7 +881,7 @@
connectionFromLabel.text(null).selectAll('title').remove();
// apply ellipsis to the label as necessary
canvasUtils.ellipsis(connectionFromLabel, d.component.source.name);
nfCanvasUtils.ellipsis(connectionFromLabel, d.component.source.name);
}).append('title').text(function () {
return d.component.source.name;
});
@ -990,7 +990,7 @@
connectionToLabel.text(null).selectAll('title').remove();
// apply ellipsis to the label as necessary
canvasUtils.ellipsis(connectionToLabel, d.component.destination.name);
nfCanvasUtils.ellipsis(connectionToLabel, d.component.destination.name);
}).append('title').text(function (d) {
return d.component.destination.name;
});
@ -1033,10 +1033,10 @@
// -----------------------
// get the connection name
var connectionNameValue = canvasUtils.formatConnectionName(d.component);
var connectionNameValue = nfCanvasUtils.formatConnectionName(d.component);
// is there a name to render
if (!common.isBlank(connectionNameValue)) {
if (!nfCommon.isBlank(connectionNameValue)) {
// see if the connection name label is already rendered
if (connectionName.empty()) {
connectionName = connectionLabelContainer.append('g')
@ -1095,7 +1095,7 @@
connectionToLabel.text(null).selectAll('title').remove();
// apply ellipsis to the label as necessary
canvasUtils.ellipsis(connectionToLabel, connectionNameValue);
nfCanvasUtils.ellipsis(connectionToLabel, connectionNameValue);
}).append('title').text(function () {
return connectionNameValue;
});
@ -1333,21 +1333,21 @@
// update backpressure object fill
connectionLabelContainer.select('rect.backpressure-object')
.classed('not-configured', function () {
return common.isUndefinedOrNull(d.status.aggregateSnapshot.percentUseCount);
return nfCommon.isUndefinedOrNull(d.status.aggregateSnapshot.percentUseCount);
});
connectionLabelContainer.selectAll('rect.backpressure-tick.object')
.classed('not-configured', function () {
return common.isUndefinedOrNull(d.status.aggregateSnapshot.percentUseCount);
return nfCommon.isUndefinedOrNull(d.status.aggregateSnapshot.percentUseCount);
});
// update backpressure data size fill
connectionLabelContainer.select('rect.backpressure-data-size')
.classed('not-configured', function () {
return common.isUndefinedOrNull(d.status.aggregateSnapshot.percentUseBytes);
return nfCommon.isUndefinedOrNull(d.status.aggregateSnapshot.percentUseBytes);
});
connectionLabelContainer.selectAll('rect.backpressure-tick.data-size')
.classed('not-configured', function () {
return common.isUndefinedOrNull(d.status.aggregateSnapshot.percentUseBytes);
return nfCommon.isUndefinedOrNull(d.status.aggregateSnapshot.percentUseBytes);
});
if (d.permissions.canWrite) {
@ -1365,7 +1365,7 @@
}
// update the position of the label if possible
canvasUtils.transition(connection.select('g.connection-label-container'), transition)
nfCanvasUtils.transition(connection.select('g.connection-label-container'), transition)
.attr('transform', function () {
var label = d3.select(this).select('rect.body');
var position = getLabelPosition(label);
@ -1389,7 +1389,7 @@
// queued count value
updated.select('text.queued tspan.count')
.text(function (d) {
return common.substringBeforeFirst(d.status.aggregateSnapshot.queued, ' ');
return nfCommon.substringBeforeFirst(d.status.aggregateSnapshot.queued, ' ');
});
var backpressurePercentDataSize = updated.select('rect.backpressure-percent.data-size');
@ -1397,7 +1397,7 @@
.duration(400)
.attr({
'width': function (d) {
if (common.isDefinedAndNotNull(d.status.aggregateSnapshot.percentUseBytes)) {
if (nfCommon.isDefinedAndNotNull(d.status.aggregateSnapshot.percentUseBytes)) {
return (backpressureBarWidth * d.status.aggregateSnapshot.percentUseBytes) / 100;
} else {
return 0;
@ -1416,7 +1416,7 @@
});
updated.select('rect.backpressure-data-size').select('title').text(function (d) {
if (common.isDefinedAndNotNull(d.status.aggregateSnapshot.percentUseBytes)) {
if (nfCommon.isDefinedAndNotNull(d.status.aggregateSnapshot.percentUseBytes)) {
return 'Queue is ' + d.status.aggregateSnapshot.percentUseBytes + '% full based on Back Pressure Data Size Threshold';
} else {
return 'Back Pressure Data Size Threshold is not configured';
@ -1429,7 +1429,7 @@
// queued size value
updated.select('text.queued tspan.size')
.text(function (d) {
return ' ' + common.substringAfterFirst(d.status.aggregateSnapshot.queued, ' ');
return ' ' + nfCommon.substringAfterFirst(d.status.aggregateSnapshot.queued, ' ');
});
var backpressurePercentObject = updated.select('rect.backpressure-percent.object');
@ -1437,7 +1437,7 @@
.duration(400)
.attr({
'width': function (d) {
if (common.isDefinedAndNotNull(d.status.aggregateSnapshot.percentUseCount)) {
if (nfCommon.isDefinedAndNotNull(d.status.aggregateSnapshot.percentUseCount)) {
return (backpressureBarWidth * d.status.aggregateSnapshot.percentUseCount) / 100;
} else {
return 0;
@ -1456,7 +1456,7 @@
});
updated.select('rect.backpressure-object').select('title').text(function (d) {
if (common.isDefinedAndNotNull(d.status.aggregateSnapshot.percentUseCount)) {
if (nfCommon.isDefinedAndNotNull(d.status.aggregateSnapshot.percentUseCount)) {
return 'Queue is ' + d.status.aggregateSnapshot.percentUseCount + '% full based on Back Pressure Object Threshold';
} else {
return 'Back Pressure Object Threshold is not configured';
@ -1498,7 +1498,7 @@
*/
var save = function (d, connection) {
var entity = {
'revision': client.getRevision(d),
'revision': nfClient.getRevision(d),
'component': connection
};
@ -1513,12 +1513,12 @@
nfConnection.set(response);
}).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Connection',
dialogContent: common.escapeHtml(xhr.responseText)
dialogContent: nfCommon.escapeHtml(xhr.responseText)
});
} else {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
});
};
@ -1527,7 +1527,7 @@
var removeConnections = function (removed) {
// consider reloading source/destination of connection being removed
removed.each(function (d) {
canvasUtils.reloadConnectionSourceAndDestination(d.sourceId, d.destinationId);
nfCanvasUtils.reloadConnectionSourceAndDestination(d.sourceId, d.destinationId);
});
// remove the connection
@ -1540,9 +1540,15 @@
selfLoopYOffset: 25
},
init: function (selectable, contextMenu) {
nfSelectable = selectable;
nfContextMenu = contextMenu;
/**
* Initializes the connection.
*
* @param nfSelectableRef The nfSelectable module.
* @param nfContextMenuRef The nfContextMenu module.
*/
init: function (nfSelectableRef, nfContextMenuRef) {
nfSelectable = nfSelectableRef;
nfContextMenu = nfContextMenuRef;
connectionMap = d3.map();
removedCache = d3.map();
@ -1638,7 +1644,7 @@
// ensure the new destination is valid
d3.select('g.hover').classed('connectable-destination', function () {
return canvasUtils.isValidConnectionDestination(d3.select(this));
return nfCanvasUtils.isValidConnectionDestination(d3.select(this));
});
// redraw this connection
@ -1667,11 +1673,11 @@
});
} else {
// prompt for the new port if appropriate
if (canvasUtils.isProcessGroup(destination) || canvasUtils.isRemoteProcessGroup(destination)) {
if (nfCanvasUtils.isProcessGroup(destination) || nfCanvasUtils.isRemoteProcessGroup(destination)) {
// user will select new port and updated connect details will be set accordingly
nfConnectionConfiguration.showConfiguration(connection, destination).done(function () {
// reload the previous destination
canvasUtils.reloadConnectionSourceAndDestination(null, previousDestinationId);
nfCanvasUtils.reloadConnectionSourceAndDestination(null, previousDestinationId);
}).fail(function () {
// reset the connection
connection.call(updateConnections, {
@ -1682,15 +1688,15 @@
} else {
// get the destination details
var destinationData = destination.datum();
var destinationType = canvasUtils.getConnectableTypeForDestination(destination);
var destinationType = nfCanvasUtils.getConnectableTypeForDestination(destination);
var connectionEntity = {
'revision': client.getRevision(connectionData),
'revision': nfClient.getRevision(connectionData),
'component': {
'id': connectionData.id,
'destination': {
'id': destinationData.id,
'groupId': canvasUtils.getGroupId(),
'groupId': nfCanvasUtils.getGroupId(),
'type': destinationType
}
}
@ -1729,13 +1735,13 @@
nfConnection.set(response);
// reload the previous destination and the new source/destination
canvasUtils.reloadConnectionSourceAndDestination(null, previousDestinationId);
canvasUtils.reloadConnectionSourceAndDestination(response.sourceId, response.destinationId);
nfCanvasUtils.reloadConnectionSourceAndDestination(null, previousDestinationId);
nfCanvasUtils.reloadConnectionSourceAndDestination(response.sourceId, response.destinationId);
}).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 401 || xhr.status === 403 || xhr.status === 404 || xhr.status === 409) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Connection',
dialogContent: common.escapeHtml(xhr.responseText)
dialogContent: nfCommon.escapeHtml(xhr.responseText)
});
// reset the connection
@ -1744,7 +1750,7 @@
'updateLabel': false
});
} else {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
});
}
@ -1781,10 +1787,10 @@
.attr('width', width)
.attr('height', height)
.attr('stroke-width', function () {
return 1 / canvasUtils.scaleCanvasView();
return 1 / nfCanvasUtils.scaleCanvasView();
})
.attr('stroke-dasharray', function () {
return 4 / canvasUtils.scaleCanvasView();
return 4 / nfCanvasUtils.scaleCanvasView();
})
.datum({
x: position.x,
@ -1885,8 +1891,8 @@
*/
add: function (connectionEntities, options) {
var selectAll = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
}
// get the current time
@ -1906,7 +1912,7 @@
$.each(connectionEntities, function (_, connectionEntity) {
add(connectionEntity);
});
} else if (common.isDefinedAndNotNull(connectionEntities)) {
} else if (nfCommon.isDefinedAndNotNull(connectionEntities)) {
add(connectionEntities);
}
@ -1962,7 +1968,7 @@
if (isDisconnected) {
// determine whether this connection and its components are included within the selection
isDisconnected = components.has(canvasUtils.getConnectionSourceComponentId(connection)) && components.has(canvasUtils.getConnectionDestinationComponentId(connection));
isDisconnected = components.has(nfCanvasUtils.getConnectionSourceComponentId(connection)) && components.has(nfCanvasUtils.getConnectionDestinationComponentId(connection));
}
});
}
@ -1978,16 +1984,16 @@
set: function (connectionEntities, options) {
var selectAll = false;
var transition = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
transition = common.isDefinedAndNotNull(options.transition) ? options.transition : transition;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition;
}
var set = function (proposedConnectionEntity) {
var currentConnectionEntity = connectionMap.get(proposedConnectionEntity.id);
// set the connection if appropriate due to revision and wasn't previously removed
if (client.isNewerRevision(currentConnectionEntity, proposedConnectionEntity) && !removedCache.has(proposedConnectionEntity.id)) {
if (nfClient.isNewerRevision(currentConnectionEntity, proposedConnectionEntity) && !removedCache.has(proposedConnectionEntity.id)) {
connectionMap.set(proposedConnectionEntity.id, $.extend({
type: 'Connection'
}, proposedConnectionEntity));
@ -2010,7 +2016,7 @@
$.each(connectionEntities, function (_, connectionEntity) {
set(connectionEntity);
});
} else if (common.isDefinedAndNotNull(connectionEntities)) {
} else if (nfCommon.isDefinedAndNotNull(connectionEntities)) {
set(connectionEntities);
}
@ -2031,7 +2037,7 @@
* @param {string} connectionId
*/
refresh: function (connectionId) {
if (common.isDefinedAndNotNull(connectionId)) {
if (nfCommon.isDefinedAndNotNull(connectionId)) {
d3.select('#id-' + connectionId).call(updateConnections, {
'updatePath': true,
'updateLabel': true
@ -2134,7 +2140,7 @@
var connections = [];
connectionMap.forEach(function (_, entry) {
// see if this component is the source or destination of this connection
if (canvasUtils.getConnectionSourceComponentId(entry) === id || canvasUtils.getConnectionDestinationComponentId(entry) === id) {
if (nfCanvasUtils.getConnectionSourceComponentId(entry) === id || nfCanvasUtils.getConnectionDestinationComponentId(entry) === id) {
connections.push(entry);
}
});
@ -2148,7 +2154,7 @@
* @param {string} id
*/
get: function (id) {
if (common.isUndefined(id)) {
if (nfCommon.isUndefined(id)) {
return connectionMap.values();
} else {
return connectionMap.get(id);

View File

@ -21,30 +21,27 @@
if (typeof define === 'function' && define.amd) {
define(['jquery',
'd3',
'nf.ErrorHandler',
'nf.Common',
'nf.CanvasUtils',
'nf.ng.Bridge'],
function ($, d3, errorHandler, common, canvasUtils, angularBridge) {
return (nf.ContextMenu = factory($, d3, errorHandler, common, canvasUtils, angularBridge));
function ($, d3, nfCommon, nfCanvasUtils, nfNgBridge) {
return (nf.ContextMenu = factory($, d3, nfCommon, nfCanvasUtils, nfNgBridge));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ContextMenu =
factory(require('jquery'),
require('d3'),
require('nf.ErrorHandler'),
require('nf.Common'),
require('nf.CanvasUtils'),
require('nf.ng.Bridge')));
} else {
nf.ContextMenu = factory(root.$,
root.d3,
root.nf.ErrorHandler,
root.nf.Common,
root.nf.CanvasUtils,
root.nf.ng.Bridge);
}
}(this, function ($, d3, errorHandler, common, canvasUtils, angularBridge) {
}(this, function ($, d3, nfCommon, nfCanvasUtils, nfNgBridge) {
'use strict';
var nfActions;
@ -55,7 +52,7 @@
* @param {selection} selection The selection of currently selected components
*/
var isNotRootGroup = function (selection) {
return canvasUtils.getParentGroupId() !== null && selection.empty();
return nfCanvasUtils.getParentGroupId() !== null && selection.empty();
};
/**
@ -64,7 +61,7 @@
* @param {selection} selection The selection of currently selected components
*/
var isConfigurable = function (selection) {
return canvasUtils.isConfigurable(selection);
return nfCanvasUtils.isConfigurable(selection);
};
/**
@ -73,7 +70,7 @@
* @param {selection} selection The selection of currently selected components
*/
var hasDetails = function (selection) {
return canvasUtils.hasDetails(selection);
return nfCanvasUtils.hasDetails(selection);
};
/**
@ -82,7 +79,7 @@
* @param {selection} selection The selection of currently selected components
*/
var isDeletable = function (selection) {
return canvasUtils.areDeletable(selection);
return nfCanvasUtils.areDeletable(selection);
};
/**
@ -91,7 +88,7 @@
* @param {selection} selection The selection of currently selected components
*/
var canCreateTemplate = function (selection) {
return canvasUtils.canWrite() && (selection.empty() && canvasUtils.canRead(selection));
return nfCanvasUtils.canWrite() && (selection.empty() && nfCanvasUtils.canRead(selection));
};
/**
@ -100,7 +97,7 @@
* @param {selection} selection The selection of currently selected components
*/
var canUploadTemplate = function (selection) {
return canvasUtils.canWrite() && selection.empty();
return nfCanvasUtils.canWrite() && selection.empty();
};
/**
@ -109,7 +106,7 @@
* @param {selection} selection The selection of currently selected components
*/
var canGroup = function (selection) {
return canvasUtils.getComponentByType('Connection').isDisconnected(selection) && canvasUtils.canModify(selection);
return nfCanvasUtils.getComponentByType('Connection').isDisconnected(selection) && nfCanvasUtils.canModify(selection);
};
/**
@ -118,7 +115,7 @@
* @param {selection} selection The selection of currently selected components
*/
var canEnable = function (selection) {
return canvasUtils.canEnable(selection);
return nfCanvasUtils.canEnable(selection);
};
/**
@ -127,7 +124,7 @@
* @param {selection} selection The selection of currently selected components
*/
var canDisable = function (selection) {
return canvasUtils.canDisable(selection);
return nfCanvasUtils.canDisable(selection);
};
/**
@ -136,7 +133,7 @@
* @param {selection} selection The selection of currently selected components
*/
var canManagePolicies = function (selection) {
return canvasUtils.isConfigurableAuthorizer() && canvasUtils.canManagePolicies(selection);
return nfCanvasUtils.isConfigurableAuthorizer() && nfCanvasUtils.canManagePolicies(selection);
};
/**
@ -145,7 +142,7 @@
* @param {selection} selection The selection of currently selected components
*/
var isRunnable = function (selection) {
return canvasUtils.areRunnable(selection);
return nfCanvasUtils.areRunnable(selection);
};
/**
@ -154,7 +151,7 @@
* @param {selection} selection The selection of currently selected components
*/
var isStoppable = function (selection) {
return canvasUtils.areStoppable(selection);
return nfCanvasUtils.areStoppable(selection);
};
/**
@ -168,7 +165,7 @@
return false;
}
return canvasUtils.isProcessor(selection) || canvasUtils.isProcessGroup(selection) || canvasUtils.isRemoteProcessGroup(selection) || canvasUtils.isConnection(selection);
return nfCanvasUtils.isProcessor(selection) || nfCanvasUtils.isProcessGroup(selection) || nfCanvasUtils.isRemoteProcessGroup(selection) || nfCanvasUtils.isConnection(selection);
};
/**
@ -181,11 +178,11 @@
if (selection.size() !== 1) {
return false;
}
if (canvasUtils.canRead(selection) === false) {
if (nfCanvasUtils.canRead(selection) === false) {
return false;
}
return canvasUtils.isProcessor(selection);
return nfCanvasUtils.isProcessor(selection);
};
/**
@ -194,7 +191,7 @@
* @param {selection} selection The selection of currently selected components
*/
var isNotConnection = function (selection) {
return selection.size() === 1 && !canvasUtils.isConnection(selection);
return selection.size() === 1 && !nfCanvasUtils.isConnection(selection);
};
/**
@ -203,7 +200,7 @@
* @param {selection} selection The selection of currently selected components
*/
var isCopyable = function (selection) {
return canvasUtils.isCopyable(selection);
return nfCanvasUtils.isCopyable(selection);
};
/**
@ -212,7 +209,7 @@
* @param {selection} selection The selection of currently selected components
*/
var isPastable = function (selection) {
return canvasUtils.isPastable();
return nfCanvasUtils.isPastable();
};
/**
@ -234,11 +231,11 @@
if (selection.size() !== 1) {
return false;
}
if (canvasUtils.canModify(selection) === false) {
if (nfCanvasUtils.canModify(selection) === false) {
return false;
}
return canvasUtils.isConnection(selection);
return nfCanvasUtils.isConnection(selection);
};
/**
@ -247,7 +244,7 @@
* @param {selection} selection The selection
*/
var canAlign = function (selection) {
return canvasUtils.canAlign(selection);
return nfCanvasUtils.canAlign(selection);
};
/**
@ -256,7 +253,7 @@
* @param {selection} selection The selection
*/
var isColorable = function (selection) {
return canvasUtils.isColorable(selection);
return nfCanvasUtils.isColorable(selection);
};
/**
@ -270,7 +267,7 @@
return false;
}
return canvasUtils.isConnection(selection);
return nfCanvasUtils.isConnection(selection);
};
/**
@ -284,9 +281,9 @@
return false;
}
return canvasUtils.isFunnel(selection) || canvasUtils.isProcessor(selection) || canvasUtils.isProcessGroup(selection) ||
canvasUtils.isRemoteProcessGroup(selection) || canvasUtils.isInputPort(selection) ||
(canvasUtils.isOutputPort(selection) && canvasUtils.getParentGroupId() !== null);
return nfCanvasUtils.isFunnel(selection) || nfCanvasUtils.isProcessor(selection) || nfCanvasUtils.isProcessGroup(selection) ||
nfCanvasUtils.isRemoteProcessGroup(selection) || nfCanvasUtils.isInputPort(selection) ||
(nfCanvasUtils.isOutputPort(selection) && nfCanvasUtils.getParentGroupId() !== null);
};
/**
@ -300,9 +297,9 @@
return false;
}
return canvasUtils.isFunnel(selection) || canvasUtils.isProcessor(selection) || canvasUtils.isProcessGroup(selection) ||
canvasUtils.isRemoteProcessGroup(selection) || canvasUtils.isOutputPort(selection) ||
(canvasUtils.isInputPort(selection) && canvasUtils.getParentGroupId() !== null);
return nfCanvasUtils.isFunnel(selection) || nfCanvasUtils.isProcessor(selection) || nfCanvasUtils.isProcessGroup(selection) ||
nfCanvasUtils.isRemoteProcessGroup(selection) || nfCanvasUtils.isOutputPort(selection) ||
(nfCanvasUtils.isInputPort(selection) && nfCanvasUtils.getParentGroupId() !== null);
};
/**
@ -315,11 +312,11 @@
if (selection.size() !== 1) {
return false;
}
if (canvasUtils.canRead(selection) === false || canvasUtils.canModify(selection) === false) {
if (nfCanvasUtils.canRead(selection) === false || nfCanvasUtils.canModify(selection) === false) {
return false;
}
if (canvasUtils.isProcessor(selection)) {
if (nfCanvasUtils.isProcessor(selection)) {
var processorData = selection.datum();
return processorData.component.persistsState === true;
} else {
@ -338,7 +335,7 @@
return false;
}
return canvasUtils.isProcessGroup(selection);
return nfCanvasUtils.isProcessGroup(selection);
};
/**
@ -352,8 +349,8 @@
return false;
}
return !canvasUtils.isLabel(selection) && !canvasUtils.isConnection(selection) && !canvasUtils.isProcessGroup(selection)
&& !canvasUtils.isRemoteProcessGroup(selection) && common.canAccessProvenance();
return !nfCanvasUtils.isLabel(selection) && !nfCanvasUtils.isConnection(selection) && !nfCanvasUtils.isProcessGroup(selection)
&& !nfCanvasUtils.isRemoteProcessGroup(selection) && nfCommon.canAccessProvenance();
};
/**
@ -366,11 +363,11 @@
if (selection.size() !== 1) {
return false;
}
if (canvasUtils.canRead(selection) === false) {
if (nfCanvasUtils.canRead(selection) === false) {
return false;
}
return canvasUtils.isRemoteProcessGroup(selection);
return nfCanvasUtils.isRemoteProcessGroup(selection);
};
/**
@ -379,11 +376,11 @@
* @param {selection} selection
*/
var canStartTransmission = function (selection) {
if (canvasUtils.canModify(selection) === false) {
if (nfCanvasUtils.canModify(selection) === false) {
return false;
}
return canvasUtils.canAllStartTransmitting(selection);
return nfCanvasUtils.canAllStartTransmitting(selection);
};
/**
@ -392,11 +389,11 @@
* @param {selection} selection
*/
var canStopTransmission = function (selection) {
if (canvasUtils.canModify(selection) === false) {
if (nfCanvasUtils.canModify(selection) === false) {
return false;
}
return canvasUtils.canAllStopTransmitting(selection);
return nfCanvasUtils.canAllStopTransmitting(selection);
};
/**
@ -423,13 +420,13 @@
* @param {type} selection
*/
var canMoveToParent = function (selection) {
if (canvasUtils.canModify(selection) === false) {
if (nfCanvasUtils.canModify(selection) === false) {
return false;
}
// TODO - also check can modify in parent
return !selection.empty() && canvasUtils.getComponentByType('Connection').isDisconnected(selection) && canvasUtils.getParentGroupId() !== null;
return !selection.empty() && nfCanvasUtils.getComponentByType('Connection').isDisconnected(selection) && nfCanvasUtils.getParentGroupId() !== null;
};
/**
@ -461,7 +458,7 @@
// create the img and conditionally add the style
var img = $('<div class="context-menu-item-img"></div>').addClass(item['clazz']).appendTo(menuItem);
if (common.isDefinedAndNotNull(item['imgStyle'])) {
if (nfCommon.isDefinedAndNotNull(item['imgStyle'])) {
img.addClass(item['imgStyle']);
}
@ -544,10 +541,10 @@
/**
* Initialize the context menu.
*
* @param actions The reference to the actions controller.
* @param nfActionsRef The nfActions module.
*/
init: function (actions) {
nfActions = actions;
init: function (nfActionsRef) {
nfActions = nfActionsRef;
$('#context-menu').on('contextmenu', function (evt) {
// stop propagation and prevent default
@ -566,12 +563,12 @@
var breadCrumb = $('#breadcrumbs').get(0);
// get the current selection
var selection = canvasUtils.getSelection();
var selection = nfCanvasUtils.getSelection();
// consider each component action for the current selection
$.each(actions, function (_, action) {
// determine if this action is application for this selection
if (action.condition(selection, canvasUtils.getComponentByType('Connection'))) {
if (action.condition(selection, nfCanvasUtils.getComponentByType('Connection'))) {
var menuItem = action.menuItem;
addMenuItem(contextMenu, {
@ -603,7 +600,7 @@
});
// inform Angular app incase we've click on the canvas
angularBridge.digest();
nfNgBridge.digest();
},
/**

View File

@ -32,8 +32,8 @@
'nf.CanvasUtils',
'nf.ReportingTask',
'nf.Processor'],
function ($, d3, errorHandler, common, dialog, client, controllerServices, settings, universalCapture, customUi, canvasUtils, reportingTask, processor) {
return (nf.ControllerService = factory($, d3, errorHandler, common, dialog, client, controllerServices, settings, universalCapture, customUi, canvasUtils, reportingTask, processor));
function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfControllerServices, nfSettings, nfUniversalCapture, nfCustomUi, nfCanvasUtils, nfReportingTask, nfProcessor) {
return (nf.ControllerService = factory($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfControllerServices, nfSettings, nfUniversalCapture, nfCustomUi, nfCanvasUtils, nfReportingTask, nfProcessor));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ControllerService =
@ -65,7 +65,7 @@
root.nf.ReportingTask,
root.nf.Processor);
}
}(this, function ($, d3, errorHandler, common, dialog, client, controllerServices, settings, universalCapture, customUi, canvasUtils, reportingTask, processor) {
}(this, function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfControllerServices, nfSettings, nfUniversalCapture, nfCustomUi, nfCanvasUtils, nfReportingTask, nfProcessor) {
'use strict';
var config = {
@ -93,15 +93,15 @@
if (errors.length === 1) {
content = $('<span></span>').text(errors[0]);
} else {
content = common.formatUnorderedList(errors);
content = nfCommon.formatUnorderedList(errors);
}
dialog.showOkDialog({
nfDialog.showOkDialog({
dialogContent: content,
headerText: 'Controller Service'
});
} else {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
};
@ -177,7 +177,7 @@
// service B that has been removed. attempting to enable/disable/remove A
// will attempt to reload B which is no longer a known service. also ensure
// we have permissions to reload the service
if (common.isUndefined(controllerServiceEntity) || controllerServiceEntity.permissions.canRead === false) {
if (nfCommon.isUndefined(controllerServiceEntity) || controllerServiceEntity.permissions.canRead === false) {
return $.Deferred(function (deferred) {
deferred.reject();
}).promise();
@ -189,7 +189,7 @@
dataType: 'json'
}).done(function (response) {
renderControllerService(serviceTable, response);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -239,8 +239,8 @@
var reference = referencingComponentEntity.component;
if (reference.referenceType === 'Processor') {
// reload the processor on the canvas if appropriate
if (canvasUtils.getGroupId() === reference.groupId) {
processor.reload(reference.id);
if (nfCanvasUtils.getGroupId() === reference.groupId) {
nfProcessor.reload(reference.id);
}
// update the current active thread count
@ -253,7 +253,7 @@
}
} else if (reference.referenceType === 'ReportingTask') {
// reload the referencing reporting tasks
reportingTask.reload(reference.id);
nfReportingTask.reload(reference.id);
// update the current active thread count
$('div.' + reference.id + '-active-threads').text(reference.activeThreadCount);
@ -313,22 +313,22 @@
var currentBulletins = bulletinIcon.data('bulletins');
// update the bulletins if necessary
if (common.doBulletinsDiffer(currentBulletins, bulletins)) {
if (nfCommon.doBulletinsDiffer(currentBulletins, bulletins)) {
bulletinIcon.data('bulletins', bulletins);
// format the new bulletins
var formattedBulletins = common.getFormattedBulletins(bulletins);
var formattedBulletins = nfCommon.getFormattedBulletins(bulletins);
// if there are bulletins update them
if (bulletins.length > 0) {
var list = common.formatUnorderedList(formattedBulletins);
var list = nfCommon.formatUnorderedList(formattedBulletins);
// update existing tooltip or initialize a new one if appropriate
if (bulletinIcon.data('qtip')) {
bulletinIcon.qtip('option', 'content.text', list);
} else {
bulletinIcon.addClass('has-bulletins').show().qtip($.extend({},
canvasUtils.config.systemTooltipConfig,
nfCanvasUtils.config.systemTooltipConfig,
{
content: list
}));
@ -350,16 +350,16 @@
var icon = $(this);
var state = referencingComponent.state.toLowerCase();
if (state === 'stopped' && !common.isEmpty(referencingComponent.validationErrors)) {
if (state === 'stopped' && !nfCommon.isEmpty(referencingComponent.validationErrors)) {
state = 'invalid';
// add tooltip for the warnings
var list = common.formatUnorderedList(referencingComponent.validationErrors);
var list = nfCommon.formatUnorderedList(referencingComponent.validationErrors);
if (icon.data('qtip')) {
icon.qtip('option', 'content.text', list);
} else {
icon.qtip($.extend({},
canvasUtils.config.systemTooltipConfig,
nfCanvasUtils.config.systemTooltipConfig,
{
content: list
}));
@ -382,16 +382,16 @@
var icon = $(this);
var state = referencingService.state === 'ENABLED' ? 'enabled' : 'disabled';
if (state === 'disabled' && !common.isEmpty(referencingService.validationErrors)) {
if (state === 'disabled' && !nfCommon.isEmpty(referencingService.validationErrors)) {
state = 'invalid';
// add tooltip for the warnings
var list = common.formatUnorderedList(referencingService.validationErrors);
var list = nfCommon.formatUnorderedList(referencingService.validationErrors);
if (icon.data('qtip')) {
icon.qtip('option', 'content.text', list);
} else {
icon.qtip($.extend({},
canvasUtils.config.systemTooltipConfig,
nfCanvasUtils.config.systemTooltipConfig,
{
content: list
}));
@ -430,7 +430,7 @@
* @param {array} referencingComponents
*/
var createReferencingComponents = function (serviceTable, referenceContainer, referencingComponents) {
if (common.isEmpty(referencingComponents)) {
if (nfCommon.isEmpty(referencingComponents)) {
referenceContainer.append('<div class="unset">No referencing components.</div>');
return;
}
@ -463,7 +463,7 @@
if (referencingComponent.referenceType === 'Processor') {
var processorLink = $('<span class="referencing-component-name link"></span>').text(referencingComponent.name).on('click', function () {
// show the component
canvasUtils.showComponent(referencingComponent.groupId, referencingComponent.id);
nfCanvasUtils.showComponent(referencingComponent.groupId, referencingComponent.id);
// close the dialog and shell
referenceContainer.closest('.dialog').modal('hide');
@ -478,11 +478,11 @@
var processorBulletins = $('<div class="referencing-component-bulletins"></div>').addClass(referencingComponent.id + '-bulletins');
// type
var processorType = $('<span class="referencing-component-type"></span>').text(common.substringAfterLast(referencingComponent.type, '.'));
var processorType = $('<span class="referencing-component-type"></span>').text(nfCommon.substringAfterLast(referencingComponent.type, '.'));
// active thread count
var processorActiveThreadCount = $('<span class="referencing-component-active-thread-count"></span>').addClass(referencingComponent.id + '-active-threads');
if (common.isDefinedAndNotNull(referencingComponent.activeThreadCount) && referencingComponent.activeThreadCount > 0) {
if (nfCommon.isDefinedAndNotNull(referencingComponent.activeThreadCount) && referencingComponent.activeThreadCount > 0) {
processorActiveThreadCount.text('(' + referencingComponent.activeThreadCount + ')');
}
@ -533,7 +533,7 @@
var serviceBulletins = $('<div class="referencing-component-bulletins"></div>').addClass(referencingComponent.id + '-bulletins');
// type
var serviceType = $('<span class="referencing-component-type"></span>').text(common.substringAfterLast(referencingComponent.type, '.'));
var serviceType = $('<span class="referencing-component-type"></span>').text(nfCommon.substringAfterLast(referencingComponent.type, '.'));
// service
var serviceItem = $('<li></li>').append(serviceTwist).append(serviceState).append(serviceBulletins).append(serviceLink).append(serviceType).append(referencingServiceReferencesContainer);
@ -564,11 +564,11 @@
var reportingTaskBulletins = $('<div class="referencing-component-bulletins"></div>').addClass(referencingComponent.id + '-bulletins');
// type
var reportingTaskType = $('<span class="referencing-component-type"></span>').text(common.substringAfterLast(referencingComponent.type, '.'));
var reportingTaskType = $('<span class="referencing-component-type"></span>').text(nfCommon.substringAfterLast(referencingComponent.type, '.'));
// active thread count
var reportingTaskActiveThreadCount = $('<span class="referencing-component-active-thread-count"></span>').addClass(referencingComponent.id + '-active-threads');
if (common.isDefinedAndNotNull(referencingComponent.activeThreadCount) && referencingComponent.activeThreadCount > 0) {
if (nfCommon.isDefinedAndNotNull(referencingComponent.activeThreadCount) && referencingComponent.activeThreadCount > 0) {
reportingTaskActiveThreadCount.text('(' + referencingComponent.activeThreadCount + ')');
}
@ -632,7 +632,7 @@
sourceId: ids
},
dataType: 'json'
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -646,7 +646,7 @@
var setEnabled = function (serviceTable, controllerServiceEntity, enabled, pollCondition) {
// build the request entity
var updateControllerServiceEntity = {
'revision': client.getRevision(controllerServiceEntity),
'revision': nfClient.getRevision(controllerServiceEntity),
'component': {
'id': controllerServiceEntity.id,
'state': enabled ? 'ENABLED' : 'DISABLED'
@ -661,7 +661,7 @@
contentType: 'application/json'
}).done(function (response) {
renderControllerService(serviceTable, response);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
// wait until the polling of each service finished
return $.Deferred(function (deferred) {
@ -740,11 +740,11 @@
if (serviceOnly) {
if (referencingComponent.referenceType === 'ControllerService') {
referencingComponentRevisions[referencingComponentEntity.id] = client.getRevision(referencingComponentEntity);
referencingComponentRevisions[referencingComponentEntity.id] = nfClient.getRevision(referencingComponentEntity);
}
} else {
if (referencingComponent.referenceType !== 'ControllerService') {
referencingComponentRevisions[referencingComponentEntity.id] = client.getRevision(referencingComponentEntity);
referencingComponentRevisions[referencingComponentEntity.id] = nfClient.getRevision(referencingComponentEntity);
}
}
@ -779,7 +779,7 @@
data: JSON.stringify(referenceEntity),
dataType: 'json',
contentType: 'application/json'
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
// Note: updated revisions will be retrieved after updateReferencingSchedulableComponents is invoked
@ -859,7 +859,7 @@
conditionMet(serviceResponse.component, bulletinResponse.bulletinBoard.bulletins);
}).fail(function (xhr, status, error) {
deferred.reject();
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
});
};
@ -881,7 +881,7 @@
conditionMet(controllerService, response.bulletinBoard.bulletins);
}).fail(function (xhr, status, error) {
deferred.reject();
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
});
}).promise();
};
@ -1051,7 +1051,7 @@
data: JSON.stringify(referenceEntity),
dataType: 'json',
contentType: 'application/json'
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
// Note: updated revisions will be retrieved after updateReferencingServices is invoked
@ -1263,7 +1263,7 @@
if (hasUnauthorizedReferencingComponent(controllerService.referencingComponents)) {
setCloseButton();
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Controller Service',
dialogContent: 'Unable to disable due to unauthorized referencing components.'
});
@ -1312,7 +1312,7 @@
// inform the user if the action was canceled
if (canceled === true && $('#nf-ok-dialog').not(':visible')) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Controller Service',
dialogContent: 'The request to disable has been canceled. Parts of this request may have already completed. Please verify the state of this service and all referencing components.'
});
@ -1416,7 +1416,7 @@
if (scope === config.serviceAndReferencingComponents && hasUnauthorizedReferencingComponent(controllerService.referencingComponents)) {
setCloseButton();
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Controller Service',
dialogContent: 'Unable to enable due to unauthorized referencing components.'
});
@ -1475,7 +1475,7 @@
// inform the user if the action was canceled
if (canceled === true && $('#nf-ok-dialog').not(':visible')) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Controller Service',
dialogContent: 'The request to enable has been canceled. Parts of this request may have already completed. Please verify the state of this service and all referencing components.'
});
@ -1497,7 +1497,7 @@
propertyName: propertyName
},
dataType: 'json'
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -1513,7 +1513,7 @@
// determine if changes have been made
if (isSaveRequired()) {
// see if those changes should be saved
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'Save',
dialogContent: 'Save changes before going to this Controller Service?',
noHandler: function () {
@ -1540,12 +1540,12 @@
// ensure details are valid as far as we can tell
if (validateDetails(updatedControllerService)) {
updatedControllerService['revision'] = client.getRevision(controllerServiceEntity);
updatedControllerService['revision'] = nfClient.getRevision(controllerServiceEntity);
var previouslyReferencedServiceIds = [];
$.each(identifyReferencedServiceDescriptors(controllerServiceEntity.component), function (_, descriptor) {
var modifyingService = !common.isUndefined(updatedControllerService.component.properties) && !common.isUndefined(updatedControllerService.component.properties[descriptor.name]);
var isCurrentlyConfigured = common.isDefinedAndNotNull(controllerServiceEntity.component.properties[descriptor.name]);
var modifyingService = !nfCommon.isUndefined(updatedControllerService.component.properties) && !nfCommon.isUndefined(updatedControllerService.component.properties[descriptor.name]);
var isCurrentlyConfigured = nfCommon.isDefinedAndNotNull(controllerServiceEntity.component.properties[descriptor.name]);
// if we are attempting to update a controller service reference
if (modifyingService && isCurrentlyConfigured) {
@ -1587,7 +1587,7 @@
var referencedServiceDescriptors = [];
$.each(component.descriptors, function (_, descriptor) {
if (common.isDefinedAndNotNull(descriptor.identifiesControllerService)) {
if (nfCommon.isDefinedAndNotNull(descriptor.identifiesControllerService)) {
referencedServiceDescriptors.push(descriptor);
}
});
@ -1607,7 +1607,7 @@
var referencedServiceId = component.properties[descriptor.name];
// ensure the property is configured
if (common.isDefinedAndNotNull(referencedServiceId) && $.trim(referencedServiceId).length > 0) {
if (nfCommon.isDefinedAndNotNull(referencedServiceId) && $.trim(referencedServiceId).length > 0) {
referencedServices.push(referencedServiceId);
}
});
@ -1642,7 +1642,7 @@
}],
select: function () {
// remove all property detail dialogs
universalCapture.removeAllPropertyDetailDialogs();
nfUniversalCapture.removeAllPropertyDetailDialogs();
// update the property table size in case this is the first time its rendered
if ($(this).text() === 'Properties') {
@ -1666,8 +1666,8 @@
close: function () {
// empty the referencing components list
var referencingComponents = $('#controller-service-referencing-components');
common.cleanUpTooltips(referencingComponents, 'div.referencing-component-state');
common.cleanUpTooltips(referencingComponents, 'div.referencing-component-bulletins');
nfCommon.cleanUpTooltips(referencingComponents, 'div.referencing-component-state');
nfCommon.cleanUpTooltips(referencingComponents, 'div.referencing-component-bulletins');
referencingComponents.css('border-width', '0').empty();
// cancel any active edits
@ -1677,13 +1677,13 @@
$('#controller-service-properties').propertytable('clear');
// clear the comments
common.clearField('read-only-controller-service-comments');
nfCommon.clearField('read-only-controller-service-comments');
// removed the cached controller service details
$('#controller-service-configuration').removeData('controllerServiceDetails');
},
open: function () {
common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
}
}
});
@ -1706,15 +1706,15 @@
// bulletins
$('#disable-controller-service-bulletins').removeClass('has-bulletins').removeData('bulletins').hide();
common.cleanUpTooltips($('#disable-controller-service-service-container'), '#disable-controller-service-bulletins');
nfCommon.cleanUpTooltips($('#disable-controller-service-service-container'), '#disable-controller-service-bulletins');
// reset progress
$('div.disable-referencing-components').removeClass('ajax-loading ajax-complete ajax-error');
// referencing components
var referencingComponents = $('#disable-controller-service-referencing-components');
common.cleanUpTooltips(referencingComponents, 'div.referencing-component-state');
common.cleanUpTooltips(referencingComponents, 'div.referencing-component-bulletins');
nfCommon.cleanUpTooltips(referencingComponents, 'div.referencing-component-state');
nfCommon.cleanUpTooltips(referencingComponents, 'div.referencing-component-bulletins');
referencingComponents.css('border-width', '0').empty();
}
}
@ -1752,15 +1752,15 @@
// bulletins
$('#enable-controller-service-bulletins').removeClass('has-bulletins').removeData('bulletins').hide();
common.cleanUpTooltips($('#enable-controller-service-service-container'), '#enable-controller-service-bulletins');
nfCommon.cleanUpTooltips($('#enable-controller-service-service-container'), '#enable-controller-service-bulletins');
// reset progress
$('div.enable-referencing-components').removeClass('ajax-loading ajax-complete ajax-error');
// referencing components
var referencingComponents = $('#enable-controller-service-referencing-components');
common.cleanUpTooltips(referencingComponents, 'div.referencing-component-state');
common.cleanUpTooltips(referencingComponents, 'div.referencing-component-bulletins');
nfCommon.cleanUpTooltips(referencingComponents, 'div.referencing-component-state');
nfCommon.cleanUpTooltips(referencingComponents, 'div.referencing-component-bulletins');
referencingComponents.css('border-width', '0').empty();
}
}
@ -1774,7 +1774,7 @@
* @argument {object} controllerServiceEntity The controller service
*/
showConfiguration: function (serviceTable, controllerServiceEntity) {
if (common.isUndefined(currentTable)) {
if (nfCommon.isUndefined(currentTable)) {
currentTable = serviceTable;
}
var controllerServiceDialog = $('#controller-service-configuration');
@ -1795,14 +1795,14 @@
// calculate the correct uri
var createdControllerService = response.component;
if (common.isDefinedAndNotNull(createdControllerService.parentGroupId)) {
if (nfCommon.isDefinedAndNotNull(createdControllerService.parentGroupId)) {
controllerServicesUri = config.urls.api + '/flow/process-groups/' + encodeURIComponent(createdControllerService.parentGroupId) + '/controller-services';
} else {
controllerServicesUri = config.urls.api + '/flow/controller/controller-services';
}
// load the controller services accordingly
return controllerServices.loadControllerServices(controllerServicesUri, serviceTable);
return nfControllerServices.loadControllerServices(controllerServicesUri, serviceTable);
},
goToServiceDeferred: function () {
return goToServiceFromProperty(serviceTable);
@ -1843,8 +1843,8 @@
controllerServiceDialog.data('controllerServiceDetails', controllerServiceEntity);
// populate the controller service settings
common.populateField('controller-service-id', controllerService['id']);
common.populateField('controller-service-type', common.substringAfterLast(controllerService['type'], '.'));
nfCommon.populateField('controller-service-id', controllerService['id']);
nfCommon.populateField('controller-service-type', nfCommon.substringAfterLast(controllerService['type'], '.'));
$('#controller-service-name').val(controllerService['name']);
$('#controller-service-comments').val(controllerService['comments']);
@ -1890,7 +1890,7 @@
}];
// determine if we should show the advanced button
if (common.isDefinedAndNotNull(controllerService.customUiUrl) && controllerService.customUiUrl !== '') {
if (nfCommon.isDefinedAndNotNull(controllerService.customUiUrl) && controllerService.customUiUrl !== '') {
buttons.push({
buttonText: 'Advanced',
clazz: 'fa fa-cog button-icon',
@ -1909,12 +1909,12 @@
$('#shell-close-button').click();
// show the custom ui
customUi.showCustomUi(controllerServiceEntity, controllerService.customUiUrl, true).done(function () {
nfCustomUi.showCustomUi(controllerServiceEntity, controllerService.customUiUrl, true).done(function () {
// once the custom ui is closed, reload the controller service
reloadControllerServiceAndReferencingComponents(serviceTable, controllerService);
// show the settings
settings.showSettings();
nfSettings.showSettings();
});
};
@ -1924,7 +1924,7 @@
// determine if changes have been made
if (isSaveRequired()) {
// see if those changes should be saved
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'Save',
dialogContent: 'Save changes before opening the advanced configuration?',
noHandler: openCustomUi,
@ -1959,7 +1959,7 @@
updateReferencingComponentsBorder(referenceContainer);
$('#controller-service-properties').propertytable('resetTableSize');
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
},
/**
@ -2012,10 +2012,10 @@
controllerServiceDialog.data('controllerServiceDetails', controllerServiceEntity);
// populate the controller service settings
common.populateField('controller-service-id', controllerService['id']);
common.populateField('controller-service-type', common.substringAfterLast(controllerService['type'], '.'));
common.populateField('read-only-controller-service-name', controllerService['name']);
common.populateField('read-only-controller-service-comments', controllerService['comments']);
nfCommon.populateField('controller-service-id', controllerService['id']);
nfCommon.populateField('controller-service-type', nfCommon.substringAfterLast(controllerService['type'], '.'));
nfCommon.populateField('read-only-controller-service-name', controllerService['name']);
nfCommon.populateField('read-only-controller-service-comments', controllerService['comments']);
// get the reference container
var referenceContainer = $('#controller-service-referencing-components');
@ -2039,7 +2039,7 @@
}];
// determine if we should show the advanced button
if (common.isDefinedAndNotNull(customUi) && common.isDefinedAndNotNull(controllerService.customUiUrl) && controllerService.customUiUrl !== '') {
if (nfCommon.isDefinedAndNotNull(nfCustomUi) && nfCommon.isDefinedAndNotNull(controllerService.customUiUrl) && controllerService.customUiUrl !== '') {
buttons.push({
buttonText: 'Advanced',
clazz: 'fa fa-cog button-icon',
@ -2057,8 +2057,8 @@
$('#shell-close-button').click();
// show the custom ui
customUi.showCustomUi(controllerServiceEntity, controllerService.customUiUrl, false).done(function () {
settings.showSettings();
nfCustomUi.showCustomUi(controllerServiceEntity, controllerService.customUiUrl, false).done(function () {
nfSettings.showSettings();
});
}
}
@ -2123,9 +2123,9 @@
*/
promptToDeleteController: function (serviceTable, controllerServiceEntity) {
// prompt for deletion
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'Delete Controller Service',
dialogContent: 'Delete controller service \'' + common.escapeHtml(controllerServiceEntity.component.name) + '\'?',
dialogContent: 'Delete controller service \'' + nfCommon.escapeHtml(controllerServiceEntity.component.name) + '\'?',
yesHandler: function () {
nfControllerService.remove(serviceTable, controllerServiceEntity);
}
@ -2141,7 +2141,7 @@
remove: function (serviceTable, controllerServiceEntity) {
// prompt for removal?
var revision = client.getRevision(controllerServiceEntity);
var revision = nfClient.getRevision(controllerServiceEntity);
$.ajax({
type: 'DELETE',
url: controllerServiceEntity.uri + '?' + $.param({
@ -2159,7 +2159,7 @@
if (controllerServiceEntity.permissions.canRead) {
reloadControllerServiceReferences(serviceTable, controllerServiceEntity.component);
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
};

View File

@ -34,8 +34,8 @@
'nf.PolicyManagement',
'nf.ComponentState',
'nf.ng.Bridge'],
function ($, d3, Slick, client, shell, processGroupConfiguration, canvasUtils, errorHandler, dialog, common, controllerService, processGroup, policyManagement, componentState, angularBridge) {
return (nf.ControllerServices = factory($, d3, Slick, client, shell, processGroupConfiguration, canvasUtils, errorHandler, dialog, common, controllerService, processGroup, policyManagement, componentState, angularBridge));
function ($, d3, Slick, nfClient, nfShell, nfProcessGroupConfiguration, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon, nfControllerService, nfProcessGroup, nfPolicyManagement, nfComponentState, nfNgBridge) {
return (nf.ControllerServices = factory($, d3, Slick, nfClient, nfShell, nfProcessGroupConfiguration, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon, nfControllerService, nfProcessGroup, nfPolicyManagement, nfComponentState, nfNgBridge));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ControllerServices =
@ -71,7 +71,7 @@
root.nf.ComponentState,
root.nf.ng.Bridge);
}
}(this, function ($, d3, Slick, client, shell, processGroupConfiguration, canvasUtils, errorHandler, dialog, common, controllerService, processGroup, policyManagement, componentState, angularBridge) {
}(this, function ($, d3, Slick, nfClient, nfShell, nfProcessGroupConfiguration, nfCanvasUtils, nfErrorHandler, nfDialog, nfCommon, nfControllerService, nfProcessGroup, nfPolicyManagement, nfComponentState, nfNgBridge) {
'use strict';
var dblClick = null;
@ -100,7 +100,7 @@
* @param item controller service type
*/
var isSelectable = function (item) {
return common.isBlank(item.usageRestriction) || common.canAccessRestrictedComponents();
return nfCommon.isBlank(item.usageRestriction) || nfCommon.canAccessRestrictedComponents();
};
/**
@ -120,7 +120,7 @@
var controllerServiceTypesGrid = $('#controller-service-types-table').data('gridInstance');
// ensure the grid has been initialized
if (common.isDefinedAndNotNull(controllerServiceTypesGrid)) {
if (nfCommon.isDefinedAndNotNull(controllerServiceTypesGrid)) {
var controllerServiceTypesData = controllerServiceTypesGrid.getData();
// update the search criteria
@ -257,7 +257,7 @@
// ensure something was selected
if (selectedServiceType === '') {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Controller Service',
dialogContent: 'The type of controller service to create must be selected.'
});
@ -276,7 +276,7 @@
var addControllerService = function (controllerServicesUri, serviceTable, controllerServiceType) {
// build the controller service entity
var controllerServiceEntity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': 0
}
@ -307,7 +307,7 @@
var row = controllerServicesData.getRowById(controllerServiceEntity.id);
controllerServicesGrid.setSelectedRows([row]);
controllerServicesGrid.scrollRowIntoView(row);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
// hide the dialog
$('#new-controller-service-dialog').modal('hide');
@ -325,7 +325,7 @@
id: 'type',
name: 'Type',
field: 'label',
formatter: common.typeFormatter,
formatter: nfCommon.typeFormatter,
sortable: false,
resizable: true
},
@ -359,11 +359,11 @@
var controllerServiceType = controllerServiceTypesGrid.getDataItem(controllerServiceTypeIndex);
// set the controller service type description
if (common.isDefinedAndNotNull(controllerServiceType)) {
if (nfCommon.isDefinedAndNotNull(controllerServiceType)) {
// show the selected controller service
$('#controller-service-description-container').show();
if (common.isBlank(controllerServiceType.description)) {
if (nfCommon.isBlank(controllerServiceType.description)) {
$('#controller-service-type-description')
.attr('title', '')
.html('<span class="unset">No description specified</span>');
@ -385,7 +385,7 @@
}
});
controllerServiceTypesGrid.onViewportChanged.subscribe(function (e, args) {
common.cleanUpTooltips($('#controller-service-types-table'), 'div.view-usage-restriction');
nfCommon.cleanUpTooltips($('#controller-service-types-table'), 'div.view-usage-restriction');
});
// wire up the dataview to the grid
@ -412,8 +412,8 @@
var item = controllerServiceTypesData.getItemById(rowId);
// show the tooltip
if (common.isDefinedAndNotNull(item.usageRestriction)) {
usageRestriction.qtip($.extend({}, common.config.tooltipConfig, {
if (nfCommon.isDefinedAndNotNull(item.usageRestriction)) {
usageRestriction.qtip($.extend({}, nfCommon.config.tooltipConfig, {
content: item.usageRestriction,
position: {
container: $('#summary'),
@ -446,10 +446,10 @@
// add the documented type
controllerServiceTypesData.addItem({
id: id++,
label: common.substringAfterLast(documentedType.type, '.'),
label: nfCommon.substringAfterLast(documentedType.type, '.'),
type: documentedType.type,
description: common.escapeHtml(documentedType.description),
usageRestriction: common.escapeHtml(documentedType.usageRestriction),
description: nfCommon.escapeHtml(documentedType.description),
usageRestriction: nfCommon.escapeHtml(documentedType.usageRestriction),
tags: documentedType.tags.join(', ')
});
@ -471,7 +471,7 @@
select: applyControllerServiceTypeFilter,
remove: applyControllerServiceTypeFilter
});
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
// initialize the controller service dialog
$('#new-controller-service-dialog').modal({
@ -539,7 +539,7 @@
return '';
}
return common.substringAfterLast(dataContext.component.type, '.');
return nfCommon.substringAfterLast(dataContext.component.type, '.');
};
/**
@ -557,7 +557,7 @@
return '';
}
if (common.isDefinedAndNotNull(dataContext.component.parentGroupId)) {
if (nfCommon.isDefinedAndNotNull(dataContext.component.parentGroupId)) {
return dataContext.component.parentGroupId;
} else {
return 'Controller';
@ -574,7 +574,7 @@
// we know the process group for this controller service is part
// of the current breadcrumb trail
var canWriteProcessGroupParent = function (processGroupId) {
var breadcrumbs = angularBridge.injector.get('breadcrumbsCtrl').getBreadcrumbs();
var breadcrumbs = nfNgBridge.injector.get('breadcrumbsCtrl').getBreadcrumbs();
var isAuthorized = false;
$.each(breadcrumbs, function (_, breadcrumbEntity) {
@ -587,10 +587,10 @@
return isAuthorized;
};
if (common.isDefinedAndNotNull(dataContext.component.parentGroupId)) {
if (nfCommon.isDefinedAndNotNull(dataContext.component.parentGroupId)) {
return canWriteProcessGroupParent(dataContext.component.parentGroupId);
} else {
return common.canModifyController();
return nfCommon.canModifyController();
}
};
@ -606,31 +606,31 @@
if(a.permissions.canRead && b.permissions.canRead) {
if (sortDetails.columnId === 'moreDetails') {
var aBulletins = 0;
if (!common.isEmpty(a.bulletins)) {
if (!nfCommon.isEmpty(a.bulletins)) {
aBulletins = a.bulletins.length;
}
var bBulletins = 0;
if (!common.isEmpty(b.bulletins)) {
if (!nfCommon.isEmpty(b.bulletins)) {
bBulletins = b.bulletins.length;
}
return aBulletins - bBulletins;
} else if (sortDetails.columnId === 'type') {
var aType = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? common.substringAfterLast(a.component[sortDetails.columnId], '.') : '';
var bType = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? common.substringAfterLast(b.component[sortDetails.columnId], '.') : '';
var aType = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? nfCommon.substringAfterLast(a.component[sortDetails.columnId], '.') : '';
var bType = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? nfCommon.substringAfterLast(b.component[sortDetails.columnId], '.') : '';
return aType === bType ? 0 : aType > bType ? 1 : -1;
} else if (sortDetails.columnId === 'state') {
var aState = 'Invalid';
if (common.isEmpty(a.component.validationErrors)) {
aState = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : '';
if (nfCommon.isEmpty(a.component.validationErrors)) {
aState = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : '';
}
var bState = 'Invalid';
if (common.isEmpty(b.component.validationErrors)) {
bState = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : '';
if (nfCommon.isEmpty(b.component.validationErrors)) {
bState = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : '';
}
return aState === bState ? 0 : aState > bState ? 1 : -1;
} else {
var aString = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : '';
var bString = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : '';
var aString = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : '';
var bString = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : '';
return aString === bString ? 0 : aString > bString ? 1 : -1;
}
} else {
@ -667,8 +667,8 @@
// always include a button to view the usage
markup += '<div title="Usage" class="pointer controller-service-usage fa fa-book" style="margin-top: 5px; margin-right: 3px;" ></div>';
var hasErrors = !common.isEmpty(dataContext.component.validationErrors);
var hasBulletins = !common.isEmpty(dataContext.bulletins);
var hasErrors = !nfCommon.isEmpty(dataContext.component.validationErrors);
var hasBulletins = !nfCommon.isEmpty(dataContext.bulletins);
if (hasErrors) {
markup += '<div class="pointer has-errors fa fa-warning" style="margin-top: 4px; margin-right: 3px; float: left;" ></div>';
@ -679,7 +679,7 @@
}
if (hasErrors || hasBulletins) {
markup += '<span class="hidden row-id">' + common.escapeHtml(dataContext.id) + '</span>';
markup += '<span class="hidden row-id">' + nfCommon.escapeHtml(dataContext.id) + '</span>';
}
return markup;
@ -692,7 +692,7 @@
// determine the appropriate label
var icon = '', label = '';
if (!common.isEmpty(dataContext.component.validationErrors)) {
if (!nfCommon.isEmpty(dataContext.component.validationErrors)) {
icon = 'invalid fa fa-warning';
label = 'Invalid';
} else {
@ -726,7 +726,7 @@
markup += '<div class="pointer edit-controller-service fa fa-pencil" title="Edit" style="margin-top: 2px; margin-right: 3px;" ></div>';
// if there are no validation errors allow enabling
if (common.isEmpty(dataContext.component.validationErrors)) {
if (nfCommon.isEmpty(dataContext.component.validationErrors)) {
markup += '<div class="pointer enable-controller-service fa fa-flash" title="Enable" style="margin-top: 2px; margin-right: 3px;"></div>';
}
}
@ -741,7 +741,7 @@
}
// allow policy configuration conditionally
if (canvasUtils.isConfigurableAuthorizer() && common.canAccessTenants()) {
if (nfCanvasUtils.isConfigurableAuthorizer() && nfCommon.canAccessTenants()) {
markup += '<div title="Access Policies" class="pointer edit-access-policies fa fa-key" style="margin-top: 2px;"></div>';
}
@ -827,44 +827,44 @@
// determine the desired action
if (controllerServicesGrid.getColumns()[args.cell].id === 'actions') {
if (target.hasClass('edit-controller-service')) {
controllerService.showConfiguration(serviceTable, controllerServiceEntity);
nfControllerService.showConfiguration(serviceTable, controllerServiceEntity);
} else if (target.hasClass('enable-controller-service')) {
controllerService.enable(serviceTable, controllerServiceEntity);
nfControllerService.enable(serviceTable, controllerServiceEntity);
} else if (target.hasClass('disable-controller-service')) {
controllerService.disable(serviceTable, controllerServiceEntity);
nfControllerService.disable(serviceTable, controllerServiceEntity);
} else if (target.hasClass('delete-controller-service')) {
controllerService.promptToDeleteController(serviceTable, controllerServiceEntity);
nfControllerService.promptToDeleteController(serviceTable, controllerServiceEntity);
} else if (target.hasClass('view-state-controller-service')) {
componentState.showState(controllerServiceEntity, controllerServiceEntity.state === 'DISABLED');
nfComponentState.showState(controllerServiceEntity, controllerServiceEntity.state === 'DISABLED');
} else if (target.hasClass('edit-access-policies')) {
// show the policies for this service
policyManagement.showControllerServicePolicy(controllerServiceEntity);
nfPolicyManagement.showControllerServicePolicy(controllerServiceEntity);
// close the settings dialog
$('#shell-close-button').click();
}
} else if (controllerServicesGrid.getColumns()[args.cell].id === 'moreDetails') {
if (target.hasClass('view-controller-service')) {
controllerService.showDetails(serviceTable, controllerServiceEntity);
nfControllerService.showDetails(serviceTable, controllerServiceEntity);
} else if (target.hasClass('controller-service-usage')) {
// close the settings dialog
$('#shell-close-button').click();
// open the documentation for this controller service
shell.showPage('../nifi-docs/documentation?' + $.param({
select: common.substringAfterLast(controllerServiceEntity.component.type, '.')
nfShell.showPage('../nifi-docs/documentation?' + $.param({
select: nfCommon.substringAfterLast(controllerServiceEntity.component.type, '.')
})).done(function() {
if (common.isDefinedAndNotNull(controllerServiceEntity.component.parentGroupId)) {
if (nfCommon.isDefinedAndNotNull(controllerServiceEntity.component.parentGroupId)) {
var groupId;
var processGroup = processGroup.get(controllerServiceEntity.component.parentGroupId);
if (common.isDefinedAndNotNull(processGroup)) {
var processGroup = nfProcessGroup.get(controllerServiceEntity.component.parentGroupId);
if (nfCommon.isDefinedAndNotNull(processGroup)) {
groupId = processGroup.id;
} else {
groupId = canvasUtils.getGroupId();
groupId = nfCanvasUtils.getGroupId();
}
// reload the corresponding group
processGroupConfiguration.showConfiguration(groupId);
nfProcessGroupConfiguration.showConfiguration(groupId);
} else {
showSettings();
}
@ -894,12 +894,12 @@
var controllerServiceEntity = controllerServicesData.getItemById(serviceId);
// format the errors
var tooltip = common.formatUnorderedList(controllerServiceEntity.component.validationErrors);
var tooltip = nfCommon.formatUnorderedList(controllerServiceEntity.component.validationErrors);
// show the tooltip
if (common.isDefinedAndNotNull(tooltip)) {
if (nfCommon.isDefinedAndNotNull(tooltip)) {
errorIcon.qtip($.extend({},
common.config.tooltipConfig,
nfCommon.config.tooltipConfig,
{
content: tooltip,
position: {
@ -923,13 +923,13 @@
var controllerServiceEntity = controllerServicesData.getItemById(taskId);
// format the tooltip
var bulletins = common.getFormattedBulletins(controllerServiceEntity.bulletins);
var tooltip = common.formatUnorderedList(bulletins);
var bulletins = nfCommon.getFormattedBulletins(controllerServiceEntity.bulletins);
var tooltip = nfCommon.formatUnorderedList(bulletins);
// show the tooltip
if (common.isDefinedAndNotNull(tooltip)) {
if (nfCommon.isDefinedAndNotNull(tooltip)) {
bulletinIcon.qtip($.extend({},
common.config.tooltipConfig,
nfCommon.config.tooltipConfig,
{
content: tooltip,
position: {
@ -966,8 +966,8 @@
}, service));
});
common.cleanUpTooltips(serviceTable, 'div.has-errors');
common.cleanUpTooltips(serviceTable, 'div.has-bulletins');
nfCommon.cleanUpTooltips(serviceTable, 'div.has-errors');
nfCommon.cleanUpTooltips(serviceTable, 'div.has-bulletins');
var controllerServicesGrid = serviceTable.data('gridInstance');
var controllerServicesData = controllerServicesGrid.getData();
@ -1084,7 +1084,7 @@
controllerServiceTypesGrid.onDblClick.subscribe(dblClick);
// reset the canvas size after the dialog is shown
if (common.isDefinedAndNotNull(controllerServiceTypesGrid)) {
if (nfCommon.isDefinedAndNotNull(controllerServiceTypesGrid)) {
controllerServiceTypesGrid.setSelectedRows([0]);
controllerServiceTypesGrid.resizeCanvas();
}
@ -1100,7 +1100,7 @@
*/
resetTableSize: function (serviceTable) {
var controllerServicesGrid = serviceTable.data('gridInstance');
if (common.isDefinedAndNotNull(controllerServicesGrid)) {
if (nfCommon.isDefinedAndNotNull(controllerServicesGrid)) {
controllerServicesGrid.resizeCanvas();
}
},
@ -1128,14 +1128,14 @@
controllerServicesData.beginUpdate();
// if there are some bulletins process them
if (!common.isEmpty(controllerServiceBulletins)) {
if (!nfCommon.isEmpty(controllerServiceBulletins)) {
var controllerServiceBulletinsBySource = d3.nest()
.key(function(d) { return d.sourceId; })
.map(controllerServiceBulletins, d3.map);
controllerServiceBulletinsBySource.forEach(function(sourceId, sourceBulletins) {
var controllerService = controllerServicesData.getItemById(sourceId);
if (common.isDefinedAndNotNull(controllerService)) {
if (nfCommon.isDefinedAndNotNull(controllerService)) {
controllerServicesData.updateItem(sourceId, $.extend(controllerService, {
bulletins: sourceBulletins
}));

View File

@ -23,8 +23,8 @@
'nf.Common',
'nf.Shell',
'nf.Dialog',
'nf.Client'], function ($, common, shell, dialog, client) {
return (nf.CustomUi = factory($, common, shell, dialog, client));
'nf.Client'], function ($, nfCommon, nfShell, nfDialog, nfClient) {
return (nf.CustomUi = factory($, nfCommon, nfShell, nfDialog, nfClient));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.CustomUi = factory(require('jquery'),
@ -39,7 +39,7 @@
root.nf.Dialog,
root.nf.Client);
}
}(this, function ($, common, shell, dialog, client) {
}(this, function ($, nfCommon, nfShell, nfDialog, nfClient) {
'use strict';
return {
@ -52,11 +52,11 @@
*/
showCustomUi: function (entity, uri, editable) {
return $.Deferred(function (deferred) {
common.getAccessToken('../nifi-api/access/ui-extension-token').done(function (uiExtensionToken) {
nfCommon.getAccessToken('../nifi-api/access/ui-extension-token').done(function (uiExtensionToken) {
// record the processor id
$('#shell-close-button');
var revision = client.getRevision(entity);
var revision = nfClient.getRevision(entity);
// build the customer ui params
var customUiParams = {
@ -67,16 +67,16 @@
};
// conditionally include the ui extension token
if (!common.isBlank(uiExtensionToken)) {
if (!nfCommon.isBlank(uiExtensionToken)) {
customUiParams['access_token'] = uiExtensionToken;
}
// show the shell
shell.showPage('..' + uri + '?' + $.param(customUiParams), false).done(function () {
nfShell.showPage('..' + uri + '?' + $.param(customUiParams), false).done(function () {
deferred.resolve();
});
}).fail(function () {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Advanced Configuration',
dialogContent: 'Unable to generate access token for accessing the advanced configuration dialog.'
});

View File

@ -28,8 +28,8 @@
'nf.Dialog',
'nf.Client',
'nf.ErrorHandler'],
function ($, d3, nfConnection, birdseye, canvasUtils, common, dialog, client, errorHandler) {
return (nf.Draggable = factory($, d3, nfConnection, birdseye, canvasUtils, common, dialog, client, errorHandler));
function ($, d3, nfConnection, nfBirdseye, nfCanvasUtils, nfCommon, nfDialog, nfClient, nfErrorHandler) {
return (nf.Draggable = factory($, d3, nfConnection, nfBirdseye, nfCanvasUtils, nfCommon, nfDialog, nfClient, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Draggable =
@ -53,7 +53,7 @@
root.nf.Client,
root.nf.ErrorHandler);
}
}(this, function ($, d3, nfConnection, birdseye, canvasUtils, common, dialog, client, errorHandler) {
}(this, function ($, d3, nfConnection, nfBirdseye, nfCanvasUtils, nfCommon, nfDialog, nfClient, nfErrorHandler) {
'use strict';
var nfCanvas;
@ -83,8 +83,8 @@
var selectedComponents = d3.selectAll('g.component.selected');
// ensure every component is writable
if (canvasUtils.canModify(selectedConnections) === false || canvasUtils.canModify(selectedComponents) === false) {
dialog.showOkDialog({
if (nfCanvasUtils.canModify(selectedConnections) === false || nfCanvasUtils.canModify(selectedComponents) === false) {
nfDialog.showOkDialog({
headerText: 'Component Position',
dialogContent: 'Must be authorized to modify every component selected.'
});
@ -104,7 +104,7 @@
// consider any self looping connections
var connections = nfConnection.getComponentConnections(d.id);
$.each(connections, function (_, connection) {
if (!updates.has(connection.id) && canvasUtils.getConnectionSourceComponentId(connection) === canvasUtils.getConnectionDestinationComponentId(connection)) {
if (!updates.has(connection.id) && nfCanvasUtils.getConnectionSourceComponentId(connection) === nfCanvasUtils.getConnectionDestinationComponentId(connection)) {
var connectionUpdate = nfDraggable.updateConnectionPosition(nfConnection.get(connection.id), delta);
if (connectionUpdate !== null) {
updates.set(connection.id, connectionUpdate);
@ -126,15 +126,15 @@
var selection = d3.selectAll('g.component.selected, g.connection.selected');
var group = d3.select('g.drop');
if (canvasUtils.canModify(selection) === false) {
dialog.showOkDialog({
if (nfCanvasUtils.canModify(selection) === false) {
nfDialog.showOkDialog({
headerText: 'Component Position',
dialogContent: 'Must be authorized to modify every component selected.'
});
return;
}
if (canvasUtils.canModify(group) === false) {
dialog.showOkDialog({
if (nfCanvasUtils.canModify(group) === false) {
nfDialog.showOkDialog({
headerText: 'Component Position',
dialogContent: 'Not authorized to modify the destination group.'
});
@ -142,7 +142,7 @@
}
// move the seleciton into the group
canvasUtils.moveComponents(selection, group);
nfCanvasUtils.moveComponents(selection, group);
};
var nfDraggable = {
@ -193,10 +193,10 @@
.attr('width', maxX - minX)
.attr('height', maxY - minY)
.attr('stroke-width', function () {
return 1 / canvasUtils.scaleCanvasView();
return 1 / nfCanvasUtils.scaleCanvasView();
})
.attr('stroke-dasharray', function () {
return 4 / canvasUtils.scaleCanvasView();
return 4 / nfCanvasUtils.scaleCanvasView();
})
.datum({
original: {
@ -257,7 +257,7 @@
// build the entity
var entity = {
'revision': client.getRevision(d),
'revision': nfClient.getRevision(d),
'component': {
'id': d.id,
'position': newPosition
@ -274,7 +274,7 @@
contentType: 'application/json'
}).done(function (response) {
// update the component
canvasUtils.getComponentByType(d.type).set(response);
nfCanvasUtils.getComponentByType(d.type).set(response);
// resolve with an object so we can refresh when finished
deferred.resolve({
@ -283,12 +283,12 @@
});
}).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Component Position',
dialogContent: common.escapeHtml(xhr.responseText)
dialogContent: nfCommon.escapeHtml(xhr.responseText)
});
} else {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
deferred.reject();
@ -318,7 +318,7 @@
});
var entity = {
'revision': client.getRevision(d),
'revision': nfClient.getRevision(d),
'component': {
id: d.id,
bends: newBends
@ -344,12 +344,12 @@
});
}).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Component Position',
dialogContent: common.escapeHtml(xhr.responseText)
dialogContent: nfCommon.escapeHtml(xhr.responseText)
});
} else {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
deferred.reject();
@ -388,7 +388,7 @@
nfConnection.refresh(connectionId);
});
}).always(function () {
birdseye.refresh();
nfBirdseye.refresh();
});
}
},

View File

@ -24,8 +24,8 @@
'nf.Common',
'nf.Client',
'nf.CanvasUtils'],
function ($, d3, common, client, canvasUtils) {
return (nf.Funnel = factory($, d3, common, client, canvasUtils));
function ($, d3, nfCommon, nfClient, nfCanvasUtils) {
return (nf.Funnel = factory($, d3, nfCommon, nfClient, nfCanvasUtils));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Funnel =
@ -41,7 +41,7 @@
root.nf.Client,
root.nf.CanvasUtils);
}
}(this, function ($, d3, common, client, canvasUtils) {
}(this, function ($, d3, nfCommon, nfClient, nfCanvasUtils) {
'use strict';
var nfConnectable;
@ -105,7 +105,7 @@
'class': 'funnel component'
})
.classed('selected', selected)
.call(canvasUtils.position);
.call(nfCanvasUtils.position);
// funnel border
funnel.append('rect')
@ -178,7 +178,7 @@
var funnel = d3.select(this);
// update the component behavior as appropriate
canvasUtils.editable(funnel, nfConnectable, nfDraggable);
nfCanvasUtils.editable(funnel, nfConnectable, nfDraggable);
});
};
@ -194,12 +194,17 @@
var nfFunnel = {
/**
* Initializes of the Processor handler.
*
* @param nfConnectableRef The nfConnectable module.
* @param nfDraggableRef The nfDraggable module.
* @param nfSelectableRef The nfSelectable module.
* @param nfContextMenuRef The nfContextMenu module.
*/
init: function (connectable, draggable, selectable, contextMenu) {
nfConnectable = connectable;
nfDraggable = draggable;
nfSelectable = selectable;
nfContextMenu = contextMenu;
init: function (nfConnectableRef, nfDraggableRef, nfSelectableRef, nfContextMenuRef) {
nfConnectable = nfConnectableRef;
nfDraggable = nfDraggableRef;
nfSelectable = nfSelectableRef;
nfContextMenu = nfContextMenuRef;
funnelMap = d3.map();
removedCache = d3.map();
@ -221,8 +226,8 @@
*/
add: function (funnelEntities, options) {
var selectAll = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
}
// get the current time
@ -243,7 +248,7 @@
$.each(funnelEntities, function (_, funnelEntity) {
add(funnelEntity);
});
} else if (common.isDefinedAndNotNull(funnelEntities)) {
} else if (nfCommon.isDefinedAndNotNull(funnelEntities)) {
add(funnelEntities);
}
@ -262,16 +267,16 @@
set: function (funnelEntities, options) {
var selectAll = false;
var transition = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
transition = common.isDefinedAndNotNull(options.transition) ? options.transition : transition;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition;
}
var set = function (proposedFunnelEntity) {
var currentFunnelEntity = funnelMap.get(proposedFunnelEntity.id);
// set the funnel if appropriate due to revision and wasn't previously removed
if (client.isNewerRevision(currentFunnelEntity, proposedFunnelEntity) && !removedCache.has(proposedFunnelEntity.id)) {
if (nfClient.isNewerRevision(currentFunnelEntity, proposedFunnelEntity) && !removedCache.has(proposedFunnelEntity.id)) {
funnelMap.set(proposedFunnelEntity.id, $.extend({
type: 'Funnel',
dimensions: dimensions
@ -294,14 +299,14 @@
$.each(funnelEntities, function (_, funnelEntity) {
set(funnelEntity);
});
} else if (common.isDefinedAndNotNull(funnelEntities)) {
} else if (nfCommon.isDefinedAndNotNull(funnelEntities)) {
set(funnelEntities);
}
// apply the selection and handle all new processors
var selection = select();
selection.enter().call(renderFunnels, selectAll);
selection.call(updateFunnels).call(canvasUtils.position, transition);
selection.call(updateFunnels).call(nfCanvasUtils.position, transition);
selection.exit().call(removeFunnels);
},
@ -312,7 +317,7 @@
* @param {string} id
*/
get: function (id) {
if (common.isUndefined(id)) {
if (nfCommon.isUndefined(id)) {
return funnelMap.values();
} else {
return funnelMap.get(id);
@ -326,7 +331,7 @@
* @param {string} id Optional
*/
refresh: function (id) {
if (common.isDefinedAndNotNull(id)) {
if (nfCommon.isDefinedAndNotNull(id)) {
d3.select('#id-' + id).call(updateFunnels);
} else {
d3.selectAll('g.funnel').call(updateFunnels);
@ -358,7 +363,7 @@
* @param {string} id The id
*/
position: function (id) {
d3.select('#id-' + id).call(canvasUtils.position);
d3.select('#id-' + id).call(nfCanvasUtils.position);
},
/**

View File

@ -25,8 +25,8 @@
define(['jquery',
'nf.ErrorHandler',
'nf.CanvasUtils'],
function ($, errorHandler, canvasUtils) {
return (nf.GoTo = factory($, errorHandler, canvasUtils));
function ($, nfErrorHandler, nfCanvasUtils) {
return (nf.GoTo = factory($, nfErrorHandler, nfCanvasUtils));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.GoTo =
@ -38,7 +38,7 @@
root.nf.ErrorHandler,
root.nf.CanvasUtils);
}
}(this, function ($, errorHandler, canvasUtils) {
}(this, function ($, nfErrorHandler, nfCanvasUtils) {
'use strict';
var config = {
@ -76,7 +76,7 @@
var connectionStyle = 'unset';
var connectionName = 'Connection';
if (connectionEntity.permissions.canRead === true) {
var formattedConnectionName = canvasUtils.formatConnectionName(connectionEntity.component);
var formattedConnectionName = nfCanvasUtils.formatConnectionName(connectionEntity.component);
if (formattedConnectionName !== '') {
connectionStyle = '';
connectionName = formattedConnectionName;
@ -87,7 +87,7 @@
$('<div class="search-result-icon icon-connect"></div>').appendTo(connectionEntry);
$('<div class="connection-entry-name go-to-link"></div>').attr('title', connectionName).addClass(connectionStyle).text(connectionName).on('click', function () {
// go to the connection
canvasUtils.showComponent(parentProcessGroupId, connectionEntity.id);
nfCanvasUtils.showComponent(parentProcessGroupId, connectionEntity.id);
// close the dialog
$('#connections-dialog').modal('hide');
@ -136,7 +136,7 @@
$('<div class="search-result-icon"></div>').addClass(smallIconClass).appendTo(downstreamComponent);
$('<div class="destination-component-name go-to-link"></div>').attr('title', destinationName).text(destinationName).on('click', function () {
// go to the component
canvasUtils.showComponent(connectionEntity.destinationGroupId, connectionEntity.destinationId);
nfCanvasUtils.showComponent(connectionEntity.destinationGroupId, connectionEntity.destinationId);
// close the dialog
$('#connections-dialog').modal('hide');
@ -171,7 +171,7 @@
$('<div class="search-result-icon icon-group"></div>').appendTo(downstreamComponent);
$('<div class="destination-component-name go-to-link"></div>').attr('title', groupLabel).text(groupLabel).on('click', function () {
// go to the remote process group
canvasUtils.showComponent(parentProcessGroupId, processGroupEntity.id);
nfCanvasUtils.showComponent(parentProcessGroupId, processGroupEntity.id);
// close the dialog
$('#connections-dialog').modal('hide');
@ -193,7 +193,7 @@
$('<div class="search-result-icon icon-port-in"></div>').appendTo(downstreamInputPort);
$('<div class="destination-input-port-name go-to-link"></div>').attr('title', portLabel).text(portLabel).on('click', function () {
// go to the remote process group
canvasUtils.showComponent(connectionEntity.destinationGroupId, connectionEntity.destinationId);
nfCanvasUtils.showComponent(connectionEntity.destinationGroupId, connectionEntity.destinationId);
// close the dialog
$('#connections-dialog').modal('hide');
@ -228,7 +228,7 @@
$('<div class="search-result-icon icon-group-remote"></div>').appendTo(downstreamComponent);
$('<div class="destination-component-name go-to-link"></div>').attr('title', remoteGroupLabel).text(remoteGroupLabel).on('click', function () {
// go to the remote process group
canvasUtils.showComponent(parentProcessGroupId, remoteProcessGroupEntity.id);
nfCanvasUtils.showComponent(parentProcessGroupId, remoteProcessGroupEntity.id);
// close the dialog
$('#connections-dialog').modal('hide');
@ -282,7 +282,7 @@
$('<div class="search-result-icon"></div>').addClass(smallIconClass).appendTo(sourceComponent);
$('<div class="source-component-name go-to-link"></div>').attr('title', sourceName).text(sourceName).on('click', function () {
// go to the component
canvasUtils.showComponent(connectionEntity.sourceGroupId, connectionEntity.sourceId);
nfCanvasUtils.showComponent(connectionEntity.sourceGroupId, connectionEntity.sourceId);
// close the dialog
$('#connections-dialog').modal('hide');
@ -317,7 +317,7 @@
$('<div class="search-result-icon icon-group"></div>').appendTo(sourceComponent);
$('<div class="source-component-name go-to-link"></div>').attr('title', groupLabel).text(groupLabel).on('click', function () {
// go to the process group
canvasUtils.showComponent(parentProcessGroupId, processGroupEntity.id);
nfCanvasUtils.showComponent(parentProcessGroupId, processGroupEntity.id);
// close the dialog
$('#connections-dialog').modal('hide');
@ -338,7 +338,7 @@
$('<div class="search-result-icon icon-port-out"></div>').appendTo(sourceOutputPort);
$('<div class="source-output-port-name go-to-link"></div>').attr('title', portLabel).text(portLabel).on('click', function () {
// go to the output port
canvasUtils.showComponent(connectionEntity.sourceGroupId, connectionEntity.sourceId);
nfCanvasUtils.showComponent(connectionEntity.sourceGroupId, connectionEntity.sourceId);
// close the dialog
$('#connections-dialog').modal('hide');
@ -373,7 +373,7 @@
$('<div class="search-result-icon icon-group-remote"></div>').appendTo(sourceComponent);
$('<div class="source-component-name go-to-link"></div>').attr('title', remoteGroupLabel).text(remoteGroupLabel).on('click', function () {
// go to the remote process group
canvasUtils.showComponent(parentProcessGroupId, remoteProcessGroupEntity.id);
nfCanvasUtils.showComponent(parentProcessGroupId, remoteProcessGroupEntity.id);
// close the dialog
$('#connections-dialog').modal('hide');
@ -451,9 +451,9 @@
*/
showDownstreamFromProcessor: function (selection) {
var processorEntity = selection.datum();
var connections = canvasUtils.getComponentByType('Connection').get();
var processGroups = canvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = canvasUtils.getComponentByType('RemoteProcessGroup').get();
var connections = nfCanvasUtils.getComponentByType('Connection').get();
var processGroups = nfCanvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = nfCanvasUtils.getComponentByType('RemoteProcessGroup').get();
var processorLabel = getDisplayName(processorEntity);
@ -471,7 +471,7 @@
$.each(connections, function (_, connectionEntity) {
// only show connections for which this selection is the source
if (connectionEntity.sourceId === processorEntity.id) {
addConnection(canvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
addConnection(nfCanvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
}
});
@ -491,9 +491,9 @@
*/
showUpstreamFromProcessor: function (selection) {
var processorEntity = selection.datum();
var connections = canvasUtils.getComponentByType('Connection').get();
var processGroups = canvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = canvasUtils.getComponentByType('RemoteProcessGroup').get();
var connections = nfCanvasUtils.getComponentByType('Connection').get();
var processGroups = nfCanvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = nfCanvasUtils.getComponentByType('RemoteProcessGroup').get();
var processorLabel = getDisplayName(processorEntity);
@ -511,7 +511,7 @@
$.each(connections, function (_, connectionEntity) {
// only show connections for which this selection is the destination
if (connectionEntity.destinationId === processorEntity.id) {
addConnection(canvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
addConnection(nfCanvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
}
});
@ -531,12 +531,12 @@
*/
showDownstreamFromGroup: function (selection) {
var groupEntity = selection.datum();
var connections = canvasUtils.getComponentByType('Connection').get();
var processGroups = canvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = canvasUtils.getComponentByType('RemoteProcessGroup').get();
var connections = nfCanvasUtils.getComponentByType('Connection').get();
var processGroups = nfCanvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = nfCanvasUtils.getComponentByType('RemoteProcessGroup').get();
var iconStyle = 'icon-group';
if (canvasUtils.isRemoteProcessGroup(selection)) {
if (nfCanvasUtils.isRemoteProcessGroup(selection)) {
iconStyle = 'icon-group-remote';
}
@ -556,7 +556,7 @@
$.each(connections, function (_, connectionEntity) {
// only show connections for which this selection is the source
if (connectionEntity.sourceGroupId === groupEntity.id) {
addConnection(canvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
addConnection(nfCanvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
}
});
@ -576,12 +576,12 @@
*/
showUpstreamFromGroup: function (selection) {
var groupEntity = selection.datum();
var connections = canvasUtils.getComponentByType('Connection').get();
var processGroups = canvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = canvasUtils.getComponentByType('RemoteProcessGroup').get();
var connections = nfCanvasUtils.getComponentByType('Connection').get();
var processGroups = nfCanvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = nfCanvasUtils.getComponentByType('RemoteProcessGroup').get();
var iconStyle = 'icon-group';
if (canvasUtils.isRemoteProcessGroup(selection)) {
if (nfCanvasUtils.isRemoteProcessGroup(selection)) {
iconStyle = 'icon-group-remote';
}
@ -601,7 +601,7 @@
$.each(connections, function (_, connectionEntity) {
// only show connections for which this selection is the destination
if (connectionEntity.destinationGroupId === groupEntity.id) {
addConnection(canvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
addConnection(nfCanvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
}
});
@ -621,9 +621,9 @@
*/
showDownstreamFromInputPort: function (selection) {
var portEntity = selection.datum();
var connections = canvasUtils.getComponentByType('Connection').get();
var processGroups = canvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = canvasUtils.getComponentByType('RemoteProcessGroup').get();
var connections = nfCanvasUtils.getComponentByType('Connection').get();
var processGroups = nfCanvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = nfCanvasUtils.getComponentByType('RemoteProcessGroup').get();
var portLabel = getDisplayName(portEntity);
@ -641,7 +641,7 @@
$.each(connections, function (_, connectionEntity) {
// only show connections for which this selection is the source
if (connectionEntity.sourceId === portEntity.id) {
addConnection(canvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
addConnection(nfCanvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
}
});
@ -664,7 +664,7 @@
$.ajax({
type: 'GET',
url: config.urls.processGroups + encodeURIComponent(canvasUtils.getParentGroupId()),
url: config.urls.processGroups + encodeURIComponent(nfCanvasUtils.getParentGroupId()),
dataType: 'json'
}).done(function (response) {
var flow = response.processGroupFlow.flow;
@ -681,7 +681,7 @@
// populate the upstream dialog
$('#connections-context')
.append('<div class="search-result-icon icon-group"></div>')
.append($('<div class="connections-component-name"></div>').text(canvasUtils.getGroupName()))
.append($('<div class="connections-component-name"></div>').text(nfCanvasUtils.getGroupName()))
.append('<div class="clear"></div>')
.append('<div class="search-result-icon icon-port-in" style="margin-left: 20px;"></div>')
.append($('<div class="connections-component-name"></div>').text(portLabel))
@ -691,7 +691,7 @@
$.each(connections, function (_, connectionEntity) {
// only show connections for which this selection is the destination
if (connectionEntity.destinationId === portEntity.id) {
addConnection(canvasUtils.getParentGroupId(), connectionEntity, processGroups, remoteProcessGroups);
addConnection(nfCanvasUtils.getParentGroupId(), connectionEntity, processGroups, remoteProcessGroups);
}
});
@ -702,7 +702,7 @@
// show the upstream dialog
$('#connections-dialog').modal('setHeaderText', 'Upstream Connections').modal('show');
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
},
/**
@ -715,7 +715,7 @@
$.ajax({
type: 'GET',
url: config.urls.processGroups + encodeURIComponent(canvasUtils.getParentGroupId()),
url: config.urls.processGroups + encodeURIComponent(nfCanvasUtils.getParentGroupId()),
dataType: 'json'
}).done(function (response) {
var flow = response.processGroupFlow.flow;
@ -732,7 +732,7 @@
// populate the downstream dialog
$('#connections-context')
.append('<div class="search-result-icon icon-group"></div>')
.append($('<div class="connections-component-name"></div>').text(canvasUtils.getGroupName()))
.append($('<div class="connections-component-name"></div>').text(nfCanvasUtils.getGroupName()))
.append('<div class="clear"></div>')
.append('<div class="search-result-icon icon-port-out" style="margin-left: 20px;"></div>')
.append($('<div class="connections-component-name"></div>').text(portLabel))
@ -742,7 +742,7 @@
$.each(connections, function (_, connectionEntity) {
// only show connections for which this selection is the source
if (connectionEntity.sourceId === portEntity.id) {
addConnection(canvasUtils.getParentGroupId(), connectionEntity, processGroups, remoteProcessGroups);
addConnection(nfCanvasUtils.getParentGroupId(), connectionEntity, processGroups, remoteProcessGroups);
}
});
@ -753,7 +753,7 @@
// show the downstream dialog
$('#connections-dialog').modal('setHeaderText', 'Downstream Connections').modal('show');
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
},
/**
@ -763,9 +763,9 @@
*/
showUpstreamFromOutputPort: function (selection) {
var portEntity = selection.datum();
var connections = canvasUtils.getComponentByType('Connection').get();
var processGroups = canvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = canvasUtils.getComponentByType('RemoteProcessGroup').get();
var connections = nfCanvasUtils.getComponentByType('Connection').get();
var processGroups = nfCanvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = nfCanvasUtils.getComponentByType('RemoteProcessGroup').get();
var portLabel = getDisplayName(portEntity);
@ -783,7 +783,7 @@
$.each(connections, function (_, connectionEntity) {
// only show connections for which this selection is the destination
if (connectionEntity.destinationId === portEntity.id) {
addConnection(canvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
addConnection(nfCanvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
}
});
@ -803,9 +803,9 @@
*/
showDownstreamFromFunnel: function (selection) {
var funnelEntity = selection.datum();
var connections = canvasUtils.getComponentByType('Connection').get();
var processGroups = canvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = canvasUtils.getComponentByType('RemoteProcessGroup').get();
var connections = nfCanvasUtils.getComponentByType('Connection').get();
var processGroups = nfCanvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = nfCanvasUtils.getComponentByType('RemoteProcessGroup').get();
// record details of the current component
currentComponentId = funnelEntity.id;
@ -821,7 +821,7 @@
$.each(connections, function (_, connectionEntity) {
// only show connections for which this selection is the source
if (connectionEntity.sourceId === funnelEntity.id) {
addConnection(canvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
addConnection(nfCanvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
}
});
@ -841,9 +841,9 @@
*/
showUpstreamFromFunnel: function (selection) {
var funnelEntity = selection.datum();
var connections = canvasUtils.getComponentByType('Connection').get();
var processGroups = canvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = canvasUtils.getComponentByType('RemoteProcessGroup').get();
var connections = nfCanvasUtils.getComponentByType('Connection').get();
var processGroups = nfCanvasUtils.getComponentByType('ProcessGroup').get();
var remoteProcessGroups = nfCanvasUtils.getComponentByType('RemoteProcessGroup').get();
// record details of the current component
currentComponentId = funnelEntity.id;
@ -859,7 +859,7 @@
$.each(connections, function (_, connectionEntity) {
// only show connections for which this selection is the destination
if (connectionEntity.destinationId === funnelEntity.id) {
addConnection(canvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
addConnection(nfCanvasUtils.getGroupId(), connectionEntity, processGroups, remoteProcessGroups);
}
});

View File

@ -35,8 +35,8 @@
'nf.Draggable',
'nf.Selectable',
'nf.ContextMenu'],
function ($, d3, common, angularBridge, nfLabel, nfFunnel, nfPort, nfRemoteProcessGroup, nfProcessGroup, nfProcessor, nfConnection, canvasUtils, connectable, draggable, selectable, contextMenu) {
return (nf.Graph = factory($, d3, common, angularBridge, nfLabel, nfFunnel, nfPort, nfRemoteProcessGroup, nfProcessGroup, nfProcessor, nfConnection, canvasUtils, connectable, draggable, selectable, contextMenu));
function ($, d3, nfCommon, nfNgBridge, nfLabel, nfFunnel, nfPort, nfRemoteProcessGroup, nfProcessGroup, nfProcessor, nfConnection, nfCanvasUtils, nfConnectable, nfDraggable, nfSelectable, nfContextMenu) {
return (nf.Graph = factory($, d3, nfCommon, nfNgBridge, nfLabel, nfFunnel, nfPort, nfRemoteProcessGroup, nfProcessGroup, nfProcessor, nfConnection, nfCanvasUtils, nfConnectable, nfDraggable, nfSelectable, nfContextMenu));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Graph =
@ -74,15 +74,15 @@
root.nf.Selectable,
root.nf.ContextMenu);
}
}(this, function ($, d3, common, angularBridge, nfLabel, nfFunnel, nfPort, nfRemoteProcessGroup, nfProcessGroup, nfProcessor, nfConnection, canvasUtils, connectable, draggable, selectable, contextMenu) {
}(this, function ($, d3, nfCommon, nfNgBridge, nfLabel, nfFunnel, nfPort, nfRemoteProcessGroup, nfProcessGroup, nfProcessor, nfConnection, nfCanvasUtils, nfConnectable, nfDraggable, nfSelectable, nfContextMenu) {
'use strict';
var combinePorts = function (contents) {
if (common.isDefinedAndNotNull(contents.inputPorts) && common.isDefinedAndNotNull(contents.outputPorts)) {
if (nfCommon.isDefinedAndNotNull(contents.inputPorts) && nfCommon.isDefinedAndNotNull(contents.outputPorts)) {
return contents.inputPorts.concat(contents.outputPorts);
} else if (common.isDefinedAndNotNull(contents.inputPorts)) {
} else if (nfCommon.isDefinedAndNotNull(contents.inputPorts)) {
return contents.inputPorts;
} else if (common.isDefinedAndNotNull(contents.outputPorts)) {
} else if (nfCommon.isDefinedAndNotNull(contents.outputPorts)) {
return contents.outputPorts;
} else {
return [];
@ -90,11 +90,11 @@
};
var combinePortStatus = function (status) {
if (common.isDefinedAndNotNull(status.inputPortStatusSnapshots) && common.isDefinedAndNotNull(status.outputPortStatusSnapshots)) {
if (nfCommon.isDefinedAndNotNull(status.inputPortStatusSnapshots) && nfCommon.isDefinedAndNotNull(status.outputPortStatusSnapshots)) {
return status.inputPortStatusSnapshots.concat(status.outputPortStatusSnapshots);
} else if (common.isDefinedAndNotNull(status.inputPortStatusSnapshots)) {
} else if (nfCommon.isDefinedAndNotNull(status.inputPortStatusSnapshots)) {
return status.inputPortStatusSnapshots;
} else if (common.isDefinedAndNotNull(status.outputPortStatusSnapshots)) {
} else if (nfCommon.isDefinedAndNotNull(status.outputPortStatusSnapshots)) {
return status.outputPortStatusSnapshots;
} else {
return [];
@ -106,8 +106,8 @@
*/
var updateComponentVisibility = function () {
var canvasContainer = $('#canvas-container');
var translate = canvasUtils.translateCanvasView();
var scale = canvasUtils.scaleCanvasView();
var translate = nfCanvasUtils.translateCanvasView();
var scale = nfCanvasUtils.scaleCanvasView();
// scale the translation
translate = [translate[0] / scale, translate[1] / scale];
@ -124,7 +124,7 @@
// detects whether a component is visible and should be rendered
var isComponentVisible = function (d) {
if (!canvasUtils.shouldRenderPerScale()) {
if (!nfCanvasUtils.shouldRenderPerScale()) {
return false;
}
@ -139,7 +139,7 @@
// detects whether a connection is visible and should be rendered
var isConnectionVisible = function (d) {
if (!canvasUtils.shouldRenderPerScale()) {
if (!nfCanvasUtils.shouldRenderPerScale()) {
return false;
}
@ -195,16 +195,16 @@
var nfGraph = {
init: function () {
// initialize the object responsible for each type of component
nfLabel.init(connectable, draggable, selectable, contextMenu);
nfFunnel.init(connectable, draggable, selectable, contextMenu);
nfPort.init(connectable, draggable, selectable, contextMenu);
nfRemoteProcessGroup.init(connectable, draggable, selectable, contextMenu);
nfProcessGroup.init(connectable, draggable, selectable, contextMenu);
nfProcessor.init(connectable, draggable, selectable, contextMenu);
nfConnection.init(selectable, contextMenu);
nfLabel.init(nfConnectable, nfDraggable, nfSelectable, nfContextMenu);
nfFunnel.init(nfConnectable, nfDraggable, nfSelectable, nfContextMenu);
nfPort.init(nfConnectable, nfDraggable, nfSelectable, nfContextMenu);
nfRemoteProcessGroup.init(nfConnectable, nfDraggable, nfSelectable, nfContextMenu);
nfProcessGroup.init(nfConnectable, nfDraggable, nfSelectable, nfContextMenu);
nfProcessor.init(nfConnectable, nfDraggable, nfSelectable, nfContextMenu);
nfConnection.init(nfSelectable, nfContextMenu);
// load the graph
return nfProcessGroup.enterGroup(canvasUtils.getGroupId());
return nfProcessGroup.enterGroup(nfCanvasUtils.getGroupId());
},
/**
@ -215,13 +215,13 @@
*/
add: function (processGroupContents, options) {
var selectAll = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
}
// if we are going to select the new components, deselect the previous selection
if (selectAll) {
canvasUtils.getSelection().classed('selected', false);
nfCanvasUtils.getSelection().classed('selected', false);
}
// merge the ports together
@ -238,7 +238,7 @@
// inform Angular app if the selection is changing
if (selectAll) {
angularBridge.digest();
nfNgBridge.digest();
}
},
@ -250,13 +250,13 @@
*/
set: function (processGroupContents, options) {
var selectAll = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
}
// if we are going to select the new components, deselect the previous selection
if (selectAll) {
canvasUtils.getSelection().classed('selected', false);
nfCanvasUtils.getSelection().classed('selected', false);
}
// merge the ports together
@ -273,7 +273,7 @@
// inform Angular app if the selection is changing
if (selectAll) {
angularBridge.digest();
nfNgBridge.digest();
}
},
@ -405,11 +405,11 @@
reload: function (component) {
var componentData = component.datum();
if (componentData.permissions.canRead) {
if (canvasUtils.isProcessor(component)) {
if (nfCanvasUtils.isProcessor(component)) {
nfProcessor.reload(componentData.id);
} else if (canvasUtils.isInputPort(component)) {
} else if (nfCanvasUtils.isInputPort(component)) {
nfPort.reload(componentData.id);
} else if (canvasUtils.isRemoteProcessGroup(component)) {
} else if (nfCanvasUtils.isRemoteProcessGroup(component)) {
nfRemoteProcessGroup.reload(componentData.id);
}
}

View File

@ -27,8 +27,8 @@
'nf.CanvasUtils',
'nf.ng.Bridge',
'nf.Label'],
function ($, d3, errorHandler, common, client, canvasUtils, angularBridge, label) {
return (nf.LabelConfiguration = factory($, d3, errorHandler, common, client, canvasUtils, angularBridge, label));
function ($, d3, nfErrorHandler, nfCommon, nfClient, nfCanvasUtils, nfNgBridge, nfLabel) {
return (nf.LabelConfiguration = factory($, d3, nfErrorHandler, nfCommon, nfClient, nfCanvasUtils, nfNgBridge, nfLabel));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.LabelConfiguration =
@ -50,7 +50,7 @@
root.nf.ng.Bridge,
root.nf.Label);
}
}(this, function ($, d3, errorHandler, common, client, canvasUtils, angularBridge, label) {
}(this, function ($, d3, nfErrorHandler, nfCommon, nfClient, nfCanvasUtils, nfNgBridge, nfLabel) {
'use strict';
var labelId = '';
@ -82,7 +82,7 @@
// build the label entity
var labelEntity = {
'revision': client.getRevision(labelData),
'revision': nfClient.getRevision(labelData),
'component': {
'id': labelId,
'label': labelValue,
@ -101,11 +101,11 @@
contentType: 'application/json'
}).done(function (response) {
// get the label out of the response
label.set(response);
nfLabel.set(response);
// inform Angular app values have changed
angularBridge.digest();
}).fail(errorHandler.handleAjaxError);
nfNgBridge.digest();
}).fail(nfErrorHandler.handleAjaxError);
// reset and hide the dialog
this.modal('hide');
@ -166,18 +166,18 @@
* @argument {selection} selection The selection
*/
showConfiguration: function (selection) {
if (canvasUtils.isLabel(selection)) {
if (nfCanvasUtils.isLabel(selection)) {
var selectionData = selection.datum();
// get the label value
var labelValue = '';
if (common.isDefinedAndNotNull(selectionData.component.label)) {
if (nfCommon.isDefinedAndNotNull(selectionData.component.label)) {
labelValue = selectionData.component.label;
}
// get the font size
var fontSize = '12px';
if (common.isDefinedAndNotNull(selectionData.component.style['font-size'])) {
if (nfCommon.isDefinedAndNotNull(selectionData.component.style['font-size'])) {
fontSize = selectionData.component.style['font-size'];
}

View File

@ -24,8 +24,8 @@
'nf.Common',
'nf.Client',
'nf.CanvasUtils'],
function ($, d3, common, client, canvasUtils) {
return (nf.Label = factory($, d3, common, client, canvasUtils));
function ($, d3, nfCommon, nfClient, nfCanvasUtils) {
return (nf.Label = factory($, d3, nfCommon, nfClient, nfCanvasUtils));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Label =
@ -41,7 +41,7 @@
root.nf.Client,
root.nf.CanvasUtils);
}
}(this, function ($, d3, common, client, canvasUtils) {
}(this, function ($, d3, nfCommon, nfClient, nfCanvasUtils) {
'use strict';
var nfConnectable;
@ -114,7 +114,7 @@
'class': 'label component'
})
.classed('selected', selected)
.call(canvasUtils.position);
.call(nfCanvasUtils.position);
// label border
label.append('rect')
@ -187,7 +187,7 @@
var color = nfLabel.defaultColor();
// use the specified color if appropriate
if (common.isDefinedAndNotNull(d.component.style['background-color'])) {
if (nfCommon.isDefinedAndNotNull(d.component.style['background-color'])) {
color = d.component.style['background-color'];
}
@ -202,7 +202,7 @@
var label = d3.select(this);
// update the component behavior as appropriate
canvasUtils.editable(label, nfConnectable, nfDraggable);
nfCanvasUtils.editable(label, nfConnectable, nfDraggable);
// update the label
var labelText = label.select('text.label-value');
@ -213,7 +213,7 @@
var fontSize = '12px';
// use the specified color if appropriate
if (common.isDefinedAndNotNull(d.component.style['font-size'])) {
if (nfCommon.isDefinedAndNotNull(d.component.style['font-size'])) {
fontSize = d.component.style['font-size'];
}
@ -225,7 +225,7 @@
// parse the lines in this label
var lines = [];
if (common.isDefinedAndNotNull(d.component.label)) {
if (nfCommon.isDefinedAndNotNull(d.component.label)) {
lines = d.component.label.split('\n');
} else {
lines.push('');
@ -234,7 +234,7 @@
var color = nfLabel.defaultColor();
// use the specified color if appropriate
if (common.isDefinedAndNotNull(d.component.style['background-color'])) {
if (nfCommon.isDefinedAndNotNull(d.component.style['background-color'])) {
color = d.component.style['background-color'];
}
@ -247,8 +247,8 @@
return line;
})
.style('fill', function (d) {
return common.determineContrastColor(
common.substringAfterLast(
return nfCommon.determineContrastColor(
nfCommon.substringAfterLast(
color, '#'));
});
});
@ -308,12 +308,17 @@
/**
* Initializes of the Processor handler.
*
* @param nfConnectableRef The nfConnectable module.
* @param nfDraggableRef The nfDraggable module.
* @param nfSelectableRef The nfSelectable module.
* @param nfContextMenuRef The nfContextMenu module.
*/
init: function (connectable, draggable, selectable, contextMenu) {
nfConnectable = connectable;
nfDraggable = draggable;
nfSelectable = selectable;
nfContextMenu = contextMenu;
init: function (nfConnectableRef, nfDraggableRef, nfSelectableRef, nfContextMenuRef) {
nfConnectable = nfConnectableRef;
nfDraggable = nfDraggableRef;
nfSelectable = nfSelectableRef;
nfContextMenu = nfContextMenuRef;
labelMap = d3.map();
removedCache = d3.map();
@ -349,19 +354,19 @@
// determine if the width has changed
var different = false;
if (common.isDefinedAndNotNull(labelData.component.width) || labelData.dimensions.width !== labelData.component.width) {
if (nfCommon.isDefinedAndNotNull(labelData.component.width) || labelData.dimensions.width !== labelData.component.width) {
different = true;
}
// determine if the height has changed
if (!different && common.isDefinedAndNotNull(labelData.component.height) || labelData.dimensions.height !== labelData.component.height) {
if (!different && nfCommon.isDefinedAndNotNull(labelData.component.height) || labelData.dimensions.height !== labelData.component.height) {
different = true;
}
// only save the updated bends if necessary
if (different) {
var labelEntity = {
'revision': client.getRevision(labelData),
'revision': nfClient.getRevision(labelData),
'component': {
'id': labelData.id,
'width': labelData.dimensions.width,
@ -381,13 +386,13 @@
}).fail(function () {
// determine the previous width
var width = dimensions.width;
if (common.isDefinedAndNotNull(labelData.component.width)) {
if (nfCommon.isDefinedAndNotNull(labelData.component.width)) {
width = labelData.component.width;
}
// determine the previous height
var height = dimensions.height;
if (common.isDefinedAndNotNull(labelData.component.height)) {
if (nfCommon.isDefinedAndNotNull(labelData.component.height)) {
height = labelData.component.height;
}
@ -415,8 +420,8 @@
*/
add: function (labelEntities, options) {
var selectAll = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
}
// get the current time
@ -436,7 +441,7 @@
$.each(labelEntities, function (_, labelEntity) {
add(labelEntity);
});
} else if (common.isDefinedAndNotNull(labelEntities)) {
} else if (nfCommon.isDefinedAndNotNull(labelEntities)) {
add(labelEntities);
}
@ -455,16 +460,16 @@
set: function (labelEntities, options) {
var selectAll = false;
var transition = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
transition = common.isDefinedAndNotNull(options.transition) ? options.transition : transition;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition;
}
var set = function (proposedLabelEntity) {
var currentLabelEntity = labelMap.get(proposedLabelEntity.id);
// set the processor if appropriate due to revision and wasn't previously removed
if (client.isNewerRevision(currentLabelEntity, proposedLabelEntity) && !removedCache.has(proposedLabelEntity.id)) {
if (nfClient.isNewerRevision(currentLabelEntity, proposedLabelEntity) && !removedCache.has(proposedLabelEntity.id)) {
labelMap.set(proposedLabelEntity.id, $.extend({
type: 'Label'
}, proposedLabelEntity));
@ -486,14 +491,14 @@
$.each(labelEntities, function (_, labelEntity) {
set(labelEntity);
});
} else if (common.isDefinedAndNotNull(labelEntities)) {
} else if (nfCommon.isDefinedAndNotNull(labelEntities)) {
set(labelEntities);
}
// apply the selection and handle all new labels
var selection = select();
selection.enter().call(renderLabels, selectAll);
selection.call(updateLabels).call(canvasUtils.position, transition);
selection.call(updateLabels).call(nfCanvasUtils.position, transition);
selection.exit().call(removeLabels);
},
@ -504,7 +509,7 @@
* @param {string} id
*/
get: function (id) {
if (common.isUndefined(id)) {
if (nfCommon.isUndefined(id)) {
return labelMap.values();
} else {
return labelMap.get(id);
@ -518,7 +523,7 @@
* @param {string} id Optional
*/
refresh: function (id) {
if (common.isDefinedAndNotNull(id)) {
if (nfCommon.isDefinedAndNotNull(id)) {
d3.select('#id-' + id).call(updateLabels);
} else {
d3.selectAll('g.label').call(updateLabels);
@ -550,7 +555,7 @@
* @param {string} id The id
*/
position: function (id) {
d3.select('#id-' + id).call(canvasUtils.position);
d3.select('#id-' + id).call(nfCanvasUtils.position);
},
/**

View File

@ -28,8 +28,8 @@
'nf.ng.Bridge',
'nf.Dialog',
'nf.Shell'],
function ($, Slick, errorHandler, common, client, canvasUtils, angularBridge, dialog, shell) {
return (nf.PolicyManagement = factory($, Slick, errorHandler, common, client, canvasUtils, angularBridge, dialog, shell));
function ($, Slick, nfErrorHandler, nfCommon, nfClient, nfCanvasUtils, nfNgBridge, nfDialog, nfShell) {
return (nf.PolicyManagement = factory($, Slick, nfErrorHandler, nfCommon, nfClient, nfCanvasUtils, nfNgBridge, nfDialog, nfShell));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.PolicyManagement =
@ -53,7 +53,7 @@
root.nf.Dialog,
root.nf.Shell);
}
}(this, function ($, Slick, errorHandler, common, client, canvasUtils, angularBridge, dialog, shell) {
}(this, function ($, Slick, nfErrorHandler, nfCommon, nfClient, nfCanvasUtils, nfNgBridge, nfDialog, nfShell) {
'use strict';
var config = {
@ -277,7 +277,7 @@
// also consider groups already selected in the search users dialog
container.children('li').each(function (_, allowedTenant) {
var tenant = $(allowedTenant).data('tenant');
if (common.isDefinedAndNotNull(tenant)) {
if (nfCommon.isDefinedAndNotNull(tenant)) {
tenants.push(tenant);
}
});
@ -381,16 +381,16 @@
// policy type listing
$('#policy-type-list').combo({
options: [
common.getPolicyTypeListing('flow'),
common.getPolicyTypeListing('controller'),
common.getPolicyTypeListing('provenance'),
common.getPolicyTypeListing('restricted-components'),
common.getPolicyTypeListing('policies'),
common.getPolicyTypeListing('tenants'),
common.getPolicyTypeListing('site-to-site'),
common.getPolicyTypeListing('system'),
common.getPolicyTypeListing('proxy'),
common.getPolicyTypeListing('counters')],
nfCommon.getPolicyTypeListing('flow'),
nfCommon.getPolicyTypeListing('controller'),
nfCommon.getPolicyTypeListing('provenance'),
nfCommon.getPolicyTypeListing('restricted-components'),
nfCommon.getPolicyTypeListing('policies'),
nfCommon.getPolicyTypeListing('tenants'),
nfCommon.getPolicyTypeListing('site-to-site'),
nfCommon.getPolicyTypeListing('system'),
nfCommon.getPolicyTypeListing('proxy'),
nfCommon.getPolicyTypeListing('counters')],
select: function (option) {
if (initialized) {
// record the policy type
@ -636,8 +636,8 @@
// defines a function for sorting
var comparer = function (a, b) {
if(a.permissions.canRead && b.permissions.canRead) {
var aString = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : '';
var bString = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : '';
var aString = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : '';
var bString = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : '';
return aString === bString ? 0 : aString > bString ? 1 : -1;
} else {
if (!a.permissions.canRead && !b.permissions.canRead){
@ -661,9 +661,9 @@
* @param item
*/
var promptToRemoveUserFromPolicy = function (item) {
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'Update Policy',
dialogContent: 'Remove \'' + common.escapeHtml(item.component.identity) + '\' from this policy?',
dialogContent: 'Remove \'' + nfCommon.escapeHtml(item.component.identity) + '\' from this policy?',
yesHandler: function () {
removeUserFromPolicy(item);
}
@ -696,7 +696,7 @@
* Prompts for the deletion of the selected policy.
*/
var promptToDeletePolicy = function () {
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'Delete Policy',
dialogContent: 'By deleting this policy, the permissions for this component will revert to the inherited policy if applicable.',
yesText: 'Delete',
@ -713,20 +713,20 @@
var deletePolicy = function () {
var currentEntity = $('#policy-table').data('policy');
if (common.isDefinedAndNotNull(currentEntity)) {
if (nfCommon.isDefinedAndNotNull(currentEntity)) {
$.ajax({
type: 'DELETE',
url: currentEntity.uri + '?' + $.param(client.getRevision(currentEntity)),
url: currentEntity.uri + '?' + $.param(nfClient.getRevision(currentEntity)),
dataType: 'json'
}).done(function () {
loadPolicy();
}).fail(function (xhr, status, error) {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
resetPolicy();
loadPolicy();
});
} else {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Delete Policy',
dialogContent: 'No policy selected'
});
@ -802,11 +802,11 @@
return $('<span>Showing effective policy inherited from the controller.</span>');
} else {
// extract the group id
var processGroupId = common.substringAfterLast(resource, '/');
var processGroupId = nfCommon.substringAfterLast(resource, '/');
var processGroupName = processGroupId;
// attempt to resolve the group name
var breadcrumbs = angularBridge.injector.get('breadcrumbsCtrl').getBreadcrumbs();
var breadcrumbs = nfNgBridge.injector.get('breadcrumbsCtrl').getBreadcrumbs();
$.each(breadcrumbs, function (_, breadcrumbEntity) {
if (breadcrumbEntity.id === processGroupId) {
processGroupName = breadcrumbEntity.label;
@ -824,11 +824,11 @@
$('#shell-close-button').click();
// load the correct group and unselect everything if necessary
canvasUtils.getComponentByType('ProcessGroup').enterGroup(processGroupId).done(function () {
canvasUtils.getSelection().classed('selected', false);
nfCanvasUtils.getComponentByType('ProcessGroup').enterGroup(processGroupId).done(function () {
nfCanvasUtils.getSelection().classed('selected', false);
// inform Angular app that values have changed
angularBridge.digest();
nfNgBridge.digest();
});
})
).append('<span>.</span>');
@ -948,7 +948,7 @@
resetPolicy();
deferred.reject();
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
});
}).promise();
@ -1006,7 +1006,7 @@
resetPolicy();
deferred.reject();
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
});
}).promise();
@ -1045,7 +1045,7 @@
}
var entity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': 0
}
@ -1074,7 +1074,7 @@
resetPolicy();
loadPolicy();
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -1102,9 +1102,9 @@
});
var currentEntity = $('#policy-table').data('policy');
if (common.isDefinedAndNotNull(currentEntity)) {
if (nfCommon.isDefinedAndNotNull(currentEntity)) {
var entity = {
'revision': client.getRevision(currentEntity),
'revision': nfClient.getRevision(currentEntity),
'component': {
'id': currentEntity.id,
'users': users,
@ -1129,16 +1129,16 @@
loadPolicy();
}
}).fail(function (xhr, status, error) {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
resetPolicy();
loadPolicy();
}).always(function () {
canvasUtils.reload({
nfCanvasUtils.reload({
'transition': true
});
});
} else {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Update Policy',
dialogContent: 'No policy selected'
});
@ -1150,7 +1150,7 @@
*/
var showPolicy = function () {
// show the configuration dialog
shell.showContent('#policy-management').always(function () {
nfShell.showContent('#policy-management').always(function () {
reset();
});
@ -1227,7 +1227,7 @@
var policyTable = $('#policy-table');
if (policyTable.is(':visible')) {
var policyGrid = policyTable.data('gridInstance');
if (common.isDefinedAndNotNull(policyGrid)) {
if (nfCommon.isDefinedAndNotNull(policyGrid)) {
policyGrid.resizeCanvas();
}
}
@ -1381,7 +1381,7 @@
var resource;
if (selection.empty()) {
$('#selected-policy-component-id').text(canvasUtils.getGroupId());
$('#selected-policy-component-id').text(nfCanvasUtils.getGroupId());
resource = 'process-groups';
// disable site to site option
@ -1402,19 +1402,19 @@
var d = selection.datum();
$('#selected-policy-component-id').text(d.id);
if (canvasUtils.isProcessor(selection)) {
if (nfCanvasUtils.isProcessor(selection)) {
resource = 'processors';
} else if (canvasUtils.isProcessGroup(selection)) {
} else if (nfCanvasUtils.isProcessGroup(selection)) {
resource = 'process-groups';
} else if (canvasUtils.isInputPort(selection)) {
} else if (nfCanvasUtils.isInputPort(selection)) {
resource = 'input-ports';
} else if (canvasUtils.isOutputPort(selection)) {
} else if (nfCanvasUtils.isOutputPort(selection)) {
resource = 'output-ports';
} else if (canvasUtils.isRemoteProcessGroup(selection)) {
} else if (nfCanvasUtils.isRemoteProcessGroup(selection)) {
resource = 'remote-process-groups';
} else if (canvasUtils.isLabel(selection)) {
} else if (nfCanvasUtils.isLabel(selection)) {
resource = 'labels';
} else if (canvasUtils.isFunnel(selection)) {
} else if (nfCanvasUtils.isFunnel(selection)) {
resource = 'funnels';
}
@ -1422,16 +1422,16 @@
$('#component-policy-target')
.combo('setOptionEnabled', {
value: 'write-receive-data'
}, canvasUtils.isInputPort(selection) && canvasUtils.getParentGroupId() === null)
}, nfCanvasUtils.isInputPort(selection) && nfCanvasUtils.getParentGroupId() === null)
.combo('setOptionEnabled', {
value: 'write-send-data'
}, canvasUtils.isOutputPort(selection) && canvasUtils.getParentGroupId() === null)
}, nfCanvasUtils.isOutputPort(selection) && nfCanvasUtils.getParentGroupId() === null)
.combo('setOptionEnabled', {
value: 'read-data'
}, !canvasUtils.isLabel(selection))
}, !nfCanvasUtils.isLabel(selection))
.combo('setOptionEnabled', {
value: 'write-data'
}, !canvasUtils.isLabel(selection));
}, !nfCanvasUtils.isLabel(selection));
}
// populate the initial resource

View File

@ -28,8 +28,8 @@
'nf.CanvasUtils',
'nf.ng.Bridge',
'nf.Port'],
function ($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, port) {
return (nf.PortConfiguration = factory($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, port));
function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfPort) {
return (nf.PortConfiguration = factory($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfPort));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.PortConfiguration =
@ -53,7 +53,7 @@
root.nf.ng.Bridge,
root.nf.Port);
}
}(this, function ($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, port) {
}(this, function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfPort) {
'use strict';
/**
@ -97,7 +97,7 @@
// build the port entity
var portEntity = {
'revision': client.getRevision(portData),
'revision': nfClient.getRevision(portData),
'component': port
};
@ -110,10 +110,10 @@
contentType: 'application/json'
}).done(function (response) {
// refresh the port component
port.set(response);
nfPort.set(response);
// inform Angular app values have changed
angularBridge.digest();
nfNgBridge.digest();
// close the details panel
$('#port-configuration').modal('hide');
@ -128,10 +128,10 @@
if (errors.length === 1) {
content = $('<span></span>').text(errors[0]);
} else {
content = common.formatUnorderedList(errors);
content = nfCommon.formatUnorderedList(errors);
}
dialog.showOkDialog({
nfDialog.showOkDialog({
dialogContent: content,
headerText: 'Port Configuration'
});
@ -140,7 +140,7 @@
$('#port-configuration').modal('hide');
// handle the error
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
});
}
@ -184,7 +184,7 @@
*/
showConfiguration: function (selection) {
// if the specified component is a port, load its properties
if (canvasUtils.isInputPort(selection) || canvasUtils.isOutputPort(selection)) {
if (nfCanvasUtils.isInputPort(selection) || nfCanvasUtils.isOutputPort(selection)) {
var selectionData = selection.datum();
// determine if the enabled checkbox is checked or not
@ -194,7 +194,7 @@
}
// show concurrent tasks for root groups only
if (canvasUtils.getParentGroupId() === null) {
if (nfCanvasUtils.getParentGroupId() === null) {
$('#port-concurrent-task-container').show();
} else {
$('#port-concurrent-task-container').hide();

View File

@ -22,8 +22,8 @@
define(['jquery',
'nf.Common',
'nf.CanvasUtils'],
function ($, common, canvasUtils) {
return (nf.PortDetails = factory($, common, canvasUtils));
function ($, nfCommon, nfCanvasUtils) {
return (nf.PortDetails = factory($, nfCommon, nfCanvasUtils));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.PortDetails =
@ -35,7 +35,7 @@
root.nf.Common,
root.nf.CanvasUtils);
}
}(this, function ($, common, canvasUtils) {
}(this, function ($, nfCommon, nfCanvasUtils) {
'use strict';
return {
@ -61,9 +61,9 @@
handler: {
close: function () {
// clear the processor details
common.clearField('read-only-port-name');
common.clearField('read-only-port-id');
common.clearField('read-only-port-comments');
nfCommon.clearField('read-only-port-name');
nfCommon.clearField('read-only-port-id');
nfCommon.clearField('read-only-port-comments');
}
}
});
@ -71,13 +71,13 @@
showDetails: function (selection) {
// if the specified component is a processor, load its properties
if (canvasUtils.isInputPort(selection) || canvasUtils.isOutputPort(selection)) {
if (nfCanvasUtils.isInputPort(selection) || nfCanvasUtils.isOutputPort(selection)) {
var selectionData = selection.datum();
// populate the port settings
common.populateField('read-only-port-name', selectionData.component.name);
common.populateField('read-only-port-id', selectionData.id);
common.populateField('read-only-port-comments', selectionData.component.comments);
nfCommon.populateField('read-only-port-name', selectionData.component.name);
nfCommon.populateField('read-only-port-id', selectionData.id);
nfCommon.populateField('read-only-port-comments', selectionData.component.comments);
// show the details
$('#port-details').modal('show');

View File

@ -24,8 +24,8 @@
'nf.Common',
'nf.Client',
'nf.CanvasUtils'],
function ($, d3, common, client, canvasUtils) {
return (nf.Port = factory($, d3, common, client, canvasUtils));
function ($, d3, nfCommon, nfClient, nfCanvasUtils) {
return (nf.Port = factory($, d3, nfCommon, nfClient, nfCanvasUtils));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Port =
@ -41,7 +41,7 @@
root.nf.Client,
root.nf.CanvasUtils);
}
}(this, function ($, d3, common, client, canvasUtils) {
}(this, function ($, d3, nfCommon, nfClient, nfCanvasUtils) {
'use strict';
var nfConnectable;
@ -118,7 +118,7 @@
}
})
.classed('selected', selected)
.call(canvasUtils.position);
.call(nfCanvasUtils.position);
// port border
port.append('rect')
@ -151,7 +151,7 @@
var offset = 0;
// conditionally render the remote banner
if (canvasUtils.getParentGroupId() === null) {
if (nfCanvasUtils.getParentGroupId() === null) {
offset = OFFSET_VALUE;
// port remote banner
@ -227,7 +227,7 @@
var details = port.select('g.port-details');
// update the component behavior as appropriate
canvasUtils.editable(port, nfConnectable, nfDraggable);
nfCanvasUtils.editable(port, nfConnectable, nfDraggable);
// if this process group is visible, render everything
if (port.classed('visible')) {
@ -235,7 +235,7 @@
details = port.append('g').attr('class', 'port-details');
var offset = 0;
if (canvasUtils.getParentGroupId() === null) {
if (nfCanvasUtils.getParentGroupId() === null) {
offset = OFFSET_VALUE;
// port transmitting icon
@ -313,9 +313,9 @@
// handle based on the number of tokens in the port name
if (words.length === 1) {
// apply ellipsis to the port name as necessary
canvasUtils.ellipsis(portName, name);
nfCanvasUtils.ellipsis(portName, name);
} else {
canvasUtils.multilineEllipsis(portName, 2, name);
nfCanvasUtils.multilineEllipsis(portName, 2, name);
}
}).append('title').text(function (d) {
return d.component.name;
@ -407,7 +407,7 @@
var tip = d3.select('#run-status-tip-' + d.id);
// if there are validation errors generate a tooltip
if (d.permissions.canRead && !common.isEmpty(d.component.validationErrors)) {
if (d.permissions.canRead && !nfCommon.isEmpty(d.component.validationErrors)) {
// create the tip if necessary
if (tip.empty()) {
tip = d3.select('#port-tooltips').append('div')
@ -419,7 +419,7 @@
// update the tip
tip.html(function () {
var list = common.formatUnorderedList(d.component.validationErrors);
var list = nfCommon.formatUnorderedList(d.component.validationErrors);
if (list === null || list.length === 0) {
return '';
} else {
@ -428,7 +428,7 @@
});
// add the tooltip
canvasUtils.canvasTooltip(tip, d3.select(this));
nfCanvasUtils.canvasTooltip(tip, d3.select(this));
} else {
// remove if necessary
if (!tip.empty()) {
@ -477,7 +477,7 @@
// active thread count
// -------------------
canvasUtils.activeThreadCount(port, d, function (off) {
nfCanvasUtils.activeThreadCount(port, d, function (off) {
offset = off;
});
@ -486,10 +486,10 @@
// ---------
port.select('rect.bulletin-background').classed('has-bulletins', function () {
return !common.isEmpty(d.status.aggregateSnapshot.bulletins);
return !nfCommon.isEmpty(d.status.aggregateSnapshot.bulletins);
});
canvasUtils.bulletins(port, d, function () {
nfCanvasUtils.bulletins(port, d, function () {
return d3.select('#port-tooltips');
}, offset);
});
@ -524,12 +524,17 @@
var nfPort = {
/**
* Initializes of the Port handler.
*
* @param nfConnectableRef The nfConnectable module.
* @param nfDraggableRef The nfDraggable module.
* @param nfSelectableRef The nfSelectable module.
* @param nfContextMenuRef The nfContextMenu module.
*/
init: function (connectable, draggable, selectable, contextMenu) {
nfConnectable = connectable;
nfDraggable = draggable;
nfSelectable = selectable;
nfContextMenu = contextMenu;
init: function (nfConnectableRef, nfDraggableRef, nfSelectableRef, nfContextMenuRef) {
nfConnectable = nfConnectableRef;
nfDraggable = nfDraggableRef;
nfSelectable = nfSelectableRef;
nfContextMenu = nfContextMenuRef;
portMap = d3.map();
removedCache = d3.map();
@ -551,13 +556,13 @@
*/
add: function (portEntities, options) {
var selectAll = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
}
// determine the appropriate dimensions for this port
var dimensions = portDimensions;
if (canvasUtils.getParentGroupId() === null) {
if (nfCanvasUtils.getParentGroupId() === null) {
dimensions = remotePortDimensions;
}
@ -582,7 +587,7 @@
$.each(portEntities, function (_, portNode) {
add(portNode);
});
} else if (common.isDefinedAndNotNull(portEntities)) {
} else if (nfCommon.isDefinedAndNotNull(portEntities)) {
add(portEntities);
}
@ -601,14 +606,14 @@
set: function (portEntities, options) {
var selectAll = false;
var transition = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
transition = common.isDefinedAndNotNull(options.transition) ? options.transition : transition;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition;
}
// determine the appropriate dimensions for this port
var dimensions = portDimensions;
if (canvasUtils.getParentGroupId() === null) {
if (nfCanvasUtils.getParentGroupId() === null) {
dimensions = remotePortDimensions;
}
@ -616,7 +621,7 @@
var currentPortEntity = portMap.get(proposedPortEntity.id);
// set the port if appropriate due to revision and wasn't previously removed
if (client.isNewerRevision(currentPortEntity, proposedPortEntity) && !removedCache.has(proposedPortEntity.id)) {
if (nfClient.isNewerRevision(currentPortEntity, proposedPortEntity) && !removedCache.has(proposedPortEntity.id)) {
// add the port
portMap.set(proposedPortEntity.id, $.extend({
type: 'Port',
@ -644,14 +649,14 @@
$.each(portEntities, function (_, portNode) {
set(portNode);
});
} else if (common.isDefinedAndNotNull(portEntities)) {
} else if (nfCommon.isDefinedAndNotNull(portEntities)) {
set(portEntities);
}
// apply the selection and handle all new ports
var selection = select();
selection.enter().call(renderPorts, selectAll);
selection.call(updatePorts).call(canvasUtils.position, transition);
selection.call(updatePorts).call(nfCanvasUtils.position, transition);
selection.exit().call(removePorts);
},
@ -662,7 +667,7 @@
* @param {string} id
*/
get: function (id) {
if (common.isUndefined(id)) {
if (nfCommon.isUndefined(id)) {
return portMap.values();
} else {
return portMap.get(id);
@ -676,7 +681,7 @@
* @param {string} id Optional
*/
refresh: function (id) {
if (common.isDefinedAndNotNull(id)) {
if (nfCommon.isDefinedAndNotNull(id)) {
d3.select('#id-' + id).call(updatePorts);
} else {
d3.selectAll('g.input-port, g.output-port').call(updatePorts);
@ -715,7 +720,7 @@
* @param {string} id The id
*/
position: function (id) {
d3.select('#id-' + id).call(canvasUtils.position);
d3.select('#id-' + id).call(nfCanvasUtils.position);
},
/**

View File

@ -28,8 +28,8 @@
'nf.ProcessGroup',
'nf.Shell',
'nf.CanvasUtils'],
function ($, d3, errorHandler, common, dialog, client, processGroup, shell, canvasUtils) {
return (nf.ProcessGroupConfiguration = factory($, d3, errorHandler, common, dialog, client, processGroup, shell, canvasUtils));
function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfProcessGroup, nfShell, nfCanvasUtils) {
return (nf.ProcessGroupConfiguration = factory($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfProcessGroup, nfShell, nfCanvasUtils));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ProcessGroupConfiguration =
@ -53,7 +53,7 @@
root.nf.Shell,
root.nf.CanvasUtils);
}
}(this, function ($, d3, errorHandler, common, dialog, client, processGroup, shell, canvasUtils) {
}(this, function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfProcessGroup, nfShell, nfCanvasUtils) {
'use strict';
var nfControllerServices;
@ -88,7 +88,7 @@
var saveConfiguration = function (version, groupId) {
// build the entity
var entity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': version
}
@ -109,12 +109,12 @@
contentType: 'application/json'
}).done(function (response) {
// refresh the process group if necessary
if (response.permissions.canRead && response.component.parentGroupId === canvasUtils.getGroupId()) {
processGroup.set(response);
if (response.permissions.canRead && response.component.parentGroupId === nfCanvasUtils.getGroupId()) {
nfProcessGroup.set(response);
}
// show the result dialog
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Process Group Configuration',
dialogContent: 'Process group configuration successfully saved.'
});
@ -124,8 +124,8 @@
saveConfiguration(response.revision.version, groupId);
});
canvasUtils.reload();
}).fail(errorHandler.handleAjaxError);
nfCanvasUtils.reload();
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -188,15 +188,15 @@
deferred.resolve();
}).fail(function (xhr, status, error) {
if (xhr.status === 403) {
if (groupId === canvasUtils.getGroupId()) {
if (groupId === nfCanvasUtils.getGroupId()) {
$('#process-group-configuration').data('process-group', {
'permissions': {
canRead: false,
canWrite: canvasUtils.canWrite()
canWrite: nfCanvasUtils.canWrite()
}
});
} else {
$('#process-group-configuration').data('process-group', processGroup.get(groupId));
$('#process-group-configuration').data('process-group', nfProcessGroup.get(groupId));
}
setUnauthorizedText();
@ -218,7 +218,7 @@
// update the current time
$('#process-group-configuration-last-refreshed').text(controllerServicesResponse.currentTime);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -226,7 +226,7 @@
*/
var showConfiguration = function () {
// show the configuration dialog
shell.showContent('#process-group-configuration').done(function () {
nfShell.showContent('#process-group-configuration').done(function () {
reset();
});
@ -256,10 +256,10 @@
/**
* Initialize the process group configuration.
*
* @param controllerServices The reference to the controllerServices controller.
* @param nfControllerServicesRef The nfControllerServices module.
*/
init: function (controllerServices) {
nfControllerServices = controllerServices;
init: function (nfControllerServicesRef) {
nfControllerServices = nfControllerServicesRef;
// initialize the process group configuration tabs
$('#process-group-configuration-tabs').tabbs({
@ -275,7 +275,7 @@
}],
select: function () {
var processGroup = $('#process-group-configuration').data('process-group');
var canWrite = common.isDefinedAndNotNull(processGroup) ? processGroup.permissions.canWrite : false;
var canWrite = nfCommon.isDefinedAndNotNull(processGroup) ? processGroup.permissions.canWrite : false;
var tab = $(this).text();
if (tab === 'General') {

View File

@ -26,8 +26,8 @@
'nf.Client',
'nf.CanvasUtils',
'nf.Dialog'],
function ($, d3, connection, common, client, canvasUtils, dialog) {
return (nf.ProcessGroup = factory($, d3, connection, common, client, canvasUtils, dialog));
function ($, d3, nfConnection, nfCommon, nfClient, nfCanvasUtils, nfDialog) {
return (nf.ProcessGroup = factory($, d3, nfConnection, nfCommon, nfClient, nfCanvasUtils, nfDialog));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ProcessGroup =
@ -47,7 +47,7 @@
root.nf.CanvasUtils,
root.nf.Dialog);
}
}(this, function ($, d3, connection, common, client, canvasUtils, dialog) {
}(this, function ($, d3, nfConnection, nfCommon, nfClient, nfCanvasUtils, nfDialog) {
'use strict';
var nfConnectable;
@ -91,7 +91,7 @@
* @param {object} d
*/
var getProcessGroupComments = function (d) {
if (common.isBlank(d.component.comments)) {
if (nfCommon.isBlank(d.component.comments)) {
return 'No comments specified';
} else {
return d.component.comments;
@ -126,7 +126,7 @@
'class': 'process-group component'
})
.classed('selected', selected)
.call(canvasUtils.position);
.call(nfCanvasUtils.position);
// ----
// body
@ -203,7 +203,7 @@
var drag = d3.select('rect.drag-selection');
if (!drag.empty()) {
// filter the current selection by this group
var selection = canvasUtils.getSelection().filter(function (d) {
var selection = nfCanvasUtils.getSelection().filter(function (d) {
return targetData.id === d.id;
});
@ -212,7 +212,7 @@
// mark that we are hovering over a drop area if appropriate
target.classed('drop', function () {
// get the current selection and ensure its disconnected
return connection.isDisconnected(canvasUtils.getSelection());
return nfConnection.isDisconnected(nfCanvasUtils.getSelection());
});
}
}
@ -257,7 +257,7 @@
var details = processGroup.select('g.process-group-details');
// update the component behavior as appropriate
canvasUtils.editable(processGroup, nfConnectable, nfDraggable);
nfCanvasUtils.editable(processGroup, nfConnectable, nfDraggable);
// if this processor is visible, render everything
if (processGroup.classed('visible')) {
@ -848,9 +848,9 @@
processGroupComments.text(null).selectAll('tspan, title').remove();
// apply ellipsis to the port name as necessary
canvasUtils.ellipsis(processGroupComments, getProcessGroupComments(d));
nfCanvasUtils.ellipsis(processGroupComments, getProcessGroupComments(d));
}).classed('unset', function (d) {
return common.isBlank(d.component.comments);
return nfCommon.isBlank(d.component.comments);
}).append('title').text(function (d) {
return getProcessGroupComments(d);
});
@ -864,7 +864,7 @@
processGroupName.text(null).selectAll('title').remove();
// apply ellipsis to the process group name as necessary
canvasUtils.ellipsis(processGroupName, d.component.name);
nfCanvasUtils.ellipsis(processGroupName, d.component.name);
}).append('title').text(function (d) {
return d.component.name;
});
@ -919,25 +919,25 @@
// queued count value
updated.select('text.process-group-queued tspan.count')
.text(function (d) {
return common.substringBeforeFirst(d.status.aggregateSnapshot.queued, ' ');
return nfCommon.substringBeforeFirst(d.status.aggregateSnapshot.queued, ' ');
});
// queued size value
updated.select('text.process-group-queued tspan.size')
.text(function (d) {
return ' ' + common.substringAfterFirst(d.status.aggregateSnapshot.queued, ' ');
return ' ' + nfCommon.substringAfterFirst(d.status.aggregateSnapshot.queued, ' ');
});
// in count value
updated.select('text.process-group-in tspan.count')
.text(function (d) {
return common.substringBeforeFirst(d.status.aggregateSnapshot.input, ' ');
return nfCommon.substringBeforeFirst(d.status.aggregateSnapshot.input, ' ');
});
// in size value
updated.select('text.process-group-in tspan.size')
.text(function (d) {
return ' ' + common.substringAfterFirst(d.status.aggregateSnapshot.input, ' ');
return ' ' + nfCommon.substringAfterFirst(d.status.aggregateSnapshot.input, ' ');
});
// in ports value
@ -961,13 +961,13 @@
// out count value
updated.select('text.process-group-out tspan.count')
.text(function (d) {
return common.substringBeforeFirst(d.status.aggregateSnapshot.output, ' ');
return nfCommon.substringBeforeFirst(d.status.aggregateSnapshot.output, ' ');
});
// out size value
updated.select('text.process-group-out tspan.size')
.text(function (d) {
return ' ' + common.substringAfterFirst(d.status.aggregateSnapshot.output, ' ');
return ' ' + nfCommon.substringAfterFirst(d.status.aggregateSnapshot.output, ' ');
});
updated.each(function (d) {
@ -978,7 +978,7 @@
// active thread count
// -------------------
canvasUtils.activeThreadCount(processGroup, d, function (off) {
nfCanvasUtils.activeThreadCount(processGroup, d, function (off) {
offset = off;
});
@ -987,10 +987,10 @@
// ---------
processGroup.select('rect.bulletin-background').classed('has-bulletins', function () {
return !common.isEmpty(d.status.aggregateSnapshot.bulletins);
return !nfCommon.isEmpty(d.status.aggregateSnapshot.bulletins);
});
canvasUtils.bulletins(processGroup, d, function () {
nfCanvasUtils.bulletins(processGroup, d, function () {
return d3.select('#process-group-tooltips');
}, offset);
});
@ -1024,12 +1024,17 @@
var nfProcessGroup = {
/**
* Initializes of the Process Group handler.
*
* @param nfConnectableRef The nfConnectable module.
* @param nfDraggableRef The nfDraggable module.
* @param nfSelectableRef The nfSelectable module.
* @param nfContextMenuRef The nfContextMenu module.
*/
init: function (connectable, draggable, selectable, contextMenu) {
nfConnectable = connectable;
nfDraggable = draggable;
nfSelectable = selectable;
nfContextMenu = contextMenu;
init: function (nfConnectableRef, nfDraggableRef, nfSelectableRef, nfContextMenuRef) {
nfConnectable = nfConnectableRef;
nfDraggable = nfDraggableRef;
nfSelectable = nfSelectableRef;
nfContextMenu = nfContextMenuRef;
processGroupMap = d3.map();
removedCache = d3.map();
@ -1051,8 +1056,8 @@
*/
add: function (processGroupEntities, options) {
var selectAll = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
}
// get the current time
@ -1073,7 +1078,7 @@
$.each(processGroupEntities, function (_, processGroupEntity) {
add(processGroupEntity);
});
} else if (common.isDefinedAndNotNull(processGroupEntities)) {
} else if (nfCommon.isDefinedAndNotNull(processGroupEntities)) {
add(processGroupEntities);
}
@ -1092,16 +1097,16 @@
set: function (processGroupEntities, options) {
var selectAll = false;
var transition = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
transition = common.isDefinedAndNotNull(options.transition) ? options.transition : transition;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition;
}
var set = function (proposedProcessGroupEntity) {
var currentProcessGroupEntity = processGroupMap.get(proposedProcessGroupEntity.id);
// set the process group if appropriate due to revision and wasn't previously removed
if (client.isNewerRevision(currentProcessGroupEntity, proposedProcessGroupEntity) && !removedCache.has(proposedProcessGroupEntity.id)) {
if (nfClient.isNewerRevision(currentProcessGroupEntity, proposedProcessGroupEntity) && !removedCache.has(proposedProcessGroupEntity.id)) {
processGroupMap.set(proposedProcessGroupEntity.id, $.extend({
type: 'ProcessGroup',
dimensions: dimensions
@ -1125,14 +1130,14 @@
$.each(processGroupEntities, function (_, processGroupEntity) {
set(processGroupEntity);
});
} else if (common.isDefinedAndNotNull(processGroupEntities)) {
} else if (nfCommon.isDefinedAndNotNull(processGroupEntities)) {
set(processGroupEntities);
}
// apply the selection and handle all new process group
var selection = select();
selection.enter().call(renderProcessGroups, selectAll);
selection.call(updateProcessGroups).call(canvasUtils.position, transition);
selection.call(updateProcessGroups).call(nfCanvasUtils.position, transition);
selection.exit().call(removeProcessGroups);
},
@ -1143,7 +1148,7 @@
* @param {string} id
*/
get: function (id) {
if (common.isUndefined(id)) {
if (nfCommon.isUndefined(id)) {
return processGroupMap.values();
} else {
return processGroupMap.get(id);
@ -1157,7 +1162,7 @@
* @param {string} id Optional
*/
refresh: function (id) {
if (common.isDefinedAndNotNull(id)) {
if (nfCommon.isDefinedAndNotNull(id)) {
d3.select('#id-' + id).call(updateProcessGroups);
} else {
d3.selectAll('g.process-group').call(updateProcessGroups);
@ -1196,7 +1201,7 @@
* @param {string} id The id
*/
position: function (id) {
d3.select('#id-' + id).call(canvasUtils.position);
d3.select('#id-' + id).call(nfCanvasUtils.position);
},
/**
@ -1257,25 +1262,25 @@
nfContextMenu.hide();
// set the new group id
canvasUtils.setGroupId(groupId);
nfCanvasUtils.setGroupId(groupId);
// reload the graph
return canvasUtils.reload().done(function () {
return nfCanvasUtils.reload().done(function () {
// attempt to restore the view
var viewRestored = canvasUtils.restoreUserView();
var viewRestored = nfCanvasUtils.restoreUserView();
// if the view was not restore attempt to fit
if (viewRestored === false) {
canvasUtils.fitCanvasView();
nfCanvasUtils.fitCanvasView();
// refresh the canvas
canvasUtils.refreshCanvasView({
nfCanvasUtils.refreshCanvasView({
transition: true
});
}
}).fail(function () {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Process Group',
dialogContent: 'Unable to enter the selected group.'
});

View File

@ -31,8 +31,8 @@
'nf.CustomUi',
'nf.UniversalCapture',
'nf.Connection'],
function ($, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfProcessor, clusterSummary, customUi, universalCapture, nfConnection) {
return (nf.ProcessorConfiguration = factory($, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfProcessor, clusterSummary, customUi, universalCapture, nfConnection));
function ($, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfProcessor, nfClusterSummary, nfCustomUi, nfUniversalCapture, nfConnection) {
return (nf.ProcessorConfiguration = factory($, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfProcessor, nfClusterSummary, nfCustomUi, nfUniversalCapture, nfConnection));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ProcessorConfiguration =
@ -62,7 +62,7 @@
root.nf.UniversalCapture,
root.nf.Connection);
}
}(this, function ($, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfProcessor, clusterSummary, customUi, universalCapture, nfConnection) {
}(this, function ($, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfProcessor, nfClusterSummary, nfCustomUi, nfUniversalCapture, nfConnection) {
'use strict';
// possible values for a processor's run duration (in millis)
@ -133,7 +133,7 @@
text: 'Primary node',
value: 'PRIMARY',
description: 'Processor will be scheduled to run only on the primary node',
disabled: !clusterSummary.isClustered() && processor.config['executionNode'] === 'PRIMARY'
disabled: !nfClusterSummary.isClustered() && processor.config['executionNode'] === 'PRIMARY'
}];
};
@ -152,15 +152,15 @@
if (errors.length === 1) {
content = $('<span></span>').text(errors[0]);
} else {
content = common.formatUnorderedList(errors);
content = nfCommon.formatUnorderedList(errors);
}
dialog.showOkDialog({
nfDialog.showOkDialog({
dialogContent: content,
headerText: 'Processor Configuration'
});
} else {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
};
@ -183,7 +183,7 @@
// build the relationship container element
var relationshipContainerElement = $('<div class="processor-relationship-container"></div>').append(relationshipCheckbox).append(relationshipLabel).append(relationshipValue).appendTo('#auto-terminate-relationship-names');
if (!common.isBlank(relationship.description)) {
if (!nfCommon.isBlank(relationship.description)) {
var relationshipDescription = $('<div class="relationship-description"></div>').text(relationship.description);
relationshipContainerElement.append(relationshipDescription);
}
@ -255,7 +255,7 @@
}
// check the scheduling period
if (common.isDefinedAndNotNull(schedulingPeriod) && schedulingPeriod.val() !== (details.config['schedulingPeriod'] + '')) {
if (nfCommon.isDefinedAndNotNull(schedulingPeriod) && schedulingPeriod.val() !== (details.config['schedulingPeriod'] + '')) {
return true;
}
@ -321,7 +321,7 @@
}
// get the scheduling period if appropriate
if (common.isDefinedAndNotNull(schedulingPeriod)) {
if (nfCommon.isDefinedAndNotNull(schedulingPeriod)) {
processorConfigDto['schedulingPeriod'] = schedulingPeriod.val();
}
@ -405,22 +405,22 @@
var config = processor['config'];
// ensure numeric fields are specified correctly
if (common.isDefinedAndNotNull(config['concurrentlySchedulableTaskCount']) && !$.isNumeric(config['concurrentlySchedulableTaskCount'])) {
if (nfCommon.isDefinedAndNotNull(config['concurrentlySchedulableTaskCount']) && !$.isNumeric(config['concurrentlySchedulableTaskCount'])) {
errors.push('Concurrent tasks must be an integer value');
}
if (common.isDefinedAndNotNull(config['schedulingPeriod']) && common.isBlank(config['schedulingPeriod'])) {
if (nfCommon.isDefinedAndNotNull(config['schedulingPeriod']) && nfCommon.isBlank(config['schedulingPeriod'])) {
errors.push('Run schedule must be specified');
}
if (common.isBlank(config['penaltyDuration'])) {
if (nfCommon.isBlank(config['penaltyDuration'])) {
errors.push('Penalty duration must be specified');
}
if (common.isBlank(config['yieldDuration'])) {
if (nfCommon.isBlank(config['yieldDuration'])) {
errors.push('Yield duration must be specified');
}
if (errors.length > 0) {
dialog.showOkDialog({
dialogContent: common.formatUnorderedList(errors),
nfDialog.showOkDialog({
dialogContent: nfCommon.formatUnorderedList(errors),
headerText: 'Processor Configuration'
});
return false;
@ -456,7 +456,7 @@
// determine if changes have been made
if (isSaveRequired()) {
// see if those changes should be saved
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'Processor Configuration',
dialogContent: 'Save changes before going to this Controller Service?',
noHandler: function () {
@ -490,7 +490,7 @@
if (validateDetails(updatedProcessor)) {
// set the revision
var d = nfProcessor.get(processor.id);
updatedProcessor['revision'] = client.getRevision(d);
updatedProcessor['revision'] = nfClient.getRevision(d);
// update the selected component
return $.ajax({
@ -535,7 +535,7 @@
}],
select: function () {
// remove all property detail dialogs
universalCapture.removeAllPropertyDetailDialogs();
nfUniversalCapture.removeAllPropertyDetailDialogs();
// update the processor property table size in case this is the first time its rendered
if ($(this).text() === 'Properties') {
@ -569,7 +569,7 @@
$('#processor-configuration').removeData('processorDetails');
},
open: function () {
common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
}
}
});
@ -620,7 +620,7 @@
propertyName: propertyName
},
dataType: 'json'
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
},
goToServiceDeferred: goToServiceFromProperty
});
@ -632,7 +632,7 @@
* @argument {selection} selection The selection
*/
showConfiguration: function (selection) {
if (canvasUtils.isProcessor(selection)) {
if (nfCanvasUtils.isProcessor(selection)) {
var selectionData = selection.datum();
// get the processor details
@ -670,7 +670,7 @@
// populate the processor settings
$('#processor-id').text(processor['id']);
$('#processor-type').text(common.substringAfterLast(processor['type'], '.'));
$('#processor-type').text(nfCommon.substringAfterLast(processor['type'], '.'));
$('#processor-name').val(processor['name']);
$('#processor-enabled').removeClass('checkbox-unchecked checkbox-checked').addClass(processorEnableStyle);
$('#penalty-duration').val(processor.config['penaltyDuration']);
@ -736,7 +736,7 @@
});
// show the execution node option if we're cluster or we're currently configured to run on the primary node only
if (clusterSummary.isClustered() || executionNode === 'PRIMARY') {
if (nfClusterSummary.isClustered() || executionNode === 'PRIMARY') {
$('#execution-node-options').show();
} else {
$('#execution-node-options').hide();
@ -759,7 +759,7 @@
}
// conditionally allow the user to specify the concurrent tasks
if (common.isDefinedAndNotNull(concurrentTasks)) {
if (nfCommon.isDefinedAndNotNull(concurrentTasks)) {
if (processor.supportsParallelProcessing === true) {
concurrentTasks.prop('disabled', false);
} else {
@ -780,7 +780,7 @@
}
// load the relationship list
if (!common.isEmpty(processor.relationships)) {
if (!nfCommon.isEmpty(processor.relationships)) {
$.each(processor.relationships, function (i, relationship) {
createRelationshipOption(relationship);
});
@ -809,7 +809,7 @@
$('#processor-configuration').modal('hide');
// inform Angular app values have changed
angularBridge.digest();
nfNgBridge.digest();
});
}
}
@ -829,7 +829,7 @@
}];
// determine if we should show the advanced button
if (common.isDefinedAndNotNull(processor.config.customUiUrl) && processor.config.customUiUrl !== '') {
if (nfCommon.isDefinedAndNotNull(processor.config.customUiUrl) && processor.config.customUiUrl !== '') {
buttons.push({
buttonText: 'Advanced',
clazz: 'fa fa-cog button-icon',
@ -845,7 +845,7 @@
$('#processor-configuration').modal('hide');
// show the custom ui
customUi.showCustomUi(processorResponse, processor.config.customUiUrl, true).done(function () {
nfCustomUi.showCustomUi(processorResponse, processor.config.customUiUrl, true).done(function () {
// once the custom ui is closed, reload the processor
nfProcessor.reload(processor.id);
@ -860,7 +860,7 @@
// determine if changes have been made
if (isSaveRequired()) {
// see if those changes should be saved
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'Save',
dialogContent: 'Save changes before opening the advanced configuration?',
noHandler: openCustomUi,
@ -899,7 +899,7 @@
if (processorRelationships.is(':visible') && processorRelationships.get(0).scrollHeight > Math.round(processorRelationships.innerHeight())) {
processorRelationships.css('border-width', '1px');
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
}
};

View File

@ -24,8 +24,8 @@
'nf.Common',
'nf.Client',
'nf.CanvasUtils'],
function ($, d3, common, client, canvasUtils) {
return (nf.Processor = factory($, d3, common, client, canvasUtils));
function ($, d3, nfCommon, nfClient, nfCanvasUtils) {
return (nf.Processor = factory($, d3, nfCommon, nfClient, nfCanvasUtils));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Processor =
@ -41,7 +41,7 @@
root.nf.Client,
root.nf.CanvasUtils);
}
}(this, function ($, d3, common, client, canvasUtils) {
}(this, function ($, d3, nfCommon, nfClient, nfCanvasUtils) {
'use strict';
var nfConnectable;
@ -103,7 +103,7 @@
'class': 'processor component'
})
.classed('selected', selected)
.call(canvasUtils.position);
.call(nfCanvasUtils.position);
// processor border
processor.append('rect')
@ -211,7 +211,7 @@
var details = processor.select('g.processor-canvas-details');
// update the component behavior as appropriate
canvasUtils.editable(processor, nfConnectable, nfDraggable);
nfCanvasUtils.editable(processor, nfConnectable, nfDraggable);
// if this processor is visible, render everything
if (processor.classed('visible')) {
@ -538,7 +538,7 @@
processorName.text(null).selectAll('title').remove();
// apply ellipsis to the processor name as necessary
canvasUtils.ellipsis(processorName, d.component.name);
nfCanvasUtils.ellipsis(processorName, d.component.name);
}).append('title').text(function (d) {
return d.component.name;
});
@ -552,9 +552,9 @@
processorType.text(null).selectAll('title').remove();
// apply ellipsis to the processor type as necessary
canvasUtils.ellipsis(processorType, common.substringAfterLast(d.component.type, '.'));
nfCanvasUtils.ellipsis(processorType, nfCommon.substringAfterLast(d.component.type, '.'));
}).append('title').text(function (d) {
return common.substringAfterLast(d.component.type, '.');
return nfCommon.substringAfterLast(d.component.type, '.');
});
} else {
// clear the processor name
@ -607,7 +607,7 @@
// use the specified color if appropriate
if (processorData.permissions.canRead) {
if (common.isDefinedAndNotNull(processorData.component.style['background-color'])) {
if (nfCommon.isDefinedAndNotNull(processorData.component.style['background-color'])) {
var color = processorData.component.style['background-color'];
//update the processor icon container
@ -636,15 +636,15 @@
}
// use the specified color if appropriate
if (common.isDefinedAndNotNull(d.component.style['background-color'])) {
if (nfCommon.isDefinedAndNotNull(d.component.style['background-color'])) {
color = d.component.style['background-color'];
//special case #ffffff implies default fill
if (color.toLowerCase() === '#ffffff') {
color = nfProcessor.defaultIconColor();
} else {
color = common.determineContrastColor(
common.substringAfterLast(
color = nfCommon.determineContrastColor(
nfCommon.substringAfterLast(
color, '#'));
}
}
@ -723,7 +723,7 @@
var tip = d3.select('#run-status-tip-' + d.id);
// if there are validation errors generate a tooltip
if (d.permissions.canRead && !common.isEmpty(d.component.validationErrors)) {
if (d.permissions.canRead && !nfCommon.isEmpty(d.component.validationErrors)) {
// create the tip if necessary
if (tip.empty()) {
tip = d3.select('#processor-tooltips').append('div')
@ -735,7 +735,7 @@
// update the tip
tip.html(function () {
var list = common.formatUnorderedList(d.component.validationErrors);
var list = nfCommon.formatUnorderedList(d.component.validationErrors);
if (list === null || list.length === 0) {
return '';
} else {
@ -744,7 +744,7 @@
});
// add the tooltip
canvasUtils.canvasTooltip(tip, d3.select(this));
nfCanvasUtils.canvasTooltip(tip, d3.select(this));
} else {
// remove the tip if necessary
if (!tip.empty()) {
@ -756,13 +756,13 @@
// in count value
updated.select('text.processor-in tspan.count')
.text(function (d) {
return common.substringBeforeFirst(d.status.aggregateSnapshot.input, ' ');
return nfCommon.substringBeforeFirst(d.status.aggregateSnapshot.input, ' ');
});
// in size value
updated.select('text.processor-in tspan.size')
.text(function (d) {
return ' ' + common.substringAfterFirst(d.status.aggregateSnapshot.input, ' ');
return ' ' + nfCommon.substringAfterFirst(d.status.aggregateSnapshot.input, ' ');
});
// read/write value
@ -774,13 +774,13 @@
// out count value
updated.select('text.processor-out tspan.count')
.text(function (d) {
return common.substringBeforeFirst(d.status.aggregateSnapshot.output, ' ');
return nfCommon.substringBeforeFirst(d.status.aggregateSnapshot.output, ' ');
});
// out size value
updated.select('text.processor-out tspan.size')
.text(function (d) {
return ' ' + common.substringAfterFirst(d.status.aggregateSnapshot.output, ' ');
return ' ' + nfCommon.substringAfterFirst(d.status.aggregateSnapshot.output, ' ');
});
// tasks/time value
@ -796,17 +796,17 @@
// active thread count
// -------------------
canvasUtils.activeThreadCount(processor, d);
nfCanvasUtils.activeThreadCount(processor, d);
// ---------
// bulletins
// ---------
processor.select('rect.bulletin-background').classed('has-bulletins', function () {
return !common.isEmpty(d.status.aggregateSnapshot.bulletins);
return !nfCommon.isEmpty(d.status.aggregateSnapshot.bulletins);
});
canvasUtils.bulletins(processor, d, function () {
nfCanvasUtils.bulletins(processor, d, function () {
return d3.select('#processor-tooltips');
}, 286);
});
@ -841,12 +841,17 @@
var nfProcessor = {
/**
* Initializes of the Processor handler.
*
* @param nfConnectableRef The nfConnectable module.
* @param nfDraggableRef The nfDraggable module.
* @param nfSelectableRef The nfSelectable module.
* @param nfContextMenuRef The nfContextMenu module.
*/
init: function (connectable, draggable, selectable, contextMenu) {
nfConnectable = connectable;
nfDraggable = draggable;
nfSelectable = selectable;
nfContextMenu = contextMenu;
init: function (nfConnectableRef, nfDraggableRef, nfSelectableRef, nfContextMenuRef) {
nfConnectable = nfConnectableRef;
nfDraggable = nfDraggableRef;
nfSelectable = nfSelectableRef;
nfContextMenu = nfContextMenuRef;
processorMap = d3.map();
removedCache = d3.map();
@ -868,8 +873,8 @@
*/
add: function (processorEntities, options) {
var selectAll = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
}
// get the current time
@ -890,7 +895,7 @@
$.each(processorEntities, function (_, processorEntity) {
add(processorEntity);
});
} else if (common.isDefinedAndNotNull(processorEntities)) {
} else if (nfCommon.isDefinedAndNotNull(processorEntities)) {
add(processorEntities);
}
@ -909,16 +914,16 @@
set: function (processorEntities, options) {
var selectAll = false;
var transition = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
transition = common.isDefinedAndNotNull(options.transition) ? options.transition : transition;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition;
}
var set = function (proposedProcessorEntity) {
var currentProcessorEntity = processorMap.get(proposedProcessorEntity.id);
// set the processor if appropriate due to revision and wasn't previously removed
if (client.isNewerRevision(currentProcessorEntity, proposedProcessorEntity) && !removedCache.has(proposedProcessorEntity.id)) {
if (nfClient.isNewerRevision(currentProcessorEntity, proposedProcessorEntity) && !removedCache.has(proposedProcessorEntity.id)) {
processorMap.set(proposedProcessorEntity.id, $.extend({
type: 'Processor',
dimensions: dimensions
@ -942,14 +947,14 @@
$.each(processorEntities, function (_, processorEntity) {
set(processorEntity);
});
} else if (common.isDefinedAndNotNull(processorEntities)) {
} else if (nfCommon.isDefinedAndNotNull(processorEntities)) {
set(processorEntities);
}
// apply the selection and handle all new processors
var selection = select();
selection.enter().call(renderProcessors, selectAll);
selection.call(updateProcessors).call(canvasUtils.position, transition);
selection.call(updateProcessors).call(nfCanvasUtils.position, transition);
selection.exit().call(removeProcessors);
},
@ -960,7 +965,7 @@
* @param {string} id
*/
get: function (id) {
if (common.isUndefined(id)) {
if (nfCommon.isUndefined(id)) {
return processorMap.values();
} else {
return processorMap.get(id);
@ -974,7 +979,7 @@
* @param {string} id Optional
*/
refresh: function (id) {
if (common.isDefinedAndNotNull(id)) {
if (nfCommon.isDefinedAndNotNull(id)) {
d3.select('#id-' + id).call(updateProcessors);
} else {
d3.selectAll('g.processor').call(updateProcessors);
@ -987,7 +992,7 @@
* @param {string} id The id
*/
position: function (id) {
d3.select('#id-' + id).call(canvasUtils.position);
d3.select('#id-' + id).call(nfCanvasUtils.position);
},
/**

View File

@ -32,8 +32,8 @@
'nf.ErrorHandler',
'nf.Storage',
'nf.CanvasUtils'],
function ($, Slick, common, dialog, shell, angularBridge, clusterSummary, errorHandler, storage, canvasUtils) {
return (nf.QueueListing = factory($, Slick, common, dialog, shell, angularBridge, clusterSummary, errorHandler, storage, canvasUtils));
function ($, Slick, nfCommon, nfDialog, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils) {
return (nf.QueueListing = factory($, Slick, nfCommon, nfDialog, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.QueueListing =
@ -59,7 +59,7 @@
root.nf.Storage,
root.nf.CanvasUtils);
}
}(this, function ($, Slick, common, dialog, shell, angularBridge, clusterSummary, errorHandler, storage, canvasUtils) {
}(this, function ($, Slick, nfCommon, nfDialog, nfShell, nfNgBridge, nfClusterSummary, nfErrorHandler, nfStorage, nfCanvasUtils) {
'use strict';
/**
@ -96,17 +96,17 @@
var dataUri = $('#flowfile-uri').text() + '/content';
// perform the request once we've received a token
common.getAccessToken(config.urls.downloadToken).done(function (downloadToken) {
nfCommon.getAccessToken(config.urls.downloadToken).done(function (downloadToken) {
var parameters = {};
// conditionally include the ui extension token
if (!common.isBlank(downloadToken)) {
if (!nfCommon.isBlank(downloadToken)) {
parameters['access_token'] = downloadToken;
}
// conditionally include the cluster node id
var clusterNodeId = $('#flowfile-cluster-node-id').text();
if (!common.isBlank(clusterNodeId)) {
if (!nfCommon.isBlank(clusterNodeId)) {
parameters['clusterNodeId'] = clusterNodeId;
}
@ -117,7 +117,7 @@
window.open(dataUri + '?' + $.param(parameters));
}
}).fail(function () {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Queue Listing',
dialogContent: 'Unable to generate access token for downloading content.'
});
@ -132,7 +132,7 @@
// generate tokens as necessary
var getAccessTokens = $.Deferred(function (deferred) {
if (storage.hasItem('jwt')) {
if (nfStorage.hasItem('jwt')) {
// generate a token for the ui extension and another for the callback
var uiExtensionToken = $.ajax({
type: 'POST',
@ -149,7 +149,7 @@
var downloadToken = downloadTokenResult[0];
deferred.resolve(uiExtensionToken, downloadToken);
}).fail(function () {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Queue Listing',
dialogContent: 'Unable to generate access token for viewing content.'
});
@ -166,12 +166,12 @@
// conditionally include the cluster node id
var clusterNodeId = $('#flowfile-cluster-node-id').text();
if (!common.isBlank(clusterNodeId)) {
if (!nfCommon.isBlank(clusterNodeId)) {
dataUriParameters['clusterNodeId'] = clusterNodeId;
}
// include the download token if applicable
if (!common.isBlank(downloadToken)) {
if (!nfCommon.isBlank(downloadToken)) {
dataUriParameters['access_token'] = downloadToken;
}
@ -197,7 +197,7 @@
};
// include the download token if applicable
if (!common.isBlank(uiExtensionToken)) {
if (!nfCommon.isBlank(uiExtensionToken)) {
contentViewerParameters['access_token'] = uiExtensionToken;
}
@ -227,7 +227,7 @@
// update the progress
var label = $('<div class="progress-label"></div>').text(percentComplete + '%');
(angularBridge.injector.get('$compile')($('<md-progress-linear ng-cloak ng-value="' + percentComplete + '" class="md-hue-2" md-mode="determinate" aria-label="Searching Queue"></md-progress-linear>'))(angularBridge.rootScope)).appendTo(progressBar);
(nfNgBridge.injector.get('$compile')($('<md-progress-linear ng-cloak ng-value="' + percentComplete + '" class="md-hue-2" md-mode="determinate" aria-label="Searching Queue"></md-progress-linear>'))(nfNgBridge.rootScope)).appendTo(progressBar);
progressBar.append(label);
};
@ -263,7 +263,7 @@
var reject = cancelled;
// ensure the listing requests are present
if (common.isDefinedAndNotNull(listingRequest)) {
if (nfCommon.isDefinedAndNotNull(listingRequest)) {
$.ajax({
type: 'DELETE',
url: listingRequest.uri,
@ -271,20 +271,20 @@
});
// use the listing request from when the listing completed
if (common.isEmpty(listingRequest.flowFileSummaries)) {
if (nfCommon.isEmpty(listingRequest.flowFileSummaries)) {
if (cancelled === false) {
reject = true;
// show the dialog
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Queue Listing',
dialogContent: 'The queue has no FlowFiles.'
});
}
} else {
// update the queue size
$('#total-flowfiles-count').text(common.formatInteger(listingRequest.queueSize.objectCount));
$('#total-flowfiles-size').text(common.formatDataSize(listingRequest.queueSize.byteCount));
$('#total-flowfiles-count').text(nfCommon.formatInteger(listingRequest.queueSize.objectCount));
$('#total-flowfiles-size').text(nfCommon.formatDataSize(listingRequest.queueSize.byteCount));
// update the last updated time
$('#queue-listing-last-refreshed').text(listingRequest.lastUpdated);
@ -356,7 +356,7 @@
}).done(function (response) {
listingRequest = response.listingRequest;
processListingRequest(nextDelay);
}).fail(completeListingRequest).fail(errorHandler.handleAjaxError);
}).fail(completeListingRequest).fail(nfErrorHandler.handleAjaxError);
};
// issue the request to list the flow files
@ -375,7 +375,7 @@
// process the drop request
listingRequest = response.listingRequest;
processListingRequest(1);
}).fail(completeListingRequest).fail(errorHandler.handleAjaxError);
}).fail(completeListingRequest).fail(nfErrorHandler.handleAjaxError);
}).promise();
};
@ -389,13 +389,13 @@
var formatFlowFileDetail = function (label, value) {
$('<div class="flowfile-detail"></div>').append(
$('<div class="detail-name"></div>').text(label)).append(
$('<div class="detail-value">' + common.formatValue(value) + '</div>').ellipsis()).append(
$('<div class="detail-value">' + nfCommon.formatValue(value) + '</div>').ellipsis()).append(
$('<div class="clear"></div>')).appendTo('#additional-flowfile-details');
};
// formats the content value
var formatContentValue = function (element, value) {
if (common.isDefinedAndNotNull(value)) {
if (nfCommon.isDefinedAndNotNull(value)) {
element.removeClass('unset').text(value);
} else {
element.addClass('unset').text('No value set');
@ -403,7 +403,7 @@
};
var params = {};
if (common.isDefinedAndNotNull(flowFileSummary.clusterNodeId)) {
if (nfCommon.isDefinedAndNotNull(flowFileSummary.clusterNodeId)) {
params['clusterNodeId'] = flowFileSummary.clusterNodeId;
}
@ -419,16 +419,16 @@
$('#flowfile-uri').text(flowFile.uri);
// show the flowfile details dialog
$('#flowfile-uuid').html(common.formatValue(flowFile.uuid));
$('#flowfile-filename').html(common.formatValue(flowFile.filename));
$('#flowfile-queue-position').html(common.formatValue(flowFile.position));
$('#flowfile-file-size').html(common.formatValue(flowFile.contentClaimFileSize));
$('#flowfile-queued-duration').text(common.formatDuration(flowFile.queuedDuration));
$('#flowfile-lineage-duration').text(common.formatDuration(flowFile.lineageDuration));
$('#flowfile-uuid').html(nfCommon.formatValue(flowFile.uuid));
$('#flowfile-filename').html(nfCommon.formatValue(flowFile.filename));
$('#flowfile-queue-position').html(nfCommon.formatValue(flowFile.position));
$('#flowfile-file-size').html(nfCommon.formatValue(flowFile.contentClaimFileSize));
$('#flowfile-queued-duration').text(nfCommon.formatDuration(flowFile.queuedDuration));
$('#flowfile-lineage-duration').text(nfCommon.formatDuration(flowFile.lineageDuration));
$('#flowfile-penalized').text(flowFile.penalized === true ? 'Yes' : 'No');
// conditionally show the cluster node identifier
if (common.isDefinedAndNotNull(flowFileSummary.clusterNodeId)) {
if (nfCommon.isDefinedAndNotNull(flowFileSummary.clusterNodeId)) {
// save the cluster node id
$('#flowfile-cluster-node-id').text(flowFileSummary.clusterNodeId);
@ -436,7 +436,7 @@
formatFlowFileDetail('Node Address', flowFileSummary.clusterNodeAddress);
}
if (common.isDefinedAndNotNull(flowFile.contentClaimContainer)) {
if (nfCommon.isDefinedAndNotNull(flowFile.contentClaimContainer)) {
// content claim
formatContentValue($('#content-container'), flowFile.contentClaimContainer);
formatContentValue($('#content-section'), flowFile.contentClaimSection);
@ -447,9 +447,9 @@
// input content file size
var contentSize = $('#content-size');
formatContentValue(contentSize, flowFile.contentClaimFileSize);
if (common.isDefinedAndNotNull(flowFile.contentClaimFileSize)) {
if (nfCommon.isDefinedAndNotNull(flowFile.contentClaimFileSize)) {
// over the default tooltip with the actual byte count
contentSize.attr('title', common.formatInteger(flowFile.contentClaimFileSizeBytes) + ' bytes');
contentSize.attr('title', nfCommon.formatInteger(flowFile.contentClaimFileSizeBytes) + ' bytes');
}
// show the content details
@ -465,18 +465,18 @@
$.each(flowFile.attributes, function (attributeName, attributeValue) {
// create the attribute record
var attributeRecord = $('<div class="attribute-detail"></div>')
.append($('<div class="attribute-name">' + common.formatValue(attributeName) + '</div>').ellipsis())
.append($('<div class="attribute-name">' + nfCommon.formatValue(attributeName) + '</div>').ellipsis())
.appendTo(attributesContainer);
// add the current value
attributeRecord
.append($('<div class="attribute-value">' + common.formatValue(attributeValue) + '</div>').ellipsis())
.append($('<div class="attribute-value">' + nfCommon.formatValue(attributeValue) + '</div>').ellipsis())
.append('<div class="clear"></div>');
});
// show the dialog
$('#flowfile-details-dialog').modal('show');
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
var nfQueueListing = {
@ -496,12 +496,12 @@
// function for formatting data sizes
var dataSizeFormatter = function (row, cell, value, columnDef, dataContext) {
return common.formatDataSize(value);
return nfCommon.formatDataSize(value);
};
// function for formatting durations
var durationFormatter = function (row, cell, value, columnDef, dataContext) {
return common.formatDuration(value);
return nfCommon.formatDuration(value);
};
// function for formatting penalization
@ -588,7 +588,7 @@
];
// conditionally show the cluster node identifier
if (clusterSummary.isClustered()) {
if (nfClusterSummary.isClustered()) {
queueListingColumns.push({
id: 'clusterNodeAddress',
name: 'Node',
@ -599,7 +599,7 @@
}
// add an actions column when the user can access provenance
if (common.canAccessProvenance()) {
if (nfCommon.canAccessProvenance()) {
// function for formatting actions
var actionsFormatter = function () {
return '<div title="Provenance" class="pointer icon icon-provenance view-provenance"></div>';
@ -654,7 +654,7 @@
$('#shell-close-button').click();
// open the provenance page with the specified component
shell.showPage('provenance?' + $.param({
nfShell.showPage('provenance?' + $.param({
flowFileUuid: item.uuid
}));
}
@ -688,7 +688,7 @@
$('#content-download').on('click', downloadContent);
// only show if content viewer is configured
if (common.isContentViewConfigured()) {
if (nfCommon.isContentViewConfigured()) {
$('#content-view').show();
$('#content-view').on('click', viewContent);
}
@ -730,7 +730,7 @@
$('#additional-flowfile-details').empty();
},
open: function () {
common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
}
}
});
@ -741,7 +741,7 @@
*/
resetTableSize: function () {
var queueListingGrid = $('#queue-listing-table').data('gridInstance');
if (common.isDefinedAndNotNull(queueListingGrid)) {
if (nfCommon.isDefinedAndNotNull(queueListingGrid)) {
queueListingGrid.resizeCanvas();
}
},
@ -757,7 +757,7 @@
// update the connection name
var connectionName = '';
if (connection.permissions.canRead) {
connectionName = canvasUtils.formatConnectionName(connection.component);
connectionName = nfCanvasUtils.formatConnectionName(connection.component);
}
if (connectionName === '') {
connectionName = 'Connection';
@ -765,7 +765,7 @@
$('#queue-listing-header-text').text(connectionName);
// show the listing container
shell.showContent('#queue-listing-container').done(function () {
nfShell.showContent('#queue-listing-container').done(function () {
$('#queue-listing-table').removeData('connection');
// clear the table
@ -779,7 +779,7 @@
// reset stats
$('#displayed-flowfiles, #total-flowfiles-count').text('0');
$('#total-flowfiles-size').text(common.formatDataSize(0));
$('#total-flowfiles-size').text(nfCommon.formatDataSize(0));
});
// adjust the table size

View File

@ -28,8 +28,8 @@
'nf.CanvasUtils',
'nf.ng.Bridge',
'nf.RemoteProcessGroup'],
function ($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfRemoteProcessGroup) {
return (nf.RemoteProcessGroupConfiguration = factory($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfRemoteProcessGroup));
function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfRemoteProcessGroup) {
return (nf.RemoteProcessGroupConfiguration = factory($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfRemoteProcessGroup));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.RemoteProcessGroupConfiguration =
@ -53,7 +53,7 @@
root.nf.ng.Bridge,
root.nf.RemoteProcessGroup);
}
}(this, function ($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfRemoteProcessGroup) {
}(this, function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfRemoteProcessGroup) {
'use strict';
return {
@ -75,7 +75,7 @@
// create the remote process group details
var remoteProcessGroupEntity = {
'revision': client.getRevision(remoteProcessGroupData),
'revision': nfClient.getRevision(remoteProcessGroupData),
'component': {
id: remoteProcessGroupId,
communicationsTimeout: $('#remote-process-group-timeout').val(),
@ -100,7 +100,7 @@
nfRemoteProcessGroup.set(response);
// inform Angular app values have changed
angularBridge.digest();
nfNgBridge.digest();
// close the details panel
$('#remote-process-group-configuration').modal('hide');
@ -112,15 +112,15 @@
if (errors.length === 1) {
content = $('<span></span>').text(errors[0]);
} else {
content = common.formatUnorderedList(errors);
content = nfCommon.formatUnorderedList(errors);
}
dialog.showOkDialog({
nfDialog.showOkDialog({
dialogContent: content,
headerText: 'Remote Process Group Configuration'
});
} else {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
});
}
@ -176,7 +176,7 @@
*/
showConfiguration: function (selection) {
// if the specified component is a remote process group, load its properties
if (canvasUtils.isRemoteProcessGroup(selection)) {
if (nfCanvasUtils.isRemoteProcessGroup(selection)) {
var selectionData = selection.datum();
// populate the port settings

View File

@ -22,8 +22,8 @@
define(['jquery',
'nf.Common',
'nf.CanvasUtils'],
function ($, common, canvasUtils) {
return (nf.RemoteProcessGroupDetails = factory($, common, canvasUtils));
function ($, nfCommon, nfCanvasUtils) {
return (nf.RemoteProcessGroupDetails = factory($, nfCommon, nfCanvasUtils));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.RemoteProcessGroupDetails =
@ -35,7 +35,7 @@
root.nf.Common,
root.nf.CanvasUtils);
}
}(this, function ($, common, canvasUtils) {
}(this, function ($, nfCommon, nfCanvasUtils) {
'use strict';
return {
@ -59,16 +59,16 @@
handler: {
close: function () {
// clear the remote process group details
common.clearField('read-only-remote-process-group-id');
common.clearField('read-only-remote-process-group-name');
common.clearField('read-only-remote-process-group-urls');
common.clearField('read-only-remote-process-group-timeout');
common.clearField('read-only-remote-process-group-yield-duration');
common.clearField('read-only-remote-process-group-transport-protocol');
common.clearField('read-only-remote-process-group-proxy-host');
common.clearField('read-only-remote-process-group-proxy-port');
common.clearField('read-only-remote-process-group-proxy-user');
common.clearField('read-only-remote-process-group-proxy-password');
nfCommon.clearField('read-only-remote-process-group-id');
nfCommon.clearField('read-only-remote-process-group-name');
nfCommon.clearField('read-only-remote-process-group-urls');
nfCommon.clearField('read-only-remote-process-group-timeout');
nfCommon.clearField('read-only-remote-process-group-yield-duration');
nfCommon.clearField('read-only-remote-process-group-transport-protocol');
nfCommon.clearField('read-only-remote-process-group-proxy-host');
nfCommon.clearField('read-only-remote-process-group-proxy-port');
nfCommon.clearField('read-only-remote-process-group-proxy-user');
nfCommon.clearField('read-only-remote-process-group-proxy-password');
}
}
});
@ -81,20 +81,20 @@
*/
showDetails: function (selection) {
// if the specified component is a remote process group, load its properties
if (canvasUtils.isRemoteProcessGroup(selection)) {
if (nfCanvasUtils.isRemoteProcessGroup(selection)) {
var selectionData = selection.datum();
// populate the port settings
common.populateField('read-only-remote-process-group-id', selectionData.id);
common.populateField('read-only-remote-process-group-name', selectionData.component.name);
common.populateField('read-only-remote-process-group-urls', selectionData.component.targetUris);
common.populateField('read-only-remote-process-group-timeout', selectionData.component.communicationsTimeout);
common.populateField('read-only-remote-process-group-yield-duration', selectionData.component.yieldDuration);
common.populateField('read-only-remote-process-group-transport-protocol', selectionData.component.transportProtocol);
common.populateField('read-only-remote-process-group-proxy-host', selectionData.component.proxyHost);
common.populateField('read-only-remote-process-group-proxy-port', selectionData.component.proxyPort);
common.populateField('read-only-remote-process-group-proxy-user', selectionData.component.proxyUser);
common.populateField('read-only-remote-process-group-proxy-password', selectionData.component.proxyPassword);
nfCommon.populateField('read-only-remote-process-group-id', selectionData.id);
nfCommon.populateField('read-only-remote-process-group-name', selectionData.component.name);
nfCommon.populateField('read-only-remote-process-group-urls', selectionData.component.targetUris);
nfCommon.populateField('read-only-remote-process-group-timeout', selectionData.component.communicationsTimeout);
nfCommon.populateField('read-only-remote-process-group-yield-duration', selectionData.component.yieldDuration);
nfCommon.populateField('read-only-remote-process-group-transport-protocol', selectionData.component.transportProtocol);
nfCommon.populateField('read-only-remote-process-group-proxy-host', selectionData.component.proxyHost);
nfCommon.populateField('read-only-remote-process-group-proxy-port', selectionData.component.proxyPort);
nfCommon.populateField('read-only-remote-process-group-proxy-user', selectionData.component.proxyUser);
nfCommon.populateField('read-only-remote-process-group-proxy-password', selectionData.component.proxyPassword);
// show the details
$('#remote-process-group-details').modal('show');

View File

@ -28,8 +28,8 @@
'nf.CanvasUtils',
'nf.ng.Bridge',
'nf.RemoteProcessGroup'],
function ($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfRemoteProcessGroup) {
return (nf.RemoteProcessGroupPorts = factory($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfRemoteProcessGroup));
function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfRemoteProcessGroup) {
return (nf.RemoteProcessGroupPorts = factory($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfRemoteProcessGroup));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.RemoteProcessGroupPorts =
@ -53,7 +53,7 @@
root.nf.ng.Bridge,
root.nf.RemoteProcessGroup);
}
}(this, function ($, d3, errorHandler, common, dialog, client, canvasUtils, angularBridge, nfRemoteProcessGroup) {
}(this, function ($, d3, nfErrorHandler, nfCommon, nfDialog, nfClient, nfCanvasUtils, nfNgBridge, nfRemoteProcessGroup) {
'use strict';
/**
@ -82,7 +82,7 @@
// create the remote process group details
var remoteProcessGroupPortEntity = {
'revision': client.getRevision(remoteProcessGroupData),
'revision': nfClient.getRevision(remoteProcessGroupData),
'remoteProcessGroupPort': {
id: remotePortId,
groupId: remoteProcessGroupId,
@ -129,22 +129,22 @@
if (errors.length === 1) {
content = $('<span></span>').text(errors[0]);
} else {
content = common.formatUnorderedList(errors);
content = nfCommon.formatUnorderedList(errors);
}
dialog.showOkDialog({
nfDialog.showOkDialog({
dialogContent: content,
headerText: 'Remote Process Group Ports'
});
} else {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
}).always(function () {
// close the dialog
$('#remote-port-configuration').modal('hide');
});
} else {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Remote Process Group Ports',
dialogContent: 'Concurrent tasks must be an integer value.'
});
@ -202,7 +202,7 @@
var remoteProcessGroupData = remoteProcessGroup.datum();
// if can modify, the over status of this node may have changed
if (canvasUtils.canModify(remoteProcessGroup)) {
if (nfCanvasUtils.canModify(remoteProcessGroup)) {
// reload the remote process group
nfRemoteProcessGroup.reload(remoteProcessGroupData.id);
}
@ -221,8 +221,8 @@
// clear any tooltips
var dialog = $('#remote-process-group-ports');
common.cleanUpTooltips(dialog, 'div.remote-port-removed');
common.cleanUpTooltips(dialog, 'div.concurrent-tasks-info');
nfCommon.cleanUpTooltips(dialog, 'div.remote-port-removed');
nfCommon.cleanUpTooltips(dialog, 'div.concurrent-tasks-info');
// clear the input and output ports
$('#remote-process-group-input-ports-container').empty();
@ -240,7 +240,7 @@
* @argument {string} portType The type of port
*/
var createPortOption = function (container, port, portType) {
var portId = common.escapeHtml(port.id);
var portId = nfCommon.escapeHtml(port.id);
var portContainer = $('<div class="remote-port-container"></div>').appendTo(container);
var portContainerEditContainer = $('<div class="remote-port-edit-container"></div>').appendTo(portContainer);
var portContainerDetailsContainer = $('<div class="remote-port-details-container"></div>').appendTo(portContainer);
@ -250,25 +250,25 @@
var remoteProcessGroup = d3.select('#id-' + remoteProcessGroupId);
// if can modify, support updating the remote group port
if (canvasUtils.canModify(remoteProcessGroup)) {
if (nfCanvasUtils.canModify(remoteProcessGroup)) {
// show the enabled transmission switch
var transmissionSwitch;
if (port.connected === true) {
if (port.transmitting === true) {
transmissionSwitch = (angularBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary enabled-active-transmission" aria-label="Toggle port transmission"></md-switch>'))(angularBridge.rootScope)).appendTo(portContainerEditContainer);
transmissionSwitch = (nfNgBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary enabled-active-transmission" aria-label="Toggle port transmission"></md-switch>'))(nfNgBridge.rootScope)).appendTo(portContainerEditContainer);
transmissionSwitch.click();
} else {
if (port.exists === true) {
transmissionSwitch = (angularBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary enabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(angularBridge.rootScope)).appendTo(portContainerEditContainer);
transmissionSwitch = (nfNgBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary enabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(nfNgBridge.rootScope)).appendTo(portContainerEditContainer);
} else {
(angularBridge.injector.get('$compile')($('<md-switch ng-disabled="true" style="margin:0px" class="md-primary disabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(angularBridge.rootScope)).appendTo(portContainerEditContainer);
(nfNgBridge.injector.get('$compile')($('<md-switch ng-disabled="true" style="margin:0px" class="md-primary disabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(nfNgBridge.rootScope)).appendTo(portContainerEditContainer);
}
}
} else {
if (port.transmitting === true) {
(angularBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary disabled-active-transmission" aria-label="Toggle port transmission"></md-switch>'))(angularBridge.rootScope)).appendTo(portContainerEditContainer);
(nfNgBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary disabled-active-transmission" aria-label="Toggle port transmission"></md-switch>'))(nfNgBridge.rootScope)).appendTo(portContainerEditContainer);
} else {
(angularBridge.injector.get('$compile')($('<md-switch ng-disabled="true" style="margin:0px" class="md-primary disabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(angularBridge.rootScope)).appendTo(portContainerEditContainer);
(nfNgBridge.injector.get('$compile')($('<md-switch ng-disabled="true" style="margin:0px" class="md-primary disabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(nfNgBridge.rootScope)).appendTo(portContainerEditContainer);
}
}
@ -292,14 +292,14 @@
}
} else if (port.exists === false) {
$('<div class="remote-port-removed"/>').appendTo(portContainerEditContainer).qtip($.extend({},
common.config.tooltipConfig,
nfCommon.config.tooltipConfig,
{
content: 'This port has been removed.'
}));
}
// only allow modifications to transmission when the swtich is defined
if (common.isDefinedAndNotNull(transmissionSwitch)) {
if (nfCommon.isDefinedAndNotNull(transmissionSwitch)) {
// create toggle for changing transmission state
transmissionSwitch.click(function () {
// get the component being edited
@ -314,7 +314,7 @@
// create the remote process group details
var remoteProcessGroupPortEntity = {
'revision': client.getRevision(remoteProcessGroupData),
'revision': nfClient.getRevision(remoteProcessGroupData),
'remoteProcessGroupPort': {
id: port.id,
groupId: remoteProcessGroupId,
@ -349,7 +349,7 @@
transmissionSwitch.removeClass('enabled-active-transmission enabled-inactive-transmission').addClass('disabled-inactive-transmission').off('click');
// hide the edit button
if (common.isDefinedAndNotNull(editRemotePort)) {
if (nfCommon.isDefinedAndNotNull(editRemotePort)) {
editRemotePort.hide();
}
} else {
@ -359,7 +359,7 @@
transmissionSwitch.removeClass('enabled-active-transmission enabled-inactive-transmission').addClass('enabled-active-transmission');
// hide the edit button
if (common.isDefinedAndNotNull(editRemotePort)) {
if (nfCommon.isDefinedAndNotNull(editRemotePort)) {
editRemotePort.hide();
}
} else {
@ -367,7 +367,7 @@
transmissionSwitch.removeClass('enabled-active-transmission enabled-inactive-transmission').addClass('enabled-inactive-transmission');
// show the edit button
if (common.isDefinedAndNotNull(editRemotePort)) {
if (nfCommon.isDefinedAndNotNull(editRemotePort)) {
editRemotePort.show();
}
}
@ -380,15 +380,15 @@
if (errors.length === 1) {
content = $('<span></span>').text(errors[0]);
} else {
content = common.formatUnorderedList(errors);
content = nfCommon.formatUnorderedList(errors);
}
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Remote Process Group Ports',
dialogContent: content
});
} else {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
});
});
@ -396,9 +396,9 @@
} else {
// show the disabled transmission switch
if (port.transmitting === true) {
(angularBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary disabled-active-transmission" aria-label="Toggle port transmission"></md-switch>'))(angularBridge.rootScope)).appendTo(portContainerEditContainer);
(nfNgBridge.injector.get('$compile')($('<md-switch style="margin:0px" class="md-primary disabled-active-transmission" aria-label="Toggle port transmission"></md-switch>'))(nfNgBridge.rootScope)).appendTo(portContainerEditContainer);
} else {
(angularBridge.injector.get('$compile')($('<md-switch ng-disabled="true" style="margin:0px" class="md-primary disabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(angularBridge.rootScope)).appendTo(portContainerEditContainer);
(nfNgBridge.injector.get('$compile')($('<md-switch ng-disabled="true" style="margin:0px" class="md-primary disabled-inactive-transmission" aria-label="Toggle port transmission"></md-switch>'))(nfNgBridge.rootScope)).appendTo(portContainerEditContainer);
}
}
@ -410,7 +410,7 @@
$('<div class="clear"></div>').appendTo(portContainerDetailsContainer);
// add the comments for this port
if (common.isBlank(port.comments)) {
if (nfCommon.isBlank(port.comments)) {
$('<div class="remote-port-description unset">No description specified.</div>').appendTo(portContainerDetailsContainer);
} else {
$('<div class="remote-port-description"></div>').text(port.comments).appendTo(portContainerDetailsContainer);
@ -431,7 +431,7 @@
'<div class="processor-setting concurrent-tasks-info fa fa-question-circle"></div>' +
'</div>' +
'</div>').append(concurrentTasks).appendTo(concurrentTasksContainer).find('div.concurrent-tasks-info').qtip($.extend({},
common.config.tooltipConfig,
nfCommon.config.tooltipConfig,
{
content: 'The number of tasks that should be concurrently scheduled for this port.'
}));
@ -461,7 +461,7 @@
portContainer.find('.ellipsis').ellipsis();
// inform Angular app values have changed
angularBridge.digest();
nfNgBridge.digest();
};
/**
@ -506,7 +506,7 @@
*/
showPorts: function (selection) {
// if the specified component is a remote process group, load its properties
if (canvasUtils.isRemoteProcessGroup(selection)) {
if (nfCanvasUtils.isRemoteProcessGroup(selection)) {
var selectionData = selection.datum();
// load the properties for the specified component
@ -527,7 +527,7 @@
// get the contents
var remoteProcessGroupContents = remoteProcessGroup.contents;
if (common.isDefinedAndNotNull(remoteProcessGroupContents)) {
if (nfCommon.isDefinedAndNotNull(remoteProcessGroupContents)) {
var connectedInputPorts = [];
var disconnectedInputPorts = [];
@ -551,7 +551,7 @@
createPortOption(inputPortContainer, inputPort, 'input');
});
if (common.isEmpty(connectedInputPorts) && common.isEmpty(disconnectedInputPorts)) {
if (nfCommon.isEmpty(connectedInputPorts) && nfCommon.isEmpty(disconnectedInputPorts)) {
$('<div class="unset"></div>').text("No ports to display").appendTo(inputPortContainer);
}
@ -578,14 +578,14 @@
createPortOption(outputPortContainer, outputPort, 'output');
});
if (common.isEmpty(connectedOutputPorts) && common.isEmpty(disconnectedOutputPorts)) {
if (nfCommon.isEmpty(connectedOutputPorts) && nfCommon.isEmpty(disconnectedOutputPorts)) {
$('<div class="unset"></div>').text("No ports to display").appendTo(outputPortContainer);
}
}
// show the details
$('#remote-process-group-ports').modal('show');
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
}
};

View File

@ -25,8 +25,8 @@
'nf.Common',
'nf.Client',
'nf.CanvasUtils'],
function ($, d3, connection, common, client, canvasUtils) {
return (nf.RemoteProcessGroup = factory($, d3, connection, common, client, canvasUtils));
function ($, d3, nfConnection, nfCommon, nfClient, nfCanvasUtils) {
return (nf.RemoteProcessGroup = factory($, d3, nfConnection, nfCommon, nfClient, nfCanvasUtils));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.RemoteProcessGroup =
@ -44,7 +44,7 @@
root.nf.Client,
root.nf.CanvasUtils);
}
}(this, function ($, d3, connection, common, client, canvasUtils) {
}(this, function ($, d3, nfConnection, nfCommon, nfClient, nfCanvasUtils) {
'use strict';
var nfConnectable;
@ -88,7 +88,7 @@
* @param {object} d
*/
var getProcessGroupComments = function (d) {
if (common.isBlank(d.component.comments)) {
if (nfCommon.isBlank(d.component.comments)) {
return 'No comments specified';
} else {
return d.component.comments;
@ -123,7 +123,7 @@
'class': 'remote-process-group component'
})
.classed('selected', selected)
.call(canvasUtils.position);
.call(nfCanvasUtils.position);
// ----
// body
@ -211,7 +211,7 @@
var details = remoteProcessGroup.select('g.remote-process-group-details');
// update the component behavior as appropriate
canvasUtils.editable(remoteProcessGroup, nfConnectable, nfDraggable);
nfCanvasUtils.editable(remoteProcessGroup, nfConnectable, nfDraggable);
// if this processor is visible, render everything
if (remoteProcessGroup.classed('visible')) {
@ -532,7 +532,7 @@
remoteProcessGroupUri.text(null).selectAll('title').remove();
// apply ellipsis to the remote process group name as necessary
canvasUtils.ellipsis(remoteProcessGroupUri, d.component.targetUris);
nfCanvasUtils.ellipsis(remoteProcessGroupUri, d.component.targetUris);
}).append('title').text(function (d) {
return d.component.name;
});
@ -571,7 +571,7 @@
});
// add the tooltip
canvasUtils.canvasTooltip(tip, d3.select(this));
nfCanvasUtils.canvasTooltip(tip, d3.select(this));
});
// ---------------
@ -587,9 +587,9 @@
remoteProcessGroupComments.text(null).selectAll('tspan, title').remove();
// apply ellipsis to the port name as necessary
canvasUtils.ellipsis(remoteProcessGroupComments, getProcessGroupComments(d));
nfCanvasUtils.ellipsis(remoteProcessGroupComments, getProcessGroupComments(d));
}).classed('unset', function (d) {
return common.isBlank(d.component.comments);
return nfCommon.isBlank(d.component.comments);
}).append('title').text(function (d) {
return getProcessGroupComments(d);
});
@ -600,7 +600,7 @@
details.select('text.remote-process-group-last-refresh')
.text(function (d) {
if (common.isDefinedAndNotNull(d.component.flowRefreshed)) {
if (nfCommon.isDefinedAndNotNull(d.component.flowRefreshed)) {
return d.component.flowRefreshed;
} else {
return 'Remote flow not current';
@ -616,7 +616,7 @@
remoteProcessGroupName.text(null).selectAll('title').remove();
// apply ellipsis to the remote process group name as necessary
canvasUtils.ellipsis(remoteProcessGroupName, d.component.name);
nfCanvasUtils.ellipsis(remoteProcessGroupName, d.component.name);
}).append('title').text(function (d) {
return d.component.name;
});
@ -680,13 +680,13 @@
// sent count value
updated.select('text.remote-process-group-sent tspan.count')
.text(function (d) {
return common.substringBeforeFirst(d.status.aggregateSnapshot.sent, ' ');
return nfCommon.substringBeforeFirst(d.status.aggregateSnapshot.sent, ' ');
});
// sent size value
updated.select('text.remote-process-group-sent tspan.size')
.text(function (d) {
return ' ' + common.substringAfterFirst(d.status.aggregateSnapshot.sent, ' ');
return ' ' + nfCommon.substringAfterFirst(d.status.aggregateSnapshot.sent, ' ');
});
// sent ports value
@ -704,13 +704,13 @@
// received count value
updated.select('text.remote-process-group-received tspan.count')
.text(function (d) {
return common.substringBeforeFirst(d.status.aggregateSnapshot.received, ' ');
return nfCommon.substringBeforeFirst(d.status.aggregateSnapshot.received, ' ');
});
// received size value
updated.select('text.remote-process-group-received tspan.size')
.text(function (d) {
return ' ' + common.substringAfterFirst(d.status.aggregateSnapshot.received, ' ');
return ' ' + nfCommon.substringAfterFirst(d.status.aggregateSnapshot.received, ' ');
});
// --------------------
@ -723,7 +723,7 @@
.text(function (d) {
var icon = '';
if (d.permissions.canRead) {
if (!common.isEmpty(d.component.authorizationIssues)) {
if (!nfCommon.isEmpty(d.component.authorizationIssues)) {
icon = '\uf071';
} else if (d.component.transmitting === true) {
icon = '\uf140';
@ -736,7 +736,7 @@
.attr('font-family', function (d) {
var family = '';
if (d.permissions.canRead) {
if (!common.isEmpty(d.component.authorizationIssues) || d.component.transmitting) {
if (!nfCommon.isEmpty(d.component.authorizationIssues) || d.component.transmitting) {
family = 'FontAwesome';
} else {
family = 'flowfont';
@ -745,20 +745,20 @@
return family;
})
.classed('invalid', function (d) {
return d.permissions.canRead && !common.isEmpty(d.component.authorizationIssues);
return d.permissions.canRead && !nfCommon.isEmpty(d.component.authorizationIssues);
})
.classed('transmitting', function (d) {
return d.permissions.canRead && common.isEmpty(d.component.authorizationIssues) && d.component.transmitting === true;
return d.permissions.canRead && nfCommon.isEmpty(d.component.authorizationIssues) && d.component.transmitting === true;
})
.classed('not-transmitting', function (d) {
return d.permissions.canRead && common.isEmpty(d.component.authorizationIssues) && d.component.transmitting === false;
return d.permissions.canRead && nfCommon.isEmpty(d.component.authorizationIssues) && d.component.transmitting === false;
})
.each(function (d) {
// get the tip
var tip = d3.select('#authorization-issues-' + d.id);
// if there are validation errors generate a tooltip
if (d.permissions.canRead && !common.isEmpty(d.component.authorizationIssues)) {
if (d.permissions.canRead && !nfCommon.isEmpty(d.component.authorizationIssues)) {
// create the tip if necessary
if (tip.empty()) {
tip = d3.select('#remote-process-group-tooltips').append('div')
@ -770,7 +770,7 @@
// update the tip
tip.html(function () {
var list = common.formatUnorderedList(d.component.authorizationIssues);
var list = nfCommon.formatUnorderedList(d.component.authorizationIssues);
if (list === null || list.length === 0) {
return '';
} else {
@ -779,7 +779,7 @@
});
// add the tooltip
canvasUtils.canvasTooltip(tip, d3.select(this));
nfCanvasUtils.canvasTooltip(tip, d3.select(this));
} else {
if (!tip.empty()) {
tip.remove();
@ -795,7 +795,7 @@
// active thread count
// -------------------
canvasUtils.activeThreadCount(remoteProcessGroup, d, function (off) {
nfCanvasUtils.activeThreadCount(remoteProcessGroup, d, function (off) {
offset = off;
});
@ -804,10 +804,10 @@
// ---------
remoteProcessGroup.select('rect.bulletin-background').classed('has-bulletins', function () {
return !common.isEmpty(d.status.aggregateSnapshot.bulletins);
return !nfCommon.isEmpty(d.status.aggregateSnapshot.bulletins);
});
canvasUtils.bulletins(remoteProcessGroup, d, function () {
nfCanvasUtils.bulletins(remoteProcessGroup, d, function () {
return d3.select('#remote-process-group-tooltips');
}, offset);
});
@ -843,12 +843,17 @@
var nfRemoteProcessGroup = {
/**
* Initializes of the Process Group handler.
*
* @param nfConnectableRef The nfConnectable module.
* @param nfDraggableRef The nfDraggable module.
* @param nfSelectableRef The nfSelectable module.
* @param nfContextMenuRef The nfContextMenu module.
*/
init: function (connectable, draggable, selectable, contextMenu) {
nfConnectable = connectable;
nfDraggable = draggable;
nfSelectable = selectable;
nfContextMenu = contextMenu;
init: function (nfConnectableRef, nfDraggableRef, nfSelectableRef, nfContextMenuRef) {
nfConnectable = nfConnectableRef;
nfDraggable = nfDraggableRef;
nfSelectable = nfSelectableRef;
nfContextMenu = nfContextMenuRef;
remoteProcessGroupMap = d3.map();
removedCache = d3.map();
@ -870,8 +875,8 @@
*/
add: function (remoteProcessGroupEntities, options) {
var selectAll = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
}
// get the current time
@ -892,7 +897,7 @@
$.each(remoteProcessGroupEntities, function (_, remoteProcessGroupEntity) {
add(remoteProcessGroupEntity);
});
} else if (common.isDefinedAndNotNull(remoteProcessGroupEntities)) {
} else if (nfCommon.isDefinedAndNotNull(remoteProcessGroupEntities)) {
add(remoteProcessGroupEntities);
}
@ -911,16 +916,16 @@
set: function (remoteProcessGroupEntities, options) {
var selectAll = false;
var transition = false;
if (common.isDefinedAndNotNull(options)) {
selectAll = common.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
transition = common.isDefinedAndNotNull(options.transition) ? options.transition : transition;
if (nfCommon.isDefinedAndNotNull(options)) {
selectAll = nfCommon.isDefinedAndNotNull(options.selectAll) ? options.selectAll : selectAll;
transition = nfCommon.isDefinedAndNotNull(options.transition) ? options.transition : transition;
}
var set = function (proposedRemoteProcessGroupEntity) {
var currentRemoteProcessGroupEntity = remoteProcessGroupMap.get(proposedRemoteProcessGroupEntity.id);
// set the remote process group if appropriate due to revision and wasn't previously removed
if (client.isNewerRevision(currentRemoteProcessGroupEntity, proposedRemoteProcessGroupEntity) && !removedCache.has(proposedRemoteProcessGroupEntity.id)) {
if (nfClient.isNewerRevision(currentRemoteProcessGroupEntity, proposedRemoteProcessGroupEntity) && !removedCache.has(proposedRemoteProcessGroupEntity.id)) {
remoteProcessGroupMap.set(proposedRemoteProcessGroupEntity.id, $.extend({
type: 'RemoteProcessGroup',
dimensions: dimensions
@ -944,14 +949,14 @@
$.each(remoteProcessGroupEntities, function (_, remoteProcessGroupEntity) {
set(remoteProcessGroupEntity);
});
} else if (common.isDefinedAndNotNull(remoteProcessGroupEntities)) {
} else if (nfCommon.isDefinedAndNotNull(remoteProcessGroupEntities)) {
set(remoteProcessGroupEntities);
}
// apply the selection and handle all new remote process groups
var selection = select();
selection.enter().call(renderRemoteProcessGroups, selectAll);
selection.call(updateRemoteProcessGroups).call(canvasUtils.position, transition);
selection.call(updateRemoteProcessGroups).call(nfCanvasUtils.position, transition);
selection.exit().call(removeRemoteProcessGroups);
},
@ -962,7 +967,7 @@
* @param {string} id
*/
get: function (id) {
if (common.isUndefined(id)) {
if (nfCommon.isUndefined(id)) {
return remoteProcessGroupMap.values();
} else {
return remoteProcessGroupMap.get(id);
@ -976,7 +981,7 @@
* @param {string} id Optional
*/
refresh: function (id) {
if (common.isDefinedAndNotNull(id)) {
if (nfCommon.isDefinedAndNotNull(id)) {
d3.select('#id-' + id).call(updateRemoteProcessGroups);
} else {
d3.selectAll('g.remote-process-group').call(updateRemoteProcessGroups);
@ -1007,10 +1012,10 @@
nfRemoteProcessGroup.set(response);
// reload the group's connections
var connections = connection.getComponentConnections(id);
var connections = nfConnection.getComponentConnections(id);
$.each(connections, function (_, connection) {
if (connection.permissions.canRead) {
connection.reload(connection.id);
nfConnection.reload(connection.id);
}
});
});
@ -1023,7 +1028,7 @@
* @param {string} id The id
*/
position: function (id) {
d3.select('#id-' + id).call(canvasUtils.position);
d3.select('#id-' + id).call(nfCanvasUtils.position);
},
/**

View File

@ -28,8 +28,8 @@
'nf.ControllerServices',
'nf.UniversalCapture',
'nf.CustomUi'],
function ($, errorHandler, common, dialog, client, controllerService, controllerServices, universalCapture, customUi) {
return (nf.ReportingTask = factory($, errorHandler, common, dialog, client, controllerService, controllerServices, universalCapture, customUi));
function ($, nfErrorHandler, nfCommon, nfDialog, nfClient, nfControllerService, nfControllerServices, nfUniversalCapture, nfCustomUi) {
return (nf.ReportingTask = factory($, nfErrorHandler, nfCommon, nfDialog, nfClient, nfControllerService, nfControllerServices, nfUniversalCapture, nfCustomUi));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ReportingTask =
@ -53,7 +53,7 @@
root.nf.UniversalCapture,
root.nf.CustomUi);
}
}(this, function ($, errorHandler, common, dialog, client, controllerService, controllerServices, universalCapture, customUi) {
}(this, function ($, nfErrorHandler, nfCommon, nfDialog, nfClient, nfControllerService, nfControllerServices, nfUniversalCapture, nfCustomUi) {
'use strict';
var nfSettings;
@ -93,15 +93,15 @@
if (errors.length === 1) {
content = $('<span></span>').text(errors[0]);
} else {
content = common.formatUnorderedList(errors);
content = nfCommon.formatUnorderedList(errors);
}
dialog.showOkDialog({
nfDialog.showOkDialog({
dialogContent: content,
headerText: 'Reporting Task'
});
} else {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
};
@ -141,7 +141,7 @@
}
// check the scheduling period
if (common.isDefinedAndNotNull(schedulingPeriod) && schedulingPeriod.val() !== (entity.component['schedulingPeriod'] + '')) {
if (nfCommon.isDefinedAndNotNull(schedulingPeriod) && schedulingPeriod.val() !== (entity.component['schedulingPeriod'] + '')) {
return true;
}
@ -204,13 +204,13 @@
var errors = [];
var reportingTask = details['component'];
if (common.isBlank(reportingTask['schedulingPeriod'])) {
if (nfCommon.isBlank(reportingTask['schedulingPeriod'])) {
errors.push('Run schedule must be specified');
}
if (errors.length > 0) {
dialog.showOkDialog({
dialogContent: common.formatUnorderedList(errors),
nfDialog.showOkDialog({
dialogContent: nfCommon.formatUnorderedList(errors),
headerText: 'Reporting Task'
});
return false;
@ -241,7 +241,7 @@
*/
var setRunning = function (reportingTaskEntity, running) {
var entity = {
'revision': client.getRevision(reportingTaskEntity),
'revision': nfClient.getRevision(reportingTaskEntity),
'component': {
'id': reportingTaskEntity.id,
'state': running === true ? 'RUNNING' : 'STOPPED'
@ -257,8 +257,8 @@
}).done(function (response) {
// update the task
renderReportingTask(response);
controllerService.reloadReferencedServices(getControllerServicesTable(), response.component);
}).fail(errorHandler.handleAjaxError);
nfControllerService.reloadReferencedServices(getControllerServicesTable(), response.component);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -272,7 +272,7 @@
// determine if changes have been made
if (isSaveRequired()) {
// see if those changes should be saved
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'Save',
dialogContent: 'Save changes before going to this Controller Service?',
noHandler: function () {
@ -304,7 +304,7 @@
// ensure details are valid as far as we can tell
if (validateDetails(updatedReportingTask)) {
updatedReportingTask['revision'] = client.getRevision(reportingTaskEntity);
updatedReportingTask['revision'] = nfClient.getRevision(reportingTaskEntity);
// update the selected component
return $.ajax({
@ -338,15 +338,17 @@
propertyName: propertyName
},
dataType: 'json'
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
var nfReportingTask = {
/**
* Initializes the reporting task configuration dialog.
*
* @param nfSettingsRef The nfSettings module.
*/
init: function (settings) {
nfSettings = settings;
init: function (nfSettingsRef) {
nfSettings = nfSettingsRef;
// initialize the configuration dialog tabs
$('#reporting-task-configuration-tabs').tabbs({
@ -365,7 +367,7 @@
}],
select: function () {
// remove all property detail dialogs
universalCapture.removeAllPropertyDetailDialogs();
nfUniversalCapture.removeAllPropertyDetailDialogs();
// update the property table size in case this is the first time its rendered
if ($(this).text() === 'Properties') {
@ -390,13 +392,13 @@
$('#reporting-task-properties').propertytable('clear');
// clear the comments
common.clearField('read-only-reporting-task-comments');
nfCommon.clearField('read-only-reporting-task-comments');
// removed the cached reporting task details
$('#reporting-task-configuration').removeData('reportingTaskDetails');
},
open: function () {
common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
}
}
});
@ -408,7 +410,7 @@
dialogContainer: '#new-reporting-task-property-container',
descriptorDeferred: getReportingTaskPropertyDescriptor,
controllerServiceCreatedDeferred: function (response) {
return controllerServices.loadControllerServices(controllerServicesUri, $('#controller-services-table'));
return nfControllerServices.loadControllerServices(controllerServicesUri, $('#controller-services-table'));
},
goToServiceDeferred: goToServiceFromProperty
});
@ -433,7 +435,7 @@
dialogContainer: '#new-reporting-task-property-container',
descriptorDeferred: getReportingTaskPropertyDescriptor,
controllerServiceCreatedDeferred: function (response) {
return controllerServices.loadControllerServices(controllerServicesUri, $('#controller-services-table'));
return nfControllerServices.loadControllerServices(controllerServicesUri, $('#controller-services-table'));
},
goToServiceDeferred: goToServiceFromProperty
});
@ -475,8 +477,8 @@
}
// populate the reporting task settings
common.populateField('reporting-task-id', reportingTask['id']);
common.populateField('reporting-task-type', common.substringAfterLast(reportingTask['type'], '.'));
nfCommon.populateField('reporting-task-id', reportingTask['id']);
nfCommon.populateField('reporting-task-type', nfCommon.substringAfterLast(reportingTask['type'], '.'));
$('#reporting-task-name').val(reportingTask['name']);
$('#reporting-task-enabled').removeClass('checkbox-unchecked checkbox-checked').addClass(reportingTaskEnableStyle);
$('#reporting-task-comments').val(reportingTask['comments']);
@ -533,7 +535,7 @@
// save the reporting task
saveReportingTask(reportingTaskEntity).done(function (response) {
// reload the reporting task
controllerService.reloadReferencedServices(getControllerServicesTable(), response.component);
nfControllerService.reloadReferencedServices(getControllerServicesTable(), response.component);
// close the details panel
$('#reporting-task-configuration').modal('hide');
@ -556,7 +558,7 @@
}];
// determine if we should show the advanced button
if (common.isDefinedAndNotNull(reportingTask.customUiUrl) && reportingTask.customUiUrl !== '') {
if (nfCommon.isDefinedAndNotNull(reportingTask.customUiUrl) && reportingTask.customUiUrl !== '') {
buttons.push({
buttonText: 'Advanced',
clazz: 'fa fa-cog button-icon',
@ -575,10 +577,10 @@
$('#shell-close-button').click();
// show the custom ui
customUi.showCustomUi(reportingTaskEntity, reportingTask.customUiUrl, true).done(function () {
nfCustomUi.showCustomUi(reportingTaskEntity, reportingTask.customUiUrl, true).done(function () {
// once the custom ui is closed, reload the reporting task
nfReportingTask.reload(reportingTaskEntity.id).done(function (response) {
controllerService.reloadReferencedServices(getControllerServicesTable(), response.reportingTask);
nfControllerService.reloadReferencedServices(getControllerServicesTable(), response.reportingTask);
});
// show the settings
@ -592,7 +594,7 @@
// determine if changes have been made
if (isSaveRequired()) {
// see if those changes should be saved
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'Save',
dialogContent: 'Save changes before opening the advanced configuration?',
noHandler: openCustomUi,
@ -624,7 +626,7 @@
$('#reporting-task-configuration').modal('show');
$('#reporting-task-properties').propertytable('resetTableSize');
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
},
/**
@ -673,10 +675,10 @@
var reportingTaskHistory = historyResponse[0].componentHistory;
// populate the reporting task settings
common.populateField('reporting-task-id', reportingTask['id']);
common.populateField('reporting-task-type', common.substringAfterLast(reportingTask['type'], '.'));
common.populateField('read-only-reporting-task-name', reportingTask['name']);
common.populateField('read-only-reporting-task-comments', reportingTask['comments']);
nfCommon.populateField('reporting-task-id', reportingTask['id']);
nfCommon.populateField('reporting-task-type', nfCommon.substringAfterLast(reportingTask['type'], '.'));
nfCommon.populateField('read-only-reporting-task-name', reportingTask['name']);
nfCommon.populateField('read-only-reporting-task-comments', reportingTask['comments']);
// make the scheduling strategy human readable
var schedulingStrategy = reportingTask['schedulingStrategy'];
@ -685,8 +687,8 @@
} else {
schedulingStrategy = "Timer driven";
}
common.populateField('read-only-reporting-task-scheduling-strategy', schedulingStrategy);
common.populateField('read-only-reporting-task-scheduling-period', reportingTask['schedulingPeriod']);
nfCommon.populateField('read-only-reporting-task-scheduling-strategy', schedulingStrategy);
nfCommon.populateField('read-only-reporting-task-scheduling-period', reportingTask['schedulingPeriod']);
var buttons = [{
buttonText: 'Ok',
@ -704,7 +706,7 @@
}];
// determine if we should show the advanced button
if (common.isDefinedAndNotNull(customUi) && common.isDefinedAndNotNull(reportingTask.customUiUrl) && reportingTask.customUiUrl !== '') {
if (nfCommon.isDefinedAndNotNull(nfCustomUi) && nfCommon.isDefinedAndNotNull(reportingTask.customUiUrl) && reportingTask.customUiUrl !== '') {
buttons.push({
buttonText: 'Advanced',
clazz: 'fa fa-cog button-icon',
@ -722,7 +724,7 @@
$('#shell-close-button').click();
// show the custom ui
customUi.showCustomUi(reportingTaskEntity, reportingTask.customUiUrl, false).done(function () {
nfCustomUi.showCustomUi(reportingTaskEntity, reportingTask.customUiUrl, false).done(function () {
nfSettings.showSettings();
});
}
@ -777,7 +779,7 @@
dataType: 'json'
}).done(function (response) {
renderReportingTask(response);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
},
/**
@ -787,9 +789,9 @@
*/
promptToDeleteReportingTask: function (reportingTaskEntity) {
// prompt for deletion
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'Delete Reporting Task',
dialogContent: 'Delete reporting task \'' + common.escapeHtml(reportingTaskEntity.component.name) + '\'?',
dialogContent: 'Delete reporting task \'' + nfCommon.escapeHtml(reportingTaskEntity.component.name) + '\'?',
yesHandler: function () {
nfReportingTask.remove(reportingTaskEntity);
}
@ -804,7 +806,7 @@
remove: function (reportingTaskEntity) {
// prompt for removal?
var revision = client.getRevision(reportingTaskEntity);
var revision = nfClient.getRevision(reportingTaskEntity);
$.ajax({
type: 'DELETE',
url: reportingTaskEntity.uri + '?' + $.param({
@ -817,7 +819,7 @@
var reportingTaskGrid = $('#reporting-tasks-table').data('gridInstance');
var reportingTaskData = reportingTaskGrid.getData();
reportingTaskData.deleteItem(reportingTaskEntity.id);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
};

View File

@ -22,8 +22,8 @@
define(['d3',
'nf.ng.Bridge',
'nf.ContextMenu'],
function (d3, angularBridge, contextMenu) {
return (nf.Selectable = factory(d3, angularBridge, contextMenu));
function (d3, nfNgBridge, nfContextMenu) {
return (nf.Selectable = factory(d3, nfNgBridge, nfContextMenu));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Selectable =
@ -35,14 +35,14 @@
root.nf.ng.Bridge,
root.nf.ContextMenu);
}
}(this, function (d3, angularBridge, contextMenu) {
}(this, function (d3, nfNgBridge, nfContextMenu) {
'use strict';
var nfSelectable = {
select: function (g) {
// hide any context menus as necessary
contextMenu.hide();
nfContextMenu.hide();
// only need to update selection if necessary
if (!g.classed('selected')) {
@ -62,7 +62,7 @@
// inform Angular app that values have changed since the
// enabled operate palette buttons are based off of the selection
angularBridge.digest();
nfNgBridge.digest();
// stop propagation
d3.event.stopPropagation();

View File

@ -32,8 +32,8 @@
'nf.Shell',
'nf.ComponentState',
'nf.PolicyManagement'],
function ($, Slick, d3, client, dialog, common, canvasUtils, controllerServices, errorHandler, reportingTask, shell, componentState, policyManagement) {
return (nf.Settings = factory($, Slick, d3, client, dialog, common, canvasUtils, controllerServices, errorHandler, reportingTask, shell, componentState, policyManagement));
function ($, Slick, d3, nfClient, nfDialog, nfCommon, nfCanvasUtils, nfControllerServices, nfErrorHandler, nfReportingTask, nfShell, nfComponentState, nfPolicyManagement) {
return (nf.Settings = factory($, Slick, d3, nfClient, nfDialog, nfCommon, nfCanvasUtils, nfControllerServices, nfErrorHandler, nfReportingTask, nfShell, nfComponentState, nfPolicyManagement));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Settings =
@ -65,7 +65,7 @@
root.nf.ComponentState,
root.nf.PolicyManagement);
}
}(this, function ($, Slick, d3, client, dialog, common, canvasUtils, controllerServices, errorHandler, reportingTask, shell, componentState, policyManagement) {
}(this, function ($, Slick, d3, nfClient, nfDialog, nfCommon, nfCanvasUtils, nfControllerServices, nfErrorHandler, nfReportingTask, nfShell, nfComponentState, nfPolicyManagement) {
'use strict';
@ -107,7 +107,7 @@
// marshal the configuration details
var configuration = marshalConfiguration();
var entity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': version
}
@ -124,7 +124,7 @@
contentType: 'application/json'
}).done(function (response) {
// close the settings dialog
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Settings',
dialogContent: 'Settings successfully applied.'
});
@ -133,7 +133,7 @@
$('#settings-save').off('click').on('click', function () {
saveSettings(response.revision.version);
});
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
/**
@ -211,7 +211,7 @@
* @param item reporting task type
*/
var isSelectable = function (item) {
return common.isBlank(item.usageRestriction) || common.canAccessRestrictedComponents();
return nfCommon.isBlank(item.usageRestriction) || nfCommon.canAccessRestrictedComponents();
};
/**
@ -247,7 +247,7 @@
return '';
}
return common.substringAfterLast(dataContext.component.type, '.');
return nfCommon.substringAfterLast(dataContext.component.type, '.');
};
/**
@ -262,31 +262,31 @@
if (a.permissions.canRead && b.permissions.canRead) {
if (sortDetails.columnId === 'moreDetails') {
var aBulletins = 0;
if (!common.isEmpty(a.bulletins)) {
if (!nfCommon.isEmpty(a.bulletins)) {
aBulletins = a.bulletins.length;
}
var bBulletins = 0;
if (!common.isEmpty(b.bulletins)) {
if (!nfCommon.isEmpty(b.bulletins)) {
bBulletins = b.bulletins.length;
}
return aBulletins - bBulletins;
} else if (sortDetails.columnId === 'type') {
var aType = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? common.substringAfterLast(a.component[sortDetails.columnId], '.') : '';
var bType = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? common.substringAfterLast(b.component[sortDetails.columnId], '.') : '';
var aType = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? nfCommon.substringAfterLast(a.component[sortDetails.columnId], '.') : '';
var bType = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? nfCommon.substringAfterLast(b.component[sortDetails.columnId], '.') : '';
return aType === bType ? 0 : aType > bType ? 1 : -1;
} else if (sortDetails.columnId === 'state') {
var aState = 'Invalid';
if (common.isEmpty(a.component.validationErrors)) {
aState = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : '';
if (nfCommon.isEmpty(a.component.validationErrors)) {
aState = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : '';
}
var bState = 'Invalid';
if (common.isEmpty(b.component.validationErrors)) {
bState = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : '';
if (nfCommon.isEmpty(b.component.validationErrors)) {
bState = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : '';
}
return aState === bState ? 0 : aState > bState ? 1 : -1;
} else {
var aString = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : '';
var bString = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : '';
var aString = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : '';
var bString = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : '';
return aString === bString ? 0 : aString > bString ? 1 : -1;
}
} else {
@ -322,7 +322,7 @@
var reportingTaskTypesGrid = $('#reporting-task-types-table').data('gridInstance');
// ensure the grid has been initialized
if (common.isDefinedAndNotNull(reportingTaskTypesGrid)) {
if (nfCommon.isDefinedAndNotNull(reportingTaskTypesGrid)) {
var reportingTaskTypesData = reportingTaskTypesGrid.getData();
// update the search criteria
@ -404,7 +404,7 @@
// ensure something was selected
if (selectedTaskType === '') {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Settings',
dialogContent: 'The type of reporting task to create must be selected.'
});
@ -421,7 +421,7 @@
var addReportingTask = function (reportingTaskType) {
// build the reporting task entity
var reportingTaskEntity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': 0
}
@ -452,7 +452,7 @@
var row = reportingTaskData.getRowById(reportingTaskEntity.id);
reportingTaskGrid.setSelectedRows([row]);
reportingTaskGrid.scrollRowIntoView(row);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
// hide the dialog
$('#new-reporting-task-dialog').modal('hide');
@ -490,7 +490,7 @@
id: 'type',
name: 'Type',
field: 'label',
formatter: common.typeFormatter,
formatter: nfCommon.typeFormatter,
sortable: false,
resizable: true
},
@ -524,11 +524,11 @@
var reportingTaskType = reportingTaskTypesGrid.getDataItem(reportingTaskTypeIndex);
// set the reporting task type description
if (common.isDefinedAndNotNull(reportingTaskType)) {
if (nfCommon.isDefinedAndNotNull(reportingTaskType)) {
// show the selected reporting task
$('#reporting-task-description-container').show();
if (common.isBlank(reportingTaskType.description)) {
if (nfCommon.isBlank(reportingTaskType.description)) {
$('#reporting-task-type-description')
.attr('title', '')
.html('<span class="unset">No description specified</span>');
@ -557,7 +557,7 @@
}
});
reportingTaskTypesGrid.onViewportChanged.subscribe(function (e, args) {
common.cleanUpTooltips($('#reporting-task-types-table'), 'div.view-usage-restriction');
nfCommon.cleanUpTooltips($('#reporting-task-types-table'), 'div.view-usage-restriction');
});
// wire up the dataview to the grid
@ -584,8 +584,8 @@
var item = reportingTaskTypesData.getItemById(rowId);
// show the tooltip
if (common.isDefinedAndNotNull(item.usageRestriction)) {
usageRestriction.qtip($.extend({}, common.config.tooltipConfig, {
if (nfCommon.isDefinedAndNotNull(item.usageRestriction)) {
usageRestriction.qtip($.extend({}, nfCommon.config.tooltipConfig, {
content: item.usageRestriction,
position: {
container: $('#summary'),
@ -618,10 +618,10 @@
// add the documented type
reportingTaskTypesData.addItem({
id: id++,
label: common.substringAfterLast(documentedType.type, '.'),
label: nfCommon.substringAfterLast(documentedType.type, '.'),
type: documentedType.type,
description: common.escapeHtml(documentedType.description),
usageRestriction: common.escapeHtml(documentedType.usageRestriction),
description: nfCommon.escapeHtml(documentedType.description),
usageRestriction: nfCommon.escapeHtml(documentedType.usageRestriction),
tags: documentedType.tags.join(', ')
});
@ -643,7 +643,7 @@
select: applyReportingTaskTypeFilter,
remove: applyReportingTaskTypeFilter
});
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
// initialize the reporting task dialog
$('#new-reporting-task-dialog').modal({
@ -732,8 +732,8 @@
// always include a button to view the usage
markup += '<div title="Usage" class="pointer reporting-task-usage fa fa-book"></div>';
var hasErrors = !common.isEmpty(dataContext.component.validationErrors);
var hasBulletins = !common.isEmpty(dataContext.bulletins);
var hasErrors = !nfCommon.isEmpty(dataContext.component.validationErrors);
var hasBulletins = !nfCommon.isEmpty(dataContext.bulletins);
if (hasErrors) {
markup += '<div class="pointer has-errors fa fa-warning" ></div>';
@ -744,7 +744,7 @@
}
if (hasErrors || hasBulletins) {
markup += '<span class="hidden row-id">' + common.escapeHtml(dataContext.component.id) + '</span>';
markup += '<span class="hidden row-id">' + nfCommon.escapeHtml(dataContext.component.id) + '</span>';
}
return markup;
@ -757,7 +757,7 @@
// determine the appropriate label
var icon = '', label = '';
if (!common.isEmpty(dataContext.component.validationErrors)) {
if (!nfCommon.isEmpty(dataContext.component.validationErrors)) {
label = 'Invalid';
icon = 'invalid fa fa-warning';
} else {
@ -775,13 +775,13 @@
// include the active thread count if appropriate
var activeThreadCount = '';
if (common.isDefinedAndNotNull(dataContext.component.activeThreadCount) && dataContext.component.activeThreadCount > 0) {
if (nfCommon.isDefinedAndNotNull(dataContext.component.activeThreadCount) && dataContext.component.activeThreadCount > 0) {
activeThreadCount = '(' + dataContext.component.activeThreadCount + ')';
}
// format the markup
var formattedValue = '<div layout="row"><div class="' + icon + '" style="margin-top: 3px;"></div>';
return formattedValue + '<div class="status-text" style="margin-top: 4px;">' + common.escapeHtml(label) + '</div><div style="float: left; margin-left: 4px;">' + common.escapeHtml(activeThreadCount) + '</div></div>';
return formattedValue + '<div class="status-text" style="margin-top: 4px;">' + nfCommon.escapeHtml(label) + '</div><div style="float: left; margin-left: 4px;">' + nfCommon.escapeHtml(activeThreadCount) + '</div></div>';
};
var reportingTaskActionFormatter = function (row, cell, value, columnDef, dataContext) {
@ -794,7 +794,7 @@
markup += '<div title="Edit" class="pointer edit-reporting-task fa fa-pencil" style="margin-top: 2px; margin-right: 3px;" ></div>';
// support starting when stopped and no validation errors
if (dataContext.component.state === 'STOPPED' && common.isEmpty(dataContext.component.validationErrors)) {
if (dataContext.component.state === 'STOPPED' && nfCommon.isEmpty(dataContext.component.validationErrors)) {
markup += '<div title="Start" class="pointer start-reporting-task fa fa-play" style="margin-top: 2px; margin-right: 3px;"></div>';
}
}
@ -804,12 +804,12 @@
}
}
if (dataContext.permissions.canWrite && common.canModifyController()) {
if (dataContext.permissions.canWrite && nfCommon.canModifyController()) {
markup += '<div title="Remove" class="pointer delete-reporting-task fa fa-trash" style="margin-top: 2px; margin-right: 3px;" ></div>';
}
// allow policy configuration conditionally
if (canvasUtils.isConfigurableAuthorizer() && common.canAccessTenants()) {
if (nfCanvasUtils.isConfigurableAuthorizer() && nfCommon.canAccessTenants()) {
markup += '<div title="Access Policies" class="pointer edit-access-policies fa fa-key" style="margin-top: 2px;"></div>';
}
@ -884,33 +884,33 @@
// determine the desired action
if (reportingTasksGrid.getColumns()[args.cell].id === 'actions') {
if (target.hasClass('edit-reporting-task')) {
reportingTask.showConfiguration(reportingTaskEntity);
nfReportingTask.showConfiguration(reportingTaskEntity);
} else if (target.hasClass('start-reporting-task')) {
reportingTask.start(reportingTaskEntity);
nfReportingTask.start(reportingTaskEntity);
} else if (target.hasClass('stop-reporting-task')) {
reportingTask.stop(reportingTaskEntity);
nfReportingTask.stop(reportingTaskEntity);
} else if (target.hasClass('delete-reporting-task')) {
reportingTask.promptToDeleteReportingTask(reportingTaskEntity);
nfReportingTask.promptToDeleteReportingTask(reportingTaskEntity);
} else if (target.hasClass('view-state-reporting-task')) {
var canClear = reportingTaskEntity.component.state === 'STOPPED' && reportingTaskEntity.component.activeThreadCount === 0;
componentState.showState(reportingTaskEntity, canClear);
nfComponentState.showState(reportingTaskEntity, canClear);
} else if (target.hasClass('edit-access-policies')) {
// show the policies for this service
policyManagement.showReportingTaskPolicy(reportingTaskEntity);
nfPolicyManagement.showReportingTaskPolicy(reportingTaskEntity);
// close the settings dialog
$('#shell-close-button').click();
}
} else if (reportingTasksGrid.getColumns()[args.cell].id === 'moreDetails') {
if (target.hasClass('view-reporting-task')) {
reportingTask.showDetails(reportingTaskEntity);
nfReportingTask.showDetails(reportingTaskEntity);
} else if (target.hasClass('reporting-task-usage')) {
// close the settings dialog
$('#shell-close-button').click();
// open the documentation for this reporting task
shell.showPage('../nifi-docs/documentation?' + $.param({
select: common.substringAfterLast(reportingTaskEntity.component.type, '.')
nfShell.showPage('../nifi-docs/documentation?' + $.param({
select: nfCommon.substringAfterLast(reportingTaskEntity.component.type, '.')
})).done(function () {
nfSettings.showSettings();
});
@ -939,12 +939,12 @@
var reportingTaskEntity = reportingTasksData.getItemById(taskId);
// format the errors
var tooltip = common.formatUnorderedList(reportingTaskEntity.component.validationErrors);
var tooltip = nfCommon.formatUnorderedList(reportingTaskEntity.component.validationErrors);
// show the tooltip
if (common.isDefinedAndNotNull(tooltip)) {
if (nfCommon.isDefinedAndNotNull(tooltip)) {
errorIcon.qtip($.extend({},
common.config.tooltipConfig,
nfCommon.config.tooltipConfig,
{
content: tooltip,
position: {
@ -968,13 +968,13 @@
var reportingTaskEntity = reportingTasksData.getItemById(taskId);
// format the tooltip
var bulletins = common.getFormattedBulletins(reportingTaskEntity.bulletins);
var tooltip = common.formatUnorderedList(bulletins);
var bulletins = nfCommon.getFormattedBulletins(reportingTaskEntity.bulletins);
var tooltip = nfCommon.formatUnorderedList(bulletins);
// show the tooltip
if (common.isDefinedAndNotNull(tooltip)) {
if (nfCommon.isDefinedAndNotNull(tooltip)) {
bulletinIcon.qtip($.extend({},
common.config.tooltipConfig,
nfCommon.config.tooltipConfig,
{
content: tooltip,
position: {
@ -1055,7 +1055,7 @@
// load the controller services
var controllerServicesUri = config.urls.api + '/flow/controller/controller-services';
var controllerServicesXhr = controllerServices.loadControllerServices(controllerServicesUri, getControllerServicesTable());
var controllerServicesXhr = nfControllerServices.loadControllerServices(controllerServicesUri, getControllerServicesTable());
// load the reporting tasks
var reportingTasks = loadReportingTasks();
@ -1066,7 +1066,7 @@
// update the current time
$('#settings-last-refreshed').text(controllerServicesResponse.currentTime);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -1086,8 +1086,8 @@
});
var reportingTasksElement = $('#reporting-tasks-table');
common.cleanUpTooltips(reportingTasksElement, 'div.has-errors');
common.cleanUpTooltips(reportingTasksElement, 'div.has-bulletins');
nfCommon.cleanUpTooltips(reportingTasksElement, 'div.has-errors');
nfCommon.cleanUpTooltips(reportingTasksElement, 'div.has-bulletins');
var reportingTasksGrid = reportingTasksElement.data('gridInstance');
var reportingTasksData = reportingTasksGrid.getData();
@ -1104,7 +1104,7 @@
*/
var showSettings = function () {
// show the settings dialog
shell.showContent('#settings').done(function () {
nfShell.showContent('#settings').done(function () {
reset();
});
@ -1150,9 +1150,9 @@
$('#settings-save').show();
} else {
var canModifyController = false;
if (common.isDefinedAndNotNull(common.currentUser)) {
if (nfCommon.isDefinedAndNotNull(nfCommon.currentUser)) {
// only consider write permissions for creating new controller services/reporting tasks
canModifyController = common.currentUser.controllerPermissions.canWrite === true;
canModifyController = nfCommon.currentUser.controllerPermissions.canWrite === true;
}
if (canModifyController) {
@ -1190,13 +1190,13 @@
var selectedTab = $('#settings-tabs li.selected-tab').text();
if (selectedTab === 'Controller Services') {
var controllerServicesUri = config.urls.api + '/controller/controller-services';
controllerServices.promptNewControllerService(controllerServicesUri, getControllerServicesTable());
nfControllerServices.promptNewControllerService(controllerServicesUri, getControllerServicesTable());
} else if (selectedTab === 'Reporting Tasks') {
$('#new-reporting-task-dialog').modal('show');
// reset the canvas size after the dialog is shown
var reportingTaskTypesGrid = $('#reporting-task-types-table').data('gridInstance');
if (common.isDefinedAndNotNull(reportingTaskTypesGrid)) {
if (nfCommon.isDefinedAndNotNull(reportingTaskTypesGrid)) {
reportingTaskTypesGrid.setSelectedRows([0]);
reportingTaskTypesGrid.resizeCanvas();
}
@ -1208,7 +1208,7 @@
// initialize each tab
initGeneral();
controllerServices.init(getControllerServicesTable(), nfSettings.showSettings);
nfControllerServices.init(getControllerServicesTable(), nfSettings.showSettings);
initReportingTasks();
},
@ -1216,10 +1216,10 @@
* Update the size of the grid based on its container's current size.
*/
resetTableSize: function () {
controllerServices.resetTableSize(getControllerServicesTable());
nfControllerServices.resetTableSize(getControllerServicesTable());
var reportingTasksGrid = $('#reporting-tasks-table').data('gridInstance');
if (common.isDefinedAndNotNull(reportingTasksGrid)) {
if (nfCommon.isDefinedAndNotNull(reportingTasksGrid)) {
reportingTasksGrid.resizeCanvas();
}
},
@ -1264,7 +1264,7 @@
*/
setBulletins: function (controllerServiceBulletins, reportingTaskBulletins) {
if ($('#controller-services-table').data('gridInstance')) {
controllerServices.setBulletins(getControllerServicesTable(), controllerServiceBulletins);
nfControllerServices.setBulletins(getControllerServicesTable(), controllerServiceBulletins);
}
// reporting tasks
@ -1273,7 +1273,7 @@
reportingTasksData.beginUpdate();
// if there are some bulletins process them
if (!common.isEmpty(reportingTaskBulletins)) {
if (!nfCommon.isEmpty(reportingTaskBulletins)) {
var reportingTaskBulletinsBySource = d3.nest()
.key(function (d) {
return d.sourceId;
@ -1282,7 +1282,7 @@
reportingTaskBulletinsBySource.forEach(function (sourceId, sourceBulletins) {
var reportingTask = reportingTasksData.getItemById(sourceId);
if (common.isDefinedAndNotNull(reportingTask)) {
if (nfCommon.isDefinedAndNotNull(reportingTask)) {
reportingTasksData.updateItem(sourceId, $.extend(reportingTask, {
bulletins: sourceBulletins
}));

View File

@ -23,8 +23,8 @@
'd3',
'nf.CanvasUtils',
'nf.Client'],
function ($, d3, canvasUtils, client) {
return (nf.Snippet = factory($, d3, canvasUtils, client));
function ($, d3, nfCanvasUtils, nfClient) {
return (nf.Snippet = factory($, d3, nfCanvasUtils, nfClient));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Snippet =
@ -38,7 +38,7 @@
root.nf.CanvasUtils,
root.nf.Client);
}
}(this, function ($, d3, canvasUtils, client) {
}(this, function ($, d3, nfCanvasUtils, nfClient) {
'use strict';
var config = {
@ -57,7 +57,7 @@
*/
marshal: function (selection) {
var snippet = {
parentGroupId: canvasUtils.getGroupId(),
parentGroupId: nfCanvasUtils.getGroupId(),
processors: {},
funnels: {},
inputPorts: {},
@ -72,22 +72,22 @@
selection.each(function (d) {
var selected = d3.select(this);
if (canvasUtils.isProcessor(selected)) {
snippet.processors[d.id] = client.getRevision(selected.datum());
} else if (canvasUtils.isFunnel(selected)) {
snippet.funnels[d.id] = client.getRevision(selected.datum());
} else if (canvasUtils.isLabel(selected)) {
snippet.labels[d.id] = client.getRevision(selected.datum());
} else if (canvasUtils.isInputPort(selected)) {
snippet.inputPorts[d.id] = client.getRevision(selected.datum());
} else if (canvasUtils.isOutputPort(selected)) {
snippet.outputPorts[d.id] = client.getRevision(selected.datum());
} else if (canvasUtils.isProcessGroup(selected)) {
snippet.processGroups[d.id] = client.getRevision(selected.datum());
} else if (canvasUtils.isRemoteProcessGroup(selected)) {
snippet.remoteProcessGroups[d.id] = client.getRevision(selected.datum());
} else if (canvasUtils.isConnection(selected)) {
snippet.connections[d.id] = client.getRevision(selected.datum());
if (nfCanvasUtils.isProcessor(selected)) {
snippet.processors[d.id] = nfClient.getRevision(selected.datum());
} else if (nfCanvasUtils.isFunnel(selected)) {
snippet.funnels[d.id] = nfClient.getRevision(selected.datum());
} else if (nfCanvasUtils.isLabel(selected)) {
snippet.labels[d.id] = nfClient.getRevision(selected.datum());
} else if (nfCanvasUtils.isInputPort(selected)) {
snippet.inputPorts[d.id] = nfClient.getRevision(selected.datum());
} else if (nfCanvasUtils.isOutputPort(selected)) {
snippet.outputPorts[d.id] = nfClient.getRevision(selected.datum());
} else if (nfCanvasUtils.isProcessGroup(selected)) {
snippet.processGroups[d.id] = nfClient.getRevision(selected.datum());
} else if (nfCanvasUtils.isRemoteProcessGroup(selected)) {
snippet.remoteProcessGroups[d.id] = nfClient.getRevision(selected.datum());
} else if (nfCanvasUtils.isConnection(selected)) {
snippet.connections[d.id] = nfClient.getRevision(selected.datum());
}
});
@ -128,7 +128,7 @@
return $.ajax({
type: 'POST',
url: config.urls.processGroups + '/' + encodeURIComponent(canvasUtils.getGroupId()) + '/snippet-instance',
url: config.urls.processGroups + '/' + encodeURIComponent(nfCanvasUtils.getGroupId()) + '/snippet-instance',
data: JSON.stringify(copySnippetRequestEntity),
dataType: 'json',
contentType: 'application/json'

View File

@ -24,8 +24,8 @@
'nf.Common',
'nf.Dialog',
'nf.ErrorHandler'],
function ($, Slick, common, dialog, errorHandler) {
return (nf.ClusterTable = factory($, Slick, common, dialog, errorHandler));
function ($, Slick, nfCommon, nfDialog, nfErrorHandler) {
return (nf.ClusterTable = factory($, Slick, nfCommon, nfDialog, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ClusterTable =
@ -41,7 +41,7 @@
root.nf.Dialog,
root.nf.ErrorHandler);
}
}(this, function ($, Slick, common, dialog, errorHandler) {
}(this, function ($, Slick, nfCommon, nfDialog, nfErrorHandler) {
'use strict';
/**
@ -58,11 +58,11 @@
data: [{
name: 'cluster',
update: refreshClusterData,
isAuthorized: common.canAccessController
isAuthorized: nfCommon.canAccessController
}, {
name: 'systemDiagnostics',
update: refreshSystemDiagnosticsData,
isAuthorized: common.canAccessSystem
isAuthorized: nfCommon.canAccessSystem
}
]
};
@ -452,7 +452,7 @@
// function for formatting the last accessed time
var valueFormatter = function (row, cell, value, columnDef, dataContext) {
return common.formatValue(value);
return nfCommon.formatValue(value);
};
// define a custom formatter for the status column
@ -523,7 +523,7 @@
];
// only allow the admin to modify the cluster
if (common.canModifyController()) {
if (nfCommon.canModifyController()) {
var actionFormatter = function (row, cell, value, columnDef, dataContext) {
var canDisconnect = false;
var canConnect = false;
@ -571,8 +571,8 @@
// defines a function for sorting
var comparer = function (a, b) {
if (sortDetails.columnId === 'heartbeat' || sortDetails.columnId === 'uptime') {
var aDate = common.parseDateTime(a[sortDetails.columnId]);
var bDate = common.parseDateTime(b[sortDetails.columnId]);
var aDate = nfCommon.parseDateTime(a[sortDetails.columnId]);
var bDate = nfCommon.parseDateTime(b[sortDetails.columnId]);
return aDate.getTime() - bDate.getTime();
} else if (sortDetails.columnId === 'queued') {
var aSplit = a[sortDetails.columnId].split(/ \/ /);
@ -580,13 +580,13 @@
var mod = count % 4;
if (mod < 2) {
$('#cluster-nodes-table span.queued-title').addClass('sorted');
var aCount = common.parseCount(aSplit[0]);
var bCount = common.parseCount(bSplit[0]);
var aCount = nfCommon.parseCount(aSplit[0]);
var bCount = nfCommon.parseCount(bSplit[0]);
return aCount - bCount;
} else {
$('#cluster-nodes-table span.queued-size-title').addClass('sorted');
var aSize = common.parseSize(aSplit[1]);
var bSize = common.parseSize(bSplit[1]);
var aSize = nfCommon.parseSize(aSplit[1]);
var bSize = nfCommon.parseSize(bSplit[1]);
return aSize - bSize;
}
} else if (sortDetails.columnId === 'maxHeap' || sortDetails.columnId === 'totalHeap' || sortDetails.columnId === 'usedHeap'
@ -594,19 +594,19 @@
|| sortDetails.columnId === 'ffRepoTotal' || sortDetails.columnId === 'ffRepoUsed'
|| sortDetails.columnId === 'ffRepoFree' || sortDetails.columnId === 'contentRepoTotal'
|| sortDetails.columnId === 'contentRepoUsed' || sortDetails.columnId === 'contentRepoFree') {
var aSize = common.parseSize(a[sortDetails.columnId]);
var bSize = common.parseSize(b[sortDetails.columnId]);
var aSize = nfCommon.parseSize(a[sortDetails.columnId]);
var bSize = nfCommon.parseSize(b[sortDetails.columnId]);
return aSize - bSize;
} else if (sortDetails.columnId === 'totalThreads' || sortDetails.columnId === 'daemonThreads'
|| sortDetails.columnId === 'processors') {
var aCount = common.parseCount(a[sortDetails.columnId]);
var bCount = common.parseCount(b[sortDetails.columnId]);
var aCount = nfCommon.parseCount(a[sortDetails.columnId]);
var bCount = nfCommon.parseCount(b[sortDetails.columnId]);
return aCount - bCount;
} else if (sortDetails.columnId === 'gcOldGen' || sortDetails.columnId === 'gcNewGen') {
var aSplit = a[sortDetails.columnId].split(/ /);
var bSplit = b[sortDetails.columnId].split(/ /);
var aCount = common.parseCount(aSplit[0]);
var bCount = common.parseCount(bSplit[0]);
var aCount = nfCommon.parseCount(aSplit[0]);
var bCount = nfCommon.parseCount(bSplit[0]);
return aCount - bCount;
} else if (sortDetails.columnId === 'status') {
var aStatus = formatNodeStatus(a);
@ -617,8 +617,8 @@
var bNode = formatNodeAddress(b);
return aNode === bNode ? 0 : aNode > bNode ? 1 : -1;
} else {
var aString = common.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = common.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
var aString = nfCommon.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = nfCommon.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
return aString === bString ? 0 : aString > bString ? 1 : -1;
}
};
@ -648,7 +648,7 @@
* @returns {string}
*/
var formatNodeAddress = function (node) {
return common.escapeHtml(node.address) + ':' + common.escapeHtml(node.apiPort);
return nfCommon.escapeHtml(node.address) + ':' + nfCommon.escapeHtml(node.apiPort);
};
/**
@ -675,7 +675,7 @@
*/
var promptForConnect = function (node) {
// prompt to connect
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'Connect Node',
dialogContent: 'Connect \'' + formatNodeAddress(node) + '\' to this cluster?',
yesHandler: function () {
@ -709,7 +709,7 @@
var clusterGrid = $('#cluster-nodes-table').data('gridInstance');
var clusterData = clusterGrid.getData();
clusterData.updateItem(node.nodeId, node);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -719,7 +719,7 @@
*/
var promptForDisconnect = function (node) {
// prompt for disconnect
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'Disconnect Node',
dialogContent: 'Disconnect \'' + formatNodeAddress(node) + '\' from the cluster?',
yesHandler: function () {
@ -754,7 +754,7 @@
var clusterGrid = $('#cluster-nodes-table').data('gridInstance');
var clusterData = clusterGrid.getData();
clusterData.updateItem(node.nodeId, node);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -764,7 +764,7 @@
*/
var promptForRemoval = function (node) {
// prompt for disconnect
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'Remove Node',
dialogContent: 'Remove \'' + formatNodeAddress(node) + '\' from the cluster?',
yesHandler: function () {
@ -788,7 +788,7 @@
var clusterGrid = $('#cluster-nodes-table').data('gridInstance');
var clusterData = clusterGrid.getData();
clusterData.deleteItem(nodeId);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -812,7 +812,7 @@
var grid = visibleTab.grid;
// ensure the grid has been initialized
if (common.isDefinedAndNotNull(grid)) {
if (nfCommon.isDefinedAndNotNull(grid)) {
var gridData = grid.getData();
// update the search criteria
@ -912,22 +912,22 @@
$.each(node.events, function (i, event) {
eventMessages.push(event.timestamp + ": " + event.message);
});
$('<div></div>').append(common.formatUnorderedList(eventMessages)).appendTo(events);
$('<div></div>').append(nfCommon.formatUnorderedList(eventMessages)).appendTo(events);
} else {
events.append('<div><span class="unset">None</span></div>');
}
// show the dialog
$('#node-details-dialog').modal('show');
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
* Applies system diagnostics data to the JVM tab.
*/
function updateJvmTableData(systemDiagnosticsResponse) {
if (common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics)
&& common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) {
if (nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics)
&& nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) {
var jvmTableRows = [];
systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots.forEach(function (nodeSnapshot) {
@ -970,8 +970,8 @@
* Applies system diagnostics data to the System tab.
*/
function updateSystemTableData(systemDiagnosticsResponse) {
if (common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics)
&& common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) {
if (nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics)
&& nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) {
var systemTableRows = [];
systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots.forEach(function (nodeSnapshot) {
@ -999,8 +999,8 @@
* Applies system diagnostics data to the FlowFile Storage tab.
*/
function updateFlowFileTableData(systemDiagnosticsResponse) {
if (common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics)
&& common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) {
if (nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics)
&& nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) {
var flowFileTableRows = [];
systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots.forEach(function (nodeSnapshot) {
@ -1028,8 +1028,8 @@
* Applies system diagnostics data to the Content Storage tab.
*/
function updateContentTableData(systemDiagnosticsResponse) {
if (common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics)
&& common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) {
if (nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics)
&& nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) {
var contentStorageTableRows = [];
systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots.forEach(function (nodeSnapshot) {
@ -1061,8 +1061,8 @@
* Applies system diagnostics data to the Versions tab.
*/
function updateVersionTableData(systemDiagnosticsResponse) {
if (common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics)
&& common.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) {
if (nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics)
&& nfCommon.isDefinedAndNotNull(systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots)) {
var versionTableRows = [];
systemDiagnosticsResponse.systemDiagnostics.nodeSnapshots.forEach(function (nodeSnapshot) {
@ -1103,7 +1103,7 @@
handlers.forEach(function (handler) {
handler(systemDiagnosticsResponse);
});
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
return loadPromise;
};
@ -1176,7 +1176,7 @@
var cluster = clusterResponse.cluster;
// ensure there are groups specified
if (common.isDefinedAndNotNull(cluster.nodes)) {
if (nfCommon.isDefinedAndNotNull(cluster.nodes)) {
var clusterGrid = nodesTab.grid;
var clusterData = clusterGrid.getData();
@ -1206,7 +1206,7 @@
handlers.forEach(function (handler) {
handler(response);
});
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
return clusterNodesDataPromise;
}
@ -1216,7 +1216,7 @@
function onSelectTab(tab) {
// Resize table
var tabGrid = tab.grid;
if (common.isDefinedAndNotNull(tabGrid)) {
if (nfCommon.isDefinedAndNotNull(tabGrid)) {
tabGrid.resizeCanvas();
}

View File

@ -24,8 +24,8 @@
'nf.ClusterTable',
'nf.ErrorHandler',
'nf.Storage'],
function ($, common, clusterTable, errorHandler, storage) {
return (nf.Cluster = factory($, common, clusterTable, errorHandler, storage));
function ($, nfCommon, nfClusterTable, nfErrorHandler, nfStorage) {
return (nf.Cluster = factory($, nfCommon, nfClusterTable, nfErrorHandler, nfStorage));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Cluster =
@ -41,7 +41,7 @@
root.nf.ErrorHandler,
root.nf.Storage);
}
}(this, function ($, common, clusterTable, errorHandler, storage) {
}(this, function ($, nfCommon, nfClusterTable, nfErrorHandler, nfStorage) {
'use strict';
$(document).ready(function () {
@ -69,8 +69,8 @@
url: config.urls.currentUser,
dataType: 'json'
}).done(function (currentUser) {
common.setCurrentUser(currentUser);
}).fail(errorHandler.handleAjaxError);
nfCommon.setCurrentUser(currentUser);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -79,7 +79,7 @@
var initializeClusterPage = function () {
// define mouse over event for the refresh button
$('#refresh-button').click(function () {
clusterTable.loadClusterTable();
nfClusterTable.loadClusterTable();
});
// return a deferred for page initialization
@ -92,8 +92,8 @@
dataType: 'json'
}).done(function (bannerResponse) {
// ensure the banners response is specified
if (common.isDefinedAndNotNull(bannerResponse.banners)) {
if (common.isDefinedAndNotNull(bannerResponse.banners.headerText) && bannerResponse.banners.headerText !== '') {
if (nfCommon.isDefinedAndNotNull(bannerResponse.banners)) {
if (nfCommon.isDefinedAndNotNull(bannerResponse.banners.headerText) && bannerResponse.banners.headerText !== '') {
// update the header text
var bannerHeader = $('#banner-header').text(bannerResponse.banners.headerText).show();
@ -107,7 +107,7 @@
updateTop('counters');
}
if (common.isDefinedAndNotNull(bannerResponse.banners.footerText) && bannerResponse.banners.footerText !== '') {
if (nfCommon.isDefinedAndNotNull(bannerResponse.banners.footerText) && bannerResponse.banners.footerText !== '') {
// update the footer text and show it
var bannerFooter = $('#banner-footer').text(bannerResponse.banners.footerText).show();
@ -123,7 +123,7 @@
deferred.resolve();
}).fail(function (xhr, status, error) {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
deferred.reject();
});
} else {
@ -137,7 +137,7 @@
* Initializes the counters page.
*/
init: function () {
storage.init();
nfStorage.init();
// load the current user
loadCurrentUser().done(function () {
@ -159,13 +159,13 @@
setBodySize();
// create the cluster table
clusterTable.init();
nfClusterTable.init();
// resize to fit
clusterTable.resetTableSize();
nfClusterTable.resetTableSize();
// load the table
clusterTable.loadClusterTable().done(function () {
nfClusterTable.loadClusterTable().done(function () {
// once the table is initialized, finish initializing the page
initializeClusterPage().done(function () {
@ -181,7 +181,7 @@
// set the document title and the about title
document.title = countersTitle;
$('#counters-header-text').text(countersTitle);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
$(window).on('resize', function (e) {
setBodySize();
@ -214,7 +214,7 @@
}
}
$.each(tabsContents, function (index, tabsContent) {
common.toggleScrollable(tabsContent.get(0));
nfCommon.toggleScrollable(tabsContent.get(0));
});
});
});

View File

@ -23,8 +23,8 @@
'Slick',
'nf.Common',
'nf.ErrorHandler'],
function ($, Slick, common, errorHandler) {
return (nf.CountersTable = factory($, Slick, common, errorHandler));
function ($, Slick, nfCommon, nfErrorHandler) {
return (nf.CountersTable = factory($, Slick, nfCommon, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.CountersTable =
@ -38,7 +38,7 @@
root.nf.Common,
root.nf.ErrorHandler);
}
}(this, function ($, Slick, common, errorHandler) {
}(this, function ($, Slick, nfCommon, nfErrorHandler) {
'use strict';
/**
@ -60,12 +60,12 @@
// defines a function for sorting
var comparer = function (a, b) {
if (sortDetails.columnId === 'value') {
var aCount = common.parseCount(a[sortDetails.columnId]);
var bCount = common.parseCount(b[sortDetails.columnId]);
var aCount = nfCommon.parseCount(a[sortDetails.columnId]);
var bCount = nfCommon.parseCount(b[sortDetails.columnId]);
return aCount - bCount;
} else {
var aString = common.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = common.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
var aString = nfCommon.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = nfCommon.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
return aString === bString ? 0 : aString > bString ? 1 : -1;
}
};
@ -91,7 +91,7 @@
var countersGrid = $('#counters-table').data('gridInstance');
// ensure the grid has been initialized
if (common.isDefinedAndNotNull(countersGrid)) {
if (nfCommon.isDefinedAndNotNull(countersGrid)) {
var countersData = countersGrid.getData();
// update the search criteria
@ -144,7 +144,7 @@
var countersGrid = $('#counters-table').data('gridInstance');
var countersData = countersGrid.getData();
countersData.updateItem(counter.id, counter);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
return {
@ -198,7 +198,7 @@
];
// only allow dfm's to reset counters
if (common.canModifyCounters()) {
if (nfCommon.canModifyCounters()) {
// function for formatting the actions column
var actionFormatter = function (row, cell, value, columnDef, dataContext) {
return '<div title="Reset Counter" class="pointer reset-counter fa fa-undo" style="margin-top: 2px;"></div>';
@ -294,7 +294,7 @@
*/
resetTableSize: function () {
var countersGrid = $('#counters-table').data('gridInstance');
if (common.isDefinedAndNotNull(countersGrid)) {
if (nfCommon.isDefinedAndNotNull(countersGrid)) {
countersGrid.resizeCanvas();
}
},
@ -312,7 +312,7 @@
var aggregateSnapshot = report.aggregateSnapshot;
// ensure there are groups specified
if (common.isDefinedAndNotNull(aggregateSnapshot.counters)) {
if (nfCommon.isDefinedAndNotNull(aggregateSnapshot.counters)) {
var countersGrid = $('#counters-table').data('gridInstance');
var countersData = countersGrid.getData();
@ -329,7 +329,7 @@
} else {
$('#total-counters').text('0');
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
};
}));

View File

@ -24,8 +24,8 @@
'nf.CountersTable',
'nf.ErrorHandler',
'nf.Storage'],
function ($, common, countersTable, errorHandler, storage) {
return (nf.Counters = factory($, common, countersTable, errorHandler, storage));
function ($, nfCommon, nfCountersTable, nfErrorHandler, nfStorage) {
return (nf.Counters = factory($, nfCommon, nfCountersTable, nfErrorHandler, nfStorage));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Counters =
@ -41,7 +41,7 @@
root.nf.ErrorHandler,
root.nf.Storage);
}
}(this, function ($, common, countersTable, errorHandler, storage) {
}(this, function ($, nfCommon, nfCountersTable, nfErrorHandler, nfStorage) {
'use strict';
$(document).ready(function () {
@ -69,9 +69,9 @@
url: config.urls.currentUser,
dataType: 'json'
}).done(function (currentUser) {
common.setCurrentUser(currentUser);
nfCommon.setCurrentUser(currentUser);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -80,7 +80,7 @@
var initializeCountersPage = function () {
// define mouse over event for the refresh button
$('#refresh-button').click(function () {
countersTable.loadCountersTable();
nfCountersTable.loadCountersTable();
});
// return a deferred for page initialization
@ -93,8 +93,8 @@
dataType: 'json'
}).done(function (response) {
// ensure the banners response is specified
if (common.isDefinedAndNotNull(response.banners)) {
if (common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
if (nfCommon.isDefinedAndNotNull(response.banners)) {
if (nfCommon.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
// update the header text
var bannerHeader = $('#banner-header').text(response.banners.headerText).show();
@ -108,7 +108,7 @@
updateTop('counters');
}
if (common.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
if (nfCommon.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
// update the footer text and show it
var bannerFooter = $('#banner-footer').text(response.banners.footerText).show();
@ -124,7 +124,7 @@
deferred.resolve();
}).fail(function (xhr, status, error) {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
deferred.reject();
});
} else {
@ -138,15 +138,15 @@
* Initializes the counters page.
*/
init: function () {
storage.init();
nfStorage.init();
// load the current user
loadCurrentUser().done(function () {
// create the counters table
countersTable.init();
nfCountersTable.init();
// load the table
countersTable.loadCountersTable().done(function () {
nfCountersTable.loadCountersTable().done(function () {
// once the table is initialized, finish initializing the page
initializeCountersPage().done(function () {
var setBodySize = function () {
@ -163,7 +163,7 @@
}
// configure the initial grid height
countersTable.resetTableSize();
nfCountersTable.resetTableSize();
};
// get the about details
@ -181,7 +181,7 @@
// set the initial size
setBodySize();
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
$(window).on('resize', function (e) {
setBodySize();
@ -214,7 +214,7 @@
}
}
$.each(tabsContents, function (index, tabsContent) {
common.toggleScrollable(tabsContent.get(0));
nfCommon.toggleScrollable(tabsContent.get(0));
});
});
});

View File

@ -23,8 +23,8 @@
'Slick',
'nf.Common',
'nf.ErrorHandler'],
function ($, Slick, common, errorHandler) {
return (nf.HistoryModel = factory($, Slick, common, errorHandler));
function ($, Slick, nfCommon, nfErrorHandler) {
return (nf.HistoryModel = factory($, Slick, nfCommon, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.HistoryModel =
@ -38,7 +38,7 @@
root.nf.Common,
root.nf.ErrorHandler);
}
}(this, function ($, Slick, common, errorHandler) {
}(this, function ($, Slick, nfCommon, nfErrorHandler) {
'use strict';
// private
@ -164,7 +164,7 @@
$('#history-last-refreshed').text(history.lastRefreshed);
// set the timezone for the start and end time
$('.timezone').text(common.substringAfterLast(history.lastRefreshed, ' '));
$('.timezone').text(nfCommon.substringAfterLast(history.lastRefreshed, ' '));
// show the filter message if applicable
if (query['sourceId'] || query['userIdentity'] || query['startDate'] || query['endDate']) {
@ -181,7 +181,7 @@
from: from,
to: to
});
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
xhr.fromPage = fromPage;
xhr.toPage = toPage;

View File

@ -25,8 +25,8 @@
'nf.Dialog',
'nf.ErrorHandler',
'nf.HistoryModel'],
function ($, Slick, common, dialog, errorHandler, HistoryModel) {
return (nf.HistoryTable = factory($, Slick, common, dialog, errorHandler, HistoryModel));
function ($, Slick, nfCommon, nfDialog, nfErrorHandler, nfHistoryModel) {
return (nf.HistoryTable = factory($, Slick, nfCommon, nfDialog, nfErrorHandler, nfHistoryModel));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.HistoryTable =
@ -44,7 +44,7 @@
root.nf.ErrorHandler,
root.nf.HistoryModel);
}
}(this, function ($, Slick, common, dialog, errorHandler, HistoryModel) {
}(this, function ($, Slick, nfCommon, nfDialog, nfErrorHandler, nfHistoryModel) {
'use strict';
/**
@ -240,15 +240,15 @@
}
var endDateTime = endDate + ' ' + endTime;
var timezone = $('.timezone:first').text();
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'History',
dialogContent: "Are you sure you want to delete all history before '" + common.escapeHtml(endDateTime) + " " + common.escapeHtml(timezone) + "'?",
dialogContent: "Are you sure you want to delete all history before '" + nfCommon.escapeHtml(endDateTime) + " " + nfCommon.escapeHtml(timezone) + "'?",
yesHandler: function () {
purgeHistory(endDateTime);
}
});
} else {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'History',
dialogContent: 'The end date must be specified.'
});
@ -311,7 +311,7 @@
if (dataContext.canRead !== true) {
return '<span class="unset" style="font-size: 13px; padding-top: 2px;">Not authorized</span>';
}
return common.formatValue(dataContext.action[columnDef.field]);
return nfCommon.formatValue(dataContext.action[columnDef.field]);
};
// initialize the templates table
@ -377,7 +377,7 @@
};
// create the remote model
var historyModel = new HistoryModel();
var historyModel = new nfHistoryModel();
// initialize the grid
var historyGrid = new Slick.Grid('#history-table', historyModel, historyColumns, historyOptions);
@ -429,7 +429,7 @@
$('#history-table').data('gridInstance', historyGrid);
// add the purge button if appropriate
if (common.canModifyController()) {
if (nfCommon.canModifyController()) {
$('#history-purge-button').on('click', function () {
$('#history-purge-dialog').modal('show');
}).show();
@ -450,7 +450,7 @@
dataType: 'json'
}).done(function () {
nfHistoryTable.loadHistoryTable();
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -461,19 +461,19 @@
var showActionDetails = function (action) {
// create the markup for the dialog
var detailsMarkup = $('<div></div>').append(
$('<div class="action-detail"><div class="history-details-name">Id</div>' + common.escapeHtml(action.sourceId) + '</div>'));
$('<div class="action-detail"><div class="history-details-name">Id</div>' + nfCommon.escapeHtml(action.sourceId) + '</div>'));
// get any component details
var componentDetails = action.componentDetails;
// inspect the operation to determine if there are any component details
if (common.isDefinedAndNotNull(componentDetails)) {
if (nfCommon.isDefinedAndNotNull(componentDetails)) {
if (action.sourceType === 'Processor' || action.sourceType === 'ControllerService' || action.sourceType === 'ReportingTask') {
detailsMarkup.append(
$('<div class="action-detail"><div class="history-details-name">Type</div>' + common.escapeHtml(componentDetails.type) + '</div>'));
$('<div class="action-detail"><div class="history-details-name">Type</div>' + nfCommon.escapeHtml(componentDetails.type) + '</div>'));
} else if (action.sourceType === 'RemoteProcessGroup') {
detailsMarkup.append(
$('<div class="action-detail"><div class="history-details-name">Uri</div>' + common.formatValue(componentDetails.uri) + '</div>'));
$('<div class="action-detail"><div class="history-details-name">Uri</div>' + nfCommon.formatValue(componentDetails.uri) + '</div>'));
}
}
@ -481,30 +481,30 @@
var actionDetails = action.actionDetails;
// inspect the operation to determine if there are any action details
if (common.isDefinedAndNotNull(actionDetails)) {
if (nfCommon.isDefinedAndNotNull(actionDetails)) {
if (action.operation === 'Configure') {
detailsMarkup.append(
$('<div class="action-detail"><div class="history-details-name">Name</div>' + common.formatValue(actionDetails.name) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Value</div>' + common.formatValue(actionDetails.value) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Previous Value</div>' + common.formatValue(actionDetails.previousValue) + '</div>'));
$('<div class="action-detail"><div class="history-details-name">Name</div>' + nfCommon.formatValue(actionDetails.name) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Value</div>' + nfCommon.formatValue(actionDetails.value) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Previous Value</div>' + nfCommon.formatValue(actionDetails.previousValue) + '</div>'));
} else if (action.operation === 'Connect' || action.operation === 'Disconnect') {
detailsMarkup.append(
$('<div class="action-detail"><div class="history-details-name">Source Id</div>' + common.escapeHtml(actionDetails.sourceId) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Source Name</div>' + common.formatValue(actionDetails.sourceName) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Source Type</div>' + common.escapeHtml(actionDetails.sourceType) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Relationship(s)</div>' + common.formatValue(actionDetails.relationship) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Destination Id</div>' + common.escapeHtml(actionDetails.destinationId) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Destination Name</div>' + common.formatValue(actionDetails.destinationName) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Destination Type</div>' + common.escapeHtml(actionDetails.destinationType) + '</div>'));
$('<div class="action-detail"><div class="history-details-name">Source Id</div>' + nfCommon.escapeHtml(actionDetails.sourceId) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Source Name</div>' + nfCommon.formatValue(actionDetails.sourceName) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Source Type</div>' + nfCommon.escapeHtml(actionDetails.sourceType) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Relationship(s)</div>' + nfCommon.formatValue(actionDetails.relationship) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Destination Id</div>' + nfCommon.escapeHtml(actionDetails.destinationId) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Destination Name</div>' + nfCommon.formatValue(actionDetails.destinationName) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Destination Type</div>' + nfCommon.escapeHtml(actionDetails.destinationType) + '</div>'));
} else if (action.operation === 'Move') {
detailsMarkup.append(
$('<div class="action-detail"><div class="history-details-name">Group</div>' + common.formatValue(actionDetails.group) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Group Id</div>' + common.escapeHtml(actionDetails.groupId) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Previous Group</div>' + common.formatValue(actionDetails.previousGroup) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Previous Group Id</div>' + common.escapeHtml(actionDetails.previousGroupId) + '</div>'));
$('<div class="action-detail"><div class="history-details-name">Group</div>' + nfCommon.formatValue(actionDetails.group) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Group Id</div>' + nfCommon.escapeHtml(actionDetails.groupId) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Previous Group</div>' + nfCommon.formatValue(actionDetails.previousGroup) + '</div>')).append(
$('<div class="action-detail"><div class="history-details-name">Previous Group Id</div>' + nfCommon.escapeHtml(actionDetails.previousGroupId) + '</div>'));
} else if (action.operation === 'Purge') {
detailsMarkup.append(
$('<div class="action-detail"><div class="history-details-name">End Date</div>' + common.escapeHtml(actionDetails.endDate) + '</div>'));
$('<div class="action-detail"><div class="history-details-name">End Date</div>' + nfCommon.escapeHtml(actionDetails.endDate) + '</div>'));
}
}
@ -528,7 +528,7 @@
*/
resetTableSize: function () {
var historyGrid = $('#history-table').data('gridInstance');
if (common.isDefinedAndNotNull(historyGrid)) {
if (nfCommon.isDefinedAndNotNull(historyGrid)) {
historyGrid.resizeCanvas();
}
},

View File

@ -25,8 +25,8 @@
'nf.ErrorHandler',
'nf.Storage',
'nf.ClusterSummary'],
function ($, common, historyTable, errorHandler, storage, clusterSummary) {
return (nf.History = factory($, common, historyTable, errorHandler, storage, clusterSummary));
function ($, nfCommon, nfHistoryTable, nfErrorHandler, nfStorage, nfClusterSummary) {
return (nf.History = factory($, nfCommon, nfHistoryTable, nfErrorHandler, nfStorage, nfClusterSummary));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.History =
@ -44,7 +44,7 @@
root.nf.Storage,
root.nf.ClusterSummary);
}
}(this, function ($, common, historyTable, errorHandler, storage, clusterSummary) {
}(this, function ($, nfCommon, nfHistoryTable, nfErrorHandler, nfStorage, nfClusterSummary) {
'use strict';
$(document).ready(function () {
@ -72,8 +72,8 @@
url: config.urls.currentUser,
dataType: 'json'
}).done(function (currentUser) {
common.setCurrentUser(currentUser);
}).fail(errorHandler.handleAjaxError);
nfCommon.setCurrentUser(currentUser);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -82,7 +82,7 @@
var initializeHistoryPage = function () {
// define mouse over event for the refresh button
$('#refresh-button').click(function () {
historyTable.loadHistoryTable();
nfHistoryTable.loadHistoryTable();
});
// return a deferred for page initialization
@ -95,8 +95,8 @@
dataType: 'json'
}).done(function (response) {
// ensure the banners response is specified
if (common.isDefinedAndNotNull(response.banners)) {
if (common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
if (nfCommon.isDefinedAndNotNull(response.banners)) {
if (nfCommon.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
// update the header text
var bannerHeader = $('#banner-header').text(response.banners.headerText).show();
@ -110,7 +110,7 @@
updateTop('history');
}
if (common.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
if (nfCommon.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
// update the footer text and show it
var bannerFooter = $('#banner-footer').text(response.banners.footerText).show();
@ -126,7 +126,7 @@
deferred.resolve();
}).fail(function (xhr, status, error) {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
deferred.reject();
});
} else {
@ -143,20 +143,20 @@
// load the current user
var currentUser = loadCurrentUser()
storage.init();
nfStorage.init();
// ensure the config requests are loaded
$.when(currentUser).done(function (currentUserResult) {
// if clustered, show message to indicate location of actions
if (clusterSummary.isClustered() === true) {
if (nfClusterSummary.isClustered() === true) {
$('#cluster-history-message').show();
}
// create the history table
historyTable.init();
nfHistoryTable.init();
// load the history table
historyTable.loadHistoryTable();
nfHistoryTable.loadHistoryTable();
// once the table is initialized, finish initializing the page
initializeHistoryPage().done(function () {
@ -173,7 +173,7 @@
}
// configure the initial grid height
historyTable.resetTableSize();
nfHistoryTable.resetTableSize();
};
// get the about details
@ -191,7 +191,7 @@
// set the initial size
setBodySize();
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
$(window).on('resize', function (e) {
setBodySize();
@ -224,7 +224,7 @@
}
}
$.each(tabsContents, function (index, tabsContent) {
common.toggleScrollable(tabsContent.get(0));
nfCommon.toggleScrollable(tabsContent.get(0));
});
});
});

View File

@ -23,8 +23,8 @@
'nf.Common',
'nf.Dialog',
'nf.Storage'],
function ($, common, dialog, storage) {
return (nf.Login = factory($, common, dialog, storage));
function ($, nfCommon, nfDialog, nfStorage) {
return (nf.Login = factory($, nfCommon, nfDialog, nfStorage));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Login =
@ -38,7 +38,7 @@
root.nf.Dialog,
root.nf.Storage);
}
}(this, function ($, common, dialog, storage) {
}(this, function ($, nfCommon, nfDialog, nfStorage) {
'use strict';
$(document).ready(function () {
@ -100,9 +100,9 @@
}
}).done(function (jwt) {
// get the payload and store the token with the appropirate expiration
var token = common.getJwtPayload(jwt);
var expiration = parseInt(token['exp'], 10) * common.MILLIS_PER_SECOND;
storage.setItem('jwt', jwt, expiration);
var token = nfCommon.getJwtPayload(jwt);
var expiration = parseInt(token['exp'], 10) * nfCommon.MILLIS_PER_SECOND;
nfStorage.setItem('jwt', jwt, expiration);
// check to see if they actually have access now
$.ajax({
@ -144,9 +144,9 @@
$('#login-message-container').show();
});
}).fail(function (xhr, status, error) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Login',
dialogContent: common.escapeHtml(xhr.responseText)
dialogContent: nfCommon.escapeHtml(xhr.responseText)
});
// update the form visibility
@ -156,7 +156,7 @@
};
var showLogoutLink = function () {
common.showLogoutLink();
nfCommon.showLogoutLink();
};
var nfLogin = {
@ -164,9 +164,9 @@
* Initializes the login page.
*/
init: function () {
storage.init();
nfStorage.init();
if (storage.getItem('jwt') !== null) {
if (nfStorage.getItem('jwt') !== null) {
showLogoutLink();
}

View File

@ -21,8 +21,8 @@
if (typeof define === 'function' && define.amd) {
define(['jquery',
'nf.Storage'],
function ($, storage) {
return (nf.AjaxSetup = factory($, storage));
function ($, nfStorage) {
return (nf.AjaxSetup = factory($, nfStorage));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.AjaxSetup = factory(require('jquery'),
@ -31,7 +31,7 @@
nf.AjaxSetup = factory(root.$,
root.nf.Storage);
}
}(this, function ($, storage) {
}(this, function ($, nfStorage) {
/**
* Performs ajax setup for use within NiFi.
*/
@ -39,10 +39,10 @@
// include jwt when possible
$.ajaxSetup({
'beforeSend': function (xhr) {
var hadToken = storage.hasItem('jwt');
var hadToken = nfStorage.hasItem('jwt');
// get the token to include in all requests
var token = storage.getItem('jwt');
var token = nfStorage.getItem('jwt');
if (token !== null) {
xhr.setRequestHeader('Authorization', 'Bearer ' + token);
} else {

View File

@ -21,8 +21,8 @@
if (typeof define === 'function' && define.amd) {
define(['jquery',
'nf.Common'],
function ($, common) {
return (nf.Client = factory($, common));
function ($, nfCommon) {
return (nf.Client = factory($, nfCommon));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Client =
@ -33,7 +33,7 @@
factory(root.$,
root.nf.Common);
}
}(this, function ($, common) {
}(this, function ($, nfCommon) {
'use strict';
var clientId = null;
@ -73,7 +73,7 @@
* @return {boolean} whether proposedData is newer than currentData
*/
isNewerRevision: function (currentData, proposedData) {
if (common.isDefinedAndNotNull(currentData)) {
if (nfCommon.isDefinedAndNotNull(currentData)) {
var currentRevision = currentData.revision;
var proposedRevision = proposedData.revision;

View File

@ -23,8 +23,8 @@
define(['jquery',
'd3',
'nf.Storage'],
function ($, d3, storage) {
return (nf.Common = factory($, d3, storage));
function ($, d3, nfStorage) {
return (nf.Common = factory($, d3, nfStorage));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Common = factory(require('jquery'),
@ -35,7 +35,7 @@
root.d3,
root.nf.Storage);
}
}(this, function ($, d3, storage) {
}(this, function ($, d3, nfStorage) {
'use strict';
$(document).ready(function () {
@ -73,14 +73,14 @@
});
// shows the logout link in the message-pane when appropriate and schedule token refresh
if (storage.getItem('jwt') !== null) {
if (nfStorage.getItem('jwt') !== null) {
$('#user-logout-container').css('display', 'block');
nfCommon.scheduleTokenRefresh();
}
// handle logout
$('#user-logout').on('click', function () {
storage.removeItem('jwt');
nfStorage.removeItem('jwt');
window.location = '/nifi/login';
});
@ -227,7 +227,7 @@
var interval = nfCommon.MILLIS_PER_MINUTE;
var checkExpiration = function () {
var expiration = storage.getItemExpiration('jwt');
var expiration = nfStorage.getItemExpiration('jwt');
// ensure there is an expiration and token present
if (expiration !== null) {
@ -501,7 +501,7 @@
* Shows the logout link if appropriate.
*/
showLogoutLink: function () {
if (storage.getItem('jwt') === null) {
if (nfStorage.getItem('jwt') === null) {
$('#user-logout-container').css('display', 'none');
} else {
$('#user-logout-container').css('display', 'block');
@ -823,7 +823,7 @@
*/
getAccessToken: function (accessTokenUrl) {
return $.Deferred(function (deferred) {
if (storage.hasItem('jwt')) {
if (nfStorage.hasItem('jwt')) {
$.ajax({
type: 'POST',
url: accessTokenUrl

View File

@ -22,8 +22,8 @@
define(['jquery',
'nf.Common',
'nf.ErrorHandler'],
function ($, common, errorHandler) {
return (nf.ConnectionDetails = factory($, common, errorHandler));
function ($, nfCommon, nfErrorHandler) {
return (nf.ConnectionDetails = factory($, nfCommon, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ConnectionDetails = factory(require('jquery'),
@ -34,7 +34,7 @@
root.nf.Common,
root.nf.ErrorHandler);
}
}(this, function ($, common, errorHandler) {
}(this, function ($, nfCommon, nfErrorHandler) {
'use strict';
/**
@ -72,7 +72,7 @@
}).done(function (response) {
var processor = response.component;
var processorName = $('<div class="label"></div>').text(processor.name).addClass('ellipsis').attr('title', processor.name);
var processorType = $('<div></div>').text(common.substringAfterLast(processor.type, '.')).addClass('ellipsis').attr('title', common.substringAfterLast(processor.type, '.'));
var processorType = $('<div></div>').text(nfCommon.substringAfterLast(processor.type, '.')).addClass('ellipsis').attr('title', nfCommon.substringAfterLast(processor.type, '.'));
// populate source processor details
$('#read-only-connection-source-label').text('From processor');
@ -232,7 +232,7 @@
}).done(function (response) {
var processor = response.component;
var processorName = $('<div class="label"></div>').text(processor.name).addClass('ellipsis').attr('title', processor.name);
var processorType = $('<div></div>').text(common.substringAfterLast(processor.type, '.')).addClass('ellipsis').attr('title', common.substringAfterLast(processor.type, '.'));
var processorType = $('<div></div>').text(nfCommon.substringAfterLast(processor.type, '.')).addClass('ellipsis').attr('title', nfCommon.substringAfterLast(processor.type, '.'));
// populate destination processor details
$('#read-only-connection-target-label').text('To processor');
@ -410,8 +410,8 @@
$('#read-only-relationship-names').empty();
// clear the connection details
common.clearField('read-only-connection-name');
common.clearField('read-only-connection-id');
nfCommon.clearField('read-only-connection-name');
nfCommon.clearField('read-only-connection-id');
// clear the connection source details
$('#read-only-connection-source-label').text('');
@ -433,7 +433,7 @@
$('#read-only-prioritizers').empty();
},
open: function () {
common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
}
}
});
@ -483,7 +483,7 @@
var selectedRelationships = connection.selectedRelationships;
// show the available relationship if applicable
if (common.isDefinedAndNotNull(availableRelationships) || common.isDefinedAndNotNull(selectedRelationships)) {
if (nfCommon.isDefinedAndNotNull(availableRelationships) || nfCommon.isDefinedAndNotNull(selectedRelationships)) {
// populate the available connections
$.each(availableRelationships, function (i, name) {
createRelationshipOption(name);
@ -516,17 +516,17 @@
}
// set the connection details
common.populateField('read-only-connection-name', connection.name);
common.populateField('read-only-connection-id', connection.id);
common.populateField('read-only-flow-file-expiration', connection.flowFileExpiration);
common.populateField('read-only-back-pressure-object-threshold', connection.backPressureObjectThreshold);
common.populateField('read-only-back-pressure-data-size-threshold', connection.backPressureDataSizeThreshold);
nfCommon.populateField('read-only-connection-name', connection.name);
nfCommon.populateField('read-only-connection-id', connection.id);
nfCommon.populateField('read-only-flow-file-expiration', connection.flowFileExpiration);
nfCommon.populateField('read-only-back-pressure-object-threshold', connection.backPressureObjectThreshold);
nfCommon.populateField('read-only-back-pressure-data-size-threshold', connection.backPressureDataSizeThreshold);
// prioritizers
if (common.isDefinedAndNotNull(connection.prioritizers) && connection.prioritizers.length > 0) {
if (nfCommon.isDefinedAndNotNull(connection.prioritizers) && connection.prioritizers.length > 0) {
var prioritizerList = $('<ol></ol>').css('list-style', 'decimal inside none');
$.each(connection.prioritizers, function (i, type) {
prioritizerList.append($('<li></li>').text(common.substringAfterLast(type, '.')));
prioritizerList.append($('<li></li>').text(nfCommon.substringAfterLast(type, '.')));
});
$('#read-only-prioritizers').append(prioritizerList);
} else {
@ -545,9 +545,9 @@
if (relationshipNames.is(':visible') && relationshipNames.get(0).scrollHeight > Math.round(relationshipNames.innerHeight())) {
relationshipNames.css('border-width', '1px');
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
};
}));

View File

@ -22,8 +22,8 @@
define(['jquery',
'nf.Dialog',
'nf.Common'],
function ($, dialog, common) {
return (nf.ErrorHandler = factory($, dialog, common));
function ($, nfDialog, nfCommon) {
return (nf.ErrorHandler = factory($, nfDialog, nfCommon));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ErrorHandler = factory(require('jquery'),
@ -34,7 +34,7 @@
root.nf.Dialog,
root.nf.Common);
}
}(this, function ($, dialog, common) {
}(this, function ($, nfDialog, nfCommon) {
'use strict';
return {
@ -54,7 +54,7 @@
// show the error pane
$('#message-pane').show();
} else {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Session Expired',
dialogContent: 'Your session has expired. Please press Ok to log in again.',
okHandler: function () {
@ -88,21 +88,21 @@
return;
}
// status code 400, 404, and 409 are expected response codes for common errors.
// status code 400, 404, and 409 are expected response codes for nfCommon errors.
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409 || xhr.status === 503) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Error',
dialogContent: common.escapeHtml(xhr.responseText)
dialogContent: nfCommon.escapeHtml(xhr.responseText)
});
} else if (xhr.status === 403) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Insufficient Permissions',
dialogContent: common.escapeHtml(xhr.responseText)
dialogContent: nfCommon.escapeHtml(xhr.responseText)
});
} else {
if (xhr.status < 99 || xhr.status === 12007 || xhr.status === 12029) {
var content = 'Please ensure the application is running and check the logs for any errors.';
if (common.isDefinedAndNotNull(status)) {
if (nfCommon.isDefinedAndNotNull(status)) {
if (status === 'timeout') {
content = 'Request has timed out. Please ensure the application is running and check the logs for any errors.';
} else if (status === 'abort') {

View File

@ -24,8 +24,8 @@
'nf.CanvasUtils',
'nf.ClusterSummary',
'nf.Actions'],
function (angularBridge, canvasUtils, common, clusterSummary, actions) {
return (nf.ng.AppCtrl = factory(angularBridge, canvasUtils, common, clusterSummary, actions));
function (nfNgBridge, nfCanvasUtils, nfCommon, nfClusterSummary, nfActions) {
return (nf.ng.AppCtrl = factory(nfNgBridge, nfCanvasUtils, nfCommon, nfClusterSummary, nfActions));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.AppCtrl =
@ -41,7 +41,7 @@
root.nf.ClusterSummary,
root.nf.Actions);
}
}(this, function (angularBridge, canvasUtils, common, clusterSummary, actions) {
}(this, function (nfNgBridge, nfCanvasUtils, nfCommon, nfClusterSummary, nfActions) {
'use strict';
return function ($scope, serviceProvider) {
@ -50,10 +50,10 @@
function AppCtrl(serviceProvider) {
//add essential modules to the scope for availability throughout the angular container
this.nf = {
"Common": common,
"ClusterSummary": clusterSummary,
"Actions": actions,
"CanvasUtils": canvasUtils,
"Common": nfCommon,
"ClusterSummary": nfClusterSummary,
"Actions": nfActions,
"CanvasUtils": nfCanvasUtils,
};
//any registered angular service is available through the serviceProvider
@ -69,6 +69,6 @@
//For production angular applications .scope() is unavailable so we set
//the root scope of the bootstrapped app on the bridge
angularBridge.rootScope = $scope;
nfNgBridge.rootScope = $scope;
}
}));

View File

@ -26,8 +26,8 @@
'nf.ErrorHandler',
'nf.CustomUi',
'nf.ClusterSummary'],
function ($, common, universalCapture, dialog, errorHandler, customUi, clusterSummary) {
return (nf.ProcessorDetails = factory($, common, universalCapture, dialog, errorHandler, customUi, clusterSummary));
function ($, nfCommon, nfUniversalCapture, nfDialog, nfErrorHandler, nfCustomUi, nfClusterSummary) {
return (nf.ProcessorDetails = factory($, nfCommon, nfUniversalCapture, nfDialog, nfErrorHandler, nfCustomUi, nfClusterSummary));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ProcessorDetails =
@ -47,7 +47,7 @@
root.nf.CustomUi,
root.nf.ClusterSummary);
}
}(this, function ($, common, universalCapture, dialog, errorHandler, customUi, clusterSummary) {
}(this, function ($, nfCommon, nfUniversalCapture, nfDialog, nfErrorHandler, nfCustomUi, nfClusterSummary) {
'use strict';
/**
@ -65,7 +65,7 @@
// build the relationship container element
var relationshipContainerElement = $('<div class="processor-relationship-container"></div>').append(relationshipLabel).appendTo('#read-only-auto-terminate-relationship-names');
if (!common.isBlank(relationship.description)) {
if (!nfCommon.isBlank(relationship.description)) {
var relationshipDescription = $('<div class="relationship-description"></div>').text(relationship.description);
relationshipContainerElement.append(relationshipDescription);
}
@ -99,7 +99,7 @@
}],
select: function () {
// remove all property detail dialogs
universalCapture.removeAllPropertyDetailDialogs();
nfUniversalCapture.removeAllPropertyDetailDialogs();
// resize the property grid in case this is the first time its rendered
if ($(this).text() === 'Properties') {
@ -127,25 +127,25 @@
$('#read-only-processor-properties').propertytable('clear');
// clear the processor details
common.clearField('read-only-processor-id');
common.clearField('read-only-processor-type');
common.clearField('read-only-processor-name');
common.clearField('read-only-concurrently-schedulable-tasks');
common.clearField('read-only-scheduling-period');
common.clearField('read-only-penalty-duration');
common.clearField('read-only-yield-duration');
common.clearField('read-only-run-duration');
common.clearField('read-only-bulletin-level');
common.clearField('read-only-execution-node');
common.clearField('read-only-execution-status');
common.clearField('read-only-processor-comments');
nfCommon.clearField('read-only-processor-id');
nfCommon.clearField('read-only-processor-type');
nfCommon.clearField('read-only-processor-name');
nfCommon.clearField('read-only-concurrently-schedulable-tasks');
nfCommon.clearField('read-only-scheduling-period');
nfCommon.clearField('read-only-penalty-duration');
nfCommon.clearField('read-only-yield-duration');
nfCommon.clearField('read-only-run-duration');
nfCommon.clearField('read-only-bulletin-level');
nfCommon.clearField('read-only-execution-node');
nfCommon.clearField('read-only-execution-status');
nfCommon.clearField('read-only-processor-comments');
// removed the cached processor details
$('#processor-details').removeData('processorDetails');
$('#processor-details').removeData('processorHistory');
},
open: function () {
common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
}
}
});
@ -170,7 +170,7 @@
url: '../nifi-api/processors/' + encodeURIComponent(processorId),
dataType: 'json'
}).done(function (response) {
if (common.isDefinedAndNotNull(response.component)) {
if (nfCommon.isDefinedAndNotNull(response.component)) {
// get the processor details
var details = response.component;
@ -178,16 +178,16 @@
$('#processor-details').data('processorDetails', details);
// populate the processor settings
common.populateField('read-only-processor-id', details['id']);
common.populateField('read-only-processor-type', common.substringAfterLast(details['type'], '.'));
common.populateField('read-only-processor-name', details['name']);
common.populateField('read-only-concurrently-schedulable-tasks', details.config['concurrentlySchedulableTaskCount']);
common.populateField('read-only-scheduling-period', details.config['schedulingPeriod']);
common.populateField('read-only-penalty-duration', details.config['penaltyDuration']);
common.populateField('read-only-yield-duration', details.config['yieldDuration']);
common.populateField('read-only-run-duration', common.formatDuration(details.config['runDurationMillis']));
common.populateField('read-only-bulletin-level', details.config['bulletinLevel']);
common.populateField('read-only-processor-comments', details.config['comments']);
nfCommon.populateField('read-only-processor-id', details['id']);
nfCommon.populateField('read-only-processor-type', nfCommon.substringAfterLast(details['type'], '.'));
nfCommon.populateField('read-only-processor-name', details['name']);
nfCommon.populateField('read-only-concurrently-schedulable-tasks', details.config['concurrentlySchedulableTaskCount']);
nfCommon.populateField('read-only-scheduling-period', details.config['schedulingPeriod']);
nfCommon.populateField('read-only-penalty-duration', details.config['penaltyDuration']);
nfCommon.populateField('read-only-yield-duration', details.config['yieldDuration']);
nfCommon.populateField('read-only-run-duration', nfCommon.formatDuration(details.config['runDurationMillis']));
nfCommon.populateField('read-only-bulletin-level', details.config['bulletinLevel']);
nfCommon.populateField('read-only-processor-comments', details.config['comments']);
var showRunSchedule = true;
@ -204,7 +204,7 @@
} else {
schedulingStrategy = "On primary node";
}
common.populateField('read-only-scheduling-strategy', schedulingStrategy);
nfCommon.populateField('read-only-scheduling-strategy', schedulingStrategy);
// only show the run schedule when applicable
if (showRunSchedule === true) {
@ -216,13 +216,13 @@
var executionNode = details.config['executionNode'];
// only show the execution-node when applicable
if (clusterSummary.isClustered() || executionNode === 'PRIMARY') {
if (nfClusterSummary.isClustered() || executionNode === 'PRIMARY') {
if (executionNode === 'ALL') {
executionNode = "All nodes";
} else if (executionNode === 'PRIMARY') {
executionNode = "Primary node only";
}
common.populateField('read-only-execution-node', executionNode);
nfCommon.populateField('read-only-execution-node', executionNode);
$('#read-only-execution-node-options').show();
} else {
@ -230,7 +230,7 @@
}
// load the relationship list
if (!common.isEmpty(details.relationships)) {
if (!nfCommon.isEmpty(details.relationships)) {
$.each(details.relationships, function (i, relationship) {
createRelationshipOption(relationship);
});
@ -278,7 +278,7 @@
}];
// determine if we should show the advanced button
if (top === window && common.isDefinedAndNotNull(customUi) && common.isDefinedAndNotNull(processor.config.customUiUrl) && processor.config.customUiUrl !== '') {
if (top === window && nfCommon.isDefinedAndNotNull(nfCustomUi) && nfCommon.isDefinedAndNotNull(processor.config.customUiUrl) && processor.config.customUiUrl !== '') {
buttons.push({
buttonText: 'Advanced',
clazz: 'fa fa-cog button-icon',
@ -293,7 +293,7 @@
$('#processor-details').modal('hide');
// show the custom ui
customUi.showCustomUi(processorResponse, processor.config.customUiUrl, false);
nfCustomUi.showCustomUi(processorResponse, processor.config.customUiUrl, false);
}
}
});
@ -312,12 +312,12 @@
}
}).fail(function (xhr, status, error) {
if (xhr.status === 400 || xhr.status === 404 || xhr.status === 409) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Error',
dialogContent: common.escapeHtml(xhr.responseText)
dialogContent: nfCommon.escapeHtml(xhr.responseText)
});
} else {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
}
});
}

View File

@ -21,8 +21,8 @@
if (typeof define === 'function' && define.amd) {
define(['jquery',
'nf.Common'],
function ($, common) {
return (nf.Shell = factory($, common));
function ($, nfCommon) {
return (nf.Shell = factory($, nfCommon));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Shell = factory(require('jquery'),
@ -31,7 +31,7 @@
nf.Shell = factory(root.$,
root.nf.Common);
}
}(this, function ($, common) {
}(this, function ($, nfCommon) {
'use strict';
$(document).ready(function () {
@ -55,7 +55,7 @@
// register a listener when the frame is undocked
$('#shell-undock-button').click(function () {
var uri = $('#shell-iframe').attr('src');
if (!common.isBlank(uri)) {
if (!nfCommon.isBlank(uri)) {
// open the page and close the shell
window.open(uri);
@ -74,10 +74,10 @@
/**
* Initialize the shell.
*
* @param contextMenu The reference to the contextMenu controller.
* @param nfContextMenuRef The nfContextMenu module.
*/
init: function (contextMenu) {
nfContextMenu = contextMenu;
init: function (nfContextMenuRef) {
nfContextMenu = nfContextMenuRef;
},
resizeContent: function (shell) {
@ -107,7 +107,7 @@
*/
showPage: function (uri, canUndock) {
// if the context menu is on this page, attempt to close
if (common.isDefinedAndNotNull(nfContextMenu)) {
if (nfCommon.isDefinedAndNotNull(nfContextMenu)) {
nfContextMenu.hide();
}
@ -115,7 +115,7 @@
var shell = $('#shell');
// default undockable to true
if (common.isNull(canUndock) || common.isUndefined(canUndock)) {
if (nfCommon.isNull(canUndock) || nfCommon.isUndefined(canUndock)) {
canUndock = true;
}
@ -128,7 +128,7 @@
// register a new open handler
$('#shell-dialog').modal('setOpenHandler', function () {
common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
});
// show the custom processor ui
@ -161,7 +161,7 @@
*/
showContent: function (domId) {
// if the context menu is on this page, attempt to close
if (common.isDefinedAndNotNull(nfContextMenu)) {
if (nfCommon.isDefinedAndNotNull(nfContextMenu)) {
nfContextMenu.hide();
}

View File

@ -24,8 +24,8 @@
'nf.Common',
'nf.Dialog',
'nf.ErrorHandler'],
function ($, d3, common, dialog, errorHandler) {
return (nf.StatusHistory = factory($, d3, common, dialog, errorHandler));
function ($, d3, nfCommon, nfDialog, nfErrorHandler) {
return (nf.StatusHistory = factory($, d3, nfCommon, nfDialog, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.StatusHistory = factory(require('jquery'),
@ -40,7 +40,7 @@
root.nf.Dialog,
root.nf.ErrorHandler);
}
}(this, function ($, d3, common, dialog, errorHandler) {
}(this, function ($, d3, nfCommon, nfDialog, nfErrorHandler) {
var config = {
nifiInstanceId: 'nifi-instance-id',
nifiInstanceLabel: 'NiFi',
@ -65,19 +65,19 @@
*/
var formatters = {
'DURATION': function (d) {
return common.formatDuration(d);
return nfCommon.formatDuration(d);
},
'COUNT': function (d) {
// need to handle floating point number since this formatter
// will also be used for average values
if (d % 1 === 0) {
return common.formatInteger(d);
return nfCommon.formatInteger(d);
} else {
return common.formatFloat(d);
return nfCommon.formatFloat(d);
}
},
'DATA_SIZE': function (d) {
return common.formatDataSize(d);
return nfCommon.formatDataSize(d);
}
};
@ -125,10 +125,10 @@
// get the descriptors
var descriptors = componentStatusHistory.fieldDescriptors;
statusHistory.details = componentStatusHistory.componentDetails;
statusHistory.selectedDescriptor = common.isUndefined(selectedDescriptor) ? descriptors[0] : selectedDescriptor;
statusHistory.selectedDescriptor = nfCommon.isUndefined(selectedDescriptor) ? descriptors[0] : selectedDescriptor;
// ensure enough status snapshots
if (common.isDefinedAndNotNull(componentStatusHistory.aggregateSnapshots) && componentStatusHistory.aggregateSnapshots.length > 1) {
if (nfCommon.isDefinedAndNotNull(componentStatusHistory.aggregateSnapshots) && componentStatusHistory.aggregateSnapshots.length > 1) {
statusHistory.instances.push({
id: config.nifiInstanceId,
label: config.nifiInstanceLabel,
@ -142,7 +142,7 @@
// get the status for each node in the cluster if applicable
$.each(componentStatusHistory.nodeSnapshots, function (_, nodeSnapshots) {
// ensure enough status snapshots
if (common.isDefinedAndNotNull(nodeSnapshots.statusSnapshots) && nodeSnapshots.statusSnapshots.length > 1) {
if (nfCommon.isDefinedAndNotNull(nodeSnapshots.statusSnapshots) && nodeSnapshots.statusSnapshots.length > 1) {
statusHistory.instances.push({
id: nodeSnapshots.nodeId,
label: nodeSnapshots.address + ':' + nodeSnapshots.apiPort,
@ -168,7 +168,7 @@
*/
var insufficientHistory = function () {
// notify the user
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Status History',
dialogContent: 'Insufficient history, please try again later.'
});
@ -216,7 +216,7 @@
options.push({
text: d.label,
value: d.field,
description: common.escapeHtml(d.description)
description: nfCommon.escapeHtml(d.description)
});
});
@ -329,7 +329,7 @@
// go through each instance of this status history
$.each(statusHistory.instances, function (_, instance) {
// if this is the first time this instance is being rendered, make it visible
if (common.isUndefinedOrNull(instances[instance.id])) {
if (nfCommon.isUndefinedOrNull(instances[instance.id])) {
instances[instance.id] = true;
}
@ -463,8 +463,8 @@
return s.timestamp;
});
});
addDetailItem(detailsContainer, 'Start', common.formatDateTime(minDate));
addDetailItem(detailsContainer, 'End', common.formatDateTime(maxDate));
addDetailItem(detailsContainer, 'Start', nfCommon.formatDateTime(minDate));
addDetailItem(detailsContainer, 'End', nfCommon.formatDateTime(maxDate));
// determine the x axis range
x.domain([minDate, maxDate]);
@ -744,7 +744,7 @@
.on('brush', brushed);
// conditionally set the brush extent
if (common.isDefinedAndNotNull(brushExtent)) {
if (nfCommon.isDefinedAndNotNull(brushExtent)) {
brush = brush.extent(brushExtent);
}
@ -924,29 +924,29 @@
// containment
// -----------
dialog = $('#status-history-dialog');
var nfDialog = {};
if (common.isDefinedAndNotNull(dialog.data('nf-dialog'))) {
nfDialog = dialog.data('nf-dialog');
var nfDialogData = {};
if (nfCommon.isDefinedAndNotNull(dialog.data('nf-dialog'))) {
nfDialogData = dialog.data('nf-dialog');
}
nfDialog['min-width'] = (dialog.width() / $(window).width()) * 100 + '%';
nfDialog['min-height'] = (dialog.height() / $(window).height()) * 100 + '%';
nfDialog.responsive['fullscreen-width'] = dialog.outerWidth() + 'px';
nfDialog.responsive['fullscreen-height'] = dialog.outerHeight() + 'px';
nfDialogData['min-width'] = (dialog.width() / $(window).width()) * 100 + '%';
nfDialogData['min-height'] = (dialog.height() / $(window).height()) * 100 + '%';
nfDialogData.responsive['fullscreen-width'] = dialog.outerWidth() + 'px';
nfDialogData.responsive['fullscreen-height'] = dialog.outerHeight() + 'px';
maxWidth = getChartMaxWidth();
if (ui.helper.width() > maxWidth) {
ui.helper.width(maxWidth);
nfDialog.responsive['fullscreen-width'] = $(window).width() + 'px';
nfDialog['min-width'] = '100%';
nfDialogData.responsive['fullscreen-width'] = $(window).width() + 'px';
nfDialogData['min-width'] = '100%';
}
maxHeight = getChartMaxHeight();
if (ui.helper.height() > maxHeight) {
ui.helper.height(maxHeight);
nfDialog.responsive['fullscreen-height'] = $(window).height() + 'px';
nfDialog['min-height'] = '100%';
nfDialogData.responsive['fullscreen-height'] = $(window).height() + 'px';
nfDialogData['min-height'] = '100%';
}
minHeight = getChartMinHeight();
@ -954,11 +954,11 @@
ui.helper.height(minHeight);
}
nfDialog['min-width'] = (parseInt(nfDialog['min-width'], 10) >= 100) ? '100%' : nfDialog['min-width'];
nfDialog['min-height'] = (parseInt(nfDialog['min-height'], 10) >= 100) ? '100%' : nfDialog['min-height'];
nfDialogData['min-width'] = (parseInt(nfDialogData['min-width'], 10) >= 100) ? '100%' : nfDialogData['min-width'];
nfDialogData['min-height'] = (parseInt(nfDialogData['min-height'], 10) >= 100) ? '100%' : nfDialogData['min-height'];
//persist data attribute
dialog.data('nfDialog', nfDialog);
dialog.data('nfDialog', nfDialogData);
// ----------------------
// status history dialog
@ -1042,7 +1042,7 @@
$('<div class="setting-name"></div>').text(label).appendTo(detailContainer);
var detailElement = $('<div class="setting-field"></div>').text(value).appendTo(detailContainer);
if (common.isDefinedAndNotNull(valueElementId)) {
if (nfCommon.isDefinedAndNotNull(valueElementId)) {
detailElement.attr('id', valueElementId);
}
};
@ -1111,7 +1111,7 @@
if (e.target === window) {
updateChart();
}
common.toggleScrollable($('#status-history-details').get(0));
nfCommon.toggleScrollable($('#status-history-details').get(0));
})
},
@ -1129,7 +1129,7 @@
dataType: 'json'
}).done(function (response) {
handleStatusHistoryResponse(groupId, connectionId, response.statusHistory, config.type.connection, selectedDescriptor);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
},
/**
@ -1146,7 +1146,7 @@
dataType: 'json'
}).done(function (response) {
handleStatusHistoryResponse(groupId, processorId, response.statusHistory, config.type.processor, selectedDescriptor);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
},
/**
@ -1163,7 +1163,7 @@
dataType: 'json'
}).done(function (response) {
handleStatusHistoryResponse(groupId, processGroupId, response.statusHistory, config.type.processGroup, selectedDescriptor);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
},
/**
@ -1180,7 +1180,7 @@
dataType: 'json'
}).done(function (response) {
handleStatusHistoryResponse(groupId, remoteProcessGroupId, response.statusHistory, config.type.remoteProcessGroup, selectedDescriptor);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
};

View File

@ -24,8 +24,8 @@
'nf.Common',
'nf.Dialog',
'nf.ErrorHandler'],
function ($, d3, common, dialog, errorHandler) {
return (nf.ng.ProvenanceLineage = factory($, d3, common, dialog, errorHandler));
function ($, d3, nfCommon, nfDialog, nfErrorHandler) {
return (nf.ng.ProvenanceLineage = factory($, d3, nfCommon, nfDialog, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.ProvenanceLineage =
@ -41,7 +41,7 @@
root.nf.Dialog,
root.nf.ErrorHandler);
}
}(this, function ($, d3, common, dialog, errorHandler) {
}(this, function ($, d3, nfCommon, nfDialog, nfErrorHandler) {
'use strict';
var mySelf = function () {
@ -136,7 +136,7 @@
data: JSON.stringify(lineageEntity),
dataType: 'json',
contentType: 'application/json'
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -147,7 +147,7 @@
*/
var getLineage = function (lineage) {
var url = lineage.uri;
if (common.isDefinedAndNotNull(lineage.request.clusterNodeId)) {
if (nfCommon.isDefinedAndNotNull(lineage.request.clusterNodeId)) {
url += '?' + $.param({
clusterNodeId: lineage.request.clusterNodeId
});
@ -157,7 +157,7 @@
type: 'GET',
url: url,
dataType: 'json'
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -168,7 +168,7 @@
*/
var cancelLineage = function (lineage) {
var url = lineage.uri;
if (common.isDefinedAndNotNull(lineage.request.clusterNodeId)) {
if (nfCommon.isDefinedAndNotNull(lineage.request.clusterNodeId)) {
url += '?' + $.param({
clusterNodeId: lineage.request.clusterNodeId
});
@ -178,7 +178,7 @@
type: 'DELETE',
url: url,
dataType: 'json'
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
var DEFAULT_NODE_SPACING = 100;
@ -216,7 +216,7 @@
descendants.add(link.target.id);
});
if (common.isUndefined(depth)) {
if (nfCommon.isUndefined(depth)) {
locateDescendants(children, descendants);
} else if (depth > 1) {
locateDescendants(children, descendants, depth - 1);
@ -483,11 +483,11 @@
node.incoming = [];
// ensure this event has an event time
if (common.isUndefined(minMillis) || minMillis > node.millis) {
if (nfCommon.isUndefined(minMillis) || minMillis > node.millis) {
minMillis = node.millis;
minTimestamp = node.timestamp;
}
if (common.isUndefined(maxMillis) || maxMillis < node.millis) {
if (nfCommon.isUndefined(maxMillis) || maxMillis < node.millis) {
maxMillis = node.millis;
}
});
@ -526,7 +526,7 @@
// create the proper date by adjusting by the offsets
var date = new Date(millis + userTimeOffset + provenanceTableCtrl.serverTimeOffset);
return common.formatDateTime(date);
return nfCommon.formatDateTime(date);
};
// handle context menu clicks...
@ -800,7 +800,7 @@
// closes the searching dialog and cancels the query on the server
var closeDialog = function () {
// cancel the provenance results since we've successfully processed the results
if (common.isDefinedAndNotNull(lineage)) {
if (nfCommon.isDefinedAndNotNull(lineage)) {
cancelLineage(lineage);
}
@ -827,11 +827,11 @@
}
// close the dialog if the results contain an error
if (!common.isEmpty(lineage.results.errors)) {
if (!nfCommon.isEmpty(lineage.results.errors)) {
var errors = lineage.results.errors;
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Process Lineage',
dialogContent: common.formatUnorderedList(errors)
dialogContent: nfCommon.formatUnorderedList(errors)
});
closeDialog();
@ -851,7 +851,7 @@
renderEventLineage(results);
} else {
// inform the user that no results were found
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Lineage Results',
dialogContent: 'The lineage search has completed successfully but there no results were found. The events may have aged off.'
});
@ -1346,7 +1346,7 @@
// closes the searching dialog and cancels the query on the server
var closeDialog = function () {
// cancel the provenance results since we've successfully processed the results
if (common.isDefinedAndNotNull(lineage)) {
if (nfCommon.isDefinedAndNotNull(lineage)) {
cancelLineage(lineage);
}
@ -1372,11 +1372,11 @@
}
// close the dialog if the results contain an error
if (!common.isEmpty(lineage.results.errors)) {
if (!nfCommon.isEmpty(lineage.results.errors)) {
var errors = lineage.results.errors;
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Process Lineage',
dialogContent: common.formatUnorderedList(errors)
dialogContent: nfCommon.formatUnorderedList(errors)
});
closeDialog();

View File

@ -26,8 +26,8 @@
'nf.ErrorHandler',
'nf.Storage',
'nf.ng.Bridge'],
function ($, Slick, common, dialog, errorHandler, storage, angularBridge) {
return (nf.ng.ProvenanceTable = factory($, Slick, common, dialog, errorHandler, storage, angularBridge));
function ($, Slick, nfCommon, nfDialog, nfErrorHandler, nfStorage, nfNgBridge) {
return (nf.ng.ProvenanceTable = factory($, Slick, nfCommon, nfDialog, nfErrorHandler, nfStorage, nfNgBridge));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.ProvenanceTable =
@ -47,7 +47,7 @@
root.nf.Storage,
root.nf.ng.Bridge);
}
}(this, function ($, Slick, common, dialog, errorHandler, storage, angularBridge) {
}(this, function ($, Slick, nfCommon, nfDialog, nfErrorHandler, nfStorage, nfNgBridge) {
'use strict';
var nfProvenanceTable = function (provenanceLineageCtrl) {
@ -93,17 +93,17 @@
var dataUri = config.urls.provenanceEvents + encodeURIComponent(eventId) + '/content/' + encodeURIComponent(direction);
// perform the request once we've received a token
common.getAccessToken(config.urls.downloadToken).done(function (downloadToken) {
nfCommon.getAccessToken(config.urls.downloadToken).done(function (downloadToken) {
var parameters = {};
// conditionally include the ui extension token
if (!common.isBlank(downloadToken)) {
if (!nfCommon.isBlank(downloadToken)) {
parameters['access_token'] = downloadToken;
}
// conditionally include the cluster node id
var clusterNodeId = $('#provenance-event-cluster-node-id').text();
if (!common.isBlank(clusterNodeId)) {
if (!nfCommon.isBlank(clusterNodeId)) {
parameters['clusterNodeId'] = clusterNodeId;
}
@ -114,7 +114,7 @@
window.open(dataUri + '?' + $.param(parameters));
}
}).fail(function () {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Provenance',
dialogContent: 'Unable to generate access token for downloading content.'
});
@ -135,7 +135,7 @@
// generate tokens as necessary
var getAccessTokens = $.Deferred(function (deferred) {
if (storage.hasItem('jwt')) {
if (nfStorage.hasItem('jwt')) {
// generate a token for the ui extension and another for the callback
var uiExtensionToken = $.ajax({
type: 'POST',
@ -152,7 +152,7 @@
var downloadToken = downloadTokenResult[0];
deferred.resolve(uiExtensionToken, downloadToken);
}).fail(function () {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Provenance',
dialogContent: 'Unable to generate access token for viewing content.'
});
@ -169,12 +169,12 @@
// conditionally include the cluster node id
var clusterNodeId = $('#provenance-event-cluster-node-id').text();
if (!common.isBlank(clusterNodeId)) {
if (!nfCommon.isBlank(clusterNodeId)) {
dataUriParameters['clusterNodeId'] = clusterNodeId;
}
// include the download token if applicable
if (!common.isBlank(downloadToken)) {
if (!nfCommon.isBlank(downloadToken)) {
dataUriParameters['access_token'] = downloadToken;
}
@ -200,7 +200,7 @@
};
// include the download token if applicable
if (!common.isBlank(uiExtensionToken)) {
if (!nfCommon.isBlank(uiExtensionToken)) {
contentViewerParameters['access_token'] = uiExtensionToken;
}
@ -257,7 +257,7 @@
$('#modified-attribute-toggle').removeClass('checkbox-checked').addClass('checkbox-unchecked');
},
open: function () {
common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
}
}
});
@ -283,7 +283,7 @@
});
// if a content viewer url is specified, use it
if (common.isContentViewConfigured()) {
if (nfCommon.isContentViewConfigured()) {
// input view
$('#input-content-view').on('click', function () {
viewContent('input');
@ -303,7 +303,7 @@
// conditionally include the cluster node id
var clusterNodeId = $('#provenance-event-cluster-node-id').text();
if (!common.isBlank(clusterNodeId)) {
if (!nfCommon.isBlank(clusterNodeId)) {
replayEntity['clusterNodeId'] = clusterNodeId;
}
@ -314,11 +314,11 @@
dataType: 'json',
contentType: 'application/json'
}).done(function (response) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Provenance',
dialogContent: 'Successfully submitted replay request.'
});
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
$('#event-details-dialog').modal('hide');
});
@ -388,7 +388,7 @@
$('#provenance-search-location').combo({
options: searchableOptions
});
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
// show the node search combo
$('#provenance-search-location-container').show();
@ -534,7 +534,7 @@
var searchValue = $.trim(searchableField.find('input.searchable-field-input').val());
// if the field isn't blank include it in the search
if (!common.isBlank(searchValue)) {
if (!nfCommon.isBlank(searchValue)) {
searchCriteria[fieldId] = searchValue;
}
});
@ -623,7 +623,7 @@
// define how general values are formatted
var valueFormatter = function (row, cell, value, columnDef, dataContext) {
return common.formatValue(value);
return nfCommon.formatValue(value);
};
// determine if the this page is in the shell
@ -634,13 +634,13 @@
var markup = '';
// conditionally include the cluster node id
if (common.SUPPORTS_SVG) {
if (nfCommon.SUPPORTS_SVG) {
markup += '<div title="Show Lineage" class="pointer show-lineage icon icon-lineage" style="margin-right: 3px;"></div>';
}
// conditionally support going to the component
var isRemotePort = dataContext.componentType === 'Remote Input Port' || dataContext.componentType === 'Remote Output Port';
if (isInShell && common.isDefinedAndNotNull(dataContext.groupId) && isRemotePort === false) {
if (isInShell && nfCommon.isDefinedAndNotNull(dataContext.groupId) && isRemotePort === false) {
markup += '<div class="pointer go-to fa fa-long-arrow-right" title="Go To"></div>';
}
@ -717,7 +717,7 @@
}
// conditionally show the action column
if (common.SUPPORTS_SVG || isInShell) {
if (nfCommon.SUPPORTS_SVG || isInShell) {
provenanceColumns.push({
id: 'actions',
name: '&nbsp;',
@ -797,7 +797,7 @@
provenanceGrid.render();
// update the total number of displayed events if necessary
$('#displayed-events').text(common.formatInteger(args.current));
$('#displayed-events').text(nfCommon.formatInteger(args.current));
});
provenanceData.onRowsChanged.subscribe(function (e, args) {
provenanceGrid.invalidateRows(args.rows);
@ -820,7 +820,7 @@
var provenanceGrid = $('#provenance-table').data('gridInstance');
// ensure the grid has been initialized
if (common.isDefinedAndNotNull(provenanceGrid)) {
if (nfCommon.isDefinedAndNotNull(provenanceGrid)) {
var provenanceData = provenanceGrid.getData();
// update the search criteria
@ -874,24 +874,24 @@
// defines a function for sorting
var comparer = function (a, b) {
if (sortDetails.columnId === 'eventTime') {
var aTime = common.parseDateTime(a[sortDetails.columnId]).getTime();
var bTime = common.parseDateTime(b[sortDetails.columnId]).getTime();
var aTime = nfCommon.parseDateTime(a[sortDetails.columnId]).getTime();
var bTime = nfCommon.parseDateTime(b[sortDetails.columnId]).getTime();
if (aTime === bTime) {
return a['id'] - b['id'];
} else {
return aTime - bTime;
}
} else if (sortDetails.columnId === 'fileSize') {
var aSize = common.parseSize(a[sortDetails.columnId]);
var bSize = common.parseSize(b[sortDetails.columnId]);
var aSize = nfCommon.parseSize(a[sortDetails.columnId]);
var bSize = nfCommon.parseSize(b[sortDetails.columnId]);
if (aSize === bSize) {
return a['id'] - b['id'];
} else {
return aSize - bSize;
}
} else {
var aString = common.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = common.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
var aString = nfCommon.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = nfCommon.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
if (aString === bString) {
return a['id'] - b['id'];
} else {
@ -928,7 +928,7 @@
data: JSON.stringify(provenanceEntity),
dataType: 'json',
contentType: 'application/json'
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -939,7 +939,7 @@
*/
var getProvenance = function (provenance) {
var url = provenance.uri;
if (common.isDefinedAndNotNull(provenance.request.clusterNodeId)) {
if (nfCommon.isDefinedAndNotNull(provenance.request.clusterNodeId)) {
url += '?' + $.param({
clusterNodeId: provenance.request.clusterNodeId,
summarize: true,
@ -956,7 +956,7 @@
type: 'GET',
url: url,
dataType: 'json'
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -967,7 +967,7 @@
*/
var cancelProvenance = function (provenance) {
var url = provenance.uri;
if (common.isDefinedAndNotNull(provenance.request.clusterNodeId)) {
if (nfCommon.isDefinedAndNotNull(provenance.request.clusterNodeId)) {
url += '?' + $.param({
clusterNodeId: provenance.request.clusterNodeId
});
@ -977,7 +977,7 @@
type: 'DELETE',
url: url,
dataType: 'json'
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -990,7 +990,7 @@
var provenanceResults = provenance.results;
// ensure there are groups specified
if (common.isDefinedAndNotNull(provenanceResults.provenanceEvents)) {
if (nfCommon.isDefinedAndNotNull(provenanceResults.provenanceEvents)) {
var provenanceTable = $('#provenance-table').data('gridInstance');
var provenanceData = provenanceTable.getData();
@ -1003,21 +1003,21 @@
$('#provenance-last-refreshed').text(provenanceResults.generated);
// update the oldest event available
$('#oldest-event').html(common.formatValue(provenanceResults.oldestEvent));
$('#oldest-event').html(nfCommon.formatValue(provenanceResults.oldestEvent));
// record the server offset
provenanceTableCtrl.serverTimeOffset = provenanceResults.timeOffset;
// determines if the specified query is blank (no search terms, start or end date)
var isBlankQuery = function (query) {
return common.isUndefinedOrNull(query.startDate) && common.isUndefinedOrNull(query.endDate) && $.isEmptyObject(query.searchTerms);
return nfCommon.isUndefinedOrNull(query.startDate) && nfCommon.isUndefinedOrNull(query.endDate) && $.isEmptyObject(query.searchTerms);
};
// update the filter message based on the request
if (isBlankQuery(provenanceRequest)) {
var message = 'Showing the most recent ';
if (provenanceResults.totalCount >= config.maxResults) {
message += (common.formatInteger(config.maxResults) + ' of ' + provenanceResults.total + ' events, please refine the search.');
message += (nfCommon.formatInteger(config.maxResults) + ' of ' + provenanceResults.total + ' events, please refine the search.');
} else {
message += ('events.');
}
@ -1026,7 +1026,7 @@
} else {
var message = 'Showing ';
if (provenanceResults.totalCount >= config.maxResults) {
message += (common.formatInteger(config.maxResults) + ' of ' + provenanceResults.total + ' events that match the specified query, please refine the search.');
message += (nfCommon.formatInteger(config.maxResults) + ' of ' + provenanceResults.total + ' events that match the specified query, please refine the search.');
} else {
message += ('the events that match the specified query.');
}
@ -1035,7 +1035,7 @@
}
// update the total number of events
$('#total-events').text(common.formatInteger(provenanceResults.provenanceEvents.length));
$('#total-events').text(nfCommon.formatInteger(provenanceResults.provenanceEvents.length));
} else {
$('#total-events').text('0');
}
@ -1048,11 +1048,11 @@
*/
var goTo = function (item) {
// ensure the component is still present in the flow
if (common.isDefinedAndNotNull(item.groupId)) {
if (nfCommon.isDefinedAndNotNull(item.groupId)) {
// only attempt this if we're within a frame
if (top !== window) {
// and our parent has canvas utils and shell defined
if (common.isDefinedAndNotNull(parent.nf) && common.isDefinedAndNotNull(parent.nf.CanvasUtils) && common.isDefinedAndNotNull(parent.nf.Shell)) {
if (nfCommon.isDefinedAndNotNull(parent.nf) && nfCommon.isDefinedAndNotNull(parent.nf.CanvasUtils) && nfCommon.isDefinedAndNotNull(parent.nf.Shell)) {
parent.nf.CanvasUtils.showComponent(item.groupId, item.componentId);
parent.$('#shell-close-button').click();
}
@ -1083,7 +1083,7 @@
// handles init failure
var failure = function (xhr, status, error) {
deferred.reject();
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
};
// initialize the lineage view
@ -1104,7 +1104,7 @@
*/
resetTableSize: function () {
var provenanceGrid = $('#provenance-table').data('gridInstance');
if (common.isDefinedAndNotNull(provenanceGrid)) {
if (nfCommon.isDefinedAndNotNull(provenanceGrid)) {
provenanceGrid.resizeCanvas();
}
},
@ -1123,7 +1123,7 @@
// update the progress bar
var label = $('<div class="progress-label"></div>').text(value + '%');
(angularBridge.injector.get('$compile')($('<md-progress-linear ng-cloak ng-value="' + value + '" class="md-hue-2" md-mode="determinate" aria-label="Progress"></md-progress-linear>'))(angularBridge.rootScope)).appendTo(progressBar);
(nfNgBridge.injector.get('$compile')($('<md-progress-linear ng-cloak ng-value="' + value + '" class="md-hue-2" md-mode="determinate" aria-label="Progress"></md-progress-linear>'))(nfNgBridge.rootScope)).appendTo(progressBar);
progressBar.append(label);
},
@ -1180,7 +1180,7 @@
// -----------------------------
// handle the specified query appropriately
if (common.isDefinedAndNotNull(query)) {
if (nfCommon.isDefinedAndNotNull(query)) {
// store the last query performed
cachedQuery = query;
} else if (!$.isEmptyObject(cachedQuery)) {
@ -1194,7 +1194,7 @@
// closes the searching dialog and cancels the query on the server
var closeDialog = function () {
// cancel the provenance results since we've successfully processed the results
if (common.isDefinedAndNotNull(provenance)) {
if (nfCommon.isDefinedAndNotNull(provenance)) {
cancelProvenance(provenance);
}
@ -1227,11 +1227,11 @@
// process the results if they are finished
if (provenance.finished === true) {
// show any errors when the query finishes
if (!common.isEmpty(provenance.results.errors)) {
if (!nfCommon.isEmpty(provenance.results.errors)) {
var errors = provenance.results.errors;
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Provenance',
dialogContent: common.formatUnorderedList(errors),
dialogContent: nfCommon.formatUnorderedList(errors),
});
}
@ -1270,7 +1270,7 @@
*/
getEventDetails: function (eventId, clusterNodeId) {
var url;
if (common.isDefinedAndNotNull(clusterNodeId)) {
if (nfCommon.isDefinedAndNotNull(clusterNodeId)) {
url = config.urls.provenanceEvents + encodeURIComponent(eventId) + '?' + $.param({
clusterNodeId: clusterNodeId
});
@ -1282,7 +1282,7 @@
type: 'GET',
url: url,
dataType: 'json'
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
},
/**
@ -1297,25 +1297,25 @@
// update the event details
$('#provenance-event-id').text(event.eventId);
$('#provenance-event-time').html(common.formatValue(event.eventTime)).ellipsis();
$('#provenance-event-type').html(common.formatValue(event.eventType)).ellipsis();
$('#provenance-event-flowfile-uuid').html(common.formatValue(event.flowFileUuid)).ellipsis();
$('#provenance-event-component-id').html(common.formatValue(event.componentId)).ellipsis();
$('#provenance-event-component-name').html(common.formatValue(event.componentName)).ellipsis();
$('#provenance-event-component-type').html(common.formatValue(event.componentType)).ellipsis();
$('#provenance-event-details').html(common.formatValue(event.details)).ellipsis();
$('#provenance-event-time').html(nfCommon.formatValue(event.eventTime)).ellipsis();
$('#provenance-event-type').html(nfCommon.formatValue(event.eventType)).ellipsis();
$('#provenance-event-flowfile-uuid').html(nfCommon.formatValue(event.flowFileUuid)).ellipsis();
$('#provenance-event-component-id').html(nfCommon.formatValue(event.componentId)).ellipsis();
$('#provenance-event-component-name').html(nfCommon.formatValue(event.componentName)).ellipsis();
$('#provenance-event-component-type').html(nfCommon.formatValue(event.componentType)).ellipsis();
$('#provenance-event-details').html(nfCommon.formatValue(event.details)).ellipsis();
// over the default tooltip with the actual byte count
var fileSize = $('#provenance-event-file-size').html(common.formatValue(event.fileSize)).ellipsis();
fileSize.attr('title', common.formatInteger(event.fileSizeBytes) + ' bytes');
var fileSize = $('#provenance-event-file-size').html(nfCommon.formatValue(event.fileSize)).ellipsis();
fileSize.attr('title', nfCommon.formatInteger(event.fileSizeBytes) + ' bytes');
// sets an duration
var setDuration = function (field, value) {
if (common.isDefinedAndNotNull(value)) {
if (nfCommon.isDefinedAndNotNull(value)) {
if (value === 0) {
field.text('< 1ms');
} else {
field.text(common.formatDuration(value));
field.text(nfCommon.formatDuration(value));
}
} else {
field.html('<span class="unset">No value set</span>');
@ -1330,7 +1330,7 @@
var formatEventDetail = function (label, value) {
$('<div class="event-detail"></div>').append(
$('<div class="detail-name"></div>').text(label)).append(
$('<div class="detail-value">' + common.formatValue(value) + '</div>').ellipsis()).append(
$('<div class="detail-value">' + nfCommon.formatValue(value) + '</div>').ellipsis()).append(
$('<div class="clear"></div>')).appendTo('#additional-provenance-details');
};
@ -1361,7 +1361,7 @@
}
// conditionally show the cluster node identifier
if (common.isDefinedAndNotNull(event.clusterNodeId)) {
if (nfCommon.isDefinedAndNotNull(event.clusterNodeId)) {
// save the cluster node id
$('#provenance-event-cluster-node-id').text(event.clusterNodeId);
@ -1374,7 +1374,7 @@
var childUuids = $('#child-flowfiles-container');
// handle parent flowfiles
if (common.isEmpty(event.parentUuids)) {
if (nfCommon.isEmpty(event.parentUuids)) {
$('#parent-flowfile-count').text(0);
parentUuids.append('<span class="unset">No parents</span>');
} else {
@ -1385,7 +1385,7 @@
}
// handle child flowfiles
if (common.isEmpty(event.childUuids)) {
if (nfCommon.isEmpty(event.childUuids)) {
$('#child-flowfile-count').text(0);
childUuids.append('<span class="unset">No children</span>');
} else {
@ -1402,23 +1402,23 @@
$.each(event.attributes, function (_, attribute) {
// create the attribute record
var attributeRecord = $('<div class="attribute-detail"></div>')
.append($('<div class="attribute-name">' + common.formatValue(attribute.name) + '</div>').ellipsis())
.append($('<div class="attribute-name">' + nfCommon.formatValue(attribute.name) + '</div>').ellipsis())
.appendTo(attributesContainer);
// add the current value
attributeRecord
.append($('<div class="attribute-value">' + common.formatValue(attribute.value) + '</div>').ellipsis())
.append($('<div class="attribute-value">' + nfCommon.formatValue(attribute.value) + '</div>').ellipsis())
.append('<div class="clear"></div>');
// show the previous value if the property has changed
if (attribute.value !== attribute.previousValue) {
if (common.isDefinedAndNotNull(attribute.previousValue)) {
if (nfCommon.isDefinedAndNotNull(attribute.previousValue)) {
attributeRecord
.append($('<div class="modified-attribute-value">' + common.formatValue(attribute.previousValue) + '<span class="unset"> (previous)</span></div>').ellipsis())
.append($('<div class="modified-attribute-value">' + nfCommon.formatValue(attribute.previousValue) + '<span class="unset"> (previous)</span></div>').ellipsis())
.append('<div class="clear"></div>');
} else {
attributeRecord
.append($('<div class="unset" style="font-size: 13px; padding-top: 2px;">' + common.formatValue(attribute.previousValue) + '</div>').ellipsis())
.append($('<div class="unset" style="font-size: 13px; padding-top: 2px;">' + nfCommon.formatValue(attribute.previousValue) + '</div>').ellipsis())
.append('<div class="clear"></div>');
}
} else {
@ -1428,7 +1428,7 @@
});
var formatContentValue = function (element, value) {
if (common.isDefinedAndNotNull(value)) {
if (nfCommon.isDefinedAndNotNull(value)) {
element.removeClass('unset').text(value);
} else {
element.addClass('unset').text('No value previously set');
@ -1446,9 +1446,9 @@
// input content file size
var inputContentSize = $('#input-content-size');
formatContentValue(inputContentSize, event.inputContentClaimFileSize);
if (common.isDefinedAndNotNull(event.inputContentClaimFileSize)) {
if (nfCommon.isDefinedAndNotNull(event.inputContentClaimFileSize)) {
// over the default tooltip with the actual byte count
inputContentSize.attr('title', common.formatInteger(event.inputContentClaimFileSizeBytes) + ' bytes');
inputContentSize.attr('title', nfCommon.formatInteger(event.inputContentClaimFileSizeBytes) + ' bytes');
}
formatContentValue($('#output-content-container'), event.outputContentClaimContainer);
@ -1460,15 +1460,15 @@
// output content file size
var outputContentSize = $('#output-content-size');
formatContentValue(outputContentSize, event.outputContentClaimFileSize);
if (common.isDefinedAndNotNull(event.outputContentClaimFileSize)) {
if (nfCommon.isDefinedAndNotNull(event.outputContentClaimFileSize)) {
// over the default tooltip with the actual byte count
outputContentSize.attr('title', common.formatInteger(event.outputContentClaimFileSizeBytes) + ' bytes');
outputContentSize.attr('title', nfCommon.formatInteger(event.outputContentClaimFileSizeBytes) + ' bytes');
}
if (event.inputContentAvailable === true) {
$('#input-content-download').show();
if (common.isContentViewConfigured()) {
if (nfCommon.isContentViewConfigured()) {
$('#input-content-view').show();
} else {
$('#input-content-view').hide();
@ -1481,7 +1481,7 @@
if (event.outputContentAvailable === true) {
$('#output-content-download').show();
if (common.isContentViewConfigured()) {
if (nfCommon.isContentViewConfigured()) {
$('#output-content-view').show();
} else {
$('#output-content-view').hide();

View File

@ -31,25 +31,25 @@
'nf.Storage'],
function ($,
angular,
common,
nfCommon,
appConfig,
appCtrl,
provenanceLineage,
provenanceTable,
angularBridge,
errorHandler,
storage) {
nfNgBridge,
nfErrorHandler,
nfStorage) {
return (nf.ng.Provenance =
factory($,
angular,
common,
nfCommon,
appConfig,
appCtrl,
provenanceLineage,
provenanceTable,
angularBridge,
errorHandler,
storage));
nfNgBridge,
nfErrorHandler,
nfStorage));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ng.Provenance =
@ -75,7 +75,7 @@
root.nf.ErrorHandler,
root.nf.Storage);
}
}(this, function ($, angular, common, appConfig, appCtrl, provenanceLineage, provenanceTable, angularBridge, errorHandler, storage) {
}(this, function ($, angular, nfCommon, appConfig, appCtrl, provenanceLineage, provenanceTable, nfNgBridge, nfErrorHandler, nfStorage) {
'use strict';
$(document).ready(function () {
@ -101,10 +101,10 @@
app.service('provenanceTableCtrl', provenanceTable);
//Manually Boostrap Angular App
angularBridge.injector = angular.bootstrap($('body'), ['ngProvenanceApp'], {strictDi: true});
nfNgBridge.injector = angular.bootstrap($('body'), ['ngProvenanceApp'], {strictDi: true});
// initialize the status page
angularBridge.injector.get('provenanceCtrl').init();
nfNgBridge.injector.get('provenanceCtrl').init();
});
var nfProvenance = function (provenanceTableCtrl) {
@ -135,7 +135,7 @@
url: config.urls.clusterSummary
}).done(function (response) {
isClustered = response.clusterSummary.connectedToCluster;
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -158,14 +158,14 @@
$('.timezone').text(aboutDetails.timezone);
// store the content viewer url if available
if (!common.isBlank(aboutDetails.contentViewerUrl)) {
if (!nfCommon.isBlank(aboutDetails.contentViewerUrl)) {
$('#nifi-content-viewer-url').text(aboutDetails.contentViewerUrl);
}
// set the document title and the about title
document.title = provenanceTitle;
$('#provenance-header-text').text(provenanceTitle);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -177,8 +177,8 @@
url: config.urls.currentUser,
dataType: 'json'
}).done(function (currentUser) {
common.setCurrentUser(currentUser);
}).fail(errorHandler.handleAjaxError);
nfCommon.setCurrentUser(currentUser);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -200,8 +200,8 @@
dataType: 'json'
}).done(function (response) {
// ensure the banners response is specified
if (common.isDefinedAndNotNull(response.banners)) {
if (common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
if (nfCommon.isDefinedAndNotNull(response.banners)) {
if (nfCommon.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
// update the header text
var bannerHeader = $('#banner-header').text(response.banners.headerText).show();
@ -215,7 +215,7 @@
updateTop('provenance');
}
if (common.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
if (nfCommon.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
// update the footer text and show it
var bannerFooter = $('#banner-footer').text(response.banners.footerText).show();
@ -231,7 +231,7 @@
deferred.resolve();
}).fail(function (xhr, status, error) {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
deferred.reject();
});
} else {
@ -250,7 +250,7 @@
* Initializes the status page.
*/
init: function () {
storage.init();
nfStorage.init();
// load the user and detect if the NiFi is clustered
$.when(loadAbout(), loadCurrentUser(), detectedCluster()).done(function () {
@ -346,7 +346,7 @@
}
}
$.each(tabsContents, function (index, tabsContent) {
common.toggleScrollable(tabsContent.get(0));
nfCommon.toggleScrollable(tabsContent.get(0));
});
});
});

View File

@ -23,8 +23,8 @@
'nf.Common',
'nf.Dialog',
'nf.SummaryTable'],
function ($, common, dialog, summaryTable) {
return (nf.ClusterSearch = factory($, common, dialog, summaryTable));
function ($, nfCommon, nfDialog, nfSummaryTable) {
return (nf.ClusterSearch = factory($, nfCommon, nfDialog, nfSummaryTable));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.ClusterSearch =
@ -38,7 +38,7 @@
root.nf.Dialog,
root.nf.SummaryTable);
}
}(this, function ($, common, dialog, summaryTable) {
}(this, function ($, nfCommon, nfDialog, nfSummaryTable) {
'use strict';
/**
@ -85,10 +85,10 @@
// selects the specified node
var selectNode = function (node) {
// update the urls to point to this specific node of the cluster
summaryTable.setClusterNodeId(node.id);
nfSummaryTable.setClusterNodeId(node.id);
// load the summary for the selected node
summaryTable.loadSummaryTable();
nfSummaryTable.loadSummaryTable();
// update the header
$('#summary-header-text').text(node.address + ' Summary');
@ -96,9 +96,9 @@
// ensure the search found some results
if (!$.isArray(searchResults) || searchResults.length === 0) {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Cluster Search',
dialogContent: 'No nodes match \'' + common.escapeHtml(clusterSearchTerm) + '\'.'
dialogContent: 'No nodes match \'' + nfCommon.escapeHtml(clusterSearchTerm) + '\'.'
});
} else if (searchResults.length > 1) {
var exactMatch = false;
@ -117,9 +117,9 @@
// close the dialog
$('#view-single-node-dialog').modal('hide');
} else {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Cluster Search',
dialogContent: 'More than one node matches \'' + common.escapeHtml(clusterSearchTerm) + '\'.'
dialogContent: 'More than one node matches \'' + nfCommon.escapeHtml(clusterSearchTerm) + '\'.'
});
}
} else if (searchResults.length === 1) {
@ -234,8 +234,8 @@
// handle the view cluster click event
$('#view-cluster-link').click(function () {
// reset the urls and refresh the table
summaryTable.setClusterNodeId(null);
summaryTable.loadSummaryTable();
nfSummaryTable.setClusterNodeId(null);
nfSummaryTable.loadSummaryTable();
// update the header
$('#summary-header-text').text('NiFi Summary');

View File

@ -26,8 +26,8 @@
'nf.ProcessorDetails',
'nf.ConnectionDetails',
'nf.ng.Bridge'],
function ($, Slick, common, errorHandler, statusHistory, processorDetails, connectionDetails, angularBridge) {
return (nf.SummaryTable = factory($, Slick, common, errorHandler, statusHistory, processorDetails, connectionDetails, angularBridge));
function ($, Slick, nfCommon, nfErrorHandler, nfStatusHistory, nfProcessorDetails, nfConnectionDetails, nfNgBridge) {
return (nf.SummaryTable = factory($, Slick, nfCommon, nfErrorHandler, nfStatusHistory, nfProcessorDetails, nfConnectionDetails, nfNgBridge));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.SummaryTable =
@ -49,7 +49,7 @@
root.nf.ConnectionDetails,
root.nf.ng.Bridge);
}
}(this, function ($, Slick, common, errorHandler, statusHistory, processorDetails, connectionDetails, angularBridge) {
}(this, function ($, Slick, nfCommon, nfErrorHandler, nfStatusHistory, nfProcessorDetails, nfConnectionDetails, nfNgBridge) {
'use strict';
/**
@ -74,7 +74,7 @@
// only attempt this if we're within a frame
if (top !== window) {
// and our parent has canvas utils and shell defined
if (common.isDefinedAndNotNull(parent.nf) && common.isDefinedAndNotNull(parent.nf.CanvasUtils) && common.isDefinedAndNotNull(parent.nf.Shell)) {
if (nfCommon.isDefinedAndNotNull(parent.nf) && nfCommon.isDefinedAndNotNull(parent.nf.CanvasUtils) && nfCommon.isDefinedAndNotNull(parent.nf.Shell)) {
parent.nf.CanvasUtils.showComponent(groupId, componentId);
parent.$('#shell-close-button').click();
}
@ -121,12 +121,12 @@
if (tab === 'Processors') {
// ensure the processor table is sized properly
var processorsGrid = $('#processor-summary-table').data('gridInstance');
if (common.isDefinedAndNotNull(processorsGrid)) {
if (nfCommon.isDefinedAndNotNull(processorsGrid)) {
processorsGrid.resizeCanvas();
// update the total number of processors
$('#displayed-items').text(common.formatInteger(processorsGrid.getData().getLength()));
$('#total-items').text(common.formatInteger(processorsGrid.getData().getLength()));
$('#displayed-items').text(nfCommon.formatInteger(processorsGrid.getData().getLength()));
$('#total-items').text(nfCommon.formatInteger(processorsGrid.getData().getLength()));
}
// update the combo for processors
@ -145,12 +145,12 @@
} else if (tab === 'Connections') {
// ensure the connection table is size properly
var connectionsGrid = $('#connection-summary-table').data('gridInstance');
if (common.isDefinedAndNotNull(connectionsGrid)) {
if (nfCommon.isDefinedAndNotNull(connectionsGrid)) {
connectionsGrid.resizeCanvas();
// update the total number of connections
$('#displayed-items').text(common.formatInteger(connectionsGrid.getData().getLength()));
$('#total-items').text(common.formatInteger(connectionsGrid.getData().getLength()));
$('#displayed-items').text(nfCommon.formatInteger(connectionsGrid.getData().getLength()));
$('#total-items').text(nfCommon.formatInteger(connectionsGrid.getData().getLength()));
}
// update the combo for connections
@ -172,12 +172,12 @@
} else if (tab === 'Input Ports') {
// ensure the connection table is size properly
var inputPortsGrid = $('#input-port-summary-table').data('gridInstance');
if (common.isDefinedAndNotNull(inputPortsGrid)) {
if (nfCommon.isDefinedAndNotNull(inputPortsGrid)) {
inputPortsGrid.resizeCanvas();
// update the total number of input ports
$('#displayed-items').text(common.formatInteger(inputPortsGrid.getData().getLength()));
$('#total-items').text(common.formatInteger(inputPortsGrid.getData().getLength()));
$('#displayed-items').text(nfCommon.formatInteger(inputPortsGrid.getData().getLength()));
$('#total-items').text(nfCommon.formatInteger(inputPortsGrid.getData().getLength()));
}
// update the combo for input ports
@ -193,12 +193,12 @@
} else if (tab === 'Output Ports') {
// ensure the connection table is size properly
var outputPortsGrid = $('#output-port-summary-table').data('gridInstance');
if (common.isDefinedAndNotNull(outputPortsGrid)) {
if (nfCommon.isDefinedAndNotNull(outputPortsGrid)) {
outputPortsGrid.resizeCanvas();
// update the total number of output ports
$('#displayed-items').text(common.formatInteger(outputPortsGrid.getData().getLength()));
$('#total-items').text(common.formatInteger(outputPortsGrid.getData().getLength()));
$('#displayed-items').text(nfCommon.formatInteger(outputPortsGrid.getData().getLength()));
$('#total-items').text(nfCommon.formatInteger(outputPortsGrid.getData().getLength()));
}
// update the combo for output ports
@ -214,12 +214,12 @@
} else if (tab === 'Remote Process Groups') {
// ensure the connection table is size properly
var remoteProcessGroupsGrid = $('#remote-process-group-summary-table').data('gridInstance');
if (common.isDefinedAndNotNull(remoteProcessGroupsGrid)) {
if (nfCommon.isDefinedAndNotNull(remoteProcessGroupsGrid)) {
remoteProcessGroupsGrid.resizeCanvas();
// update the total number of remote process groups
$('#displayed-items').text(common.formatInteger(remoteProcessGroupsGrid.getData().getLength()));
$('#total-items').text(common.formatInteger(remoteProcessGroupsGrid.getData().getLength()));
$('#displayed-items').text(nfCommon.formatInteger(remoteProcessGroupsGrid.getData().getLength()));
$('#total-items').text(nfCommon.formatInteger(remoteProcessGroupsGrid.getData().getLength()));
}
// update the combo for remote process groups
@ -238,12 +238,12 @@
} else {
// ensure the connection table is size properly
var processGroupGrid = $('#process-group-summary-table').data('gridInstance');
if (common.isDefinedAndNotNull(processGroupGrid)) {
if (nfCommon.isDefinedAndNotNull(processGroupGrid)) {
processGroupGrid.resizeCanvas();
// update the total number of process groups
$('#displayed-items').text(common.formatInteger(processGroupGrid.getData().getLength()));
$('#total-items').text(common.formatInteger(processGroupGrid.getData().getLength()));
$('#displayed-items').text(nfCommon.formatInteger(processGroupGrid.getData().getLength()));
$('#total-items').text(nfCommon.formatInteger(processGroupGrid.getData().getLength()));
}
// update the combo for process groups
@ -269,8 +269,8 @@
var markup = '<div title="View Processor Details" class="pointer show-processor-details fa fa-info-circle" style="margin-right: 3px;"></div>';
// if there are bulletins, render them on the graph
if (!common.isEmpty(dataContext.bulletins)) {
markup += '<div class="has-bulletins fa fa-sticky-note-o"></div><span class="hidden row-id">' + common.escapeHtml(dataContext.id) + '</span>';
if (!nfCommon.isEmpty(dataContext.bulletins)) {
markup += '<div class="has-bulletins fa fa-sticky-note-o"></div><span class="hidden row-id">' + nfCommon.escapeHtml(dataContext.id) + '</span>';
}
return markup;
@ -283,22 +283,22 @@
// formatter for tasks
var taskTimeFormatter = function (row, cell, value, columnDef, dataContext) {
return common.formatInteger(dataContext.tasks) + ' / ' + dataContext.tasksDuration;
return nfCommon.formatInteger(dataContext.tasks) + ' / ' + dataContext.tasksDuration;
};
// function for formatting the last accessed time
var valueFormatter = function (row, cell, value, columnDef, dataContext) {
return common.formatValue(value);
return nfCommon.formatValue(value);
};
// define a custom formatter for the run status column
var runStatusFormatter = function (row, cell, value, columnDef, dataContext) {
var activeThreadCount = '';
if (common.isDefinedAndNotNull(dataContext.activeThreadCount) && dataContext.activeThreadCount > 0) {
if (nfCommon.isDefinedAndNotNull(dataContext.activeThreadCount) && dataContext.activeThreadCount > 0) {
activeThreadCount = '(' + dataContext.activeThreadCount + ')';
}
var classes = common.escapeHtml(value.toLowerCase());
switch (common.escapeHtml(value.toLowerCase())) {
var classes = nfCommon.escapeHtml(value.toLowerCase());
switch (nfCommon.escapeHtml(value.toLowerCase())) {
case 'running':
classes += ' fa fa-play running';
break;
@ -318,7 +318,7 @@
classes += '';
}
var formattedValue = '<div layout="row"><div class="' + classes + '"></div>';
return formattedValue + '<div class="status-text" style="margin-top: 4px;">' + common.escapeHtml(value) + '</div><div style="float: left; margin-left: 4px;">' + common.escapeHtml(activeThreadCount) + '</div></div>';
return formattedValue + '<div class="status-text" style="margin-top: 4px;">' + nfCommon.escapeHtml(value) + '</div><div style="float: left; margin-left: 4px;">' + nfCommon.escapeHtml(activeThreadCount) + '</div></div>';
};
// define the input, read, written, and output columns (reused between both tables)
@ -395,7 +395,7 @@
var isInShell = (top !== window);
// add an action column if appropriate
if (isClustered || isInShell || common.SUPPORTS_SVG) {
if (isClustered || isInShell || nfCommon.SUPPORTS_SVG) {
// define how the column is formatted
var processorActionFormatter = function (row, cell, value, columnDef, dataContext) {
var markup = '';
@ -404,7 +404,7 @@
markup += '<div class="pointer go-to fa fa-long-arrow-right" title="Go To Processor" style="margin-right: 3px;"></div>';
}
if (common.SUPPORTS_SVG) {
if (nfCommon.SUPPORTS_SVG) {
markup += '<div class="pointer show-processor-status-history fa fa-area-chart" title="View Status History" style="margin-right: 3px;"></div>';
}
@ -479,7 +479,7 @@
if (target.hasClass('go-to')) {
goTo(item.groupId, item.id);
} else if (target.hasClass('show-processor-status-history')) {
statusHistory.showProcessorChart(item.groupId, item.id);
nfStatusHistory.showProcessorChart(item.groupId, item.id);
} else if (target.hasClass('show-cluster-processor-summary')) {
// load the cluster processor summary
loadClusterProcessorSummary(item.groupId, item.id);
@ -495,7 +495,7 @@
}
} else if (processorsGrid.getColumns()[args.cell].id === 'moreDetails') {
if (target.hasClass('show-processor-details')) {
processorDetails.showDetails(item.groupId, item.id);
nfProcessorDetails.showDetails(item.groupId, item.id);
}
}
});
@ -507,7 +507,7 @@
// update the total number of displayed processors if necessary
if ($('#processor-summary-table').is(':visible')) {
$('#displayed-items').text(common.formatInteger(args.current));
$('#displayed-items').text(nfCommon.formatInteger(args.current));
}
});
processorsData.onRowsChanged.subscribe(function (e, args) {
@ -525,12 +525,12 @@
var item = processorsData.getItemById(processorId);
// format the tooltip
var bulletins = common.getFormattedBulletins(item.bulletins);
var tooltip = common.formatUnorderedList(bulletins);
var bulletins = nfCommon.getFormattedBulletins(item.bulletins);
var tooltip = nfCommon.formatUnorderedList(bulletins);
// show the tooltip
if (common.isDefinedAndNotNull(tooltip)) {
bulletinIcon.qtip($.extend({}, common.config.tooltipConfig, {
if (nfCommon.isDefinedAndNotNull(tooltip)) {
bulletinIcon.qtip($.extend({}, nfCommon.config.tooltipConfig, {
content: tooltip,
position: {
container: $('#summary'),
@ -646,11 +646,11 @@
var backpressureFormatter = function (row, cell, value, columnDef, dataContext) {
var percentUseCount = 'NA';
if (common.isDefinedAndNotNull(dataContext.percentUseCount)) {
if (nfCommon.isDefinedAndNotNull(dataContext.percentUseCount)) {
percentUseCount = dataContext.percentUseCount + '%';
}
var percentUseBytes = 'NA';
if (common.isDefinedAndNotNull(dataContext.percentUseBytes)) {
if (nfCommon.isDefinedAndNotNull(dataContext.percentUseBytes)) {
percentUseBytes = dataContext.percentUseBytes + '%';
}
return percentUseCount + ' / ' + percentUseBytes;
@ -704,7 +704,7 @@
];
// add an action column if appropriate
if (isClustered || isInShell || common.SUPPORTS_SVG) {
if (isClustered || isInShell || nfCommon.SUPPORTS_SVG) {
// define how the column is formatted
var connectionActionFormatter = function (row, cell, value, columnDef, dataContext) {
var markup = '';
@ -713,7 +713,7 @@
markup += '<div class="pointer go-to fa fa-long-arrow-right" title="Go To Connection" style="margin-right: 3px;"></div>';
}
if (common.SUPPORTS_SVG) {
if (nfCommon.SUPPORTS_SVG) {
markup += '<div class="pointer show-connection-status-history fa fa-area-chart" title="View Status History" style="margin-right: 3px;"></div>';
}
@ -788,7 +788,7 @@
if (target.hasClass('go-to')) {
goTo(item.groupId, item.id);
} else if (target.hasClass('show-connection-status-history')) {
statusHistory.showConnectionChart(item.groupId, item.id);
nfStatusHistory.showConnectionChart(item.groupId, item.id);
} else if (target.hasClass('show-cluster-connection-summary')) {
// load the cluster processor summary
loadClusterConnectionSummary(item.groupId, item.id);
@ -804,7 +804,7 @@
}
} else if (connectionsGrid.getColumns()[args.cell].id === 'moreDetails') {
if (target.hasClass('show-connection-details')) {
connectionDetails.showDetails(item.groupId, item.id);
nfConnectionDetails.showDetails(item.groupId, item.id);
}
}
});
@ -816,7 +816,7 @@
// update the total number of displayed processors, if necessary
if ($('#connection-summary-table').is(':visible')) {
$('#displayed-items').text(common.formatInteger(args.current));
$('#displayed-items').text(nfCommon.formatInteger(args.current));
}
});
connectionsData.onRowsChanged.subscribe(function (e, args) {
@ -924,8 +924,8 @@
var markup = '';
// if there are bulletins, render them on the graph
if (!common.isEmpty(dataContext.bulletins)) {
markup += '<div class="has-bulletins fa fa-sticky-note-o" style="margin-top: 5px; margin-left: 5px; float: left;"></div><span class="hidden row-id">' + common.escapeHtml(dataContext.id) + '</span>';
if (!nfCommon.isEmpty(dataContext.bulletins)) {
markup += '<div class="has-bulletins fa fa-sticky-note-o" style="margin-top: 5px; margin-left: 5px; float: left;"></div><span class="hidden row-id">' + nfCommon.escapeHtml(dataContext.id) + '</span>';
}
return markup;
@ -983,7 +983,7 @@
];
// add an action column if appropriate
if (isClustered || isInShell || common.SUPPORTS_SVG) {
if (isClustered || isInShell || nfCommon.SUPPORTS_SVG) {
// define how the column is formatted
var processGroupActionFormatter = function (row, cell, value, columnDef, dataContext) {
var markup = '';
@ -992,7 +992,7 @@
markup += '<div class="pointer go-to fa fa-long-arrow-right" title="Go To Process Group" style="margin-right: 3px;"></div>';
}
if (common.SUPPORTS_SVG) {
if (nfCommon.SUPPORTS_SVG) {
markup += '<div class="pointer show-process-group-status-history fa fa-area-chart" title="View Status History" style="margin-right: 3px;"></div>';
}
@ -1065,12 +1065,12 @@
// determine the desired action
if (processGroupsGrid.getColumns()[args.cell].id === 'actions') {
if (target.hasClass('go-to')) {
if (common.isDefinedAndNotNull(parent.nf) && common.isDefinedAndNotNull(parent.nf.ProcessGroup) && common.isDefinedAndNotNull(parent.nf.Shell)) {
if (nfCommon.isDefinedAndNotNull(parent.nf) && nfCommon.isDefinedAndNotNull(parent.nf.ProcessGroup) && nfCommon.isDefinedAndNotNull(parent.nf.Shell)) {
parent.nf.ProcessGroup.enterGroup(item.id);
parent.$('#shell-close-button').click();
}
} else if (target.hasClass('show-process-group-status-history')) {
statusHistory.showProcessGroupChart(item.groupId, item.id);
nfStatusHistory.showProcessGroupChart(item.groupId, item.id);
} else if (target.hasClass('show-cluster-process-group-summary')) {
// load the cluster processor summary
loadClusterProcessGroupSummary(item.id);
@ -1094,7 +1094,7 @@
// update the total number of displayed process groups if necessary
if ($('#process-group-summary-table').is(':visible')) {
$('#displayed-items').text(common.formatInteger(args.current));
$('#displayed-items').text(nfCommon.formatInteger(args.current));
}
});
processGroupsData.onRowsChanged.subscribe(function (e, args) {
@ -1112,12 +1112,12 @@
var item = processGroupsData.getItemById(processGroupId);
// format the tooltip
var bulletins = common.getFormattedBulletins(item.bulletins);
var tooltip = common.formatUnorderedList(bulletins);
var bulletins = nfCommon.getFormattedBulletins(item.bulletins);
var tooltip = nfCommon.formatUnorderedList(bulletins);
// show the tooltip
if (common.isDefinedAndNotNull(tooltip)) {
bulletinIcon.qtip($.extend({}, common.config.tooltipConfig, {
if (nfCommon.isDefinedAndNotNull(tooltip)) {
bulletinIcon.qtip($.extend({}, nfCommon.config.tooltipConfig, {
content: tooltip,
position: {
container: $('#summary'),
@ -1338,7 +1338,7 @@
// update the total number of displayed processors, if necessary
if ($('#input-port-summary-table').is(':visible')) {
$('#display-items').text(common.formatInteger(args.current));
$('#display-items').text(nfCommon.formatInteger(args.current));
}
});
inputPortsData.onRowsChanged.subscribe(function (e, args) {
@ -1356,12 +1356,12 @@
var item = inputPortsData.getItemById(portId);
// format the tooltip
var bulletins = common.getFormattedBulletins(item.bulletins);
var tooltip = common.formatUnorderedList(bulletins);
var bulletins = nfCommon.getFormattedBulletins(item.bulletins);
var tooltip = nfCommon.formatUnorderedList(bulletins);
// show the tooltip
if (common.isDefinedAndNotNull(tooltip)) {
bulletinIcon.qtip($.extend({}, common.config.tooltipConfig, {
if (nfCommon.isDefinedAndNotNull(tooltip)) {
bulletinIcon.qtip($.extend({}, nfCommon.config.tooltipConfig, {
content: tooltip,
position: {
container: $('#summary'),
@ -1578,7 +1578,7 @@
// update the total number of displayed processors, if necessary
if ($('#output-port-summary-table').is(':visible')) {
$('#display-items').text(common.formatInteger(args.current));
$('#display-items').text(nfCommon.formatInteger(args.current));
}
});
outputPortsData.onRowsChanged.subscribe(function (e, args) {
@ -1596,12 +1596,12 @@
var item = outputPortsData.getItemById(portId);
// format the tooltip
var bulletins = common.getFormattedBulletins(item.bulletins);
var tooltip = common.formatUnorderedList(bulletins);
var bulletins = nfCommon.getFormattedBulletins(item.bulletins);
var tooltip = nfCommon.formatUnorderedList(bulletins);
// show the tooltip
if (common.isDefinedAndNotNull(tooltip)) {
bulletinIcon.qtip($.extend({}, common.config.tooltipConfig, {
if (nfCommon.isDefinedAndNotNull(tooltip)) {
bulletinIcon.qtip($.extend({}, nfCommon.config.tooltipConfig, {
content: tooltip,
position: {
container: $('#summary'),
@ -1710,7 +1710,7 @@
// define a custom formatter for the run status column
var transmissionStatusFormatter = function (row, cell, value, columnDef, dataContext) {
var activeThreadCount = '';
if (common.isDefinedAndNotNull(dataContext.activeThreadCount) && dataContext.activeThreadCount > 0) {
if (nfCommon.isDefinedAndNotNull(dataContext.activeThreadCount) && dataContext.activeThreadCount > 0) {
activeThreadCount = '(' + dataContext.activeThreadCount + ')';
}
@ -1727,7 +1727,7 @@
// generate the mark up
var formattedValue = '<div layout="row"><div class="' + transmissionClass + '"></div>';
return formattedValue + '<div class="status-text" style="margin-top: 4px;">' + transmissionLabel + '</div><div style="float: left; margin-left: 4px;">' + common.escapeHtml(activeThreadCount) + '</div></div>';
return formattedValue + '<div class="status-text" style="margin-top: 4px;">' + transmissionLabel + '</div><div style="float: left; margin-left: 4px;">' + nfCommon.escapeHtml(activeThreadCount) + '</div></div>';
};
var transmissionStatusColumn = {
@ -1767,7 +1767,7 @@
];
// add an action column if appropriate
if (isClustered || isInShell || common.SUPPORTS_SVG) {
if (isClustered || isInShell || nfCommon.SUPPORTS_SVG) {
// define how the column is formatted
var remoteProcessGroupActionFormatter = function (row, cell, value, columnDef, dataContext) {
var markup = '';
@ -1776,7 +1776,7 @@
markup += '<div class="pointer go-to fa fa-long-arrow-right" title="Go To Process Group" style="margin-right: 3px;"></div>';
}
if (common.SUPPORTS_SVG) {
if (nfCommon.SUPPORTS_SVG) {
markup += '<div class="pointer show-remote-process-group-status-history fa fa-area-chart" title="View Status History" style="margin-right: 3px;"></div>';
}
@ -1851,7 +1851,7 @@
if (target.hasClass('go-to')) {
goTo(item.groupId, item.id);
} else if (target.hasClass('show-remote-process-group-status-history')) {
statusHistory.showRemoteProcessGroupChart(item.groupId, item.id);
nfStatusHistory.showRemoteProcessGroupChart(item.groupId, item.id);
} else if (target.hasClass('show-cluster-remote-process-group-summary')) {
// load the cluster processor summary
loadClusterRemoteProcessGroupSummary(item.groupId, item.id);
@ -1875,7 +1875,7 @@
// update the total number of displayed processors, if necessary
if ($('#remote-process-group-summary-table').is(':visible')) {
$('#displayed-items').text(common.formatInteger(args.current));
$('#displayed-items').text(nfCommon.formatInteger(args.current));
}
});
remoteProcessGroupsData.onRowsChanged.subscribe(function (e, args) {
@ -1893,12 +1893,12 @@
var item = remoteProcessGroupsData.getItemById(remoteProcessGroupId);
// format the tooltip
var bulletins = common.getFormattedBulletins(item.bulletins);
var tooltip = common.formatUnorderedList(bulletins);
var bulletins = nfCommon.getFormattedBulletins(item.bulletins);
var tooltip = nfCommon.formatUnorderedList(bulletins);
// show the tooltip
if (common.isDefinedAndNotNull(tooltip)) {
bulletinIcon.qtip($.extend({}, common.config.tooltipConfig, {
if (nfCommon.isDefinedAndNotNull(tooltip)) {
bulletinIcon.qtip($.extend({}, nfCommon.config.tooltipConfig, {
content: tooltip,
position: {
container: $('#summary'),
@ -2056,7 +2056,7 @@
$('#summary-loading-container').show();
},
open: function () {
common.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
nfCommon.toggleScrollable($('#' + this.find('.tab-container').attr('id') + '-content').get(0));
}
}
});
@ -2081,7 +2081,7 @@
*/
var sort = function (tableId, sortDetails, data) {
// ensure there is a state object for this table
if (common.isUndefined(sortState[tableId])) {
if (nfCommon.isUndefined(sortState[tableId])) {
sortState[tableId] = {};
}
@ -2089,17 +2089,17 @@
var comparer = function (a, b) {
if (sortDetails.columnId === 'moreDetails') {
var aBulletins = 0;
if (!common.isEmpty(a.bulletins)) {
if (!nfCommon.isEmpty(a.bulletins)) {
aBulletins = a.bulletins.length;
}
var bBulletins = 0;
if (!common.isEmpty(b.bulletins)) {
if (!nfCommon.isEmpty(b.bulletins)) {
bBulletins = b.bulletins.length;
}
return aBulletins - bBulletins;
} else if (sortDetails.columnId === 'runStatus' || sortDetails.columnId === 'transmissionStatus') {
var aString = common.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = common.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
var aString = nfCommon.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = nfCommon.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
if (aString === bString) {
return a.activeThreadCount - b.activeThreadCount;
} else {
@ -2109,26 +2109,26 @@
var mod = sortState[tableId].count % 4;
if (mod < 2) {
$('#' + tableId + ' span.queued-title').addClass('sorted');
var aQueueCount = common.parseCount(a['queuedCount']);
var bQueueCount = common.parseCount(b['queuedCount']);
var aQueueCount = nfCommon.parseCount(a['queuedCount']);
var bQueueCount = nfCommon.parseCount(b['queuedCount']);
return aQueueCount - bQueueCount;
} else {
$('#' + tableId + ' span.queued-size-title').addClass('sorted');
var aQueueSize = common.parseSize(a['queuedSize']);
var bQueueSize = common.parseSize(b['queuedSize']);
var aQueueSize = nfCommon.parseSize(a['queuedSize']);
var bQueueSize = nfCommon.parseSize(b['queuedSize']);
return aQueueSize - bQueueSize;
}
} else if (sortDetails.columnId === 'backpressure') {
var mod = sortState[tableId].count % 4;
if (mod < 2) {
$('#' + tableId + ' span.backpressure-object-title').addClass('sorted');
var aPercentUseObject = common.isDefinedAndNotNull(a['percentUseCount']) ? a['percentUseCount'] : -1;
var bPercentUseObject = common.isDefinedAndNotNull(b['percentUseCount']) ? b['percentUseCount'] : -1;
var aPercentUseObject = nfCommon.isDefinedAndNotNull(a['percentUseCount']) ? a['percentUseCount'] : -1;
var bPercentUseObject = nfCommon.isDefinedAndNotNull(b['percentUseCount']) ? b['percentUseCount'] : -1;
return aPercentUseObject - bPercentUseObject;
} else {
$('#' + tableId + ' span.backpressure-data-size-title').addClass('sorted');
var aPercentUseDataSize = common.isDefinedAndNotNull(a['percentUseBytes']) ? a['percentUseBytes'] : -1;
var bPercentUseDataSize = common.isDefinedAndNotNull(b['percentUseBytes']) ? b['percentUseBytes'] : -1;
var aPercentUseDataSize = nfCommon.isDefinedAndNotNull(a['percentUseBytes']) ? a['percentUseBytes'] : -1;
var bPercentUseDataSize = nfCommon.isDefinedAndNotNull(b['percentUseBytes']) ? b['percentUseBytes'] : -1;
return aPercentUseDataSize - bPercentUseDataSize;
}
} else if (sortDetails.columnId === 'sent' || sortDetails.columnId === 'received' || sortDetails.columnId === 'input' || sortDetails.columnId === 'output' || sortDetails.columnId === 'transferred') {
@ -2137,44 +2137,44 @@
var mod = sortState[tableId].count % 4;
if (mod < 2) {
$('#' + tableId + ' span.' + sortDetails.columnId + '-title').addClass('sorted');
var aCount = common.parseCount(aSplit[0]);
var bCount = common.parseCount(bSplit[0]);
var aCount = nfCommon.parseCount(aSplit[0]);
var bCount = nfCommon.parseCount(bSplit[0]);
return aCount - bCount;
} else {
$('#' + tableId + ' span.' + sortDetails.columnId + '-size-title').addClass('sorted');
var aSize = common.parseSize(aSplit[1]);
var bSize = common.parseSize(bSplit[1]);
var aSize = nfCommon.parseSize(aSplit[1]);
var bSize = nfCommon.parseSize(bSplit[1]);
return aSize - bSize;
}
} else if (sortDetails.columnId === 'io') {
var mod = sortState[tableId].count % 4;
if (mod < 2) {
$('#' + tableId + ' span.read-title').addClass('sorted');
var aReadSize = common.parseSize(a['read']);
var bReadSize = common.parseSize(b['read']);
var aReadSize = nfCommon.parseSize(a['read']);
var bReadSize = nfCommon.parseSize(b['read']);
return aReadSize - bReadSize;
} else {
$('#' + tableId + ' span.written-title').addClass('sorted');
var aWriteSize = common.parseSize(a['written']);
var bWriteSize = common.parseSize(b['written']);
var aWriteSize = nfCommon.parseSize(a['written']);
var bWriteSize = nfCommon.parseSize(b['written']);
return aWriteSize - bWriteSize;
}
} else if (sortDetails.columnId === 'tasks') {
var mod = sortState[tableId].count % 4;
if (mod < 2) {
$('#' + tableId + ' span.tasks-title').addClass('sorted');
var aTasks = common.parseCount(a['tasks']);
var bTasks = common.parseCount(b['tasks']);
var aTasks = nfCommon.parseCount(a['tasks']);
var bTasks = nfCommon.parseCount(b['tasks']);
return aTasks - bTasks;
} else {
$('#' + tableId + ' span.time-title').addClass('sorted');
var aDuration = common.parseDuration(a['tasksDuration']);
var bDuration = common.parseDuration(b['tasksDuration']);
var aDuration = nfCommon.parseDuration(a['tasksDuration']);
var bDuration = nfCommon.parseDuration(b['tasksDuration']);
return aDuration - bDuration;
}
} else {
var aString = common.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = common.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
var aString = nfCommon.isDefinedAndNotNull(a[sortDetails.columnId]) ? a[sortDetails.columnId] : '';
var bString = nfCommon.isDefinedAndNotNull(b[sortDetails.columnId]) ? b[sortDetails.columnId] : '';
return aString === bString ? 0 : aString > bString ? 1 : -1;
}
};
@ -2244,7 +2244,7 @@
// add the parameter if appropriate
var parameters = {};
if (!common.isNull(clusterNodeId)) {
if (!nfCommon.isNull(clusterNodeId)) {
parameters['clusterNodeId'] = clusterNodeId;
}
@ -2268,7 +2268,7 @@
$('#free-heap').text(aggregateSnapshot.freeHeap);
// ensure the heap utilization could be calculated
if (common.isDefinedAndNotNull(aggregateSnapshot.heapUtilization)) {
if (nfCommon.isDefinedAndNotNull(aggregateSnapshot.heapUtilization)) {
$('#utilization-heap').text('(' + aggregateSnapshot.heapUtilization + ')');
} else {
$('#utilization-heap').text('');
@ -2281,7 +2281,7 @@
$('#free-non-heap').text(aggregateSnapshot.freeNonHeap);
// enure the non heap utilization could be calculated
if (common.isDefinedAndNotNull(aggregateSnapshot.nonHeapUtilization)) {
if (nfCommon.isDefinedAndNotNull(aggregateSnapshot.nonHeapUtilization)) {
$('#utilization-non-heap').text('(' + aggregateSnapshot.nonHeapUtilization + ')');
} else {
$('#utilization-non-heap').text('');
@ -2289,7 +2289,7 @@
// garbage collection
var garbageCollectionContainer = $('#garbage-collection-table tbody').empty();
if (common.isDefinedAndNotNull(aggregateSnapshot.garbageCollection)) {
if (nfCommon.isDefinedAndNotNull(aggregateSnapshot.garbageCollection)) {
// sort the garbage collections
var sortedGarbageCollection = aggregateSnapshot.garbageCollection.sort(function (a, b) {
return a.name === b.name ? 0 : a.name > b.name ? 1 : -1;
@ -2307,10 +2307,10 @@
$('#available-processors').text(aggregateSnapshot.availableProcessors);
// load
if (common.isDefinedAndNotNull(aggregateSnapshot.processorLoadAverage)) {
$('#processor-load-average').text(common.formatFloat(aggregateSnapshot.processorLoadAverage));
if (nfCommon.isDefinedAndNotNull(aggregateSnapshot.processorLoadAverage)) {
$('#processor-load-average').text(nfCommon.formatFloat(aggregateSnapshot.processorLoadAverage));
} else {
$('#processor-load-average').html(common.formatValue(aggregateSnapshot.processorLoadAverage));
$('#processor-load-average').html(nfCommon.formatValue(aggregateSnapshot.processorLoadAverage));
}
// flow file storage usage
@ -2319,7 +2319,7 @@
// content repo storage usage
var contentRepositoryUsageContainer = $('#content-repository-storage-usage-container').empty();
if (common.isDefinedAndNotNull(aggregateSnapshot.contentRepositoryStorageUsage)) {
if (nfCommon.isDefinedAndNotNull(aggregateSnapshot.contentRepositoryStorageUsage)) {
// sort the content repos
var sortedContentRepositoryStorageUsage = aggregateSnapshot.contentRepositoryStorageUsage.sort(function (a, b) {
return a.identifier === b.identifier ? 0 : a.identifier > b.identifier ? 1 : -1;
@ -2354,7 +2354,7 @@
// update the stats last refreshed timestamp
$('#system-diagnostics-last-refreshed').text(aggregateSnapshot.statsLastRefreshed);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -2383,12 +2383,12 @@
var storage = $('<div class="storage-identifier setting-name"></div>');
storage.text('Usage:');
if (common.isDefinedAndNotNull(storageUsage.identifier)) {
if (nfCommon.isDefinedAndNotNull(storageUsage.identifier)) {
storage.text('Usage for ' + storageUsage.identifier + ':');
}
storage.appendTo(storageUsageContainer);
(angularBridge.injector.get('$compile')($('<md-progress-linear class="md-hue-2" md-mode="determinate" value="' + (used / total) * 100 + '" aria-label="FlowFile Repository Storage Usage"></md-progress-linear>'))(angularBridge.rootScope)).appendTo(storageUsageContainer);
(nfNgBridge.injector.get('$compile')($('<md-progress-linear class="md-hue-2" md-mode="determinate" value="' + (used / total) * 100 + '" aria-label="FlowFile Repository Storage Usage"></md-progress-linear>'))(nfNgBridge.rootScope)).appendTo(storageUsageContainer);
var usageDetails = $('<div class="storage-usage-details"></div>').text(' (' + storageUsage.usedSpace + ' of ' + storageUsage.totalSpace + ')').prepend($('<b></b>').text(Math.round((used / total) * 100) + '%'));
$('<div class="storage-usage-header"></div>').append(usageDetails).append('<div class="clear"></div>').appendTo(storageUsageContainer);
@ -2469,7 +2469,7 @@
}
// ensure the grid has been initialized
if (common.isDefinedAndNotNull(grid)) {
if (nfCommon.isDefinedAndNotNull(grid)) {
var data = grid.getData();
// update the search criteria
@ -2497,7 +2497,7 @@
},
dataType: 'json'
}).done(function (response) {
if (common.isDefinedAndNotNull(response.processorStatus)) {
if (nfCommon.isDefinedAndNotNull(response.processorStatus)) {
var processorStatus = response.processorStatus;
var clusterProcessorsGrid = $('#cluster-processor-summary-table').data('gridInstance');
@ -2536,7 +2536,7 @@
// update the stats last refreshed timestamp
$('#cluster-processor-summary-last-refreshed').text(processorStatus.statsLastRefreshed);
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -2555,7 +2555,7 @@
},
dataType: 'json'
}).done(function (response) {
if (common.isDefinedAndNotNull(response.connectionStatus)) {
if (nfCommon.isDefinedAndNotNull(response.connectionStatus)) {
var connectionStatus = response.connectionStatus;
var clusterConnectionsGrid = $('#cluster-connection-summary-table').data('gridInstance');
@ -2593,7 +2593,7 @@
// update the stats last refreshed timestamp
$('#cluster-connection-summary-last-refreshed').text(connectionStatus.statsLastRefreshed);
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -2612,7 +2612,7 @@
},
dataType: 'json'
}).done(function (response) {
if (common.isDefinedAndNotNull(response.processGroupStatus)) {
if (nfCommon.isDefinedAndNotNull(response.processGroupStatus)) {
var processGroupStatus = response.processGroupStatus;
var clusterProcessGroupsGrid = $('#cluster-process-group-summary-table').data('gridInstance');
@ -2653,7 +2653,7 @@
// update the stats last refreshed timestamp
$('#cluster-process-group-summary-last-refreshed').text(processGroupStatus.statsLastRefreshed);
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -2672,7 +2672,7 @@
},
dataType: 'json'
}).done(function (response) {
if (common.isDefinedAndNotNull(response.portStatus)) {
if (nfCommon.isDefinedAndNotNull(response.portStatus)) {
var inputPortStatus = response.portStatus;
var clusterInputPortsGrid = $('#cluster-input-port-summary-table').data('gridInstance');
@ -2706,7 +2706,7 @@
// update the stats last refreshed timestamp
$('#cluster-input-port-summary-last-refreshed').text(inputPortStatus.statsLastRefreshed);
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -2725,7 +2725,7 @@
},
dataType: 'json'
}).done(function (response) {
if (common.isDefinedAndNotNull(response.portStatus)) {
if (nfCommon.isDefinedAndNotNull(response.portStatus)) {
var outputPortStatus = response.portStatus;
var clusterOutputPortsGrid = $('#cluster-output-port-summary-table').data('gridInstance');
@ -2759,7 +2759,7 @@
// update the stats last refreshed timestamp
$('#cluster-output-port-summary-last-refreshed').text(outputPortStatus.statsLastRefreshed);
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -2778,7 +2778,7 @@
},
dataType: 'json'
}).done(function (response) {
if (common.isDefinedAndNotNull(response.remoteProcessGroupStatus)) {
if (nfCommon.isDefinedAndNotNull(response.remoteProcessGroupStatus)) {
var remoteProcessGroupStatus = response.remoteProcessGroupStatus;
var clusterRemoteProcessGroupsGrid = $('#cluster-remote-process-group-summary-table').data('gridInstance');
@ -2814,7 +2814,7 @@
// update the stats last refreshed timestamp
$('#cluster-remote-process-group-summary-last-refreshed').text(remoteProcessGroupStatus.statsLastRefreshed);
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
var clusterNodeId = null;
@ -2837,11 +2837,11 @@
var configDetails = configResponse.flowConfiguration;
// initialize the chart
statusHistory.init(configDetails.timeOffset);
nfStatusHistory.init(configDetails.timeOffset);
// initialize the processor/connection details dialog
processorDetails.init(false);
connectionDetails.init();
nfProcessorDetails.init(false);
nfConnectionDetails.init();
initSummaryTable(isClustered);
deferred.resolve();
@ -2867,7 +2867,7 @@
var processorsTable = $('#processor-summary-table');
if (processorsTable.is(':visible')) {
var processorsGrid = processorsTable.data('gridInstance');
if (common.isDefinedAndNotNull(processorsGrid)) {
if (nfCommon.isDefinedAndNotNull(processorsGrid)) {
processorsGrid.resizeCanvas();
}
}
@ -2875,7 +2875,7 @@
var connectionsTable = $('#connection-summary-table');
if (connectionsTable.is(':visible')) {
var connectionsGrid = connectionsTable.data('gridInstance');
if (common.isDefinedAndNotNull(connectionsGrid)) {
if (nfCommon.isDefinedAndNotNull(connectionsGrid)) {
connectionsGrid.resizeCanvas();
}
}
@ -2883,7 +2883,7 @@
var processGroupsTable = $('#process-group-summary-table');
if (processGroupsTable.is(':visible')) {
var processGroupsGrid = processGroupsTable.data('gridInstance');
if (common.isDefinedAndNotNull(processGroupsGrid)) {
if (nfCommon.isDefinedAndNotNull(processGroupsGrid)) {
processGroupsGrid.resizeCanvas();
}
}
@ -2891,7 +2891,7 @@
var inputPortsTable = $('#input-port-summary-table');
if (inputPortsTable.is(':visible')) {
var inputPortGrid = inputPortsTable.data('gridInstance');
if (common.isDefinedAndNotNull(inputPortGrid)) {
if (nfCommon.isDefinedAndNotNull(inputPortGrid)) {
inputPortGrid.resizeCanvas();
}
}
@ -2899,7 +2899,7 @@
var outputPortsTable = $('#output-port-summary-table');
if (outputPortsTable.is(':visible')) {
var outputPortGrid = outputPortsTable.data('gridInstance');
if (common.isDefinedAndNotNull(outputPortGrid)) {
if (nfCommon.isDefinedAndNotNull(outputPortGrid)) {
outputPortGrid.resizeCanvas();
}
}
@ -2907,7 +2907,7 @@
var remoteProcessGroupsTable = $('#remote-process-group-summary-table');
if (remoteProcessGroupsTable.is(':visible')) {
var remoteProcessGroupGrid = remoteProcessGroupsTable.data('gridInstance');
if (common.isDefinedAndNotNull(remoteProcessGroupGrid)) {
if (nfCommon.isDefinedAndNotNull(remoteProcessGroupGrid)) {
remoteProcessGroupGrid.resizeCanvas();
}
}
@ -2921,7 +2921,7 @@
// add the parameter if appropriate
var parameters = {};
if (!common.isNull(clusterNodeId)) {
if (!nfCommon.isNull(clusterNodeId)) {
parameters['clusterNodeId'] = clusterNodeId;
}
@ -2941,10 +2941,10 @@
var processGroupStatus = response.processGroupStatus;
var aggregateSnapshot = processGroupStatus.aggregateSnapshot;
if (common.isDefinedAndNotNull(aggregateSnapshot)) {
if (nfCommon.isDefinedAndNotNull(aggregateSnapshot)) {
// remove any tooltips from the processor table
var processorsGridElement = $('#processor-summary-table');
common.cleanUpTooltips(processorsGridElement, 'div.has-bulletins');
nfCommon.cleanUpTooltips(processorsGridElement, 'div.has-bulletins');
// get the processor grid/data
var processorsGrid = processorsGridElement.data('gridInstance');
@ -2956,7 +2956,7 @@
// remove any tooltips from the process group table
var processGroupGridElement = $('#process-group-summary-table');
common.cleanUpTooltips(processGroupGridElement, 'div.has-bulletins');
nfCommon.cleanUpTooltips(processGroupGridElement, 'div.has-bulletins');
// get the process group grid/data
var processGroupGrid = processGroupGridElement.data('gridInstance');
@ -2964,7 +2964,7 @@
// remove any tooltips from the input port table
var inputPortsGridElement = $('#input-port-summary-table');
common.cleanUpTooltips(inputPortsGridElement, 'div.has-bulletins');
nfCommon.cleanUpTooltips(inputPortsGridElement, 'div.has-bulletins');
// get the input ports grid/data
var inputPortsGrid = inputPortsGridElement.data('gridInstance');
@ -2972,7 +2972,7 @@
// remove any tooltips from the output port table
var outputPortsGridElement = $('#output-port-summary-table');
common.cleanUpTooltips(outputPortsGridElement, 'div.has-bulletins');
nfCommon.cleanUpTooltips(outputPortsGridElement, 'div.has-bulletins');
// get the output ports grid/data
var outputPortsGrid = outputPortsGridElement.data('gridInstance');
@ -2980,7 +2980,7 @@
// remove any tooltips from the remote process group table
var remoteProcessGroupsGridElement = $('#remote-process-group-summary-table');
common.cleanUpTooltips(remoteProcessGroupsGridElement, 'div.has-bulletins');
nfCommon.cleanUpTooltips(remoteProcessGroupsGridElement, 'div.has-bulletins');
// get the remote process groups grid
var remoteProcessGroupsGrid = remoteProcessGroupsGridElement.data('gridInstance');
@ -3031,22 +3031,22 @@
// update the total number of processors
if ($('#processor-summary-table').is(':visible')) {
$('#total-items').text(common.formatInteger(processorItems.length));
$('#total-items').text(nfCommon.formatInteger(processorItems.length));
} else if ($('#connection-summary-table').is(':visible')) {
$('#total-items').text(common.formatInteger(connectionItems.length));
$('#total-items').text(nfCommon.formatInteger(connectionItems.length));
} else if ($('#input-port-summary-table').is(':visible')) {
$('#total-items').text(common.formatInteger(inputPortItems.length));
$('#total-items').text(nfCommon.formatInteger(inputPortItems.length));
} else if ($('#output-port-summary-table').is(':visible')) {
$('#total-items').text(common.formatInteger(outputPortItems.length));
$('#total-items').text(nfCommon.formatInteger(outputPortItems.length));
} else if ($('#process-group-summary-table').is(':visible')) {
$('#total-items').text(common.formatInteger(processGroupItems.length));
$('#total-items').text(nfCommon.formatInteger(processGroupItems.length));
} else {
$('#total-items').text(common.formatInteger(remoteProcessGroupItems.length));
$('#total-items').text(nfCommon.formatInteger(remoteProcessGroupItems.length));
}
} else {
$('#total-items').text('0');
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
};
}));

View File

@ -33,30 +33,30 @@
'nf.SummaryTable'],
function ($,
angular,
common,
clusterSummary,
clusterSearch,
nfCommon,
nfClusterSummary,
nfClusterSearch,
appConfig,
appCtrl,
serviceProvider,
provenanceTable,
angularBridge,
errorHandler,
storage,
summaryTable) {
nfNgBridge,
nfErrorHandler,
nfStorage,
nfSummaryTable) {
return (nf.Summary =
factory($,
angular,
common,
clusterSummary,
clusterSearch,
nfCommon,
nfClusterSummary,
nfClusterSearch,
appConfig,
appCtrl,
serviceProvider,
angularBridge,
errorHandler,
storage,
summaryTable));
nfNgBridge,
nfErrorHandler,
nfStorage,
nfSummaryTable));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Summary =
@ -86,7 +86,7 @@
root.nf.Storage,
root.nf.SummaryTable);
}
}(this, function ($, angular, common, clusterSummary, clusterSearch, appConfig, appCtrl, serviceProvider, angularBridge, errorHandler, storage, summaryTable) {
}(this, function ($, angular, nfCommon, nfClusterSummary, nfClusterSearch, appConfig, appCtrl, serviceProvider, nfNgBridge, nfErrorHandler, nfStorage, nfSummaryTable) {
'use strict';
$(document).ready(function () {
@ -108,10 +108,10 @@
app.service('serviceProvider', serviceProvider);
//Manually Boostrap Angular App
angularBridge.injector = angular.bootstrap($('body'), ['ngSummaryApp'], {strictDi: true});
nfNgBridge.injector = angular.bootstrap($('body'), ['ngSummaryApp'], {strictDi: true});
// initialize the summary page
clusterSummary.loadClusterSummary().done(function () {
nfClusterSummary.loadClusterSummary().done(function () {
nfSummary.init();
});
});
@ -136,16 +136,16 @@
type: 'GET',
url: config.urls.clusterSummary
}).done(function (response) {
summaryTable.init(response.clusterSummary.connectedToCluster).done(function () {
nfSummaryTable.init(response.clusterSummary.connectedToCluster).done(function () {
// initialize the search field if applicable
if (response.clusterSummary.connectedToCluster) {
clusterSearch.init();
nfClusterSearch.init();
}
deferred.resolve();
}).fail(function () {
deferred.reject();
});
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}).promise();
};
@ -155,8 +155,8 @@
var initializeSummaryPage = function () {
// define mouse over event for the refresh buttons
$('#refresh-button').click(function () {
clusterSummary.loadClusterSummary().done(function () {
summaryTable.loadSummaryTable();
nfClusterSummary.loadClusterSummary().done(function () {
nfSummaryTable.loadSummaryTable();
});
});
@ -170,8 +170,8 @@
dataType: 'json'
}).done(function (response) {
// ensure the banners response is specified
if (common.isDefinedAndNotNull(response.banners)) {
if (common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
if (nfCommon.isDefinedAndNotNull(response.banners)) {
if (nfCommon.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
// update the header text
var bannerHeader = $('#banner-header').text(response.banners.headerText).show();
@ -185,7 +185,7 @@
updateTop('summary');
}
if (common.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
if (nfCommon.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
// update the footer text and show it
var bannerFooter = $('#banner-footer').text(response.banners.footerText).show();
@ -201,7 +201,7 @@
deferred.resolve();
}).fail(function (xhr, status, error) {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
deferred.reject();
});
} else {
@ -215,12 +215,12 @@
* Initializes the status page.
*/
init: function () {
storage.init();
nfStorage.init();
// intialize the summary table
initializeSummaryTable().done(function () {
// load the table
summaryTable.loadSummaryTable().done(function () {
nfSummaryTable.loadSummaryTable().done(function () {
// once the table is initialized, finish initializing the page
initializeSummaryPage().done(function () {
@ -241,7 +241,7 @@
});
}
summaryTable.resetTableSize();
nfSummaryTable.resetTableSize();
};
// get the about details
@ -259,7 +259,7 @@
// set the initial size
setBodySize();
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
$(window).on('resize', function (e) {
setBodySize();
@ -292,7 +292,7 @@
}
}
$.each(tabsContents, function (index, tabsContent) {
common.toggleScrollable(tabsContent.get(0));
nfCommon.toggleScrollable(tabsContent.get(0));
});
});
});

View File

@ -24,8 +24,8 @@
'nf.Common',
'nf.Dialog',
'nf.ErrorHandler'],
function ($, Slick, common, dialog, errorHandler) {
return (nf.TemplatesTable = factory($, Slick, common, dialog, errorHandler));
function ($, Slick, nfCommon, nfDialog, nfErrorHandler) {
return (nf.TemplatesTable = factory($, Slick, nfCommon, nfDialog, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.TemplatesTable =
@ -41,7 +41,7 @@
root.nf.Dialog,
root.nf.ErrorHandler);
}
}(this, function ($, Slick, common, dialog, errorHandler) {
}(this, function ($, Slick, nfCommon, nfDialog, nfErrorHandler) {
'use strict';
/**
@ -65,12 +65,12 @@
var comparer = function (a, b) {
if (a.permissions.canRead && b.permissions.canRead) {
if (sortDetails.columnId === 'timestamp') {
var aDate = common.parseDateTime(a.template[sortDetails.columnId]);
var bDate = common.parseDateTime(b.template[sortDetails.columnId]);
var aDate = nfCommon.parseDateTime(a.template[sortDetails.columnId]);
var bDate = nfCommon.parseDateTime(b.template[sortDetails.columnId]);
return aDate.getTime() - bDate.getTime();
} else {
var aString = common.isDefinedAndNotNull(a.template[sortDetails.columnId]) ? a.template[sortDetails.columnId] : '';
var bString = common.isDefinedAndNotNull(b.template[sortDetails.columnId]) ? b.template[sortDetails.columnId] : '';
var aString = nfCommon.isDefinedAndNotNull(a.template[sortDetails.columnId]) ? a.template[sortDetails.columnId] : '';
var bString = nfCommon.isDefinedAndNotNull(b.template[sortDetails.columnId]) ? b.template[sortDetails.columnId] : '';
return aString === bString ? 0 : aString > bString ? 1 : -1;
}
} else {
@ -96,9 +96,9 @@
*/
var promptToDeleteTemplate = function (templateEntity) {
// prompt for deletion
dialog.showYesNoDialog({
nfDialog.showYesNoDialog({
headerText: 'Delete Template',
dialogContent: 'Delete template \'' + common.escapeHtml(templateEntity.template.name) + '\'?',
dialogContent: 'Delete template \'' + nfCommon.escapeHtml(templateEntity.template.name) + '\'?',
yesHandler: function () {
deleteTemplate(templateEntity);
}
@ -114,7 +114,7 @@
// only attempt this if we're within a frame
if (top !== window) {
// and our parent has canvas utils and shell defined
if (common.isDefinedAndNotNull(parent.nf) && common.isDefinedAndNotNull(parent.nf.PolicyManagement) && common.isDefinedAndNotNull(parent.nf.Shell)) {
if (nfCommon.isDefinedAndNotNull(parent.nf) && nfCommon.isDefinedAndNotNull(parent.nf.PolicyManagement) && nfCommon.isDefinedAndNotNull(parent.nf.Shell)) {
parent.nf.PolicyManagement.showTemplatePolicy(templateEntity);
parent.$('#shell-close-button').click();
}
@ -138,7 +138,7 @@
// update the total number of templates
$('#total-templates').text(templatesData.getItems().length);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -158,7 +158,7 @@
var templatesGrid = $('#templates-table').data('gridInstance');
// ensure the grid has been initialized
if (common.isDefinedAndNotNull(templatesGrid)) {
if (nfCommon.isDefinedAndNotNull(templatesGrid)) {
var templatesData = templatesGrid.getData();
// update the search criteria
@ -200,11 +200,11 @@
* @param {object} templateEntity The template
*/
var downloadTemplate = function (templateEntity) {
common.getAccessToken(config.urls.downloadToken).done(function (downloadToken) {
nfCommon.getAccessToken(config.urls.downloadToken).done(function (downloadToken) {
var parameters = {};
// conditionally include the download token
if (!common.isBlank(downloadToken)) {
if (!nfCommon.isBlank(downloadToken)) {
parameters['access_token'] = downloadToken;
}
@ -215,7 +215,7 @@
window.open(templateEntity.template.uri + '/download' + '?' + $.param(parameters));
}
}).fail(function () {
dialog.showOkDialog({
nfDialog.showOkDialog({
headerText: 'Download Template',
dialogContent: 'Unable to generate access token for downloading content.'
});
@ -267,7 +267,7 @@
return '';
}
return common.formatValue(dataContext.template.description);
return nfCommon.formatValue(dataContext.template.description);
};
var groupIdFormatter = function (row, cell, value, columnDef, dataContext) {
@ -292,8 +292,8 @@
}
// allow policy configuration conditionally if embedded in
if (top !== window && common.canAccessTenants()) {
if (common.isDefinedAndNotNull(parent.nf) && common.isDefinedAndNotNull(parent.nf.CanvasUtils) && parent.nf.CanvasUtils.isConfigurableAuthorizer()) {
if (top !== window && nfCommon.canAccessTenants()) {
if (nfCommon.isDefinedAndNotNull(parent.nf) && nfCommon.isDefinedAndNotNull(parent.nf.CanvasUtils) && parent.nf.CanvasUtils.isConfigurableAuthorizer()) {
markup += '<div title="Access Policies" class="pointer edit-access-policies fa fa-key" style="margin-top: 2px;"></div>';
}
}
@ -427,7 +427,7 @@
*/
resetTableSize: function () {
var templateGrid = $('#templates-table').data('gridInstance');
if (common.isDefinedAndNotNull(templateGrid)) {
if (nfCommon.isDefinedAndNotNull(templateGrid)) {
templateGrid.resizeCanvas();
}
},
@ -442,7 +442,7 @@
dataType: 'json'
}).done(function (response) {
// ensure there are groups specified
if (common.isDefinedAndNotNull(response.templates)) {
if (nfCommon.isDefinedAndNotNull(response.templates)) {
var templatesGrid = $('#templates-table').data('gridInstance');
var templatesData = templatesGrid.getData();
@ -459,7 +459,7 @@
} else {
$('#total-templates').text('0');
}
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
};
}));

View File

@ -24,8 +24,8 @@
'nf.TemplatesTable',
'nf.ErrorHandler',
'nf.Storage'],
function ($, common, templatesTable, errorHandler, storage) {
return (nf.Templates = factory($, common, templatesTable, errorHandler, storage));
function ($, nfCommon, nfTemplatesTable, nfErrorHandler, nfStorage) {
return (nf.Templates = factory($, nfCommon, nfTemplatesTable, nfErrorHandler, nfStorage));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Templates =
@ -41,7 +41,7 @@
root.nf.ErrorHandler,
root.nf.Storage);
}
}(this, function ($, common, templatesTable, errorHandler, storage) {
}(this, function ($, nfCommon, nfTemplatesTable, nfErrorHandler, nfStorage) {
'use strict';
$(document).ready(function () {
@ -69,8 +69,8 @@
url: config.urls.currentUser,
dataType: 'json'
}).done(function (currentUser) {
common.setCurrentUser(currentUser);
}).fail(errorHandler.handleAjaxError);
nfCommon.setCurrentUser(currentUser);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -79,7 +79,7 @@
var initializeTemplatesPage = function () {
// define mouse over event for the refresh button
$('#refresh-button').click(function () {
templatesTable.loadTemplatesTable();
nfTemplatesTable.loadTemplatesTable();
});
// get the banners if we're not in the shell
@ -91,8 +91,8 @@
dataType: 'json'
}).done(function (response) {
// ensure the banners response is specified
if (common.isDefinedAndNotNull(response.banners)) {
if (common.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
if (nfCommon.isDefinedAndNotNull(response.banners)) {
if (nfCommon.isDefinedAndNotNull(response.banners.headerText) && response.banners.headerText !== '') {
// update the header text
var bannerHeader = $('#banner-header').text(response.banners.headerText).show();
@ -106,7 +106,7 @@
updateTop('templates');
}
if (common.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
if (nfCommon.isDefinedAndNotNull(response.banners.footerText) && response.banners.footerText !== '') {
// update the footer text and show it
var bannerFooter = $('#banner-footer').text(response.banners.footerText).show();
@ -122,7 +122,7 @@
deferred.resolve();
}).fail(function (xhr, status, error) {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
deferred.reject();
});
} else {
@ -136,16 +136,16 @@
* Initializes the templates page.
*/
init: function () {
storage.init();
nfStorage.init();
// load the current user
loadCurrentUser().done(function () {
// create the templates table
templatesTable.init();
nfTemplatesTable.init();
// load the table
templatesTable.loadTemplatesTable().done(function () {
nfTemplatesTable.loadTemplatesTable().done(function () {
// once the table is initialized, finish initializing the page
initializeTemplatesPage().done(function () {
var setBodySize = function () {
@ -162,7 +162,7 @@
}
// configure the initial grid height
templatesTable.resetTableSize();
nfTemplatesTable.resetTableSize();
};
// get the about details
@ -180,7 +180,7 @@
// set the initial size
setBodySize();
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
$(window).on('resize', function (e) {
setBodySize();
@ -213,7 +213,7 @@
}
}
$.each(tabsContents, function (index, tabsContent) {
common.toggleScrollable(tabsContent.get(0));
nfCommon.toggleScrollable(tabsContent.get(0));
});
});
});

View File

@ -24,8 +24,8 @@
'nf.Common',
'nf.Client',
'nf.ErrorHandler'],
function ($, Slick, common, client, errorHandler) {
return (nf.UsersTable = factory($, Slick, common, client, errorHandler));
function ($, Slick, nfCommon, nfClient, nfErrorHandler) {
return (nf.UsersTable = factory($, Slick, nfCommon, nfClient, nfErrorHandler));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.UsersTable =
@ -41,7 +41,7 @@
root.nf.Client,
root.nf.ErrorHandler);
}
}(this, function ($, Slick, common, client, errorHandler) {
}(this, function ($, Slick, nfCommon, nfClient, nfErrorHandler) {
'use strict';
/**
@ -76,11 +76,11 @@
// update the user
$.ajax({
type: 'DELETE',
url: user.uri + '?' + $.param(client.getRevision(user)),
url: user.uri + '?' + $.param(nfClient.getRevision(user)),
dataType: 'json'
}).done(function () {
nfUsersTable.loadUsersTable();
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
// hide the dialog
$('#user-delete-dialog').modal('hide');
@ -169,7 +169,7 @@
// build the request entity
var updatedGroupEntity = {
'revision': client.getRevision(groupEntity),
'revision': nfClient.getRevision(groupEntity),
'component': $.extend({}, groupEntity.component, {
'users': groupMembers
})
@ -207,7 +207,7 @@
// build the request entity
var updatedGroupEntity = {
'revision': client.getRevision(groupEntity),
'revision': nfClient.getRevision(groupEntity),
'component': $.extend({}, groupEntity.component, {
'users': groupMembers
})
@ -258,8 +258,8 @@
usersGrid.setSelectedRows([row]);
usersGrid.scrollRowIntoView(row);
});
}).fail(errorHandler.handleAjaxError);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -276,7 +276,7 @@
var userEntity = usersData.getItemById(userId);
var updatedUserEntity = {
'revision': client.getRevision(userEntity),
'revision': nfClient.getRevision(userEntity),
'component': {
'id': userId,
'identity': userIdentity
@ -331,8 +331,8 @@
$.when.apply(window, xhrs).always(function () {
nfUsersTable.loadUsersTable();
}).fail(errorHandler.handleAjaxError);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -359,7 +359,7 @@
usersGrid.setSelectedRows([row]);
usersGrid.scrollRowIntoView(row);
});
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
var updateGroup = function (groupId, groupIdentity, selectedUsers) {
@ -369,7 +369,7 @@
var groupEntity = usersData.getItemById(groupId);
var updatedGroupoEntity = {
'revision': client.getRevision(groupEntity),
'revision': nfClient.getRevision(groupEntity),
'component': {
'id': groupId,
'identity': groupIdentity,
@ -386,7 +386,7 @@
contentType: 'application/json'
}).done(function (groupEntity) {
nfUsersTable.loadUsersTable();
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
};
/**
@ -410,7 +410,7 @@
// see if we should create or update this user
if ($.trim(userId) === '') {
var tenantEntity = {
'revision': client.getRevision({
'revision': nfClient.getRevision({
'revision': {
'version': 0
}
@ -524,7 +524,7 @@
*/
var globalResourceParser = function (dataContext) {
return 'Global policy to ' +
common.getPolicyTypeListing(common.substringAfterFirst(dataContext.component.resource, '/')).text;
nfCommon.getPolicyTypeListing(nfCommon.substringAfterFirst(dataContext.component.resource, '/')).text;
};
/**
@ -539,13 +539,13 @@
//determine policy type
if (resource.startsWith('/policies')) {
resource = common.substringAfterFirst(resource, '/policies');
resource = nfCommon.substringAfterFirst(resource, '/policies');
policyLabel += 'Admin policy for ';
} else if (resource.startsWith('/data-transfer')) {
resource = common.substringAfterFirst(resource, '/data-transfer');
resource = nfCommon.substringAfterFirst(resource, '/data-transfer');
policyLabel += 'Site to site policy for ';
} else if (resource.startsWith('/data')) {
resource = common.substringAfterFirst(resource, '/data');
resource = nfCommon.substringAfterFirst(resource, '/data');
policyLabel += 'Data policy for ';
} else {
policyLabel += 'Component policy for ';
@ -592,7 +592,7 @@
// if the user has permission to the policy
if (dataContext.permissions.canRead === true) {
// check if Global policy
if (common.isUndefinedOrNull(dataContext.component.componentReference)) {
if (nfCommon.isUndefinedOrNull(dataContext.component.componentReference)) {
return globalResourceParser(dataContext);
}
// not a global policy... check if user has access to the component reference
@ -607,7 +607,7 @@
var markup = '';
if (dataContext.permissions.canRead === true) {
if (common.isDefinedAndNotNull(dataContext.component.componentReference)) {
if (nfCommon.isDefinedAndNotNull(dataContext.component.componentReference)) {
if (dataContext.component.resource.indexOf('/processors') >= 0) {
markup += '<div title="Go To" class="pointer go-to-component fa fa-long-arrow-right" style="float: left;"></div>';
} else if (dataContext.component.resource.indexOf('/controller-services') >= 0) {
@ -797,12 +797,12 @@
var markup = '';
// ensure user can modify the user
if (common.canModifyTenants()) {
if (nfCommon.canModifyTenants()) {
markup += '<div title="Edit" class="pointer edit-user fa fa-pencil" style="margin-right: 3px;"></div>';
markup += '<div title="Remove" class="pointer delete-user fa fa-trash"></div>';
}
if (!common.isEmpty(dataContext.component.accessPolicies)) {
if (!nfCommon.isEmpty(dataContext.component.accessPolicies)) {
markup += '<div title="View User Policies" class="pointer view-user-policies fa fa-key" style="margin-left: 3px;"></div>';
}
@ -923,8 +923,8 @@
// defines a function for sorting
var comparer = function (a, b) {
if (a.permissions.canRead && b.permissions.canRead) {
var aString = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : '';
var bString = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : '';
var aString = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : '';
var bString = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : '';
return aString === bString ? 0 : aString > bString ? 1 : -1;
} else {
if (!a.permissions.canRead && !b.permissions.canRead) {
@ -953,8 +953,8 @@
var comparer = function (a, b) {
if (a.permissions.canRead && b.permissions.canRead) {
if (sortDetails.columnId === 'action') {
var aString = common.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : '';
var bString = common.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : '';
var aString = nfCommon.isDefinedAndNotNull(a.component[sortDetails.columnId]) ? a.component[sortDetails.columnId] : '';
var bString = nfCommon.isDefinedAndNotNull(b.component[sortDetails.columnId]) ? b.component[sortDetails.columnId] : '';
return aString === bString ? 0 : aString > bString ? 1 : -1;
} else if (sortDetails.columnId === 'policy') {
var aString = '';
@ -963,7 +963,7 @@
// if the user has permission to the policy
if (a.permissions.canRead === true) {
// check if Global policy
if (common.isUndefinedOrNull(a.component.componentReference)) {
if (nfCommon.isUndefinedOrNull(a.component.componentReference)) {
aString = globalResourceParser(a);
} else {
// not a global policy... check if user has access to the component reference
@ -976,7 +976,7 @@
// if the user has permission to the policy
if (b.permissions.canRead === true) {
// check if Global policy
if (common.isUndefinedOrNull(b.component.componentReference)) {
if (nfCommon.isUndefinedOrNull(b.component.componentReference)) {
bString = globalResourceParser(b);
} else {
// not a global policy... check if user has access to the component reference
@ -1021,7 +1021,7 @@
var usersGrid = $('#users-table').data('gridInstance');
// ensure the grid has been initialized
if (common.isDefinedAndNotNull(usersGrid)) {
if (nfCommon.isDefinedAndNotNull(usersGrid)) {
var usersData = usersGrid.getData();
// update the search criteria
@ -1195,7 +1195,7 @@
userPoliciesData.beginUpdate();
// set the rows
if (common.isDefinedAndNotNull(user.component.accessPolicies)) {
if (nfCommon.isDefinedAndNotNull(user.component.accessPolicies)) {
userPoliciesData.setItems(user.component.accessPolicies);
}
@ -1222,7 +1222,7 @@
initUserDeleteDialog();
initUsersTable();
if (common.canModifyTenants()) {
if (nfCommon.canModifyTenants()) {
$('#new-user-button').on('click', function () {
buildUsersList();
buildGroupsList();
@ -1247,7 +1247,7 @@
var usersTable = $('#users-table');
if (usersTable.is(':visible')) {
var grid = usersTable.data('gridInstance');
if (common.isDefinedAndNotNull(grid)) {
if (nfCommon.isDefinedAndNotNull(grid)) {
grid.resizeCanvas();
}
}
@ -1310,7 +1310,7 @@
usersGrid.getSelectionModel().setSelectedRows([]);
$('#total-users').text(usersData.getLength());
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
}
};

View File

@ -25,8 +25,8 @@
'nf.ErrorHandler',
'nf.Storage',
'nf.Client'],
function ($, common, usersTable, errorHandler, storage, client) {
return (nf.Users = factory($, common, usersTable, errorHandler, storage, client));
function ($, nfCommon, nfUsersTable, nfErrorHandler, nfStorage, nfClient) {
return (nf.Users = factory($, nfCommon, nfUsersTable, nfErrorHandler, nfStorage, nfClient));
});
} else if (typeof exports === 'object' && typeof module === 'object') {
module.exports = (nf.Users =
@ -45,7 +45,7 @@
root.nf.Storage,
root.nf.Client);
}
}(this, function ($, common, usersTable, errorHandler, storage, client) {
}(this, function ($, nfCommon, nfUsersTable, nfErrorHandler, nfStorage, nfClient) {
'use strict';
$(document).ready(function () {
@ -79,14 +79,14 @@
url: config.urls.currentUser,
dataType: 'json'
}).done(function (currentUser) {
common.setCurrentUser(currentUser);
}).fail(errorHandler.handleAjaxError);
nfCommon.setCurrentUser(currentUser);
}).fail(nfErrorHandler.handleAjaxError);
};
var initializeUsersPage = function () {
// define mouse over event for the refresh button
common.addHoverEffect('#user-refresh-button', 'button-refresh', 'button-refresh-hover').click(function () {
usersTable.loadUsersTable();
nfCommon.addHoverEffect('#user-refresh-button', 'button-refresh', 'button-refresh-hover').click(function () {
nfUsersTable.loadUsersTable();
});
// get the banners if we're not in the shell
@ -98,8 +98,8 @@
dataType: 'json'
}).done(function (bannerResponse) {
// ensure the banners response is specified
if (common.isDefinedAndNotNull(bannerResponse.banners)) {
if (common.isDefinedAndNotNull(bannerResponse.banners.headerText) && bannerResponse.banners.headerText !== '') {
if (nfCommon.isDefinedAndNotNull(bannerResponse.banners)) {
if (nfCommon.isDefinedAndNotNull(bannerResponse.banners.headerText) && bannerResponse.banners.headerText !== '') {
// update the header text
var bannerHeader = $('#banner-header').text(bannerResponse.banners.headerText).show();
@ -113,7 +113,7 @@
updateTop('users');
}
if (common.isDefinedAndNotNull(bannerResponse.banners.footerText) && bannerResponse.banners.footerText !== '') {
if (nfCommon.isDefinedAndNotNull(bannerResponse.banners.footerText) && bannerResponse.banners.footerText !== '') {
// update the footer text and show it
var bannerFooter = $('#banner-footer').text(bannerResponse.banners.footerText).show();
@ -129,7 +129,7 @@
deferred.resolve();
}).fail(function (xhr, status, error) {
errorHandler.handleAjaxError(xhr, status, error);
nfErrorHandler.handleAjaxError(xhr, status, error);
deferred.reject();
});
} else {
@ -143,25 +143,25 @@
* Initializes the counters page.
*/
init: function () {
storage.init();
nfStorage.init();
// initialize the client
client.init();
nfClient.init();
// load the users authorities
ensureAccess().done(function () {
// create the counters table
usersTable.init();
nfUsersTable.init();
// load the users table
usersTable.loadUsersTable().done(function () {
nfUsersTable.loadUsersTable().done(function () {
// finish initializing users page
initializeUsersPage().done(function () {
// listen for browser resize events to update the page size
$(window).resize(usersTable.resetTableSize);
$(window).resize(nfUsersTable.resetTableSize);
// configure the initial grid height
usersTable.resetTableSize();
nfUsersTable.resetTableSize();
// get the about details
$.ajax({
@ -175,7 +175,7 @@
// set the document title and the about title
document.title = countersTitle;
$('#users-header-text').text(countersTitle);
}).fail(errorHandler.handleAjaxError);
}).fail(nfErrorHandler.handleAjaxError);
});
$(window).on('resize', function (e) {