[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2019-02-28 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16780883#comment-16780883
 ] 

ASF subversion and git services commented on NIFI-5859:
---

Commit 5249a85030eafb5db63650fadbc2c03d257e7cc0 in nifi's branch 
refs/heads/master from Bryan Bende
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=5249a85 ]

NIFI-5859 Modifications to extension manifest generation to better support 
unmarshalling XML into pojos

- Fixing doc generation for providedServiceAPIs

This closes #3338.

Signed-off-by: Kevin Doran 


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
> Fix For: nifi-nar-maven-plugin-1.2.1
>
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2019-02-13 Thread Kevin Doran (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16767579#comment-16767579
 ] 

Kevin Doran commented on NIFI-5859:
---

[~joewitt] thanks for catching. updated the fix version

> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
> Fix For: nifi-nar-maven-plugin-1.2.1
>
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2019-02-13 Thread Joseph Witt (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16767577#comment-16767577
 ] 

Joseph Witt commented on NIFI-5859:
---

[~kdoran] Any JIRA we resolve through code commits/etc.. we should specify what 
the fix version is for it so when the release happens the rel notes will have 
it.  If there isn't a fix version for this we can create one.


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2019-02-12 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16766238#comment-16766238
 ] 

ASF subversion and git services commented on NIFI-5859:
---

Commit 7278a3970d0a397564dd08dd89c770d6d14820ae in nifi's branch 
refs/heads/master from Bryan Bende
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=7278a39 ]

NIFI-5859 Add nifi-api dependency to nifi-jetty-bundle pom so the NAR Maven 
plugin will know the api version

Signed-off-by: Kevin Doran 

This closes #3291.


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-12-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16715535#comment-16715535
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user bbende commented on a diff in the pull request:

https://github.com/apache/nifi-maven/pull/7#discussion_r240308506
  
--- Diff: src/main/java/org/apache/nifi/NarMojo.java ---
@@ -426,12 +479,260 @@
 protected boolean cloneDuringInstanceClassLoading;
 
 
+/**
+ * The {@link RepositorySystemSession} used for obtaining the local 
and remote artifact repositories.
+ */
+@Parameter(defaultValue = "${repositorySystemSession}", readonly = 
true)
+private RepositorySystemSession repoSession;
+
+
+/**
+ * The {@link ProjectBuilder} used to generate the {@link 
MavenProject} for the nar artifact the dependency tree is being generated for.
+ */
+@Component
+private ProjectBuilder projectBuilder;
+
+
+
 @Override
