You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mc...@apache.org on 2015/03/31 23:07:49 UTC
[05/25] incubator-nifi git commit: Squashed commit of the following:
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js
index c21969e..8943ddf 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-funnel.js
@@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/* global nf, d3 */
+
nf.Funnel = (function () {
var dimensions = {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-go-to.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-go-to.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-go-to.js
index 18812c4..2c75b7e 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-go-to.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-go-to.js
@@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/* global nf */
+
/**
* Handles the upstream/downstream dialogs.
*/
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph-control.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph-control.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph-control.js
index 6537344..b6f2a51 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph-control.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph-control.js
@@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/* global nf */
+
nf.GraphControl = (function () {
var config = {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph.js
index a9070c7..99f978e 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-graph.js
@@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/* global nf */
+
nf.Graph = (function () {
var combinePorts = function (contents) {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label-configuration.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label-configuration.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label-configuration.js
index aef6c74..e367452 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label-configuration.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label-configuration.js
@@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/* global nf */
+
nf.LabelConfiguration = (function () {
var labelUri = '';
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js
index c175418..69a4758 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-label.js
@@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/* global nf, d3 */
+
nf.Label = (function () {
var dimensions = {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port-configuration.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port-configuration.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port-configuration.js
index 49d2b01..0939b3a 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port-configuration.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port-configuration.js
@@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/* global nf, d3 */
+
nf.PortConfiguration = (function () {
/**
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port-details.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port-details.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port-details.js
index a2cba44..c520044 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port-details.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port-details.js
@@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/* global nf */
+
nf.PortDetails = (function () {
return {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port.js
index ed584b8..e0ff75d 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-port.js
@@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/* global nf, d3 */
+
nf.Port = (function () {
var PREVIEW_NAME_LENGTH = 15;
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group-configuration.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group-configuration.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group-configuration.js
index 3603976..fb22411 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group-configuration.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group-configuration.js
@@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/* global nf, d3 */
+
nf.ProcessGroupConfiguration = (function () {
return {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group-details.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group-details.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group-details.js
index 2f88c12..d1cec36 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group-details.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group-details.js
@@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/* global nf */
+
nf.ProcessGroupDetails = (function () {
return {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js
index ae42547..32ba3af 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-process-group.js
@@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/* global nf, d3 */
+
nf.ProcessGroup = (function () {
var PREVIEW_NAME_LENGTH = 30;
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-configuration.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-configuration.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-configuration.js
index 14ffa95..329afc1 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-configuration.js
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-configuration.js
@@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+/* global nf */
+
nf.ProcessorConfiguration = (function () {
// possible values for a processor's run duration (in millis)
@@ -220,7 +223,7 @@ nf.ProcessorConfiguration = (function () {
}
// defer to the property and relationship grids
- return nf.ProcessorPropertyTable.isSaveRequired();
+ return $('#processor-properties').propertytable('isSaveRequired');
};
/**
@@ -275,7 +278,7 @@ nf.ProcessorConfiguration = (function () {
processorConfigDto['autoTerminatedRelationships'] = marshalRelationships();
// properties
- var properties = nf.ProcessorPropertyTable.marshalProperties();
+ var properties = $('#processor-properties').propertytable('marshalProperties');
// set the properties
if ($.isEmptyObject(properties) === false) {
@@ -389,25 +392,25 @@ nf.ProcessorConfiguration = (function () {
selectedTabStyle: 'selected-tab',
tabs: [{
name: 'Settings',
- tabContentId: 'configuration-standard-settings-tab-content'
+ tabContentId: 'processor-standard-settings-tab-content'
}, {
name: 'Scheduling',
- tabContentId: 'configuration-scheduling-tab-content'
+ tabContentId: 'processor-scheduling-tab-content'
}, {
name: 'Properties',
- tabContentId: 'configuration-processor-properties-tab-content'
+ tabContentId: 'processor-properties-tab-content'
}, {
name: 'Comments',
- tabContentId: 'configuration-comments-tab-content'
+ tabContentId: 'processor-comments-tab-content'
}],
select: function () {
// update the processor property table size in case this is the first time its rendered
if ($(this).text() === 'Properties') {
- nf.ProcessorPropertyTable.resetTableSize();
+ $('#processor-properties').propertytable('resetTableSize');
}
// close all fields currently being edited
- nf.ProcessorPropertyTable.saveRow();
+ $('#processor-properties').propertytable('saveRow');
// show the border around the processor relationships if necessary
var processorRelationships = $('#auto-terminate-relationship-names');
@@ -426,18 +429,11 @@ nf.ProcessorConfiguration = (function () {
// empty the relationship list
$('#auto-terminate-relationship-names').css('border-width', '0').empty();
- // close the new property dialog if necessary
- $('#processor-property-dialog').hide();
-
- // cancel any active edits
- nf.ProcessorPropertyTable.cancelEdit();
-
- // clear the tables
- nf.ProcessorPropertyTable.clear();
+ // cancel any active edits and clear the table
+ $('#processor-properties').propertytable('cancelEdit').propertytable('clear');
// removed the cached processor details
$('#processor-configuration').removeData('processorDetails');
- $('#processor-configuration').removeData('processorHistory');
}
}
}).draggable({
@@ -469,7 +465,21 @@ nf.ProcessorConfiguration = (function () {
});
// initialize the property table
- nf.ProcessorPropertyTable.init();
+ $('#processor-properties').propertytable({
+ readOnly: false,
+ newPropertyDialogContainer: '#new-processor-property-container',
+ descriptorDeferred: function(propertyName) {
+ var processor = $('#processor-configuration').data('processorDetails');
+ return $.ajax({
+ type: 'GET',
+ url: processor.uri + '/descriptors',
+ data: {
+ propertyName: propertyName
+ },
+ dataType: 'json'
+ }).fail(nf.Common.handleAjaxError);
+ }
+ });
},
/**
@@ -484,237 +494,244 @@ nf.ProcessorConfiguration = (function () {
// get the processor details
var processor = selectionData.component;
- // record the processor details
- $('#processor-configuration').data('processorDetails', processor);
+ // reload the processor in case an property descriptors have updated
+ var reloadProcessor = nf.Processor.reload(processor);
+
+ // get the processor history
+ var loadHistory = $.ajax({
+ type: 'GET',
+ url: '../nifi-api/controller/history/processors/' + encodeURIComponent(processor.id),
+ dataType: 'json'
+ });
+
+ // once everything is loaded, show the dialog
+ $.when(reloadProcessor, loadHistory).done(function (processorResponse, historyResponse) {
+ // get the updated processor
+ processor = processorResponse[0].processor;
+
+ // get the processor history
+ var processorHistory = historyResponse[0].componentHistory;
+
+ // record the processor details
+ $('#processor-configuration').data('processorDetails', processor);
+
+ // determine if the enabled checkbox is checked or not
+ var processorEnableStyle = 'checkbox-checked';
+ if (processor['state'] === 'DISABLED') {
+ processorEnableStyle = 'checkbox-unchecked';
+ }
- // determine if the enabled checkbox is checked or not
- var processorEnableStyle = 'checkbox-checked';
- if (processor['state'] === 'DISABLED') {
- processorEnableStyle = 'checkbox-unchecked';
- }
+ // populate the processor settings
+ $('#processor-id').text(processor['id']);
+ $('#processor-type').text(nf.Common.substringAfterLast(processor['type'], '.'));
+ $('#processor-name').val(processor['name']);
+ $('#processor-enabled').removeClass('checkbox-unchecked checkbox-checked').addClass(processorEnableStyle);
+ $('#penalty-duration').val(processor.config['penaltyDuration']);
+ $('#yield-duration').val(processor.config['yieldDuration']);
+ $('#processor-comments').val(processor.config['comments']);
+
+ // set the run duration
+ var runDuration = RUN_DURATION_VALUES.indexOf(processor.config['runDurationMillis']);
+ $('#run-duration-slider').slider('value', runDuration);
+
+ // select the appropriate bulletin level
+ $('#bulletin-level-combo').combo('setSelectedOption', {
+ value: processor.config['bulletinLevel']
+ });
- // populate the processor settings
- $('#processor-id').text(processor['id']);
- $('#processor-type').text(nf.Common.substringAfterLast(processor['type'], '.'));
- $('#processor-name').val(processor['name']);
- $('#processor-enabled').removeClass('checkbox-unchecked checkbox-checked').addClass(processorEnableStyle);
- $('#penalty-duration').val(processor.config['penaltyDuration']);
- $('#yield-duration').val(processor.config['yieldDuration']);
- $('#processor-comments').val(processor.config['comments']);
-
- // set the run duration
- var runDuration = RUN_DURATION_VALUES.indexOf(processor.config['runDurationMillis']);
- $('#run-duration-slider').slider('value', runDuration);
-
- // select the appropriate bulletin level
- $('#bulletin-level-combo').combo('setSelectedOption', {
- value: processor.config['bulletinLevel']
- });
+ // initialize the scheduling strategy
+ $('#scheduling-strategy-combo').combo({
+ options: getSchedulingStrategies(processor),
+ selectedOption: {
+ value: processor.config['schedulingStrategy']
+ },
+ select: function (selectedOption) {
+ // show the appropriate panel
+ if (selectedOption.value === 'EVENT_DRIVEN') {
+ $('#event-driven-warning').show();
- // initialize the scheduling strategy
- $('#scheduling-strategy-combo').combo({
- options: getSchedulingStrategies(processor),
- selectedOption: {
- value: processor.config['schedulingStrategy']
- },
- select: function (selectedOption) {
- // show the appropriate panel
- if (selectedOption.value === 'EVENT_DRIVEN') {
- $('#event-driven-warning').show();
-
- $('#timer-driven-options').hide();
- $('#event-driven-options').show();
- $('#cron-driven-options').hide();
- } else {
- $('#event-driven-warning').hide();
-
- if (selectedOption.value === 'CRON_DRIVEN') {
$('#timer-driven-options').hide();
- $('#event-driven-options').hide();
- $('#cron-driven-options').show();
- } else {
- $('#timer-driven-options').show();
- $('#event-driven-options').hide();
+ $('#event-driven-options').show();
$('#cron-driven-options').hide();
+ } else {
+ $('#event-driven-warning').hide();
+
+ if (selectedOption.value === 'CRON_DRIVEN') {
+ $('#timer-driven-options').hide();
+ $('#event-driven-options').hide();
+ $('#cron-driven-options').show();
+ } else {
+ $('#timer-driven-options').show();
+ $('#event-driven-options').hide();
+ $('#cron-driven-options').hide();
+ }
}
}
- }
- });
-
- // initialize the concurrentTasks
- var defaultConcurrentTasks = processor.config['defaultConcurrentTasks'];
- $('#timer-driven-concurrently-schedulable-tasks').val(defaultConcurrentTasks['TIMER_DRIVEN']);
- $('#event-driven-concurrently-schedulable-tasks').val(defaultConcurrentTasks['EVENT_DRIVEN']);
- $('#cron-driven-concurrently-schedulable-tasks').val(defaultConcurrentTasks['CRON_DRIVEN']);
-
- // get the appropriate concurrent tasks field
- var concurrentTasks;
- if (processor.config['schedulingStrategy'] === 'EVENT_DRIVEN') {
- concurrentTasks = $('#event-driven-concurrently-schedulable-tasks').val(processor.config['concurrentlySchedulableTaskCount']);
- } else if (processor.config['schedulingStrategy'] === 'CRON_DRIVEN') {
- concurrentTasks = $('#cron-driven-concurrently-schedulable-tasks').val(processor.config['concurrentlySchedulableTaskCount']);
- } else {
- concurrentTasks = $('#timer-driven-concurrently-schedulable-tasks').val(processor.config['concurrentlySchedulableTaskCount']);
- }
+ });
- // conditionally allow the user to specify the concurrent tasks
- if (nf.Common.isDefinedAndNotNull(concurrentTasks)) {
- if (processor.supportsParallelProcessing === true) {
- concurrentTasks.prop('disabled', false);
+ // initialize the concurrentTasks
+ var defaultConcurrentTasks = processor.config['defaultConcurrentTasks'];
+ $('#timer-driven-concurrently-schedulable-tasks').val(defaultConcurrentTasks['TIMER_DRIVEN']);
+ $('#event-driven-concurrently-schedulable-tasks').val(defaultConcurrentTasks['EVENT_DRIVEN']);
+ $('#cron-driven-concurrently-schedulable-tasks').val(defaultConcurrentTasks['CRON_DRIVEN']);
+
+ // get the appropriate concurrent tasks field
+ var concurrentTasks;
+ if (processor.config['schedulingStrategy'] === 'EVENT_DRIVEN') {
+ concurrentTasks = $('#event-driven-concurrently-schedulable-tasks').val(processor.config['concurrentlySchedulableTaskCount']);
+ } else if (processor.config['schedulingStrategy'] === 'CRON_DRIVEN') {
+ concurrentTasks = $('#cron-driven-concurrently-schedulable-tasks').val(processor.config['concurrentlySchedulableTaskCount']);
} else {
- concurrentTasks.prop('disabled', true);
+ concurrentTasks = $('#timer-driven-concurrently-schedulable-tasks').val(processor.config['concurrentlySchedulableTaskCount']);
}
- }
-
- // initialize the schedulingStrategy
- var defaultSchedulingPeriod = processor.config['defaultSchedulingPeriod'];
- $('#cron-driven-scheduling-period').val(defaultSchedulingPeriod['CRON_DRIVEN']);
- $('#timer-driven-scheduling-period').val(defaultSchedulingPeriod['TIMER_DRIVEN']);
- // set the scheduling period as appropriate
- if (processor.config['schedulingStrategy'] === 'CRON_DRIVEN') {
- $('#cron-driven-scheduling-period').val(processor.config['schedulingPeriod']);
- } else if (processor.config['schedulingStrategy'] !== 'EVENT_DRIVEN') {
- $('#timer-driven-scheduling-period').val(processor.config['schedulingPeriod']);
- }
+ // conditionally allow the user to specify the concurrent tasks
+ if (nf.Common.isDefinedAndNotNull(concurrentTasks)) {
+ if (processor.supportsParallelProcessing === true) {
+ concurrentTasks.prop('disabled', false);
+ } else {
+ concurrentTasks.prop('disabled', true);
+ }
+ }
- // load the property table
- nf.ProcessorPropertyTable.loadProperties(processor.config.properties, processor.config.descriptors);
+ // initialize the schedulingStrategy
+ var defaultSchedulingPeriod = processor.config['defaultSchedulingPeriod'];
+ $('#cron-driven-scheduling-period').val(defaultSchedulingPeriod['CRON_DRIVEN']);
+ $('#timer-driven-scheduling-period').val(defaultSchedulingPeriod['TIMER_DRIVEN']);
- // load the relationship list
- if (!nf.Common.isEmpty(processor.relationships)) {
- $.each(processor.relationships, function (i, relationship) {
- createRelationshipOption(relationship);
- });
- } else {
- $('#auto-terminate-relationship-names').append('<div class="unset">This processor has no relationships.</div>');
- }
+ // set the scheduling period as appropriate
+ if (processor.config['schedulingStrategy'] === 'CRON_DRIVEN') {
+ $('#cron-driven-scheduling-period').val(processor.config['schedulingPeriod']);
+ } else if (processor.config['schedulingStrategy'] !== 'EVENT_DRIVEN') {
+ $('#timer-driven-scheduling-period').val(processor.config['schedulingPeriod']);
+ }
- var buttons = [{
- buttonText: 'Apply',
- handler: {
- click: function () {
- // close all fields currently being edited
- nf.ProcessorPropertyTable.saveRow();
-
- // marshal the settings and properties and update the processor
- var updatedProcessor = marshalDetails();
-
- // ensure details are valid as far as we can tell
- if (validateDetails(updatedProcessor)) {
- // update the selected component
- $.ajax({
- type: 'PUT',
- data: JSON.stringify(updatedProcessor),
- url: processor.uri,
- dataType: 'json',
- processData: false,
- contentType: 'application/json'
- }).done(function (response) {
- if (nf.Common.isDefinedAndNotNull(response.processor)) {
- // update the revision
- nf.Client.setRevision(response.revision);
-
- // set the new processor state based on the response
- nf.Processor.set(response.processor);
-
- // reload the processor's outgoing connections
- reloadProcessorConnections(processor);
+ // load the relationship list
+ if (!nf.Common.isEmpty(processor.relationships)) {
+ $.each(processor.relationships, function (i, relationship) {
+ createRelationshipOption(relationship);
+ });
+ } else {
+ $('#auto-terminate-relationship-names').append('<div class="unset">This processor has no relationships.</div>');
+ }
- // close the details panel
- $('#processor-configuration').modal('hide');
- }
- }).fail(handleProcessorConfigurationError);
+ var buttons = [{
+ buttonText: 'Apply',
+ handler: {
+ click: function () {
+ // close all fields currently being edited
+ $('#processor-properties').propertytable('saveRow');
+
+ // marshal the settings and properties and update the processor
+ var updatedProcessor = marshalDetails();
+
+ // ensure details are valid as far as we can tell
+ if (validateDetails(updatedProcessor)) {
+ // update the selected component
+ $.ajax({
+ type: 'PUT',
+ data: JSON.stringify(updatedProcessor),
+ url: processor.uri,
+ dataType: 'json',
+ processData: false,
+ contentType: 'application/json'
+ }).done(function (response) {
+ if (nf.Common.isDefinedAndNotNull(response.processor)) {
+ // update the revision
+ nf.Client.setRevision(response.revision);
+
+ // set the new processor state based on the response
+ nf.Processor.set(response.processor);
+
+ // reload the processor's outgoing connections
+ reloadProcessorConnections(processor);
+
+ // close the details panel
+ $('#processor-configuration').modal('hide');
+ }
+ }).fail(handleProcessorConfigurationError);
+ }
}
}
- }
- }, {
- buttonText: 'Cancel',
- handler: {
- click: function () {
- $('#processor-configuration').modal('hide');
- }
- }
- }];
-
- // determine if we should show the advanced button
- if (nf.Common.isDefinedAndNotNull(processor.config.customUiUrl) && processor.config.customUiUrl !== '') {
- buttons.push({
- buttonText: 'Advanced',
- handler: {
- click: function () {
- var openCustomUi = function () {
- // reset state and close the dialog manually to avoid hiding the faded background
+ }, {
+ buttonText: 'Cancel',
+ handler: {
+ click: function () {
$('#processor-configuration').modal('hide');
-
- // show the custom ui
- nf.CustomProcessorUi.showCustomUi($('#processor-id').text(), processor.config.customUiUrl, true).done(function () {
- // once the custom ui is closed, reload the processor
- nf.Processor.reload(processor);
-
- // and reload the processor's outgoing connections
- reloadProcessorConnections(processor);
- });
- };
-
- // close all fields currently being edited
- nf.ProcessorPropertyTable.saveRow();
-
- // determine if changes have been made
- if (isSaveRequired()) {
- // see if those changes should be saved
- nf.Dialog.showYesNoDialog({
- dialogContent: 'Save changes before opening the advanced configuration?',
- overlayBackground: false,
- noHandler: openCustomUi,
- yesHandler: function () {
- // marshal the settings and properties and update the processor
- var updatedProcessor = marshalDetails();
-
- // ensure details are valid as far as we can tell
- if (validateDetails(updatedProcessor)) {
- // update the selected component
- $.ajax({
- type: 'PUT',
- data: JSON.stringify(updatedProcessor),
- url: processor.uri,
- dataType: 'json',
- processData: false,
- contentType: 'application/json'
- }).done(function (response) {
- if (nf.Common.isDefinedAndNotNull(response.processor)) {
- // update the revision
- nf.Client.setRevision(response.revision);
-
- // open the custom ui
- openCustomUi();
- }
- }).fail(handleProcessorConfigurationError);
+ }
+ }
+ }];
+
+ // determine if we should show the advanced button
+ if (nf.Common.isDefinedAndNotNull(processor.config.customUiUrl) && processor.config.customUiUrl !== '') {
+ buttons.push({
+ buttonText: 'Advanced',
+ handler: {
+ click: function () {
+ var openCustomUi = function () {
+ // reset state and close the dialog manually to avoid hiding the faded background
+ $('#processor-configuration').modal('hide');
+
+ // show the custom ui
+ nf.CustomUi.showCustomUi($('#processor-id').text(), processor.config.customUiUrl, true).done(function () {
+ // once the custom ui is closed, reload the processor
+ nf.Processor.reload(processor);
+
+ // and reload the processor's outgoing connections
+ reloadProcessorConnections(processor);
+ });
+ };
+
+ // close all fields currently being edited
+ $('#processor-properties').propertytable('saveRow');
+
+ // determine if changes have been made
+ if (isSaveRequired()) {
+ // see if those changes should be saved
+ nf.Dialog.showYesNoDialog({
+ dialogContent: 'Save changes before opening the advanced configuration?',
+ overlayBackground: false,
+ noHandler: openCustomUi,
+ yesHandler: function () {
+ // marshal the settings and properties and update the processor
+ var updatedProcessor = marshalDetails();
+
+ // ensure details are valid as far as we can tell
+ if (validateDetails(updatedProcessor)) {
+ // update the selected component
+ $.ajax({
+ type: 'PUT',
+ data: JSON.stringify(updatedProcessor),
+ url: processor.uri,
+ dataType: 'json',
+ processData: false,
+ contentType: 'application/json'
+ }).done(function (response) {
+ if (nf.Common.isDefinedAndNotNull(response.processor)) {
+ // update the revision
+ nf.Client.setRevision(response.revision);
+
+ // open the custom ui
+ openCustomUi();
+ }
+ }).fail(handleProcessorConfigurationError);
+ }
}
- }
- });
- } else {
- // if there were no changes, simply open the custom ui
- openCustomUi();
+ });
+ } else {
+ // if there were no changes, simply open the custom ui
+ openCustomUi();
+ }
}
}
- }
- });
- }
-
- // set the button model
- $('#processor-configuration').modal('setButtonModel', buttons);
-
- // get the processor history
- $.ajax({
- type: 'GET',
- url: '../nifi-api/controller/history/processors/' + encodeURIComponent(processor.id),
- dataType: 'json'
- }).done(function (response) {
- var processorHistory = response.processorHistory;
+ });
+ }
- // record the processor history
- $('#processor-configuration').data('processorHistory', processorHistory);
+ // set the button model
+ $('#processor-configuration').modal('setButtonModel', buttons);
+
+ // load the property table
+ $('#processor-properties').propertytable('loadProperties', processor.config.properties, processor.config.descriptors, processorHistory.propertyHistory);
// show the details
$('#processor-configuration').modal('show');
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-combo-editor.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-combo-editor.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-combo-editor.js
deleted file mode 100644
index e777293..0000000
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-combo-editor.js
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-nf.ProcessorPropertyComboEditor = function (args) {
- var scope = this;
- var initialValue = null;
- var wrapper;
- var combo;
-
- this.init = function () {
- var container = $('body');
-
- // create the wrapper
- wrapper = $('<div></div>').css({
- 'z-index': 1999,
- 'position': 'absolute',
- 'background': 'white',
- 'padding': '5px',
- 'overflow': 'hidden',
- 'border': '3px solid #365C6A',
- 'box-shadow': '4px 4px 6px rgba(0, 0, 0, 0.9)',
- 'cursor': 'move'
- }).draggable({
- cancel: '.button, .combo',
- containment: 'parent'
- }).appendTo(container);
-
- // identify the property descriptor - property descriptor is never null/undefined here... in order
- // to use this editor, the property descriptor would have had to indicate a set of allowable values
- var processorDetails = $('#processor-configuration').data('processorDetails');
- var propertyDescriptor = processorDetails.config.descriptors[args.item.property];
-
- // check for allowable values which will drive which editor to use
- var allowableValues = nf.ProcessorPropertyTable.getAllowableValues(propertyDescriptor);
-
- // show the output port options
- var options = [];
- if (propertyDescriptor.required === false) {
- options.push({
- text: 'No value',
- value: null,
- optionClass: 'unset'
- });
- }
- if ($.isArray(allowableValues)) {
- $.each(allowableValues, function (i, allowableValue) {
- options.push({
- text: allowableValue.displayName,
- value: allowableValue.value,
- description: nf.Common.escapeHtml(allowableValue.description)
- });
- });
- }
-
- // ensure the options there is at least one option
- if (options.length === 0) {
- options.push({
- text: 'No value',
- value: null,
- optionClass: 'unset',
- disabled: true
- });
- }
-
- // determine the max height
- var position = args.position;
- var windowHeight = $(window).height();
- var maxHeight = windowHeight - position.bottom - 16;
-
- // build the combo field
- combo = $('<div class="value-combo combo"></div>').combo({
- options: options,
- maxHeight: maxHeight
- }).width(position.width - 16).appendTo(wrapper);
-
- // add buttons for handling user input
- $('<div class="button button-normal">Cancel</div>').css({
- 'margin': '0 0 0 5px',
- 'float': 'left'
- }).on('click', scope.cancel).appendTo(wrapper);
- $('<div class="button button-normal">Ok</div>').css({
- 'margin': '0 0 0 5px',
- 'float': 'left'
- }).on('click', scope.save).appendTo(wrapper);
-
- // position and focus
- scope.position(position);
- };
-
- this.save = function () {
- args.commitChanges();
- };
-
- this.cancel = function () {
- args.cancelChanges();
- };
-
- this.hide = function () {
- wrapper.hide();
- };
-
- this.show = function () {
- wrapper.show();
- };
-
- this.position = function (position) {
- wrapper.css({
- 'top': position.top - 5,
- 'left': position.left - 5
- });
- };
-
- this.destroy = function () {
- wrapper.remove();
- };
-
- this.focus = function () {
- };
-
- this.loadValue = function (item) {
- // identify the property descriptor
- var processorDetails = $('#processor-configuration').data('processorDetails');
- var propertyDescriptor = processorDetails.config.descriptors[item.property];
-
- // select as appropriate
- if (!nf.Common.isUndefined(item.value)) {
- initialValue = item.value;
-
- combo.combo('setSelectedOption', {
- value: item.value
- });
- } else if (nf.Common.isDefinedAndNotNull(propertyDescriptor.defaultValue)) {
- initialValue = propertyDescriptor.defaultValue;
-
- combo.combo('setSelectedOption', {
- value: propertyDescriptor.defaultValue
- });
- }
- };
-
- this.serializeValue = function () {
- var selectedOption = combo.combo('getSelectedOption');
- return selectedOption.value;
- };
-
- this.applyValue = function (item, state) {
- item[args.column.field] = state;
- };
-
- this.isValueChanged = function () {
- var selectedOption = combo.combo('getSelectedOption');
- return (!(selectedOption.value === "" && initialValue === null)) && (selectedOption.value !== initialValue);
- };
-
- this.validate = function () {
- return {
- valid: true,
- msg: null
- };
- };
-
- // initialize the custom long text editor
- this.init();
-};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-nfel-editor.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-nfel-editor.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-nfel-editor.js
deleted file mode 100644
index dc369ac..0000000
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-nfel-editor.js
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-nf.ProcessorPropertyNfelEditor = function (args) {
- var scope = this;
- var initialValue = '';
- var previousValue;
- var propertyDescriptor;
- var isEmpty;
- var wrapper;
- var editor;
-
- this.init = function () {
- var container = $('body');
-
- // get the property descriptor for this property
- var details = $('#processor-configuration').data('processorDetails');
- propertyDescriptor = details.config.descriptors[args.item.property];
-
- // determine if this is a sensitive property
- var sensitive = nf.ProcessorPropertyTable.isSensitiveProperty(propertyDescriptor);
-
- // record the previous value
- previousValue = args.item[args.column.field];
-
- var languageId = 'nfel';
- var editorClass = languageId + '-editor';
-
- // create the wrapper
- wrapper = $('<div></div>').addClass('slickgrid-nfel-editor').css({
- 'z-index': 14000,
- 'position': 'absolute',
- 'background': 'white',
- 'padding': '5px',
- 'overflow': 'hidden',
- 'border': '3px solid #365C6A',
- 'box-shadow': '4px 4px 6px rgba(0, 0, 0, 0.9)',
- 'cursor': 'move'
- }).draggable({
- cancel: 'input, textarea, pre, .nf-checkbox, .button, .' + editorClass,
- containment: 'parent'
- }).appendTo(container);
-
- // create the editor
- editor = $('<div></div>').addClass(editorClass).appendTo(wrapper).nfeditor({
- languageId: languageId,
- width: args.position.width,
- minWidth: 175,
- minHeight: 100,
- resizable: true,
- sensitive: sensitive,
- escape: function () {
- scope.cancel();
- },
- enter: function () {
- scope.save();
- }
- });
-
- // create the button panel
- var stringCheckPanel = $('<div class="string-check-container">');
-
- // build the custom checkbox
- isEmpty = $('<div class="nf-checkbox string-check"/>').appendTo(stringCheckPanel);
- $('<span class="string-check-label"> Empty</span>').appendTo(stringCheckPanel);
-
- var ok = $('<div class="button button-normal">Ok</div>').on('click', scope.save);
- var cancel = $('<div class="button button-normal">Cancel</div>').on('click', scope.cancel);
- $('<div></div>').css({
- 'position': 'absolute',
- 'bottom': '0',
- 'left': '0',
- 'right': '0',
- 'padding': '0 3px 5px 1px'
- }).append(stringCheckPanel).append(ok).append(cancel).append('<div class="clear"></div>').appendTo(wrapper);
-
- // position and focus
- scope.position(args.position);
- editor.nfeditor('focus').nfeditor('selectAll');
- };
-
- this.save = function () {
- args.commitChanges();
- };
-
- this.cancel = function () {
- editor.nfeditor('setValue', initialValue);
- args.cancelChanges();
- };
-
- this.hide = function () {
- wrapper.hide();
- };
-
- this.show = function () {
- wrapper.show();
- editor.nfeditor('setSize', args.position.width, null).nfeditor('refresh');
- };
-
- this.position = function (position) {
- wrapper.css({
- 'top': position.top - 5,
- 'left': position.left - 5
- });
- };
-
- this.destroy = function () {
- editor.nfeditor('destroy');
- wrapper.remove();
- };
-
- this.focus = function () {
- editor.nfeditor('focus');
- };
-
- this.loadValue = function (item) {
- // determine if this is a sensitive property
- var isEmptyChecked = false;
- var sensitive = nf.ProcessorPropertyTable.isSensitiveProperty(propertyDescriptor);
-
- // determine the value to use when populating the text field
- if (nf.Common.isDefinedAndNotNull(item[args.column.field])) {
- if (sensitive) {
- initialValue = nf.ProcessorPropertyTable.config.sensitiveText;
- } else {
- initialValue = item[args.column.field];
- isEmptyChecked = initialValue === '';
- }
- }
-
- // determine if its an empty string
- var checkboxStyle = isEmptyChecked ? 'checkbox-checked' : 'checkbox-unchecked';
- isEmpty.addClass(checkboxStyle);
-
- editor.nfeditor('setValue', initialValue).nfeditor('selectAll');
- };
-
- this.serializeValue = function () {
- var value = editor.nfeditor('getValue');
-
- // if the field has been cleared, set the value accordingly
- if (value === '') {
- // if the user has checked the empty string checkbox, use emtpy string
- if (isEmpty.hasClass('checkbox-checked')) {
- return '';
- } else {
- // otherwise if the property is required
- if (nf.ProcessorPropertyTable.isRequiredProperty(propertyDescriptor)) {
- if (nf.Common.isBlank(propertyDescriptor.defaultValue)) {
- return previousValue;
- } else {
- return propertyDescriptor.defaultValue;
- }
- } else {
- // if the property is not required, clear the value
- return null;
- }
- }
- } else {
- // if the field still has the sensitive class it means a property
- // was edited but never modified so we should restore the previous
- // value instead of setting it to the 'sensitive value set' string
-
- // if the field hasn't been modified return the previous value... this
- // is important because sensitive properties contain the text 'sensitive
- // value set' which is cleared when the value is edited. we do not
- // want to actually use this value
- if (editor.nfeditor('isModified') === false) {
- return previousValue;
- } else {
- // if there is text specified, use that value
- return value;
- }
- }
- };
-
- this.applyValue = function (item, state) {
- item[args.column.field] = state;
- };
-
- this.isValueChanged = function () {
- return scope.serializeValue() !== previousValue;
- };
-
- this.validate = function () {
- return {
- valid: true,
- msg: null
- };
- };
-
- // initialize the custom long nfel editor
- this.init();
-};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-table.js
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-table.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-table.js
deleted file mode 100644
index 4c04702..0000000
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-table.js
+++ /dev/null
@@ -1,567 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-nf.ProcessorPropertyTable = (function () {
-
- /**
- * Initialize the new property dialog.
- */
- var initNewPropertyDialog = function () {
- var languageId = 'nfel';
- var editorClass = languageId + '-editor';
-
- // add the over state for the new property button
- nf.Common.addHoverEffect('#add-property-icon', 'add-icon-bg', 'add-icon-bg-hover');
-
- var add = function () {
- var propertyName = $.trim($('#new-property-name').val());
- var propertyValue = $('#new-property-value').nfeditor('getValue');
-
- // ensure the property name and value is specified
- if (propertyName !== '') {
- // add a row for the new property
- var propertyGrid = $('#processor-properties').data('gridInstance');
- var propertyData = propertyGrid.getData();
- propertyData.addItem({
- id: propertyData.getLength(),
- hidden: false,
- property: propertyName,
- displayName: propertyName,
- previousValue: null,
- value: propertyValue,
- type: 'userDefined'
- });
- } else {
- nf.Dialog.showOkDialog({
- dialogContent: 'Property name must be specified.',
- overlayBackground: false
- });
- }
-
- // close the dialog
- $('#processor-property-dialog').hide();
- };
-
- var cancel = function () {
- $('#processor-property-dialog').hide();
- };
-
- // create the editor
- $('#new-property-value').addClass(editorClass).nfeditor({
- languageId: languageId,
- width: 318,
- minWidth: 318,
- height: 106,
- minHeight: 106,
- resizable: true,
- escape: cancel,
- enter: add
- });
-
- // add a click listener to display the new property dialog
- $('#add-property-icon').on('click', function () {
- // close all fields currently being edited
- nf.ProcessorPropertyTable.saveRow();
-
- // clear the dialog
- $('#new-property-name').val('');
- $('#new-property-value').nfeditor('setValue', '');
-
- // reset the add property dialog position/size
- $('#new-property-value').nfeditor('setSize', 318, 106);
-
- // open the new property dialog
- $('#processor-property-dialog').center().show();
-
- // give the property name focus
- $('#new-property-value').nfeditor('refresh');
- $('#new-property-name').focus();
- });
-
- // make the new property dialog draggable
- $('#processor-property-dialog').draggable({
- cancel: 'input, textarea, pre, .button, .' + editorClass,
- containment: 'parent'
- }).on('click', '#new-property-ok', add).on('click', '#new-property-cancel', cancel);
-
- // enable tabs in the property value
- $('#new-property-name').on('keydown', function (e) {
- if (e.which === $.ui.keyCode.ENTER && !e.shiftKey) {
- add();
- } else if (e.which === $.ui.keyCode.ESCAPE) {
- e.preventDefault();
- cancel();
- }
- });
- };
-
- /**
- * Initializes the processor property table.
- */
- var initProcessorPropertiesTable = function () {
- // function for formatting the property name
- var nameFormatter = function (row, cell, value, columnDef, dataContext) {
- var nameWidthOffset = 10;
- var cellContent = $('<div></div>');
-
- // format the contents
- var formattedValue = $('<span/>').addClass('table-cell').text(value).appendTo(cellContent);
- if (dataContext.type === 'required') {
- formattedValue.addClass('required');
- }
-
- // get the processor details to insert the description tooltip
- var details = $('#processor-configuration').data('processorDetails');
- var propertyDescriptor = details.config.descriptors[dataContext.property];
-
- // show the property description if applicable
- if (nf.Common.isDefinedAndNotNull(propertyDescriptor)) {
- if (!nf.Common.isBlank(propertyDescriptor.description) || !nf.Common.isBlank(propertyDescriptor.defaultValue) || !nf.Common.isBlank(propertyDescriptor.supportsEl)) {
- $('<img class="icon-info" src="images/iconInfo.png" alt="Info" title="" style="float: right; margin-right: 6px; margin-top: 4px;" />').appendTo(cellContent);
- $('<span class="hidden property-descriptor-name"></span>').text(dataContext.property).appendTo(cellContent);
- nameWidthOffset = 26; // 10 + icon width (10) + icon margin (6)
- }
- }
-
- // adjust the width accordingly
- formattedValue.width(columnDef.width - nameWidthOffset).ellipsis();
-
- // return the cell content
- return cellContent.html();
- };
-
- // function for formatting the property value
- var valueFormatter = function (row, cell, value, columnDef, dataContext) {
- var valueMarkup;
- if (nf.Common.isDefinedAndNotNull(value)) {
- // identify the property descriptor
- var processorDetails = $('#processor-configuration').data('processorDetails');
- var propertyDescriptor = processorDetails.config.descriptors[dataContext.property];
-
- // determine if the property is sensitive
- if (nf.ProcessorPropertyTable.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 = nf.ProcessorPropertyTable.getAllowableValues(propertyDescriptor);
- if ($.isArray(allowableValues)) {
- $.each(allowableValues, function (_, allowableValue) {
- if (value === allowableValue.value) {
- value = allowableValue.displayName;
- return false;
- }
- });
- }
-
- if (value === '') {
- valueMarkup = '<span class="table-cell blank">Empty string set</span>';
- } else {
- valueMarkup = '<div class="table-cell value"><pre class="ellipsis">' + nf.Common.escapeHtml(value) + '</pre></div>';
- }
- }
- } else {
- valueMarkup = '<span class="unset">No value set</span>';
- }
-
- // format the contents
- var content = $(valueMarkup);
- if (dataContext.type === 'required') {
- content.addClass('required');
- }
- content.find('.ellipsis').width(columnDef.width - 10).ellipsis();
-
- // return the appropriate markup
- return $('<div/>').append(content).html();
- };
-
- // custom formatter for the actions column
- var actionFormatter = function (row, cell, value, columnDef, dataContext) {
- var markup = '';
-
- // allow user defined properties to be removed
- if (dataContext.type === 'userDefined') {
- markup = '<img src="images/iconDelete.png" title="Delete" class="pointer" style="margin-top: 2px" onclick="javascript:nf.ProcessorPropertyTable.deleteProperty(\'' + row + '\');"/>';
- }
-
- return markup;
- };
-
- var processorConfigurationColumns = [
- {id: 'property', field: 'displayName', name: 'Property', sortable: false, resizable: true, rerenderOnResize: true, formatter: nameFormatter},
- {id: 'value', field: 'value', name: 'Value', sortable: false, resizable: true, cssClass: 'pointer', rerenderOnResize: true, formatter: valueFormatter},
- {id: "actions", name: " ", minWidth: 20, width: 20, formatter: actionFormatter}
- ];
- var processorConfigurationOptions = {
- forceFitColumns: true,
- enableTextSelectionOnCells: true,
- enableCellNavigation: true,
- enableColumnReorder: false,
- editable: true,
- enableAddRow: false,
- autoEdit: false
- };
-
- // initialize the dataview
- var processorConfigurationData = new Slick.Data.DataView({
- inlineFilters: false
- });
- processorConfigurationData.setItems([]);
- processorConfigurationData.setFilterArgs({
- searchString: '',
- property: 'hidden'
- });
- processorConfigurationData.setFilter(filter);
- processorConfigurationData.getItemMetadata = function (index) {
- var item = processorConfigurationData.getItem(index);
-
- // identify the property descriptor
- var processorDetails = $('#processor-configuration').data('processorDetails');
- var propertyDescriptor = processorDetails.config.descriptors[item.property];
-
- // support el if specified or unsure yet (likely a dynamic property)
- if (nf.Common.isUndefinedOrNull(propertyDescriptor) || nf.ProcessorPropertyTable.supportsEl(propertyDescriptor)) {
- return {
- columns: {
- value: {
- editor: nf.ProcessorPropertyNfelEditor
- }
- }
- };
- } else {
- // check for allowable values which will drive which editor to use
- var allowableValues = nf.ProcessorPropertyTable.getAllowableValues(propertyDescriptor);
- if ($.isArray(allowableValues)) {
- return {
- columns: {
- value: {
- editor: nf.ProcessorPropertyComboEditor
- }
- }
- };
- } else {
- return {
- columns: {
- value: {
- editor: nf.ProcessorPropertyTextEditor
- }
- }
- };
- }
- }
- };
-
- // initialize the grid
- var processorConfigurationGrid = new Slick.Grid('#processor-properties', processorConfigurationData, processorConfigurationColumns, processorConfigurationOptions);
- processorConfigurationGrid.setSelectionModel(new Slick.RowSelectionModel());
- processorConfigurationGrid.onClick.subscribe(function (e, args) {
- // edits the clicked cell
- processorConfigurationGrid.gotoCell(args.row, args.cell, true);
-
- // prevents standard edit logic
- e.stopImmediatePropagation();
- });
-
- // wire up the dataview to the grid
- processorConfigurationData.onRowCountChanged.subscribe(function (e, args) {
- processorConfigurationGrid.updateRowCount();
- processorConfigurationGrid.render();
- });
- processorConfigurationData.onRowsChanged.subscribe(function (e, args) {
- processorConfigurationGrid.invalidateRows(args.rows);
- processorConfigurationGrid.render();
- });
-
- // hold onto an instance of the grid and listen for mouse events to add tooltips where appropriate
- $('#processor-properties').data('gridInstance', processorConfigurationGrid).on('mouseenter', 'div.slick-cell', function (e) {
- var infoIcon = $(this).find('img.icon-info');
- if (infoIcon.length && !infoIcon.data('qtip')) {
- var property = $(this).find('span.property-descriptor-name').text();
-
- // get the processor details to insert the description tooltip
- var details = $('#processor-configuration').data('processorDetails');
- var propertyDescriptor = details.config.descriptors[property];
-
- // get the processor history
- var processorHistory = $('#processor-configuration').data('processorHistory');
- var propertyHistory = processorHistory.propertyHistory[property];
-
- // format the tooltip
- var tooltip = nf.Common.formatPropertyTooltip(propertyDescriptor, propertyHistory);
-
- if (nf.Common.isDefinedAndNotNull(tooltip)) {
- infoIcon.qtip($.extend({
- content: tooltip
- }, nf.Common.config.tooltipConfig));
- }
- }
- });
- };
-
- /**
- * Performs the filtering.
- *
- * @param {object} item The item subject to filtering
- * @param {object} args Filter arguments
- * @returns {Boolean} Whether or not to include the item
- */
- var filter = function (item, args) {
- return item.hidden === false;
- };
-
- return {
- config: {
- sensitiveText: 'Sensitive value set'
- },
-
- /**
- * Initializes the property table.
- */
- init: function () {
- initNewPropertyDialog();
- initProcessorPropertiesTable();
- },
-
- /**
- * Determines if the specified property is sensitive.
- *
- * @argument {object} propertyDescriptor The property descriptor
- */
- isSensitiveProperty: function (propertyDescriptor) {
- if (nf.Common.isDefinedAndNotNull(propertyDescriptor)) {
- return propertyDescriptor.sensitive === true;
- } else {
- return false;
- }
- },
-
- /**
- * Determines if the specified property is required.
- *
- * @param {object} propertyDescriptor The property descriptor
- */
- isRequiredProperty: function (propertyDescriptor) {
- if (nf.Common.isDefinedAndNotNull(propertyDescriptor)) {
- return propertyDescriptor.required === true;
- } else {
- return false;
- }
- },
-
- /**
- * Determines if the specified property is required.
- *
- * @param {object} propertyDescriptor The property descriptor
- */
- isDynamicProperty: function (propertyDescriptor) {
- if (nf.Common.isDefinedAndNotNull(propertyDescriptor)) {
- return propertyDescriptor.dynamic === true;
- } else {
- return false;
- }
- },
-
- /**
- * Gets the allowable values for the specified property.
- *
- * @argument {object} propertyDescriptor The property descriptor
- */
- getAllowableValues: function (propertyDescriptor) {
- if (nf.Common.isDefinedAndNotNull(propertyDescriptor)) {
- return propertyDescriptor.allowableValues;
- } else {
- return null;
- }
- },
-
- /**
- * Returns whether the specified property supports EL.
- *
- * @param {object} propertyDescriptor The property descriptor
- */
- supportsEl: function (propertyDescriptor) {
- if (nf.Common.isDefinedAndNotNull(propertyDescriptor)) {
- return propertyDescriptor.supportsEl === true;
- } else {
- return false;
- }
- },
-
- /**
- * Saves the last edited row in the specified grid.
- */
- saveRow: function () {
- // get the property grid to commit the current edit
- var propertyGrid = $('#processor-properties').data('gridInstance');
- if (nf.Common.isDefinedAndNotNull(propertyGrid)) {
- var editController = propertyGrid.getEditController();
- editController.commitCurrentEdit();
- }
- },
-
- /**
- * Cancels the edit in the specified row.
- */
- cancelEdit: function () {
- // get the property grid to reset the current edit
- var propertyGrid = $('#processor-properties').data('gridInstance');
- if (nf.Common.isDefinedAndNotNull(propertyGrid)) {
- var editController = propertyGrid.getEditController();
- editController.cancelCurrentEdit();
- }
- },
-
- /**
- * Deletes the property in the specified row.
- *
- * @argument {string} row The row
- */
- deleteProperty: function (row) {
- var propertyGrid = $('#processor-properties').data('gridInstance');
- if (nf.Common.isDefinedAndNotNull(propertyGrid)) {
- var propertyData = propertyGrid.getData();
-
- // update the property in question
- var property = propertyData.getItem(row);
- property.hidden = true;
-
- // refresh the table
- propertyData.updateItem(property.id, property);
- }
- },
-
- /**
- * Update the size of the grid based on its container's current size.
- */
- resetTableSize: function () {
- var propertyGrid = $('#processor-properties').data('gridInstance');
- if (nf.Common.isDefinedAndNotNull(propertyGrid)) {
- propertyGrid.resizeCanvas();
- }
- },
-
- /**
- * Loads the specified properties.
- *
- * @argument {object} properties The properties
- * @argument {map} descriptors The property descriptors (property name -> property descriptor)
- */
- loadProperties: function (properties, descriptors) {
- // get the property grid
- var propertyGrid = $('#processor-properties').data('gridInstance');
- var propertyData = propertyGrid.getData();
-
- // generate the processor properties
- if (nf.Common.isDefinedAndNotNull(properties)) {
- propertyData.beginUpdate();
-
- var i = 0;
- $.each(properties, function (name, value) {
- // get the property descriptor
- var descriptor = descriptors[name];
-
- // determine the property type
- var type = 'userDefined';
- var displayName = name;
- if (nf.Common.isDefinedAndNotNull(descriptor)) {
- if (nf.ProcessorPropertyTable.isRequiredProperty(descriptor)) {
- type = 'required';
- } else if (nf.ProcessorPropertyTable.isDynamicProperty(descriptor)) {
- type = 'userDefined';
- } else {
- type = 'optional';
- }
-
- // use the display name if possible
- displayName = descriptor.displayName;
-
- // determine the value
- if (nf.Common.isNull(value) && nf.Common.isDefinedAndNotNull(descriptor.defaultValue)) {
- value = descriptor.defaultValue;
- }
- }
-
- // add the row
- propertyData.addItem({
- id: i++,
- hidden: false,
- property: name,
- displayName: displayName,
- previousValue: value,
- value: value,
- type: type
- });
- });
-
- propertyData.endUpdate();
- }
- },
-
- /**
- * Determines if a save is required.
- */
- isSaveRequired: function () {
- // get the property grid
- var propertyGrid = $('#processor-properties').data('gridInstance');
- var propertyData = propertyGrid.getData();
-
- // determine if any of the processor properties have changed
- var isSaveRequired = false;
- $.each(propertyData.getItems(), function () {
- if (this.value !== this.previousValue) {
- isSaveRequired = true;
- return false;
- }
- });
- return isSaveRequired;
- },
-
- /**
- * Marshal's the properties to send to the server.
- */
- marshalProperties: function () {
- // properties
- var properties = {};
-
- // get the property grid data
- var propertyGrid = $('#processor-properties').data('gridInstance');
- var propertyData = propertyGrid.getData();
- $.each(propertyData.getItems(), function () {
- if (this.hidden === true) {
- properties[this.property] = null;
- } else if (this.value !== this.previousValue) {
- properties[this.property] = this.value;
- }
- });
-
- return properties;
- },
-
- /**
- * Clears the property table.
- */
- clear: function () {
- var propertyGridElement = $('#processor-properties');
-
- // clean up any tooltips that may have been generated
- nf.Common.cleanUpTooltips(propertyGridElement, 'img.icon-info');
-
- // clear the data in the grid
- var propertyGrid = propertyGridElement.data('gridInstance');
- var propertyData = propertyGrid.getData();
- propertyData.setItems([]);
- }
- };
-}());
\ No newline at end of file