Repository: incubator-nifi
Updated Branches:
  refs/heads/NIFI-250 dbaa219df -> 80b8c6024


NIFI-250:
- Updating custom UIs to support both old (deprecated) and new models.
- Ensuring the annotation data is populated in outgoing DTOs.
- Ensuring the component type is populated in the details for custom UIs.
- Renaming the js module for custom UIs to exclude the reference to processors.

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

Branch: refs/heads/NIFI-250
Commit: 691b4617d5568cd9a28f38d081b85d233ccbea44
Parents: dbaa219
Author: Matt Gilman <[email protected]>
Authored: Tue Mar 24 08:57:34 2015 -0400
Committer: Matt Gilman <[email protected]>
Committed: Tue Mar 24 08:57:34 2015 -0400

----------------------------------------------------------------------
 .../StandardNiFiWebConfigurationContext.java    |  3 ++
 .../org/apache/nifi/web/api/dto/DtoFactory.java |  2 +
 .../nifi-framework/nifi-web/nifi-web-ui/pom.xml |  2 +-
 .../main/resources/filters/canvas.properties    |  2 +-
 .../js/nf/canvas/nf-controller-service.js       |  6 +--
 .../js/nf/canvas/nf-custom-processor-ui.js      | 46 -------------------
 .../main/webapp/js/nf/canvas/nf-custom-ui.js    | 47 ++++++++++++++++++++
 .../js/nf/canvas/nf-processor-configuration.js  |  2 +-
 .../webapp/js/nf/canvas/nf-reporting-task.js    |  6 +--
 .../main/webapp/js/nf/nf-processor-details.js   |  4 +-
 10 files changed, 63 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/691b4617/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiWebConfigurationContext.java
----------------------------------------------------------------------
diff --git 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiWebConfigurationContext.java
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiWebConfigurationContext.java
index 1d99b4e..eb4b81e 100644
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiWebConfigurationContext.java
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiWebConfigurationContext.java
@@ -365,6 +365,7 @@ public class StandardNiFiWebConfigurationContext implements 
NiFiWebConfiguration
             return new ComponentDetails.Builder()
                     .id(processor.getId())
                     .name(processor.getName())
+                    .type(processor.getType())
                     .state(processor.getState())
                     .annotationData(processorConfig.getAnnotationData())
                     .properties(processorConfig.getProperties())
@@ -474,6 +475,7 @@ public class StandardNiFiWebConfigurationContext implements 
NiFiWebConfiguration
             return new ComponentDetails.Builder()
                     .id(controllerService.getId())
                     .name(controllerService.getName())
+                    .type(controllerService.getType())
                     .state(controllerService.getState())
                     .annotationData(controllerService.getAnnotationData())
                     .properties(controllerService.getProperties())
@@ -583,6 +585,7 @@ public class StandardNiFiWebConfigurationContext implements 
NiFiWebConfiguration
             return new ComponentDetails.Builder()
                     .id(reportingTask.getId())
                     .name(reportingTask.getName())