-public void execute() throws MojoExecutionException, 
MojoFailureException {
+public void execute() throws MojoExecutionException {
 copyDependencies();
+
+try {
+generateDocumentation();
--- End diff --

Could we add an optional property like "enforceDocGeneration" (or some 
better name) that when true we would let the exception be thrown here to fail 
the build?

The use-case would be to know that when doing a release we have 
successfully generated the docs if the build passed. Right now it can silently 
fail with a warning and you'd have to manually inspect every NAR to really know.


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-12-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16715538#comment-16715538
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user bbende commented on a diff in the pull request:

https://github.com/apache/nifi-maven/pull/7#discussion_r240314647
  
--- Diff: src/main/java/org/apache/nifi/XmlDefinitionWriter.java ---
@@ -0,0 +1,165 @@
+/*
+ * 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.
+ */
+package org.apache.nifi;
+
+import org.apache.nifi.extension.definition.ExtensionDefinition;
+import org.apache.nifi.extension.definition.ExtensionType;
+import org.apache.nifi.extension.definition.Restriction;
+import org.apache.nifi.extension.definition.Restrictions;
+import org.apache.nifi.extension.definition.ServiceAPIDefinition;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+public class XmlDefinitionWriter {
--- End diff --

Can this be removed now that we are using the classes from nifi-api? 


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-12-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16715537#comment-16715537
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user bbende commented on a diff in the pull request:

https://github.com/apache/nifi-maven/pull/7#discussion_r240314701
  
--- Diff: src/main/java/org/apache/nifi/PropertiesDefinitionWriter.java ---
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+package org.apache.nifi;
+
+import org.apache.nifi.extension.definition.ExtensionDefinition;
+import org.apache.nifi.extension.definition.Restriction;
+import org.apache.nifi.extension.definition.Restrictions;
+import org.apache.nifi.extension.definition.ServiceAPIDefinition;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Objects;
+import java.util.Properties;
+
+public class PropertiesDefinitionWriter {
--- End diff --

Can this be removed now that we are using the classes from nifi-api? 


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-12-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16715540#comment-16715540
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user bbende commented on a diff in the pull request:

https://github.com/apache/nifi-maven/pull/7#discussion_r240310495
  
--- Diff: src/main/java/org/apache/nifi/NarMojo.java ---
@@ -426,12 +479,260 @@
 protected boolean cloneDuringInstanceClassLoading;
 
 
+/**
+ * The {@link RepositorySystemSession} used for obtaining the local 
and remote artifact repositories.
+ */
+@Parameter(defaultValue = "${repositorySystemSession}", readonly = 
true)
+private RepositorySystemSession repoSession;
+
+
+/**
+ * The {@link ProjectBuilder} used to generate the {@link 
MavenProject} for the nar artifact the dependency tree is being generated for.
+ */
+@Component
+private ProjectBuilder projectBuilder;
+
+
+
 @Override
-public void execute() throws MojoExecutionException, 
MojoFailureException {
+public void execute() throws MojoExecutionException {
 copyDependencies();
+
+try {
+generateDocumentation();
+} catch (final Throwable t) { // Catch Throwable in case a linkage 
error such as NoClassDefFoundError occurs
+getLog().warn("Could not generate extensions' documentation", 
t);
+}
+
 makeNar();
 }
 
+private File getExtensionsDocumentationFile() {
+final File directory = new File(projectBuildDirectory, 
"META-INF/docs");
+return new File(directory, "extension-docs.xml");
+}
+
+private void generateDocumentation() throws MojoExecutionException {
+getLog().info("Generating documentation for NiFi extensions in the 
NAR...");
+
+// Create the ClassLoader for the NAR
+final ExtensionClassLoaderFactory classLoaderFactory = 
createClassLoaderFactory();
+
+final ExtensionClassLoader extensionClassLoader;
+try {
+extensionClassLoader = 
classLoaderFactory.createExtensionClassLoader();
+} catch (final Exception e) {
+if (getLog().isDebugEnabled()) {
+getLog().debug("Unable to create a ClassLoader for 
documenting extensions. If this NAR contains any NiFi Extensions, those 
extensions will not be documented.", e);
+} else {
+getLog().warn("Unable to create a ClassLoader for 
documenting extensions. If this NAR contains any NiFi Extensions, those 
extensions will not be documented. " +
+"Enable mvn DEBUG output for more information (mvn 
-X).");
+}
+
+return;
+}
+
+
+final File docsFile = getExtensionsDocumentationFile();
+createDirectory(docsFile.getParentFile());
+
+final File additionalDetailsDir = new 
File(docsFile.getParentFile(), "additional-details");
+createDirectory(additionalDetailsDir);
+
+try (final OutputStream out = new FileOutputStream(docsFile)) {
+
+final XMLStreamWriter xmlWriter = 
XMLOutputFactory.newInstance().createXMLStreamWriter(out, "UTF-8");
+try {
+xmlWriter.writeStartElement("extensions");
+
+final String nifiApiVersion = 
extensionClassLoader.getNiFiApiVersion();
+xmlWriter.writeStartElement("nifiApiVersion");
+xmlWriter.writeCharacters(nifiApiVersion);
+xmlWriter.writeEndElement();
+
+final Class docWriterClass;
+try {
+docWriterClass = 
Class.forName(DOCUMENTATION_WRITER_CLASS_NAME, false, extensionClassLoader);
--- End diff --

Should we do this before entering the try block on line 542 so that if the 
doc writer class can't be found we won't write anything to the docs file?


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the 

[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-12-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16715536#comment-16715536
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user bbende commented on a diff in the pull request:

https://github.com/apache/nifi-maven/pull/7#discussion_r240374218
  
--- Diff: 
src/main/java/org/apache/nifi/extension/definition/extraction/ExtensionDefinitionFactory.java
 ---
@@ -0,0 +1,247 @@
+/*
+ * 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.
+ */
+package org.apache.nifi.extension.definition.extraction;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.nifi.extension.definition.ExtensionDefinition;
+import org.apache.nifi.extension.definition.ExtensionType;
+import org.apache.nifi.extension.definition.Restriction;
+import org.apache.nifi.extension.definition.Restrictions;
+import org.apache.nifi.extension.definition.ServiceAPIDefinition;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class ExtensionDefinitionFactory {
+private static final String SERVICES_DIRECTORY = "META-INF/services/";
+
+private static final Map INTERFACE_NAMES = new 
HashMap<>();
+static {
+INTERFACE_NAMES.put(ExtensionType.PROCESSOR, 
"org.apache.nifi.processor.Processor");
+INTERFACE_NAMES.put(ExtensionType.CONTROLLER_SERVICE, 
"org.apache.nifi.controller.ControllerService");
+INTERFACE_NAMES.put(ExtensionType.REPORTING_TASK, 
"org.apache.nifi.reporting.ReportingTask");
+}
+
+private final ClassLoader extensionClassLoader;
+
+public ExtensionDefinitionFactory(final ClassLoader classLoader) {
+this.extensionClassLoader = classLoader;
+}
+
+public Set discoverExtensions(final ExtensionType 
extensionType) throws IOException {
+final String interfaceName = INTERFACE_NAMES.get(extensionType);
+final Set classNames = discoverClassNames(interfaceName);
+
+if (classNames.isEmpty()) {
+return Collections.emptySet();
+}
+
+final Set definitions = new HashSet<>();
+for (final String className : classNames) {
+try {
+definitions.add(createExtensionDefinition(extensionType, 
className));
+} catch (final Exception e) {
+throw new IOException("Failed to create Extension 
Definition for " + extensionType + " " + className, e);
+}
+}
+
+return definitions;
+}
+
+private ExtensionDefinition createExtensionDefinition(final 
ExtensionType extensionType, final String className) throws 
ClassNotFoundException,
+IllegalAccessException, NoSuchMethodException, 
InvocationTargetException {
+
+final Class extensionClass = Class.forName(className, false, 
extensionClassLoader);
+
+final String capabilityDescription = 
getCapabilityDescription(extensionClass);
+final Set tags = getTags(extensionClass);
+final Restrictions restrictions = getRestrictions(extensionClass);
+final Set serviceApis = 
getProvidedServiceAPIs(extensionType, extensionClass);
+
+return new StandardExtensionDefinition(extensionType, className, 
capabilityDescription, tags, restrictions, serviceApis);
+}
+
+private Set 

[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-12-10 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16715008#comment-16715008
 ] 

ASF subversion and git services commented on NIFI-5859:
---

Commit 1ac5b93144ebd92c907fb49664a524e196ae20c6 in nifi's branch 
refs/heads/master from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=1ac5b93 ]

NIFI-5859: Added XML-based documentation writer that can be used to document a 
component.
- Found several instances of nifi-framework-api's ProviderException being 
thrown from processors. Changed those to IllegalStateException, as 
ProviderException is not an appropriate Exception in those cases, and 
extensions should not depend on nifi-framework-api.
- Performed some cleanup, moving Property Descriptors from Controller Service 
API's/specs into the implementations. Adding to the Service API results in 
bringing in nifi-utils to the nifi-standard-services-api-nar, which is a bad 
practice. The 'main' service api nar should not have a dependency on a util 
class.

NIFI-5859: Added javadocs. Fixed pom.xml that was left pointing to snapshot 
version of nar maven plugin

NIFI-5859: Addressing review feedback: adding component type, multiple 
additional details into separate file(s)

This closes #3192.

Signed-off-by: Bryan Bende 


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-12-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16715011#comment-16715011
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user asfgit closed the pull request at:

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


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-12-10 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16715007#comment-16715007
 ] 

ASF subversion and git services commented on NIFI-5859:
---

Commit 1ac5b93144ebd92c907fb49664a524e196ae20c6 in nifi's branch 
refs/heads/master from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=1ac5b93 ]

NIFI-5859: Added XML-based documentation writer that can be used to document a 
component.
- Found several instances of nifi-framework-api's ProviderException being 
thrown from processors. Changed those to IllegalStateException, as 
ProviderException is not an appropriate Exception in those cases, and 
extensions should not depend on nifi-framework-api.
- Performed some cleanup, moving Property Descriptors from Controller Service 
API's/specs into the implementations. Adding to the Service API results in 
bringing in nifi-utils to the nifi-standard-services-api-nar, which is a bad 
practice. The 'main' service api nar should not have a dependency on a util 
class.

NIFI-5859: Added javadocs. Fixed pom.xml that was left pointing to snapshot 
version of nar maven plugin

NIFI-5859: Addressing review feedback: adding component type, multiple 
additional details into separate file(s)

This closes #3192.

Signed-off-by: Bryan Bende 


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-12-10 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16715009#comment-16715009
 ] 

ASF subversion and git services commented on NIFI-5859:
---

Commit 1ac5b93144ebd92c907fb49664a524e196ae20c6 in nifi's branch 
refs/heads/master from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=1ac5b93 ]

NIFI-5859: Added XML-based documentation writer that can be used to document a 
component.
- Found several instances of nifi-framework-api's ProviderException being 
thrown from processors. Changed those to IllegalStateException, as 
ProviderException is not an appropriate Exception in those cases, and 
extensions should not depend on nifi-framework-api.
- Performed some cleanup, moving Property Descriptors from Controller Service 
API's/specs into the implementations. Adding to the Service API results in 
bringing in nifi-utils to the nifi-standard-services-api-nar, which is a bad 
practice. The 'main' service api nar should not have a dependency on a util 
class.

NIFI-5859: Added javadocs. Fixed pom.xml that was left pointing to snapshot 
version of nar maven plugin

NIFI-5859: Addressing review feedback: adding component type, multiple 
additional details into separate file(s)

This closes #3192.

Signed-off-by: Bryan Bende 


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-12-10 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16715006#comment-16715006
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user bbende commented on the issue:

https://github.com/apache/nifi/pull/3192
  
LGTM, going to merge, thanks! 


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-12-05 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16710582#comment-16710582
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user markap14 commented on the issue:

https://github.com/apache/nifi/pull/3192
  
OK @bbende I have pushed new commits that I believe address all of the 
concerns above.


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-12-05 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16710181#comment-16710181
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user markap14 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/3192#discussion_r239102517
  
--- Diff: 
nifi-api/src/main/java/org/apache/nifi/documentation/AbstractDocumentationWriter.java
 ---
@@ -0,0 +1,301 @@
+/*
+ * 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.
+ */
+package org.apache.nifi.documentation;
+
+import org.apache.nifi.annotation.behavior.DynamicProperties;
+import org.apache.nifi.annotation.behavior.DynamicProperty;
+import org.apache.nifi.annotation.behavior.DynamicRelationship;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.ReadsAttribute;
+import org.apache.nifi.annotation.behavior.ReadsAttributes;
+import org.apache.nifi.annotation.behavior.Restricted;
+import org.apache.nifi.annotation.behavior.Stateful;
+import org.apache.nifi.annotation.behavior.SystemResourceConsideration;
+import org.apache.nifi.annotation.behavior.WritesAttribute;
+import org.apache.nifi.annotation.behavior.WritesAttributes;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.DeprecationNotice;
+import org.apache.nifi.annotation.documentation.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.components.ConfigurableComponent;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.ControllerService;
+import 
org.apache.nifi.documentation.init.DocumentationControllerServiceInitializationContext;
+import 
org.apache.nifi.documentation.init.DocumentationProcessorInitializationContext;
+import 
org.apache.nifi.documentation.init.DocumentationReportingInitializationContext;
+import org.apache.nifi.processor.Processor;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.reporting.InitializationException;
+import org.apache.nifi.reporting.ReportingTask;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Base class for DocumentationWriter that simplifies iterating over all 
information for a component, creating a separate method
+ * for each, to ensure that implementations properly override all methods 
and therefore properly account for all information about
+ * a component.
+ *
+ * Please note that while this class lives within the nifi-api, it is 
provided primarily as a means for documentation components within
+ * the NiFi NAR Maven Plugin. Its home is the nifi-api, however, because 
the API is needed in order to extract the relevant information and
+ * the NAR Maven Plugin cannot have a direct dependency on nifi-api (doing 
so would cause a circular dependency). By having this homed within
+ * the nifi-api, the Maven plugin is able to discover the class 
dynamically and invoke the one or two methods necessary to create the 
documentation.
+ *
+ * This is a new capability in 1.9.0 in preparation for the Extension 
Registry and therefore, you should
+ * NOTE WELL: At this time, while this class is part of nifi-api, 
it is still evolving and may change in a non-backward-compatible manner or even 
be
+ * removed from one incremental release to the next. Use at your own risk!
+ */
+public abstract class AbstractDocumentationWriter implements 
DocumentationWriter {
+
+@Override
+public final void write(final ConfigurableComponent component) throws 

[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-12-05 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16710179#comment-16710179
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user markap14 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/3192#discussion_r239102417
  
--- Diff: 
nifi-nar-bundles/nifi-standard-services/nifi-standard-services-api-nar/pom.xml 
---
@@ -26,6 +26,12 @@
 true
 
 
+
+org.apache.nifi
+nifi-jetty-bundle
+1.9.0-SNAPSHOT
+nar
--- End diff --

It is needed if any component has a Custom UI. Otherwise, the NAR plugin is 
unable to generate the documentation needed. While NiFi will create the linkage 
for you, it can do so because it knows that the NAR is in the "lib" directory. 
Without this, the plugin doesn't know what version of the jetty bundle to use. 
This will be necessary for any component that contains a Custom UI. It is, 
however, considered a best practice already to include this in such a case, 
because you are explicitly depending on those classes being in the classpath, 
so you should explicitly declare it.


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-12-05 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16710175#comment-16710175
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user markap14 commented on a diff in the pull request:

https://github.com/apache/nifi/pull/3192#discussion_r239101308
  
--- Diff: 
nifi-api/src/main/java/org/apache/nifi/documentation/AbstractDocumentationWriter.java
 ---
@@ -0,0 +1,301 @@
+/*
+ * 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.
+ */
+package org.apache.nifi.documentation;
+
+import org.apache.nifi.annotation.behavior.DynamicProperties;
+import org.apache.nifi.annotation.behavior.DynamicProperty;
+import org.apache.nifi.annotation.behavior.DynamicRelationship;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.ReadsAttribute;
+import org.apache.nifi.annotation.behavior.ReadsAttributes;
+import org.apache.nifi.annotation.behavior.Restricted;
+import org.apache.nifi.annotation.behavior.Stateful;
+import org.apache.nifi.annotation.behavior.SystemResourceConsideration;
+import org.apache.nifi.annotation.behavior.WritesAttribute;
+import org.apache.nifi.annotation.behavior.WritesAttributes;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.DeprecationNotice;
+import org.apache.nifi.annotation.documentation.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.components.ConfigurableComponent;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.ControllerService;
+import 
org.apache.nifi.documentation.init.DocumentationControllerServiceInitializationContext;
+import 
org.apache.nifi.documentation.init.DocumentationProcessorInitializationContext;
+import 
org.apache.nifi.documentation.init.DocumentationReportingInitializationContext;
+import org.apache.nifi.processor.Processor;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.reporting.InitializationException;
+import org.apache.nifi.reporting.ReportingTask;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Base class for DocumentationWriter that simplifies iterating over all 
information for a component, creating a separate method
+ * for each, to ensure that implementations properly override all methods 
and therefore properly account for all information about
+ * a component.
+ *
+ * Please note that while this class lives within the nifi-api, it is 
provided primarily as a means for documentation components within
+ * the NiFi NAR Maven Plugin. Its home is the nifi-api, however, because 
the API is needed in order to extract the relevant information and
+ * the NAR Maven Plugin cannot have a direct dependency on nifi-api (doing 
so would cause a circular dependency). By having this homed within
+ * the nifi-api, the Maven plugin is able to discover the class 
dynamically and invoke the one or two methods necessary to create the 
documentation.
+ *
+ * This is a new capability in 1.9.0 in preparation for the Extension 
Registry and therefore, you should
+ * NOTE WELL: At this time, while this class is part of nifi-api, 
it is still evolving and may change in a non-backward-compatible manner or even 
be
+ * removed from one incremental release to the next. Use at your own risk!
+ */
+public abstract class AbstractDocumentationWriter implements 
DocumentationWriter {
+
+@Override
+public final void write(final ConfigurableComponent component) throws 

[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-11-30 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16705214#comment-16705214
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user bbende commented on a diff in the pull request:

https://github.com/apache/nifi/pull/3192#discussion_r237974350
  
--- Diff: 
nifi-nar-bundles/nifi-standard-services/nifi-standard-services-api-nar/pom.xml 
---
@@ -26,6 +26,12 @@
 true
 
 
+
+org.apache.nifi
+nifi-jetty-bundle
+1.9.0-SNAPSHOT
+nar
--- End diff --

I'm curious what caused this to be needed. At runtime we automatically make 
the Jetty bundle be the parent of any bundle that doesn't specify a dependency.


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-11-30 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16705212#comment-16705212
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user bbende commented on a diff in the pull request:

https://github.com/apache/nifi/pull/3192#discussion_r237982934
  
--- Diff: 
nifi-api/src/main/java/org/apache/nifi/documentation/AbstractDocumentationWriter.java
 ---
@@ -0,0 +1,301 @@
+/*
+ * 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.
+ */
+package org.apache.nifi.documentation;
+
+import org.apache.nifi.annotation.behavior.DynamicProperties;
+import org.apache.nifi.annotation.behavior.DynamicProperty;
+import org.apache.nifi.annotation.behavior.DynamicRelationship;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.ReadsAttribute;
+import org.apache.nifi.annotation.behavior.ReadsAttributes;
+import org.apache.nifi.annotation.behavior.Restricted;
+import org.apache.nifi.annotation.behavior.Stateful;
+import org.apache.nifi.annotation.behavior.SystemResourceConsideration;
+import org.apache.nifi.annotation.behavior.WritesAttribute;
+import org.apache.nifi.annotation.behavior.WritesAttributes;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.DeprecationNotice;
+import org.apache.nifi.annotation.documentation.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.components.ConfigurableComponent;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.ControllerService;
+import 
org.apache.nifi.documentation.init.DocumentationControllerServiceInitializationContext;
+import 
org.apache.nifi.documentation.init.DocumentationProcessorInitializationContext;
+import 
org.apache.nifi.documentation.init.DocumentationReportingInitializationContext;
+import org.apache.nifi.processor.Processor;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.reporting.InitializationException;
+import org.apache.nifi.reporting.ReportingTask;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Base class for DocumentationWriter that simplifies iterating over all 
information for a component, creating a separate method
+ * for each, to ensure that implementations properly override all methods 
and therefore properly account for all information about
+ * a component.
+ *
+ * Please note that while this class lives within the nifi-api, it is 
provided primarily as a means for documentation components within
+ * the NiFi NAR Maven Plugin. Its home is the nifi-api, however, because 
the API is needed in order to extract the relevant information and
+ * the NAR Maven Plugin cannot have a direct dependency on nifi-api (doing 
so would cause a circular dependency). By having this homed within
+ * the nifi-api, the Maven plugin is able to discover the class 
dynamically and invoke the one or two methods necessary to create the 
documentation.
+ *
+ * This is a new capability in 1.9.0 in preparation for the Extension 
Registry and therefore, you should
+ * NOTE WELL: At this time, while this class is part of nifi-api, 
it is still evolving and may change in a non-backward-compatible manner or even 
be
+ * removed from one incremental release to the next. Use at your own risk!
+ */
+public abstract class AbstractDocumentationWriter implements 
DocumentationWriter {
+
+@Override
+public final void write(final ConfigurableComponent component) throws 

[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-11-30 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16705213#comment-16705213
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user bbende commented on a diff in the pull request:

https://github.com/apache/nifi/pull/3192#discussion_r237917798
  
--- Diff: 
nifi-api/src/main/java/org/apache/nifi/documentation/AbstractDocumentationWriter.java
 ---
@@ -0,0 +1,301 @@
+/*
+ * 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.
+ */
+package org.apache.nifi.documentation;
+
+import org.apache.nifi.annotation.behavior.DynamicProperties;
+import org.apache.nifi.annotation.behavior.DynamicProperty;
+import org.apache.nifi.annotation.behavior.DynamicRelationship;
+import org.apache.nifi.annotation.behavior.InputRequirement;
+import org.apache.nifi.annotation.behavior.ReadsAttribute;
+import org.apache.nifi.annotation.behavior.ReadsAttributes;
+import org.apache.nifi.annotation.behavior.Restricted;
+import org.apache.nifi.annotation.behavior.Stateful;
+import org.apache.nifi.annotation.behavior.SystemResourceConsideration;
+import org.apache.nifi.annotation.behavior.WritesAttribute;
+import org.apache.nifi.annotation.behavior.WritesAttributes;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.DeprecationNotice;
+import org.apache.nifi.annotation.documentation.SeeAlso;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.components.ConfigurableComponent;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.ControllerService;
+import 
org.apache.nifi.documentation.init.DocumentationControllerServiceInitializationContext;
+import 
org.apache.nifi.documentation.init.DocumentationProcessorInitializationContext;
+import 
org.apache.nifi.documentation.init.DocumentationReportingInitializationContext;
+import org.apache.nifi.processor.Processor;
+import org.apache.nifi.processor.Relationship;
+import org.apache.nifi.reporting.InitializationException;
+import org.apache.nifi.reporting.ReportingTask;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Base class for DocumentationWriter that simplifies iterating over all 
information for a component, creating a separate method
+ * for each, to ensure that implementations properly override all methods 
and therefore properly account for all information about
+ * a component.
+ *
+ * Please note that while this class lives within the nifi-api, it is 
provided primarily as a means for documentation components within
+ * the NiFi NAR Maven Plugin. Its home is the nifi-api, however, because 
the API is needed in order to extract the relevant information and
+ * the NAR Maven Plugin cannot have a direct dependency on nifi-api (doing 
so would cause a circular dependency). By having this homed within
+ * the nifi-api, the Maven plugin is able to discover the class 
dynamically and invoke the one or two methods necessary to create the 
documentation.
+ *
+ * This is a new capability in 1.9.0 in preparation for the Extension 
Registry and therefore, you should
+ * NOTE WELL: At this time, while this class is part of nifi-api, 
it is still evolving and may change in a non-backward-compatible manner or even 
be
+ * removed from one incremental release to the next. Use at your own risk!
+ */
+public abstract class AbstractDocumentationWriter implements 
DocumentationWriter {
+
+@Override
+public final void write(final ConfigurableComponent component) throws 

[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-11-30 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16704907#comment-16704907
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

Github user bbende commented on the issue:

https://github.com/apache/nifi/pull/3192
  
Will review...


> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-11-30 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16704855#comment-16704855
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

GitHub user markap14 opened a pull request:

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

NIFI-5859: Added XML-based documentation writer that can be used to d…

…ocument a component.

- Found several instances of nifi-framework-api's ProviderException being 
thrown from processors. Changed those to IllegalStateException, as 
ProviderException is not an appropriate Exception in those cases, and 
extensions should not depend on nifi-framework-api.
- Performed some cleanup, moving Property Descriptors from Controller 
Service API's/specs into the implementations. Adding to the Service API results 
in bringing in nifi-utils to the nifi-standard-services-api-nar, which is a bad 
practice. The 'main' service api nar should not have a dependency on a util 
class.

Thank you for submitting a contribution to Apache NiFi.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced 
 in the commit message?

- [ ] Does your PR title start with NIFI- where  is the JIRA number 
you are trying to resolve? Pay particular attention to the hyphen "-" character.

- [ ] Has your PR been rebased against the latest commit within the target 
branch (typically master)?

- [ ] Is your initial contribution a single, squashed commit?

### For code changes:
- [ ] Have you ensured that the full suite of tests is executed via mvn 
-Pcontrib-check clean install at the root nifi folder?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
- [ ] If applicable, have you updated the LICENSE file, including the main 
LICENSE file under nifi-assembly?
- [ ] If applicable, have you updated the NOTICE file, including the main 
NOTICE file found under nifi-assembly?
- [ ] If adding new Properties, have you added .displayName in addition to 
.name (programmatic access) for each of the new properties?

### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in 
which it is rendered?

### Note:
Please ensure that once the PR is submitted, you check travis-ci for build 
issues and submit an update to your PR as soon as possible.


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

$ git pull https://github.com/markap14/nifi NIFI-5859

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

https://github.com/apache/nifi/pull/3192.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 #3192


commit e07d9be3b07ade875c87d6463487807ca2bf5246
Author: Mark Payne 
Date:   2018-11-15T17:07:08Z

NIFI-5859: Added XML-based documentation writer that can be used to 
document a component.
- Found several instances of nifi-framework-api's ProviderException being 
thrown from processors. Changed those to IllegalStateException, as 
ProviderException is not an appropriate Exception in those cases, and 
extensions should not depend on nifi-framework-api.
- Performed some cleanup, moving Property Descriptors from Controller 
Service API's/specs into the implementations. Adding to the Service API results 
in bringing in nifi-utils to the nifi-standard-services-api-nar, which is a bad 
practice. The 'main' service api nar should not have a dependency on a util 
class.




> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the 

[jira] [Commented] (NIFI-5859) Update NAR maven plugin to include information about Extensions

2018-11-30 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/NIFI-5859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16704843#comment-16704843
 ] 

ASF GitHub Bot commented on NIFI-5859:
--

GitHub user markap14 opened a pull request:

https://github.com/apache/nifi-maven/pull/7

NIFI-5859: Build NAR Extension Definitions/docs at build time



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

$ git pull https://github.com/markap14/nifi-maven NIFI-5859

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

https://github.com/apache/nifi-maven/pull/7.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 #7


commit 7cecaa9a841af8c5729fd5b135db400318245bf3
Author: Mark Payne 
Date:   2018-11-14T20:09:25Z

NIFI-5859: Build NAR Extension Definitions/docs at build time




> Update NAR maven plugin to include information about Extensions
> ---
>
> Key: NIFI-5859
> URL: https://issues.apache.org/jira/browse/NIFI-5859
> Project: Apache NiFi
>  Issue Type: New Feature
>  Components: Tools and Build
>Reporter: Mark Payne
>Assignee: Mark Payne
>Priority: Major
>
> In order to have the NiFi Registry host any extensions, the registry will 
> need a way to know what extensions exist in a given NAR. Currently, that 
> information is not available directly.
> The NAR maven plugin should be updated to provide a list of extensions and 
> for each one, provide at least the following minimal information:
>  * Extension Type
>  * Extension Name
>  * Capability Description
>  * Whether or not the component is Restricted, "sub-restrictions" it has, and 
> explanations of both
>  * Any Tags that the component has
>  * If the component is a Controller Service, any Controller Service API's 
> that it provides
> Additionally, it would be ideal to provide all documentation for the 
> component within the NAR. It is best, though, not to write the documentation 
> in HTML as is done now but rather in XML or some sort of form that provides 
> the information in a structured way without any styling. This would allow the 
> documentation to be rendered consistently, even if the styling changes from 1 
> version to the next.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)