[GitHub] nifi pull request: NIFI-1908 Added encoding-version attribute to T...

2016-05-30 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/nifi/pull/471


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request: NIFI-1908 Added encoding-version attribute to T...

2016-05-30 Thread mcgilman
Github user mcgilman commented on the pull request:

https://github.com/apache/nifi/pull/471#issuecomment-222539446
  
Other changes look good! Will merge to master. 

During my testing of a 1.x template in an 0.x instance I discovered a 
separate issue that the templates from an 1.x instance are currently not 
including the child group contents. I've created a new JIRA to address this 
issue [1]. Testing with a sub-group-less 1.x template worked fine in a 0.x 
instance.

[1] https://issues.apache.org/jira/browse/NIFI-1941


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request: NIFI-1908 Added encoding-version attribute to T...

2016-05-30 Thread mcgilman
Github user mcgilman commented on a diff in the pull request:

https://github.com/apache/nifi/pull/471#discussion_r65097776
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
 ---
@@ -1354,55 +1349,55 @@ private void validateSnippetContents(final 
FlowSnippetDTO flow) {
 @Override
 public FlowEntity copySnippet(final String groupId, final String 
snippetId, final Double originX, final Double originY, final String 
idGenerationSeed) {
 final FlowDTO flowDto = revisionManager.get(groupId,
-rev -> {
-// create the new snippet
-final FlowSnippetDTO snippet = 
snippetDAO.copySnippet(groupId, snippetId, originX, originY, idGenerationSeed);
-
-// validate the new snippet
-validateSnippetContents(snippet);
+rev -> {
+// create the new snippet
+final FlowSnippetDTO snippet = 
snippetDAO.copySnippet(groupId, snippetId, originX, originY, idGenerationSeed);
 
-// save the flow
-controllerFacade.save();
-
-// drop the snippet
-snippetDAO.dropSnippet(snippetId);
+// validate the new snippet
+validateSnippetContents(snippet);
 
-// identify all components added
-final Set identifiers = new HashSet<>();
-snippet.getProcessors().stream()
-.map(proc -> proc.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getConnections().stream()
-.map(conn -> conn.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getInputPorts().stream()
-.map(port -> port.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getOutputPorts().stream()
-.map(port -> port.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getProcessGroups().stream()
-.map(group -> group.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getRemoteProcessGroups().stream()
-.map(remoteGroup -> remoteGroup.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getRemoteProcessGroups().stream()
-.flatMap(remoteGroup -> 
remoteGroup.getContents().getInputPorts().stream())
-.map(remoteInputPort -> remoteInputPort.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getRemoteProcessGroups().stream()
-.flatMap(remoteGroup -> 
remoteGroup.getContents().getOutputPorts().stream())
-.map(remoteOutputPort -> remoteOutputPort.getId())
-.forEach(id -> identifiers.add(id));
+// save the flow
+controllerFacade.save();
 
-final ProcessGroup processGroup = 
processGroupDAO.getProcessGroup(groupId);
-return revisionManager.get(identifiers,
-() -> {
-final ProcessGroupStatus groupStatus = 
controllerFacade.getProcessGroupStatus(groupId);
-return dtoFactory.createFlowDto(processGroup, 
groupStatus, snippet, revisionManager);
-});
-});
+// drop the snippet
+snippetDAO.dropSnippet(snippetId);
+
+// identify all components added
+final Set identifiers = new HashSet<>();
+snippet.getProcessors().stream()
+.map(proc -> proc.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getConnections().stream()
+.map(conn -> conn.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getInputPorts().stream()
+.map(port -> port.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getOutputPorts().stream()
+.map(port -> port.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getProcessGroups().stream()
+.map(group -> group.getId())
+.forEach(id -> identifiers.add(id));
   

[GitHub] nifi pull request: NIFI-1908 Added encoding-version attribute to T...

2016-05-30 Thread mcgilman
Github user mcgilman commented on a diff in the pull request:

https://github.com/apache/nifi/pull/471#discussion_r65096361
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
 ---
@@ -1354,55 +1349,55 @@ private void validateSnippetContents(final 
FlowSnippetDTO flow) {
 @Override
 public FlowEntity copySnippet(final String groupId, final String 
snippetId, final Double originX, final Double originY, final String 
idGenerationSeed) {
 final FlowDTO flowDto = revisionManager.get(groupId,
-rev -> {
-// create the new snippet
-final FlowSnippetDTO snippet = 
snippetDAO.copySnippet(groupId, snippetId, originX, originY, idGenerationSeed);
-
-// validate the new snippet
-validateSnippetContents(snippet);
+rev -> {
+// create the new snippet
+final FlowSnippetDTO snippet = 
snippetDAO.copySnippet(groupId, snippetId, originX, originY, idGenerationSeed);
 
-// save the flow
-controllerFacade.save();
-
-// drop the snippet
-snippetDAO.dropSnippet(snippetId);
+// validate the new snippet
+validateSnippetContents(snippet);
 
-// identify all components added
-final Set identifiers = new HashSet<>();
-snippet.getProcessors().stream()
-.map(proc -> proc.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getConnections().stream()
-.map(conn -> conn.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getInputPorts().stream()
-.map(port -> port.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getOutputPorts().stream()
-.map(port -> port.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getProcessGroups().stream()
-.map(group -> group.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getRemoteProcessGroups().stream()
-.map(remoteGroup -> remoteGroup.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getRemoteProcessGroups().stream()
-.flatMap(remoteGroup -> 
remoteGroup.getContents().getInputPorts().stream())
-.map(remoteInputPort -> remoteInputPort.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getRemoteProcessGroups().stream()
-.flatMap(remoteGroup -> 
remoteGroup.getContents().getOutputPorts().stream())
-.map(remoteOutputPort -> remoteOutputPort.getId())
-.forEach(id -> identifiers.add(id));
+// save the flow
+controllerFacade.save();
 
-final ProcessGroup processGroup = 
processGroupDAO.getProcessGroup(groupId);
-return revisionManager.get(identifiers,
-() -> {
-final ProcessGroupStatus groupStatus = 
controllerFacade.getProcessGroupStatus(groupId);
-return dtoFactory.createFlowDto(processGroup, 
groupStatus, snippet, revisionManager);
-});
-});
+// drop the snippet
+snippetDAO.dropSnippet(snippetId);
+
+// identify all components added
+final Set identifiers = new HashSet<>();
+snippet.getProcessors().stream()
+.map(proc -> proc.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getConnections().stream()
+.map(conn -> conn.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getInputPorts().stream()
+.map(port -> port.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getOutputPorts().stream()
+.map(port -> port.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getProcessGroups().stream()
+.map(group -> group.getId())
+.forEach(id -> identifiers.add(id));
   

[GitHub] nifi pull request: NIFI-1908 Added encoding-version attribute to T...

2016-05-30 Thread jtstorck
Github user jtstorck commented on a diff in the pull request:

https://github.com/apache/nifi/pull/471#discussion_r65096222
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
 ---
@@ -1354,55 +1349,55 @@ private void validateSnippetContents(final 
FlowSnippetDTO flow) {
 @Override
 public FlowEntity copySnippet(final String groupId, final String 
snippetId, final Double originX, final Double originY, final String 
idGenerationSeed) {
 final FlowDTO flowDto = revisionManager.get(groupId,
-rev -> {
-// create the new snippet
-final FlowSnippetDTO snippet = 
snippetDAO.copySnippet(groupId, snippetId, originX, originY, idGenerationSeed);
-
-// validate the new snippet
-validateSnippetContents(snippet);
+rev -> {
+// create the new snippet
+final FlowSnippetDTO snippet = 
snippetDAO.copySnippet(groupId, snippetId, originX, originY, idGenerationSeed);
 
-// save the flow
-controllerFacade.save();
-
-// drop the snippet
-snippetDAO.dropSnippet(snippetId);
+// validate the new snippet
+validateSnippetContents(snippet);
 
-// identify all components added
-final Set identifiers = new HashSet<>();
-snippet.getProcessors().stream()
-.map(proc -> proc.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getConnections().stream()
-.map(conn -> conn.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getInputPorts().stream()
-.map(port -> port.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getOutputPorts().stream()
-.map(port -> port.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getProcessGroups().stream()
-.map(group -> group.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getRemoteProcessGroups().stream()
-.map(remoteGroup -> remoteGroup.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getRemoteProcessGroups().stream()
-.flatMap(remoteGroup -> 
remoteGroup.getContents().getInputPorts().stream())
-.map(remoteInputPort -> remoteInputPort.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getRemoteProcessGroups().stream()
-.flatMap(remoteGroup -> 
remoteGroup.getContents().getOutputPorts().stream())
-.map(remoteOutputPort -> remoteOutputPort.getId())
-.forEach(id -> identifiers.add(id));
+// save the flow
+controllerFacade.save();
 
-final ProcessGroup processGroup = 
processGroupDAO.getProcessGroup(groupId);
-return revisionManager.get(identifiers,
-() -> {
-final ProcessGroupStatus groupStatus = 
controllerFacade.getProcessGroupStatus(groupId);
-return dtoFactory.createFlowDto(processGroup, 
groupStatus, snippet, revisionManager);
-});
-});
+// drop the snippet
+snippetDAO.dropSnippet(snippetId);
+
+// identify all components added
+final Set identifiers = new HashSet<>();
+snippet.getProcessors().stream()
+.map(proc -> proc.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getConnections().stream()
+.map(conn -> conn.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getInputPorts().stream()
+.map(port -> port.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getOutputPorts().stream()
+.map(port -> port.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getProcessGroups().stream()
+.map(group -> group.getId())
+.forEach(id -> identifiers.add(id));
   

[GitHub] nifi pull request: NIFI-1908 Added encoding-version attribute to T...

2016-05-30 Thread mcgilman
Github user mcgilman commented on a diff in the pull request:

https://github.com/apache/nifi/pull/471#discussion_r65095238
  
--- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
 ---
@@ -1354,55 +1349,55 @@ private void validateSnippetContents(final 
FlowSnippetDTO flow) {
 @Override
 public FlowEntity copySnippet(final String groupId, final String 
snippetId, final Double originX, final Double originY, final String 
idGenerationSeed) {
 final FlowDTO flowDto = revisionManager.get(groupId,
-rev -> {
-// create the new snippet
-final FlowSnippetDTO snippet = 
snippetDAO.copySnippet(groupId, snippetId, originX, originY, idGenerationSeed);
-
-// validate the new snippet
-validateSnippetContents(snippet);
+rev -> {
+// create the new snippet
+final FlowSnippetDTO snippet = 
snippetDAO.copySnippet(groupId, snippetId, originX, originY, idGenerationSeed);
 
-// save the flow
-controllerFacade.save();
-
-// drop the snippet
-snippetDAO.dropSnippet(snippetId);
+// validate the new snippet
+validateSnippetContents(snippet);
 
-// identify all components added
-final Set identifiers = new HashSet<>();
-snippet.getProcessors().stream()
-.map(proc -> proc.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getConnections().stream()
-.map(conn -> conn.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getInputPorts().stream()
-.map(port -> port.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getOutputPorts().stream()
-.map(port -> port.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getProcessGroups().stream()
-.map(group -> group.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getRemoteProcessGroups().stream()
-.map(remoteGroup -> remoteGroup.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getRemoteProcessGroups().stream()
-.flatMap(remoteGroup -> 
remoteGroup.getContents().getInputPorts().stream())
-.map(remoteInputPort -> remoteInputPort.getId())
-.forEach(id -> identifiers.add(id));
-snippet.getRemoteProcessGroups().stream()
-.flatMap(remoteGroup -> 
remoteGroup.getContents().getOutputPorts().stream())
-.map(remoteOutputPort -> remoteOutputPort.getId())
-.forEach(id -> identifiers.add(id));
+// save the flow
+controllerFacade.save();
 
-final ProcessGroup processGroup = 
processGroupDAO.getProcessGroup(groupId);
-return revisionManager.get(identifiers,
-() -> {
-final ProcessGroupStatus groupStatus = 
controllerFacade.getProcessGroupStatus(groupId);
-return dtoFactory.createFlowDto(processGroup, 
groupStatus, snippet, revisionManager);
-});
-});
+// drop the snippet
+snippetDAO.dropSnippet(snippetId);
+
+// identify all components added
+final Set identifiers = new HashSet<>();
+snippet.getProcessors().stream()
+.map(proc -> proc.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getConnections().stream()
+.map(conn -> conn.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getInputPorts().stream()
+.map(port -> port.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getOutputPorts().stream()
+.map(port -> port.getId())
+.forEach(id -> identifiers.add(id));
+snippet.getProcessGroups().stream()
+.map(group -> group.getId())
+.forEach(id -> identifiers.add(id));
   

[GitHub] nifi pull request: NIFI-1908 Added encoding-version attribute to T...

2016-05-27 Thread mcgilman
Github user mcgilman commented on the pull request:

https://github.com/apache/nifi/pull/471#issuecomment-12578
  
Reviewing...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] nifi pull request: NIFI-1908 Added encoding-version attribute to T...

2016-05-27 Thread jtstorck
GitHub user jtstorck opened a pull request:

https://github.com/apache/nifi/pull/471

NIFI-1908 Added encoding-version attribute to TemplateDTO

added scaling of templates upon instantiation for placement on the canvas
added template-0.7.0.xml for live-testing the import of templates

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jtstorck/nifi NIFI-1908

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/nifi/pull/471.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #471


commit bee475818864514fad8fa647f67fee99b58647f6
Author: Jeff Storck 
Date:   2016-05-20T20:32:33Z

NIFI-1908 Added encoding-version attribute to TemplateDTO
added scaling of templates upon instantiation for placement on the canvas
added template-0.7.0.xml for live-testing the import of templates




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---