+                    .type(reportingTask.getType())
                     .state(reportingTask.getState())
                     .annotationData(reportingTask.getAnnotationData())
                     .properties(reportingTask.getProperties())

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/691b4617/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
----------------------------------------------------------------------
diff --git 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
index 93d4dc9..dcf4f84 100644
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
@@ -847,6 +847,7 @@ public final class DtoFactory {
         dto.setSchedulingPeriod(reportingTaskNode.getSchedulingPeriod());
         dto.setState(reportingTaskNode.getScheduledState().name());
         dto.setActiveThreadCount(reportingTaskNode.getActiveThreadCount());
+        dto.setAnnotationData(reportingTaskNode.getAnnotationData());
 //        dto.setComments(reportingTaskNode.getComments());
 
         final Map<String, String> defaultSchedulingPeriod = new HashMap<>();
@@ -913,6 +914,7 @@ public final class DtoFactory {
         dto.setName(controllerServiceNode.getName());
         
dto.setType(controllerServiceNode.getControllerServiceImplementation().getClass().getName());
         dto.setState(controllerServiceNode.getState().name());
+        dto.setAnnotationData(controllerServiceNode.getAnnotationData());
         dto.setComments(controllerServiceNode.getComments());
         
         // sort a copy of the properties

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/691b4617/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml
----------------------------------------------------------------------
diff --git 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml
index f2ce074..f2d4861 100644
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/pom.xml
@@ -265,7 +265,7 @@
                                                 
<include>${staging.dir}/js/nf/canvas/nf-storage.js</include>
                                                 
<include>${staging.dir}/js/nf/canvas/nf-snippet.js</include>
                                                 
<include>${staging.dir}/js/nf/canvas/nf-canvas-toolbox.js</include>
-                                                
<include>${staging.dir}/js/nf/canvas/nf-custom-processor-ui.js</include>
+                                                
<include>${staging.dir}/js/nf/canvas/nf-custom-ui.js</include>
                                                 
<include>${staging.dir}/js/nf/canvas/nf-registration.js</include>
                                                 
<include>${staging.dir}/js/nf/canvas/nf-controller-service.js</include>
                                                 
<include>${staging.dir}/js/nf/canvas/nf-reporting-task.js</include>

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/691b4617/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/canvas.properties
----------------------------------------------------------------------
diff --git 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/canvas.properties
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/canvas.properties
index eae97e0..fd2bc17 100644
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/canvas.properties
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/resources/filters/canvas.properties
@@ -22,7 +22,7 @@ nf.canvas.script.tags=<script type="text/javascript" 
src="js/nf/nf-namespace.js?
 <script type="text/javascript" 
src="js/nf/canvas/nf-storage.js?${project.version}"></script>\n\
 <script type="text/javascript" 
src="js/nf/canvas/nf-snippet.js?${project.version}"></script>\n\
 <script type="text/javascript" 
src="js/nf/canvas/nf-canvas-toolbox.js?${project.version}"></script>\n\
-<script type="text/javascript" 
src="js/nf/canvas/nf-custom-processor-ui.js?${project.version}"></script>\n\
+<script type="text/javascript" 
src="js/nf/canvas/nf-custom-ui.js?${project.version}"></script>\n\
 <script type="text/javascript" 
src="js/nf/canvas/nf-registration.js?${project.version}"></script>\n\
 <script type="text/javascript" 
src="js/nf/canvas/nf-controller-service.js?${project.version}"></script>\n\
 <script type="text/javascript" 
src="js/nf/canvas/nf-reporting-task.js?${project.version}"></script>\n\

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/691b4617/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
----------------------------------------------------------------------
diff --git 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
index e949987..e5956bc 100644
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-controller-service.js
@@ -1353,7 +1353,7 @@ nf.ControllerService = (function () {
                                     $('#shell-close-button').click();
                     
                                     // show the custom ui
-                                    
nf.CustomProcessorUi.showCustomUi($('#controller-service-id').text(), 
controllerService.customUiUrl, true).done(function () {
+                                    
nf.CustomUi.showCustomUi($('#controller-service-id').text(), 
controllerService.customUiUrl, true).done(function () {
                                         // once the custom ui is closed, 
reload the controller service
                                         
reloadControllerService(controllerService);
                                     });
@@ -1496,7 +1496,7 @@ nf.ControllerService = (function () {
                     }];
 
                 // determine if we should show the advanced button
-                if (nf.Common.isDefinedAndNotNull(nf.CustomProcessorUi) && 
nf.Common.isDefinedAndNotNull(controllerService.customUiUrl) && 
controllerService.customUiUrl !== '') {
+                if (nf.Common.isDefinedAndNotNull(nf.CustomUi) && 
nf.Common.isDefinedAndNotNull(controllerService.customUiUrl) && 
controllerService.customUiUrl !== '') {
                     buttons.push({
                         buttonText: 'Advanced',
                         handler: {
@@ -1505,7 +1505,7 @@ nf.ControllerService = (function () {
                                 controllerServiceDialog.modal('hide');
 
                                 // show the custom ui
-                                
nf.CustomProcessorUi.showCustomUi(controllerService.id, 
controllerService.customUiUrl, false);
+                                nf.CustomUi.showCustomUi(controllerService.id, 
controllerService.customUiUrl, false);
                             }
                         }
                     });

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/691b4617/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-custom-processor-ui.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-custom-processor-ui.js
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-custom-processor-ui.js
deleted file mode 100644
index adbf9c2..0000000
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-custom-processor-ui.js
+++ /dev/null
@@ -1,46 +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.
- */
-
-/* global nf */
-
-nf.CustomProcessorUi = {
-    /**
-     * Shows the custom ui.
-     * 
-     * @argument {string} processorId       The processor id
-     * @argument {string} uri               The uri for the custom ui
-     * @argument {boolean} editable         Whether the custom ui should 
support editing
-     */
-    showCustomUi: function (processorId, uri, editable) {
-
-        // record the processor id
-        $('#shell-close-button');
-
-        var revision = nf.Client.getRevision();
-
-        // build the customer ui params
-        var customUiParams = {
-            'processorId': processorId,
-            'revision': revision.version,
-            'clientId': revision.clientId,
-            'editable': editable
-        };
-
-        // show the shell
-        return nf.Shell.showPage('..' + uri + '?' + $.param(customUiParams), 
false);
-    }
-};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/691b4617/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-custom-ui.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-custom-ui.js
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-custom-ui.js
new file mode 100644
index 0000000..365831a
--- /dev/null
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-custom-ui.js
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+/* global nf */
+
+nf.CustomUi = {
+    /**
+     * Shows the custom ui.
+     * 
+     * @argument {string} id       The component id
+     * @argument {string} uri               The uri for the custom ui
+     * @argument {boolean} editable         Whether the custom ui should 
support editing
+     */
+    showCustomUi: function (id, uri, editable) {
+
+        // record the processor id
+        $('#shell-close-button');
+
+        var revision = nf.Client.getRevision();
+
+        // build the customer ui params
+        var customUiParams = {
+            'id': id,
+            'processorId': id,                  // deprecated
+            'revision': revision.version,
+            'clientId': revision.clientId,
+            'editable': editable
+        };
+
+        // show the shell
+        return nf.Shell.showPage('..' + uri + '?' + $.param(customUiParams), 
false);
+    }
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/691b4617/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 9045829..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
@@ -673,7 +673,7 @@ nf.ProcessorConfiguration = (function () {
                                         
$('#processor-configuration').modal('hide');
 
                                         // show the custom ui
-                                        
nf.CustomProcessorUi.showCustomUi($('#processor-id').text(), 
processor.config.customUiUrl, true).done(function () {
+                                        
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);
 

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/691b4617/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.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-reporting-task.js
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js
index 9719578..7770df3 100644
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-reporting-task.js
@@ -458,7 +458,7 @@ nf.ReportingTask = (function () {
                                     $('#shell-close-button').click();
 
                                     // show the custom ui
-                                    
nf.CustomProcessorUi.showCustomUi($('#reporting-task-id').text(), 
reportingTask.customUiUrl, true).done(function () {
+                                    
nf.CustomUi.showCustomUi($('#reporting-task-id').text(), 
reportingTask.customUiUrl, true).done(function () {
                                         // once the custom ui is closed, 
reload the reporting task
                                         reloadReportingTask(reportingTask);
                                     });
@@ -598,7 +598,7 @@ nf.ReportingTask = (function () {
                     }];
 
                 // determine if we should show the advanced button
-                if (nf.Common.isDefinedAndNotNull(nf.CustomProcessorUi) && 
nf.Common.isDefinedAndNotNull(reportingTask.customUiUrl) && 
reportingTask.customUiUrl !== '') {
+                if (nf.Common.isDefinedAndNotNull(nf.CustomUi) && 
nf.Common.isDefinedAndNotNull(reportingTask.customUiUrl) && 
reportingTask.customUiUrl !== '') {
                     buttons.push({
                         buttonText: 'Advanced',
                         handler: {
@@ -607,7 +607,7 @@ nf.ReportingTask = (function () {
                                 reportingTaskDialog.modal('hide');
 
                                 // show the custom ui
-                                
nf.CustomProcessorUi.showCustomUi(reportingTask.id, reportingTask.customUiUrl, 
false);
+                                nf.CustomUi.showCustomUi(reportingTask.id, 
reportingTask.customUiUrl, false);
                             }
                         }
                     });

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/691b4617/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js
----------------------------------------------------------------------
diff --git 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js
index abf4dc2..76d9e53 100644
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js
@@ -226,7 +226,7 @@ nf.ProcessorDetails = (function () {
                     }];
 
                 // determine if we should show the advanced button
-                if (nf.Common.isDefinedAndNotNull(nf.CustomProcessorUi) && 
nf.Common.isDefinedAndNotNull(processor.config.customUiUrl) && 
processor.config.customUiUrl !== '') {
+                if (nf.Common.isDefinedAndNotNull(nf.CustomUi) && 
nf.Common.isDefinedAndNotNull(processor.config.customUiUrl) && 
processor.config.customUiUrl !== '') {
                     buttons.push({
                         buttonText: 'Advanced',
                         handler: {
@@ -235,7 +235,7 @@ nf.ProcessorDetails = (function () {
                                 $('#processor-details').modal('hide');
 
                                 // show the custom ui
-                                
nf.CustomProcessorUi.showCustomUi(processor.id, processor.config.customUiUrl, 
false);
+                                nf.CustomUi.showCustomUi(processor.id, 
processor.config.customUiUrl, false);
                             }
                         }
                     });

Reply via email to