NIFI-280 This closes #19 Updated poms for versions after merge. Minor doc removals. Awesome PR!

This commit is contained in:
joewitt 2015-03-17 23:42:22 -04:00
parent cadfc679d8
commit e9d31f5d99
39 changed files with 1008 additions and 1573 deletions

View File

@ -181,6 +181,11 @@ The following binary components are provided under the Apache Software License v
Apache log4j Apache log4j
Copyright 2007 The Apache Software Foundation Copyright 2007 The Apache Software Foundation
(ASLv2) Apache Tika
The following NOTICE information applies:
Apache Tika Core
Copyright 2007-2015 The Apache Software Foundation
(ASLv2) Apache Commons Configuration (ASLv2) Apache Commons Configuration
The following NOTICE information applies: The following NOTICE information applies:
Apache Commons Configuration Apache Commons Configuration

View File

@ -1,49 +1,49 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<project <project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Licensed to the Apache Software Foundation (ASF) under one or more <!-- Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with this contributor license agreements. See the NOTICE file distributed with this
work for additional information regarding copyright ownership. The ASF licenses work for additional information regarding copyright ownership. The ASF licenses
this file to You under the Apache License, Version 2.0 (the "License"); you 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 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 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 required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 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 OR CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the License. --> the specific language governing permissions and limitations under the License. -->
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.apache.nifi</groupId> <groupId>org.apache.nifi</groupId>
<artifactId>nifi-framework</artifactId> <artifactId>nifi-framework</artifactId>
<version>0.0.2-incubating-SNAPSHOT</version> <version>0.1.0-incubating-SNAPSHOT</version>
</parent> </parent>
<artifactId>nifi-documentation</artifactId> <artifactId>nifi-documentation</artifactId>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.nifi</groupId> <groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-utils</artifactId> <artifactId>nifi-nar-utils</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.nifi</groupId> <groupId>org.apache.nifi</groupId>
<artifactId>nifi-api</artifactId> <artifactId>nifi-api</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.nifi</groupId> <groupId>org.apache.nifi</groupId>
<artifactId>nifi-properties</artifactId> <artifactId>nifi-properties</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.nifi</groupId> <groupId>org.apache.nifi</groupId>
<artifactId>nifi-processor-utils</artifactId> <artifactId>nifi-processor-utils</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -27,12 +27,12 @@ import org.apache.nifi.reporting.InitializationException;
*/ */
public interface ConfigurableComponentInitializer { public interface ConfigurableComponentInitializer {
/** /**
* Initializes a configurable component to the point that you can call * Initializes a configurable component to the point that you can call
* getPropertyDescriptors() on it * getPropertyDescriptors() on it
* *
* @param component the component to initialize * @param component the component to initialize
* @throws InitializationException if the component could not be initialized * @throws InitializationException if the component could not be initialized
*/ */
void initialize(ConfigurableComponent component) throws InitializationException; void initialize(ConfigurableComponent component) throws InitializationException;
} }

View File

@ -43,140 +43,137 @@ import org.slf4j.LoggerFactory;
/** /**
* Uses the ExtensionManager to get a list of Processor, ControllerService, and * Uses the ExtensionManager to get a list of Processor, ControllerService, and
* Reporting Task classes that were loaded and generate documentation for them. * Reporting Task classes that were loaded and generate documentation for them.
* *
* *
*/ */
public class DocGenerator { public class DocGenerator {
private static final Logger logger = LoggerFactory.getLogger(DocGenerator.class); private static final Logger logger = LoggerFactory.getLogger(DocGenerator.class);
/** /**
* Generates documentation into the work/docs dir specified by * Generates documentation into the work/docs dir specified by
* NiFiProperties. * NiFiProperties.
* *
* @param properties * @param properties
*/ */
public static void generate(final NiFiProperties properties) { public static void generate(final NiFiProperties properties) {
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
final Set<Class> extensionClasses = new HashSet<>(); final Set<Class> extensionClasses = new HashSet<>();
extensionClasses.addAll(ExtensionManager.getExtensions(Processor.class)); extensionClasses.addAll(ExtensionManager.getExtensions(Processor.class));
extensionClasses.addAll(ExtensionManager.getExtensions(ControllerService.class)); extensionClasses.addAll(ExtensionManager.getExtensions(ControllerService.class));
extensionClasses.addAll(ExtensionManager.getExtensions(ReportingTask.class)); extensionClasses.addAll(ExtensionManager.getExtensions(ReportingTask.class));
final File explodedNiFiDocsDir = properties.getComponentDocumentationWorkingDirectory(); final File explodedNiFiDocsDir = properties.getComponentDocumentationWorkingDirectory();
logger.debug("Generating documentation for: " + extensionClasses.size() + " components in: " logger.debug("Generating documentation for: " + extensionClasses.size() + " components in: "
+ explodedNiFiDocsDir); + explodedNiFiDocsDir);
for (final Class<?> extensionClass : extensionClasses) { for (final Class<?> extensionClass : extensionClasses) {
if (ConfigurableComponent.class.isAssignableFrom(extensionClass)) { if (ConfigurableComponent.class.isAssignableFrom(extensionClass)) {
final Class<? extends ConfigurableComponent> componentClass = extensionClass final Class<? extends ConfigurableComponent> componentClass = extensionClass
.asSubclass(ConfigurableComponent.class); .asSubclass(ConfigurableComponent.class);
try { try {
logger.debug("Documenting: " + componentClass); logger.debug("Documenting: " + componentClass);
document(explodedNiFiDocsDir, componentClass); document(explodedNiFiDocsDir, componentClass);
} catch (Exception e) { } catch (Exception e) {
logger.warn("Unable to document: " + componentClass); logger.warn("Unable to document: " + componentClass);
} }
} }
} }
} }
/** /**
* Generates the documentation for a particular configurable comopnent. Will * Generates the documentation for a particular configurable comopnent. Will
* check to see if an "additionalDetails.html" file exists and will link * check to see if an "additionalDetails.html" file exists and will link
* that from the generated documentation. * that from the generated documentation.
* *
* @param docsDir * @param docsDir the work\docs\components dir to stick component
* the work\docs\components dir to stick component documentation * documentation in
* in * @param componentClass the class to document
* @param componentClass * @throws InstantiationException
* the class to document * @throws IllegalAccessException
* @throws InstantiationException * @throws IOException
* @throws IllegalAccessException * @throws InitializationException
* @throws IOException */
* @throws InitializationException private static void document(final File docsDir, final Class<? extends ConfigurableComponent> componentClass)
*/ throws InstantiationException, IllegalAccessException, IOException, InitializationException {
private static void document(final File docsDir, final Class<? extends ConfigurableComponent> componentClass)
throws InstantiationException, IllegalAccessException, IOException, InitializationException {
final ConfigurableComponent component = componentClass.newInstance(); final ConfigurableComponent component = componentClass.newInstance();
final ConfigurableComponentInitializer initializer = getComponentInitializer(componentClass); final ConfigurableComponentInitializer initializer = getComponentInitializer(componentClass);
initializer.initialize(component); initializer.initialize(component);
final DocumentationWriter writer = getDocumentWriter(componentClass); final DocumentationWriter writer = getDocumentWriter(componentClass);
final File directory = new File(docsDir, componentClass.getCanonicalName()); final File directory = new File(docsDir, componentClass.getCanonicalName());
directory.mkdirs(); directory.mkdirs();
final File baseDocumenationFile = new File(directory, "index.html"); final File baseDocumenationFile = new File(directory, "index.html");
if (baseDocumenationFile.exists()) { if (baseDocumenationFile.exists()) {
logger.warn(baseDocumenationFile + " already exists, overwriting!"); logger.warn(baseDocumenationFile + " already exists, overwriting!");
} }
try (final OutputStream output = new BufferedOutputStream(new FileOutputStream(baseDocumenationFile))) { try (final OutputStream output = new BufferedOutputStream(new FileOutputStream(baseDocumenationFile))) {
writer.write(component, output, hasAdditionalInfo(directory)); writer.write(component, output, hasAdditionalInfo(directory));
} }
} }
/** /**
* Returns the DocumentationWriter for the type of component. Currently * Returns the DocumentationWriter for the type of component. Currently
* Processor, ControllerService, and ReportingTask are supported. * Processor, ControllerService, and ReportingTask are supported.
* *
* @param componentClass * @param componentClass the class that requires a DocumentationWriter
* the class that requires a DocumentationWriter * @return a DocumentationWriter capable of generating documentation for
* @return a DocumentationWriter capable of generating documentation for * that specific type of class
* that specific type of class */
*/ private static DocumentationWriter getDocumentWriter(final Class<? extends ConfigurableComponent> componentClass) {
private static DocumentationWriter getDocumentWriter(final Class<? extends ConfigurableComponent> componentClass) { if (Processor.class.isAssignableFrom(componentClass)) {
if (Processor.class.isAssignableFrom(componentClass)) { return new HtmlProcessorDocumentationWriter();
return new HtmlProcessorDocumentationWriter(); } else if (ControllerService.class.isAssignableFrom(componentClass)) {
} else if (ControllerService.class.isAssignableFrom(componentClass)) { return new HtmlDocumentationWriter();
return new HtmlDocumentationWriter(); } else if (ReportingTask.class.isAssignableFrom(componentClass)) {
} else if (ReportingTask.class.isAssignableFrom(componentClass)) { return new HtmlDocumentationWriter();
return new HtmlDocumentationWriter(); }
}
return null; return null;
} }
/** /**
* Returns a ConfigurableComponentInitializer for the type of component. * Returns a ConfigurableComponentInitializer for the type of component.
* Currently Processor, ControllerService and ReportingTask are supported. * Currently Processor, ControllerService and ReportingTask are supported.
* *
* @param componentClass * @param componentClass the class that requires a
* the class that requires a ConfigurableComponentInitializer * ConfigurableComponentInitializer
* @return a ConfigurableComponentInitializer capable of initializing that * @return a ConfigurableComponentInitializer capable of initializing that
* specific type of class * specific type of class
*/ */
private static ConfigurableComponentInitializer getComponentInitializer( private static ConfigurableComponentInitializer getComponentInitializer(
final Class<? extends ConfigurableComponent> componentClass) { final Class<? extends ConfigurableComponent> componentClass) {
if (Processor.class.isAssignableFrom(componentClass)) { if (Processor.class.isAssignableFrom(componentClass)) {
return new ProcessorInitializer(); return new ProcessorInitializer();
} else if (ControllerService.class.isAssignableFrom(componentClass)) { } else if (ControllerService.class.isAssignableFrom(componentClass)) {
return new ControllerServiceInitializer(); return new ControllerServiceInitializer();
} else if (ReportingTask.class.isAssignableFrom(componentClass)) { } else if (ReportingTask.class.isAssignableFrom(componentClass)) {
return new ReportingTaskingInitializer(); return new ReportingTaskingInitializer();
} }
return null; return null;
} }
/** /**
* Checks to see if a directory to write to has an additionalDetails.html in * Checks to see if a directory to write to has an additionalDetails.html in
* it already. * it already.
* *
* @param directory * @param directory
* @return true if additionalDetails.html exists, false otherwise. * @return true if additionalDetails.html exists, false otherwise.
*/ */
private static boolean hasAdditionalInfo(File directory) { private static boolean hasAdditionalInfo(File directory) {
return directory.list(new FilenameFilter() { return directory.list(new FilenameFilter() {
@Override @Override
public boolean accept(File dir, String name) { public boolean accept(File dir, String name) {
return name.equalsIgnoreCase(HtmlDocumentationWriter.ADDITIONAL_DETAILS_HTML); return name.equalsIgnoreCase(HtmlDocumentationWriter.ADDITIONAL_DETAILS_HTML);
} }
}).length > 0; }).length > 0;
} }
} }

View File

@ -23,11 +23,11 @@ import org.apache.nifi.components.ConfigurableComponent;
/** /**
* Generates documentation for an instance of a ConfigurableComponent * Generates documentation for an instance of a ConfigurableComponent
* *
* *
*/ */
public interface DocumentationWriter { public interface DocumentationWriter {
void write(ConfigurableComponent configurableComponent, OutputStream streamToWriteTo, void write(ConfigurableComponent configurableComponent, OutputStream streamToWriteTo,
boolean includesAdditionalDocumentation) throws IOException; boolean includesAdditionalDocumentation) throws IOException;
} }

View File

@ -38,380 +38,354 @@ import org.apache.nifi.documentation.DocumentationWriter;
* Generates HTML documentation for a ConfigurableComponent. This class is used * Generates HTML documentation for a ConfigurableComponent. This class is used
* to generate documentation for ControllerService and ReportingTask because * to generate documentation for ControllerService and ReportingTask because
* they have no additional information. * they have no additional information.
* *
* *
*/ */
public class HtmlDocumentationWriter implements DocumentationWriter { public class HtmlDocumentationWriter implements DocumentationWriter {
/** /**
* The filename where additional user specified information may be stored. * The filename where additional user specified information may be stored.
*/ */
public static final String ADDITIONAL_DETAILS_HTML = "additionalDetails.html"; public static final String ADDITIONAL_DETAILS_HTML = "additionalDetails.html";
@Override @Override
public void write(final ConfigurableComponent configurableComponent, final OutputStream streamToWriteTo, public void write(final ConfigurableComponent configurableComponent, final OutputStream streamToWriteTo,
final boolean includesAdditionalDocumentation) throws IOException { final boolean includesAdditionalDocumentation) throws IOException {
try { try {
XMLStreamWriter xmlStreamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter( XMLStreamWriter xmlStreamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(
streamToWriteTo, "UTF-8"); streamToWriteTo, "UTF-8");
xmlStreamWriter.writeDTD("<!DOCTYPE html>"); xmlStreamWriter.writeDTD("<!DOCTYPE html>");
xmlStreamWriter.writeStartElement("html"); xmlStreamWriter.writeStartElement("html");
xmlStreamWriter.writeAttribute("lang", "en"); xmlStreamWriter.writeAttribute("lang", "en");
writeHead(configurableComponent, xmlStreamWriter); writeHead(configurableComponent, xmlStreamWriter);
writeBody(configurableComponent, xmlStreamWriter, includesAdditionalDocumentation); writeBody(configurableComponent, xmlStreamWriter, includesAdditionalDocumentation);
xmlStreamWriter.writeEndElement(); xmlStreamWriter.writeEndElement();
xmlStreamWriter.close(); xmlStreamWriter.close();
} catch (XMLStreamException | FactoryConfigurationError e) { } catch (XMLStreamException | FactoryConfigurationError e) {
throw new IOException("Unable to create XMLOutputStream", e); throw new IOException("Unable to create XMLOutputStream", e);
} }
} }
/** /**
* Writes the head portion of the HTML documentation. * Writes the head portion of the HTML documentation.
* *
* @param configurableComponent * @param configurableComponent the component to describe
* the component to describe * @param xmlStreamWriter the stream to write to
* @param xmlStreamWriter * @throws XMLStreamException thrown if there was a problem writing to the
* the stream to write to * stream
* @throws XMLStreamException */
* thrown if there was a problem writing to the stream protected void writeHead(final ConfigurableComponent configurableComponent,
*/ final XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
protected void writeHead(final ConfigurableComponent configurableComponent, xmlStreamWriter.writeStartElement("head");
final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { xmlStreamWriter.writeStartElement("meta");
xmlStreamWriter.writeStartElement("head"); xmlStreamWriter.writeAttribute("charset", "utf-8");
xmlStreamWriter.writeStartElement("meta"); xmlStreamWriter.writeEndElement();
xmlStreamWriter.writeAttribute("charset", "utf-8"); writeSimpleElement(xmlStreamWriter, "title", getTitle(configurableComponent));
xmlStreamWriter.writeEndElement();
writeSimpleElement(xmlStreamWriter, "title", getTitle(configurableComponent));
xmlStreamWriter.writeStartElement("link"); xmlStreamWriter.writeStartElement("link");
xmlStreamWriter.writeAttribute("rel", "stylesheet"); xmlStreamWriter.writeAttribute("rel", "stylesheet");
xmlStreamWriter.writeAttribute("href", "../../css/component-usage.css"); xmlStreamWriter.writeAttribute("href", "../../css/component-usage.css");
xmlStreamWriter.writeAttribute("type", "text/css"); xmlStreamWriter.writeAttribute("type", "text/css");
xmlStreamWriter.writeEndElement(); xmlStreamWriter.writeEndElement();
xmlStreamWriter.writeEndElement(); xmlStreamWriter.writeEndElement();
} }
/** /**
* Gets the class name of the component. * Gets the class name of the component.
* *
* @param configurableComponent * @param configurableComponent the component to describe
* the component to describe * @return the class name of the component
* @return the class name of the component */
*/ protected String getTitle(final ConfigurableComponent configurableComponent) {
protected String getTitle(final ConfigurableComponent configurableComponent) { return configurableComponent.getClass().getSimpleName();
return configurableComponent.getClass().getSimpleName(); }
}
/** /**
* Writes the body section of the documentation, this consists of the * Writes the body section of the documentation, this consists of the
* component description, the tags, and the PropertyDescriptors. * component description, the tags, and the PropertyDescriptors.
* *
* @param configurableComponent * @param configurableComponent the component to describe
* the component to describe * @param xmlStreamWriter the stream writer
* @param xmlStreamWriter * @param hasAdditionalDetails whether there are additional details present
* the stream writer * or not
* @param hasAdditionalDetails * @throws XMLStreamException thrown if there was a problem writing to the
* whether there are additional details present or not * XML stream
* @throws XMLStreamException */
* thrown if there was a problem writing to the XML stream private void writeBody(final ConfigurableComponent configurableComponent,
*/ final XMLStreamWriter xmlStreamWriter, final boolean hasAdditionalDetails)
private final void writeBody(final ConfigurableComponent configurableComponent, throws XMLStreamException {
final XMLStreamWriter xmlStreamWriter, final boolean hasAdditionalDetails) xmlStreamWriter.writeStartElement("body");
throws XMLStreamException { writeDescription(configurableComponent, xmlStreamWriter, hasAdditionalDetails);
xmlStreamWriter.writeStartElement("body"); writeTags(configurableComponent, xmlStreamWriter);
writeDescription(configurableComponent, xmlStreamWriter, hasAdditionalDetails); writeProperties(configurableComponent, xmlStreamWriter);
writeTags(configurableComponent, xmlStreamWriter); writeAdditionalBodyInfo(configurableComponent, xmlStreamWriter);
writeProperties(configurableComponent, xmlStreamWriter); xmlStreamWriter.writeEndElement();
writeAdditionalBodyInfo(configurableComponent, xmlStreamWriter); }
xmlStreamWriter.writeEndElement();
}
/** /**
* This method may be overridden by sub classes to write additional * This method may be overridden by sub classes to write additional
* information to the body of the documentation. * information to the body of the documentation.
* *
* @param configurableComponent * @param configurableComponent the component to describe
* the component to describe * @param xmlStreamWriter the stream writer
* @param xmlStreamWriter * @throws XMLStreamException thrown if there was a problem writing to the
* the stream writer * XML stream
* @throws XMLStreamException */
* thrown if there was a problem writing to the XML stream protected void writeAdditionalBodyInfo(final ConfigurableComponent configurableComponent,
*/ final XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
protected void writeAdditionalBodyInfo(final ConfigurableComponent configurableComponent, }
final XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
}
/** /**
* Writes the tags attached to a ConfigurableComponent. * Writes the tags attached to a ConfigurableComponent.
* *
* @param configurableComponent * @param configurableComponent
* @param xmlStreamWriter * @param xmlStreamWriter
* @throws XMLStreamException * @throws XMLStreamException
*/ */
private void writeTags(final ConfigurableComponent configurableComponent, private void writeTags(final ConfigurableComponent configurableComponent,
final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { final XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
final Tags tags = configurableComponent.getClass().getAnnotation(Tags.class); final Tags tags = configurableComponent.getClass().getAnnotation(Tags.class);
xmlStreamWriter.writeStartElement("h3"); xmlStreamWriter.writeStartElement("h3");
xmlStreamWriter.writeCharacters("Tags: "); xmlStreamWriter.writeCharacters("Tags: ");
xmlStreamWriter.writeEndElement(); xmlStreamWriter.writeEndElement();
xmlStreamWriter.writeStartElement("p"); xmlStreamWriter.writeStartElement("p");
if (tags != null) { if (tags != null) {
final String tagString = StringUtils.join(tags.value(), ", "); final String tagString = StringUtils.join(tags.value(), ", ");
xmlStreamWriter.writeCharacters(tagString); xmlStreamWriter.writeCharacters(tagString);
} else { } else {
xmlStreamWriter.writeCharacters("None."); xmlStreamWriter.writeCharacters("None.");
} }
xmlStreamWriter.writeEndElement(); xmlStreamWriter.writeEndElement();
} }
/** /**
* Writes a description of the configurable component. * Writes a description of the configurable component.
* *
* @param configurableComponent * @param configurableComponent the component to describe
* the component to describe * @param xmlStreamWriter the stream writer
* @param xmlStreamWriter * @param hasAdditionalDetails whether there are additional details
* the stream writer * available as 'additionalDetails.html'
* @param hasAdditionalDetails * @throws XMLStreamException thrown if there was a problem writing to the
* whether there are additional details available as * XML stream
* 'additionalDetails.html' */
* @throws XMLStreamException protected void writeDescription(final ConfigurableComponent configurableComponent,
* thrown if there was a problem writing to the XML stream final XMLStreamWriter xmlStreamWriter, final boolean hasAdditionalDetails)
*/ throws XMLStreamException {
protected void writeDescription(final ConfigurableComponent configurableComponent, writeSimpleElement(xmlStreamWriter, "h2", "Description: ");
final XMLStreamWriter xmlStreamWriter, final boolean hasAdditionalDetails) writeSimpleElement(xmlStreamWriter, "p", getDescription(configurableComponent));
throws XMLStreamException { if (hasAdditionalDetails) {
writeSimpleElement(xmlStreamWriter, "h2", "Description: "); xmlStreamWriter.writeStartElement("p");
writeSimpleElement(xmlStreamWriter, "p", getDescription(configurableComponent));
if (hasAdditionalDetails) {
xmlStreamWriter.writeStartElement("p");
writeLink(xmlStreamWriter, "Additional Details...", ADDITIONAL_DETAILS_HTML); writeLink(xmlStreamWriter, "Additional Details...", ADDITIONAL_DETAILS_HTML);
xmlStreamWriter.writeEndElement(); xmlStreamWriter.writeEndElement();
} }
} }
/** /**
* Gets a description of the ConfigurableComponent using the * Gets a description of the ConfigurableComponent using the
* CapabilityDescription annotation. * CapabilityDescription annotation.
* *
* @param configurableComponent * @param configurableComponent the component to describe
* the component to describe * @return a description of the configurableComponent
* @return a description of the configurableComponent */
*/ protected String getDescription(final ConfigurableComponent configurableComponent) {
protected String getDescription(final ConfigurableComponent configurableComponent) { final CapabilityDescription capabilityDescription = configurableComponent.getClass().getAnnotation(
final CapabilityDescription capabilityDescription = configurableComponent.getClass().getAnnotation( CapabilityDescription.class);
CapabilityDescription.class);
final String description; final String description;
if (capabilityDescription != null) { if (capabilityDescription != null) {
description = capabilityDescription.value(); description = capabilityDescription.value();
} else { } else {
description = "No description provided."; description = "No description provided.";
} }
return description; return description;
} }
/** /**
* Writes the PropertyDescriptors out as a table. * Writes the PropertyDescriptors out as a table.
* *
* @param configurableComponent * @param configurableComponent the component to describe
* the component to describe * @param xmlStreamWriter the stream writer
* @param xmlStreamWriter * @throws XMLStreamException thrown if there was a problem writing to the
* the stream writer * XML Stream
* @throws XMLStreamException */
* thrown if there was a problem writing to the XML Stream protected void writeProperties(final ConfigurableComponent configurableComponent,
*/ final XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
protected void writeProperties(final ConfigurableComponent configurableComponent, writeSimpleElement(xmlStreamWriter, "h3", "Properties: ");
final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { xmlStreamWriter.writeStartElement("p");
writeSimpleElement(xmlStreamWriter, "h3", "Properties: "); xmlStreamWriter.writeCharacters("In the list below, the names of required properties appear in ");
xmlStreamWriter.writeStartElement("p"); writeSimpleElement(xmlStreamWriter, "strong", "bold");
xmlStreamWriter.writeCharacters("In the list below, the names of required properties appear in "); xmlStreamWriter.writeCharacters(". Any "
writeSimpleElement(xmlStreamWriter, "strong", "bold"); + "other properties (not in bold) are considered optional. The table also "
xmlStreamWriter.writeCharacters(". Any " + "indicates any default values, whether a property supports the ");
+ "other properties (not in bold) are considered optional. The table also " writeLink(xmlStreamWriter, "NiFi Expression Language",
+ "indicates any default values, whether a property supports the "); "../../html/expression-language-guide.html");
writeLink(xmlStreamWriter, "NiFi Expression Language", xmlStreamWriter.writeCharacters(", and whether a property is considered "
"../../html/expression-language-guide.html"); + "\"sensitive\", meaning that its value will be encrypted. Before entering a "
xmlStreamWriter.writeCharacters(", and whether a property is considered " + "value in a sensitive property, ensure that the ");
+ "\"sensitive\", meaning that its value will be encrypted. Before entering a " writeSimpleElement(xmlStreamWriter, "strong", "nifi.properties");
+ "value in a sensitive property, ensure that the "); xmlStreamWriter.writeCharacters(" file has " + "an entry for the property ");
writeSimpleElement(xmlStreamWriter, "strong", "nifi.properties"); writeSimpleElement(xmlStreamWriter, "strong", "nifi.sensitive.props.key");
xmlStreamWriter.writeCharacters(" file has " + "an entry for the property "); xmlStreamWriter.writeCharacters(".");
writeSimpleElement(xmlStreamWriter, "strong", "nifi.sensitive.props.key"); xmlStreamWriter.writeEndElement();
xmlStreamWriter.writeCharacters(".");
xmlStreamWriter.writeEndElement();
List<PropertyDescriptor> properties = configurableComponent.getPropertyDescriptors();
if (properties.size() > 0) {
xmlStreamWriter.writeStartElement("table");
List<PropertyDescriptor> properties = configurableComponent.getPropertyDescriptors(); // write the header row
if (properties.size() > 0) { xmlStreamWriter.writeStartElement("tr");
xmlStreamWriter.writeStartElement("table"); writeSimpleElement(xmlStreamWriter, "th", "Name");
writeSimpleElement(xmlStreamWriter, "th", "Default Value");
writeSimpleElement(xmlStreamWriter, "th", "Valid Values");
writeSimpleElement(xmlStreamWriter, "th", "Description");
xmlStreamWriter.writeEndElement();
// write the header row // write the individual properties
xmlStreamWriter.writeStartElement("tr"); for (PropertyDescriptor property : properties) {
writeSimpleElement(xmlStreamWriter, "th", "Name"); xmlStreamWriter.writeStartElement("tr");
writeSimpleElement(xmlStreamWriter, "th", "Default Value"); xmlStreamWriter.writeStartElement("td");
writeSimpleElement(xmlStreamWriter, "th", "Valid Values"); if (property.isRequired()) {
writeSimpleElement(xmlStreamWriter, "th", "Description"); writeSimpleElement(xmlStreamWriter, "strong", property.getDisplayName());
xmlStreamWriter.writeEndElement(); } else {
xmlStreamWriter.writeCharacters(property.getDisplayName());
}
// write the individual properties xmlStreamWriter.writeEndElement();
for (PropertyDescriptor property : properties) { writeSimpleElement(xmlStreamWriter, "td", property.getDefaultValue());
xmlStreamWriter.writeStartElement("tr"); xmlStreamWriter.writeStartElement("td");
xmlStreamWriter.writeStartElement("td"); writeValidValues(xmlStreamWriter, property);
if (property.isRequired()) { xmlStreamWriter.writeEndElement();
writeSimpleElement(xmlStreamWriter, "strong", property.getDisplayName()); xmlStreamWriter.writeStartElement("td");
} else { if (property.getDescription() != null && property.getDescription().trim().length() > 0) {
xmlStreamWriter.writeCharacters(property.getDisplayName()); xmlStreamWriter.writeCharacters(property.getDescription());
} } else {
xmlStreamWriter.writeCharacters("No Description Provided.");
}
xmlStreamWriter.writeEndElement(); if (property.isSensitive()) {
writeSimpleElement(xmlStreamWriter, "td", property.getDefaultValue()); xmlStreamWriter.writeEmptyElement("br");
xmlStreamWriter.writeStartElement("td"); writeSimpleElement(xmlStreamWriter, "strong", "Sensitive Property: true");
writeValidValues(xmlStreamWriter, property); }
xmlStreamWriter.writeEndElement();
xmlStreamWriter.writeStartElement("td");
if (property.getDescription() != null && property.getDescription().trim().length() > 0) {
xmlStreamWriter.writeCharacters(property.getDescription());
} else {
xmlStreamWriter.writeCharacters("No Description Provided.");
}
if (property.isSensitive()) { if (property.isExpressionLanguageSupported()) {
xmlStreamWriter.writeEmptyElement("br"); xmlStreamWriter.writeEmptyElement("br");
writeSimpleElement(xmlStreamWriter, "strong", "Sensitive Property: true"); writeSimpleElement(xmlStreamWriter, "strong", "Supports Expression Language: true");
} }
xmlStreamWriter.writeEndElement();
if (property.isExpressionLanguageSupported()) { xmlStreamWriter.writeEndElement();
xmlStreamWriter.writeEmptyElement("br"); }
writeSimpleElement(xmlStreamWriter, "strong", "Supports Expression Language: true");
}
xmlStreamWriter.writeEndElement();
xmlStreamWriter.writeEndElement(); // TODO support dynamic properties...
} xmlStreamWriter.writeEndElement();
// TODO support dynamic properties... } else {
xmlStreamWriter.writeEndElement(); writeSimpleElement(xmlStreamWriter, "p", "This component has no required or optional properties.");
}
}
} else { private void writeValidValueDescription(XMLStreamWriter xmlStreamWriter, String description)
writeSimpleElement(xmlStreamWriter, "p", "This component has no required or optional properties."); throws XMLStreamException {
} xmlStreamWriter.writeCharacters(" ");
} xmlStreamWriter.writeStartElement("img");
xmlStreamWriter.writeAttribute("src", "../../html/images/iconInfo.png");
xmlStreamWriter.writeAttribute("alt", description);
xmlStreamWriter.writeAttribute("title", description);
xmlStreamWriter.writeEndElement();
private void writeValidValueDescription(XMLStreamWriter xmlStreamWriter, String description) }
throws XMLStreamException {
xmlStreamWriter.writeCharacters(" ");
xmlStreamWriter.writeStartElement("img");
xmlStreamWriter.writeAttribute("src", "../../html/images/iconInfo.png");
xmlStreamWriter.writeAttribute("alt", description);
xmlStreamWriter.writeAttribute("title", description);
xmlStreamWriter.writeEndElement();
} /**
* Interrogates a PropertyDescriptor to get a list of AllowableValues, if
* there are none, nothing is written to the stream.
*
* @param xmlStreamWriter the stream writer to use
* @param property the property to describe
* @throws XMLStreamException thrown if there was a problem writing to the
* XML Stream
*/
protected void writeValidValues(XMLStreamWriter xmlStreamWriter, PropertyDescriptor property)
throws XMLStreamException {
if (property.getAllowableValues() != null && property.getAllowableValues().size() > 0) {
xmlStreamWriter.writeStartElement("ul");
for (AllowableValue value : property.getAllowableValues()) {
xmlStreamWriter.writeStartElement("li");
xmlStreamWriter.writeCharacters(value.getDisplayName());
/** if (value.getDescription() != null) {
* Interrogates a PropertyDescriptor to get a list of AllowableValues, if writeValidValueDescription(xmlStreamWriter, value.getDescription());
* there are none, nothing is written to the stream. }
* xmlStreamWriter.writeEndElement();
* @param xmlStreamWriter
* the stream writer to use
* @param property
* the property to describe
* @throws XMLStreamException
* thrown if there was a problem writing to the XML Stream
*/
protected void writeValidValues(XMLStreamWriter xmlStreamWriter, PropertyDescriptor property)
throws XMLStreamException {
if (property.getAllowableValues() != null && property.getAllowableValues().size() > 0) {
xmlStreamWriter.writeStartElement("ul");
for (AllowableValue value : property.getAllowableValues()) {
xmlStreamWriter.writeStartElement("li");
xmlStreamWriter.writeCharacters(value.getDisplayName());
if (value.getDescription() != null) { }
writeValidValueDescription(xmlStreamWriter, value.getDescription()); xmlStreamWriter.writeEndElement();
} } else if (property.getControllerServiceDefinition() != null) {
xmlStreamWriter.writeEndElement(); Class<? extends ControllerService> controllerServiceClass = property.getControllerServiceDefinition();
writeSimpleElement(xmlStreamWriter, "strong", "Controller Service: ");
xmlStreamWriter.writeEmptyElement("br");
xmlStreamWriter.writeCharacters(controllerServiceClass.getSimpleName());
}
}
} /**
xmlStreamWriter.writeEndElement(); * Writes a begin element, then text, then end element for the element of a
} else if (property.getControllerServiceDefinition() != null) { * users choosing. Example: &lt;p&gt;text&lt;/p&gt;
Class<? extends ControllerService> controllerServiceClass = property.getControllerServiceDefinition(); *
writeSimpleElement(xmlStreamWriter, "strong", "Controller Service: "); * @param writer the stream writer to use
xmlStreamWriter.writeEmptyElement("br"); * @param elementName the name of the element
xmlStreamWriter.writeCharacters(controllerServiceClass.getSimpleName()); * @param characters the characters to insert into the element
} * @param strong whether the characters should be strong or not.
} * @throws XMLStreamException thrown if there was a problem writing to the
* stream.
*/
protected final static void writeSimpleElement(final XMLStreamWriter writer, final String elementName,
final String characters, boolean strong) throws XMLStreamException {
writer.writeStartElement(elementName);
if (strong) {
writer.writeStartElement("strong");
}
writer.writeCharacters(characters);
if (strong) {
writer.writeEndElement();
}
writer.writeEndElement();
}
/** /**
* Writes a begin element, then text, then end element for the element of a * Writes a begin element, then text, then end element for the element of a
* users choosing. Example: &lt;p&gt;text&lt;/p&gt; * users choosing. Example: &lt;p&gt;text&lt;/p&gt;
* *
* @param writer * @param writer the stream writer to use
* the stream writer to use * @param elementName the name of the element
* @param elementName * @param characters the characters to insert into the element
* the name of the element * @throws XMLStreamException thrown if there was a problem writing to the
* @param characters * stream
* the characters to insert into the element */
* @param strong protected final static void writeSimpleElement(final XMLStreamWriter writer, final String elementName,
* whether the characters should be strong or not. final String characters) throws XMLStreamException {
* @throws XMLStreamException writeSimpleElement(writer, elementName, characters, false);
* thrown if there was a problem writing to the stream. }
*/
protected final static void writeSimpleElement(final XMLStreamWriter writer, final String elementName,
final String characters, boolean strong) throws XMLStreamException {
writer.writeStartElement(elementName);
if (strong) {
writer.writeStartElement("strong");
}
writer.writeCharacters(characters);
if (strong) {
writer.writeEndElement();
}
writer.writeEndElement();
}
/** /**
* Writes a begin element, then text, then end element for the element of a * A helper method to write a link
* users choosing. Example: &lt;p&gt;text&lt;/p&gt; *
* * @param xmlStreamWriter the stream to write to
* @param writer * @param text the text of the link
* the stream writer to use * @param location the location of the link
* @param elementName * @throws XMLStreamException thrown if there was a problem writing to the
* the name of the element * stream
* @param characters */
* the characters to insert into the element protected void writeLink(final XMLStreamWriter xmlStreamWriter, final String text, final String location)
* @throws XMLStreamException throws XMLStreamException {
* thrown if there was a problem writing to the stream xmlStreamWriter.writeStartElement("a");
*/ xmlStreamWriter.writeAttribute("href", location);
protected final static void writeSimpleElement(final XMLStreamWriter writer, final String elementName, xmlStreamWriter.writeCharacters(text);
final String characters) throws XMLStreamException { xmlStreamWriter.writeEndElement();
writeSimpleElement(writer, elementName, characters, false); }
}
/**
* A helper method to write a link
*
* @param xmlStreamWriter
* the stream to write to
* @param text
* the text of the link
* @param location
* the location of the link
* @throws XMLStreamException
* thrown if there was a problem writing to the stream
*/
protected void writeLink(final XMLStreamWriter xmlStreamWriter, final String text, final String location)
throws XMLStreamException {
xmlStreamWriter.writeStartElement("a");
xmlStreamWriter.writeAttribute("href", location);
xmlStreamWriter.writeCharacters(text);
xmlStreamWriter.writeEndElement();
}
} }

View File

@ -26,33 +26,33 @@ import org.apache.nifi.processor.Relationship;
/** /**
* Writes documentation specific for a Processor. This includes everything for a * Writes documentation specific for a Processor. This includes everything for a
* ConfigurableComponent as well as Relationship information. * ConfigurableComponent as well as Relationship information.
* *
* *
*/ */
public class HtmlProcessorDocumentationWriter extends HtmlDocumentationWriter { public class HtmlProcessorDocumentationWriter extends HtmlDocumentationWriter {
@Override @Override
protected void writeAdditionalBodyInfo(final ConfigurableComponent configurableComponent, protected void writeAdditionalBodyInfo(final ConfigurableComponent configurableComponent,
final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { final XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
final Processor processor = (Processor) configurableComponent; final Processor processor = (Processor) configurableComponent;
writeSimpleElement(xmlStreamWriter, "h3", "Relationships: "); writeSimpleElement(xmlStreamWriter, "h3", "Relationships: ");
if (processor.getRelationships().size() > 0) { if (processor.getRelationships().size() > 0) {
xmlStreamWriter.writeStartElement("table"); xmlStreamWriter.writeStartElement("table");
xmlStreamWriter.writeStartElement("tr"); xmlStreamWriter.writeStartElement("tr");
writeSimpleElement(xmlStreamWriter, "th", "Name"); writeSimpleElement(xmlStreamWriter, "th", "Name");
writeSimpleElement(xmlStreamWriter, "th", "Description"); writeSimpleElement(xmlStreamWriter, "th", "Description");
xmlStreamWriter.writeEndElement(); xmlStreamWriter.writeEndElement();
for (Relationship relationship : processor.getRelationships()) { for (Relationship relationship : processor.getRelationships()) {
xmlStreamWriter.writeStartElement("tr"); xmlStreamWriter.writeStartElement("tr");
writeSimpleElement(xmlStreamWriter, "td", relationship.getName()); writeSimpleElement(xmlStreamWriter, "td", relationship.getName());
writeSimpleElement(xmlStreamWriter, "td", relationship.getDescription()); writeSimpleElement(xmlStreamWriter, "td", relationship.getDescription());
xmlStreamWriter.writeEndElement(); xmlStreamWriter.writeEndElement();
} }
xmlStreamWriter.writeEndElement(); xmlStreamWriter.writeEndElement();
} else { } else {
xmlStreamWriter.writeCharacters("This processor has no relationships."); xmlStreamWriter.writeCharacters("This processor has no relationships.");
} }
} }
} }

View File

@ -25,14 +25,14 @@ import org.apache.nifi.reporting.InitializationException;
/** /**
* Initializes a ControllerService using a * Initializes a ControllerService using a
* MockControllerServiceInitializationContext * MockControllerServiceInitializationContext
* *
* *
*/ */
public class ControllerServiceInitializer implements ConfigurableComponentInitializer { public class ControllerServiceInitializer implements ConfigurableComponentInitializer {
@Override @Override
public void initialize(ConfigurableComponent component) throws InitializationException { public void initialize(ConfigurableComponent component) throws InitializationException {
ControllerService controllerService = (ControllerService) component; ControllerService controllerService = (ControllerService) component;
controllerService.initialize(new MockControllerServiceInitializationContext()); controllerService.initialize(new MockControllerServiceInitializationContext());
} }
} }

View File

@ -23,15 +23,15 @@ import org.apache.nifi.processor.Processor;
/** /**
* Initializes a Procesor using a MockProcessorInitializationContext * Initializes a Procesor using a MockProcessorInitializationContext
* *
* *
*/ */
public class ProcessorInitializer implements ConfigurableComponentInitializer { public class ProcessorInitializer implements ConfigurableComponentInitializer {
@Override @Override
public void initialize(ConfigurableComponent component) { public void initialize(ConfigurableComponent component) {
Processor processor = (Processor) component; Processor processor = (Processor) component;
processor.initialize(new MockProcessorInitializationContext()); processor.initialize(new MockProcessorInitializationContext());
} }
} }

View File

@ -24,14 +24,14 @@ import org.apache.nifi.reporting.ReportingTask;
/** /**
* Initializes a ReportingTask using a MockReportingInitializationContext; * Initializes a ReportingTask using a MockReportingInitializationContext;
* *
* *
*/ */
public class ReportingTaskingInitializer implements ConfigurableComponentInitializer { public class ReportingTaskingInitializer implements ConfigurableComponentInitializer {
@Override @Override
public void initialize(ConfigurableComponent component) throws InitializationException { public void initialize(ConfigurableComponent component) throws InitializationException {
ReportingTask reportingTask = (ReportingTask) component; ReportingTask reportingTask = (ReportingTask) component;
reportingTask.initialize(new MockReportingInitializationContext()); reportingTask.initialize(new MockReportingInitializationContext());
} }
} }

View File

@ -22,19 +22,19 @@ import org.apache.nifi.controller.ControllerServiceLookup;
/** /**
* A Mock ControllerServiceInitializationContext so that ControllerServices can * A Mock ControllerServiceInitializationContext so that ControllerServices can
* be initialized for the purpose of generating documentation. * be initialized for the purpose of generating documentation.
* *
* *
*/ */
public class MockControllerServiceInitializationContext implements ControllerServiceInitializationContext { public class MockControllerServiceInitializationContext implements ControllerServiceInitializationContext {
@Override @Override
public String getIdentifier() { public String getIdentifier() {
return ""; return "";
} }
@Override @Override
public ControllerServiceLookup getControllerServiceLookup() { public ControllerServiceLookup getControllerServiceLookup() {
return new MockControllerServiceLookup(); return new MockControllerServiceLookup();
} }
} }

View File

@ -26,30 +26,30 @@ import org.apache.nifi.controller.ControllerServiceLookup;
* A Mock ControllerServiceLookup that can be used so that * A Mock ControllerServiceLookup that can be used so that
* ConfigurableComponents can be initialized for the purpose of generating * ConfigurableComponents can be initialized for the purpose of generating
* documentation * documentation
* *
* *
*/ */
public class MockControllerServiceLookup implements ControllerServiceLookup { public class MockControllerServiceLookup implements ControllerServiceLookup {
@Override @Override
public ControllerService getControllerService(String serviceIdentifier) { public ControllerService getControllerService(String serviceIdentifier) {
return null; return null;
} }
@Override @Override
public boolean isControllerServiceEnabled(String serviceIdentifier) { public boolean isControllerServiceEnabled(String serviceIdentifier) {
return false; return false;
} }
@Override @Override
public boolean isControllerServiceEnabled(ControllerService service) { public boolean isControllerServiceEnabled(ControllerService service) {
return false; return false;
} }
@Override @Override
public Set<String> getControllerServiceIdentifiers(Class<? extends ControllerService> serviceType) public Set<String> getControllerServiceIdentifiers(Class<? extends ControllerService> serviceType)
throws IllegalArgumentException { throws IllegalArgumentException {
return Collections.emptySet(); return Collections.emptySet();
} }
} }

View File

@ -23,23 +23,23 @@ import org.apache.nifi.processor.ProcessorInitializationContext;
/** /**
* A Mock ProcessorInitializationContext that can be used so that Processors can * A Mock ProcessorInitializationContext that can be used so that Processors can
* be initialized for the purpose of generating documentation. * be initialized for the purpose of generating documentation.
* *
* *
*/ */
public class MockProcessorInitializationContext implements ProcessorInitializationContext { public class MockProcessorInitializationContext implements ProcessorInitializationContext {
@Override @Override
public String getIdentifier() { public String getIdentifier() {
return ""; return "";
} }
@Override @Override
public ProcessorLog getLogger() { public ProcessorLog getLogger() {
return null; return null;
} }
@Override @Override
public ControllerServiceLookup getControllerServiceLookup() { public ControllerServiceLookup getControllerServiceLookup() {
return new MockControllerServiceLookup(); return new MockControllerServiceLookup();
} }
} }

View File

@ -25,39 +25,39 @@ import org.apache.nifi.scheduling.SchedulingStrategy;
/** /**
* A Mock ReportingInitializationContext that can be used to initialize a * A Mock ReportingInitializationContext that can be used to initialize a
* ReportingTask for the purposes of documentation generation. * ReportingTask for the purposes of documentation generation.
* *
* @author Alligator * @author Alligator
* *
*/ */
public class MockReportingInitializationContext implements ReportingInitializationContext { public class MockReportingInitializationContext implements ReportingInitializationContext {
@Override @Override
public String getIdentifier() { public String getIdentifier() {
return ""; return "";
} }
@Override @Override
public String getName() { public String getName() {
return ""; return "";
} }
@Override @Override
public long getSchedulingPeriod(TimeUnit timeUnit) { public long getSchedulingPeriod(TimeUnit timeUnit) {
return 0; return 0;
} }
@Override @Override
public ControllerServiceLookup getControllerServiceLookup() { public ControllerServiceLookup getControllerServiceLookup() {
return new MockControllerServiceLookup(); return new MockControllerServiceLookup();
} }
@Override @Override
public String getSchedulingPeriod() { public String getSchedulingPeriod() {
return ""; return "";
} }
@Override @Override
public SchedulingStrategy getSchedulingStrategy() { public SchedulingStrategy getSchedulingStrategy() {
return SchedulingStrategy.TIMER_DRIVEN; return SchedulingStrategy.TIMER_DRIVEN;
} }
} }

View File

@ -1,3 +1,19 @@
/*
* 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.example; package org.apache.nifi.documentation.example;
import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.AbstractProcessor;
@ -9,7 +25,6 @@ public class NakedProcessor extends AbstractProcessor {
@Override @Override
public void onTrigger(ProcessContext arg0, ProcessSession arg1) throws ProcessException { public void onTrigger(ProcessContext arg0, ProcessSession arg1) throws ProcessException {
// TODO Auto-generated method stub
} }

View File

@ -39,7 +39,7 @@
<module>nifi-administration</module> <module>nifi-administration</module>
<module>nifi-web</module> <module>nifi-web</module>
<module>nifi-resources</module> <module>nifi-resources</module>
<module>nifi-documentation</module> <module>nifi-documentation</module>
</modules> </modules>
<dependencies> <dependencies>
<dependency> <dependency>

View File

@ -111,7 +111,7 @@
<dependency> <dependency>
<groupId>org.apache.nifi</groupId> <groupId>org.apache.nifi</groupId>
<artifactId>nifi-documentation</artifactId> <artifactId>nifi-documentation</artifactId>
<version>0.0.2-incubating-SNAPSHOT</version> <version>0.1.0-incubating-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>

View File

@ -151,7 +151,7 @@ public class DistributeLoad extends AbstractProcessor {
} }
private static Relationship createRelationship(final int num) { private static Relationship createRelationship(final int num) {
return new Relationship.Builder().name(String.valueOf(num)).build(); return new Relationship.Builder().name(String.valueOf(num)).description("Where to route flowfiles for this relationship index").build();
} }
@Override @Override

View File

@ -79,9 +79,9 @@ public class HandleHttpRequest extends AbstractProcessor {
private static final Pattern URL_QUERY_PARAM_DELIMITER = Pattern.compile("&"); private static final Pattern URL_QUERY_PARAM_DELIMITER = Pattern.compile("&");
// Allowable values for client auth // Allowable values for client auth
public static final AllowableValue CLIENT_NONE = new AllowableValue("No Authentication", "Processor will not authenticate clients. Anyone can communicate with this Processor anonymously"); public static final AllowableValue CLIENT_NONE = new AllowableValue("No Authentication", "No Authentication", "Processor will not authenticate clients. Anyone can communicate with this Processor anonymously");
public static final AllowableValue CLIENT_WANT = new AllowableValue("Want Authentication", "Processor will try to verify the client but if unable to verify will allow the client to communicate anonymously"); public static final AllowableValue CLIENT_WANT = new AllowableValue("Want Authentication", "Want Authentication", "Processor will try to verify the client but if unable to verify will allow the client to communicate anonymously");
public static final AllowableValue CLIENT_NEED = new AllowableValue("Need Authentication", "Processor will reject communications from any client unless the client provides a certificate that is trusted by the TrustStore specified in the SSL Context Service"); public static final AllowableValue CLIENT_NEED = new AllowableValue("Need Authentication", "Need Authentication", "Processor will reject communications from any client unless the client provides a certificate that is trusted by the TrustStore specified in the SSL Context Service");
public static final PropertyDescriptor PORT = new PropertyDescriptor.Builder() public static final PropertyDescriptor PORT = new PropertyDescriptor.Builder()
@ -208,6 +208,7 @@ public class HandleHttpRequest extends AbstractProcessor {
descriptors.add(ALLOW_HEAD); descriptors.add(ALLOW_HEAD);
descriptors.add(ALLOW_OPTIONS); descriptors.add(ALLOW_OPTIONS);
descriptors.add(ADDITIONAL_METHODS); descriptors.add(ADDITIONAL_METHODS);
descriptors.add(CLIENT_AUTH);
return descriptors; return descriptors;
} }

View File

@ -22,39 +22,19 @@
</head> </head>
<body> <body>
<h2>Description:</h2> <strong>Relationships</strong>
<p>This processor distributes FlowFiles to downstream <ul>
processors based on a distribution strategy. The user may select the strategy "round robin", the <li>1
strategy "next available", or "load distribution service". If using the round robin <ul>
strategy, the default is to assign each destination (i.e., relationship) a weighting of 1 <li>By default, there is one relationship, named 1. The number
(evenly distributed). However, the user may add optional properties to change this weighting. When of relationships is determined by the value of the &lt;Number of
adding a property, the name must be a positive integer between 1 and the number of relationships (inclusive). Relationships&gt; property.</li>
For example, if Number of Relationships has a value of 8 and a property is added with the name 5 </ul>
and the value 10, then relationship 5 (among the 8) will receive 10 </li>
FlowFiles in each iteration instead of 1. All other relationships will receive 1 FlowFile in each iteration. </ul>
</p>
<strong>Properties:</strong>
<p>In the list below, the names of required properties appear
in bold. Any other properties (not in bold) are considered optional.
If a property has a default value, it is indicated. If a property
supports the use of the NiFi Expression Language (or simply,
"expression language"), that is also indicated.</p>
<p>
<strong>Relationships:</strong>
</p>
<ul>
<li>1
<ul>
<li>By default, there is one relationship, named 1. The number
of relationships is determined by the value of the &lt;Number of
Relationships&gt; property.</li>
</ul>
</li>
</ul>
</body> </body>
</html> </html>

View File

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="en">
<!--
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.
-->
<head>
<meta charset="utf-8"/>
<title>EvaluateJsonPath</title>
<link rel="stylesheet" href="../../css/component-usage.css" type="text/css"/>
</head>
<body>
<!-- Processor Documentation ================================================== -->
<p>
<strong>Note:</strong> The underlying JsonPath library loads the entirety of the streamed content into and performs
result evaluations in memory. Accordingly, it is important to consider the anticipated profile of content being
evaluated by this processor and the hardware supporting it especially when working against large JSON documents.
</p>
<p>
<strong>Modifies Attributes:</strong>
</p>
<p>
This processor adds user-defined attributes if the &lt;Destination&gt; property is set to
<code>flowfile-attribute</code>.
</p>
<p>
<strong>Properties</strong>
</p>
<ul>
<li>
user-defined properties
<ul>
<li>The name of the attribute to put the JsonPath result into if
flowfile-attribute is used as the value for the Destination
property; if using flowfile-content as the value for the
Destination property, this value is ignored.
</li>
<li>Supports expression language: false</li>
</ul>
</li>
</ul>
</body>
</html>

View File

@ -1,155 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<!--
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.
-->
<head>
<meta charset="utf-8"/>
<title>EvaluateJsonPath</title>
<link rel="stylesheet" href="../../css/component-usage.css" type="text/css"/>
</head>
<body>
<!-- Processor Documentation ================================================== -->
<h2>Description:</h2>
<p>
Evaluates one or more JsonPath expressions against the content of a FlowFile. The results of those expressions are
assigned to FlowFile Attributes or are written to the content of the FlowFile itself, depending on configuration of
the Processor. JsonPaths are entered by adding user-defined properties; the name of the property maps to the
Attribute Name into which the result will be placed (if the Destination is flowfile-attribute; otherwise, the
property name is ignored). The value of the property must be a valid JsonPath expression. If the JsonPath evaluates
to a JSON array or JSON object and the Return Type is set to 'scalar' the FlowFile will be unmodified and will be
routed to failure. A Return Type of JSON can return scalar values if the provided JsonPath evaluates to the
specified value and will be routed as a match. If Destination is 'flowfile-content' and the JsonPath does not
evaluate to a defined path, the FlowFile will be routed to 'unmatched' without having its contents modified. If
Destination is flowfile-attribute and the expression matches nothing, attributes will be created with empty
strings as the value, and the FlowFile will always be routed to 'matched.'
</p>
<p>
<strong>Note:</strong> The underlying JsonPath library loads the entirety of the streamed content into and performs
result evaluations in memory. Accordingly, it is important to consider the anticipated profile of content being
evaluated by this processor and the hardware supporting it especially when working against large JSON documents.
</p>
<p>
<strong>Properties:</strong>
</p>
<p>
In the list below, the names of required properties appear in bold.
Any other properties (not in bold) are considered optional. If a
property has a default value, it is indicated. If a property
supports the use of the NiFi Expression Language (or simply,
"expression language"), that is also indicated.
</p>
<p>
<strong>Modifies Attributes:</strong>
</p>
<p>
This processor adds user-defined attributes if the &lt;Destination&gt; property is set to
<code>flowfile-attribute</code>.
</p>
<ul>
<li>
<strong>Destination</strong>
<ul>
<li>Indicates whether the results of the JsonPath evaluation are
written to the FlowFile content or a FlowFile attribute; if using
attribute, the attribute's name must be specified in the value of
the Attribute Name property.
</li>
<li>
Valid values are:
<ul>
<li>flowfile-content</li>
<li>flowfile-attribute</li>
</ul>
</li>
<li>Default value: flowfile-content</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li>
<strong>Return Type</strong>
<ul>
<li>Indicates the desired return type of the JsonPath expressions.
Selecting 'auto-detect' will set the return type to 'json' for a
Destination of 'flowfile-content', and 'scalar' for a Destination of
'flowfile-attribute'.")
</li>
<li>
Valid values are:
<ul>
<li>auto-detect</li>
<li>json</li>
<li>scalar</li>
</ul>
</li>
<li>Default value: auto-detect</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li>
user-defined properties
<ul>
<li>The name of the attribute to put the JsonPath result into if
flowfile-attribute is used as the value for the Destination
property; if using flowfile-content as the value for the
Destination property, this value is ignored.
</li>
<li>Supports expression language: false</li>
</ul>
</li>
</ul>
<p>
<strong>Relationships:</strong>
</p>
<ul>
<li>
failure
<ul>
<li>If the JsonPath cannot be evaluated against the content of the
FlowFile, then the FlowFile follows this relationship. For
example, if the FlowFile does not contain valid JSON.
</li>
</ul>
</li>
<li>
matched
<ul>
<li>If the JsonPath is successfully evaluated and the FlowFile is
modified as a result, then the FlowFile follows this
relationship.
</li>
</ul>
</li>
<li>
unmatched
<ul>
<li>If the JsonPath does not match the content of the FlowFile, then
the FlowFile follows this relationship.
</li>
</ul>
</li>
</ul>
</p>
</body>
</html>

View File

@ -1,55 +1,55 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<!-- <!--
Licensed to the Apache Software Foundation (ASF) under one or more Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership. this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0 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 not use this file except in compliance with
the License. You may obtain a copy of the License at the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>EvaluateXQuery</title> <title>EvaluateXQuery</title>
<link rel="stylesheet" href="../../css/component-usage.css" <link rel="stylesheet" href="../../css/component-usage.css"
type="text/css" /> type="text/css" />
</head> </head>
<body> <body>
<!-- Processor Documentation ================================================== --> <!-- Processor Documentation ================================================== -->
<p> <p>
<strong>Modifies Attributes:</strong> <strong>Modifies Attributes:</strong>
</p> </p>
<p> <p>
This processor adds user-defined attributes if the &lt;Destination&gt; This processor adds user-defined attributes if the &lt;Destination&gt;
property is set to property is set to
<code>flowfile-attribute</code> <code>flowfile-attribute</code>
. .
</p> </p>
<p> <p>
<strong>Examples:</strong> <strong>Examples:</strong>
</p> </p>
<p>This processor produces one attribute or FlowFile per <p>This processor produces one attribute or FlowFile per
XQueryResult. If only one attribute or FlowFile is desired, the XQueryResult. If only one attribute or FlowFile is desired, the
following examples demonstrate how this can be achieved using the following examples demonstrate how this can be achieved using the
XQuery language. The examples below reference the following sample XQuery language. The examples below reference the following sample
XML:</p> XML:</p>
<pre> <pre>
<code> <code>
&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;?xml-stylesheet type="text/xsl" href="foo.xsl"?&gt; &lt;?xml-stylesheet type="text/xsl" href="foo.xsl"?&gt;
@ -85,77 +85,77 @@
&lt;/fruit&gt; &lt;/fruit&gt;
&lt;/ns:fruitbasket&gt; &lt;/ns:fruitbasket&gt;
</code> </code>
</pre> </pre>
<p> <p>
<ul> <ul>
<li>XQuery to return all "fruit" nodes individually (7 Results): <li>XQuery to return all "fruit" nodes individually (7 Results):
<ul> <ul>
<li>//fruit</li> <li>//fruit</li>
</ul> </ul>
</li> </li>
<li>XQuery to return only the first "fruit" node (1 Result): <li>XQuery to return only the first "fruit" node (1 Result):
<ul> <ul>
<li>//fruit[1]</li> <li>//fruit[1]</li>
</ul> </ul>
</li> </li>
<li>XQuery to return only the last "fruit" node (1 Result): <li>XQuery to return only the last "fruit" node (1 Result):
<ul> <ul>
<li>//fruit[count(//fruit)]</li> <li>//fruit[count(//fruit)]</li>
</ul> </ul>
</li> </li>
<li>XQuery to return all "fruit" nodes, wrapped in a "basket" tag <li>XQuery to return all "fruit" nodes, wrapped in a "basket" tag
(1 Result): (1 Result):
<ul> <ul>
<li>&lt;basket&gt;{//fruit}&lt;/basket&gt;</li> <li>&lt;basket&gt;{//fruit}&lt;/basket&gt;</li>
</ul> </ul>
</li> </li>
<li>XQuery to return all "fruit" names individually (7 Results): <li>XQuery to return all "fruit" names individually (7 Results):
<ul> <ul>
<li>//fruit/text()</li> <li>//fruit/text()</li>
</ul> </ul>
</li> </li>
<li>XQuery to return only the first "fruit" name (1 Result): <li>XQuery to return only the first "fruit" name (1 Result):
<ul> <ul>
<li>//fruit[1]/text()</li> <li>//fruit[1]/text()</li>
</ul> </ul>
</li> </li>
<li>XQuery to return only the last "fruit" name (1 Result): <li>XQuery to return only the last "fruit" name (1 Result):
<ul> <ul>
<li>//fruit[count(//fruit)]/text()</li> <li>//fruit[count(//fruit)]/text()</li>
</ul> </ul>
</li> </li>
<li>XQuery to return all "fruit" names as a comma separated list <li>XQuery to return all "fruit" names as a comma separated list
(1 Result): (1 Result):
<ul> <ul>
<li>string-join((for $x in //fruit return $x/name/text()), ', <li>string-join((for $x in //fruit return $x/name/text()), ',
')</li> ')</li>
</ul> </ul>
</li> </li>
<li>XQuery to return all "fruit" colors and names as a comma <li>XQuery to return all "fruit" colors and names as a comma
separated list (1 Result): separated list (1 Result):
<ul> <ul>
<li>string-join((for $y in (for $x in //fruit return <li>string-join((for $y in (for $x in //fruit return
string-join(($x/color/text() , $x/name/text()), ' ')) return $y), string-join(($x/color/text() , $x/name/text()), ' ')) return $y),
', ')</li> ', ')</li>
</ul> </ul>
</li> </li>
<li>XQuery to return all "fruit" colors and names as a comma <li>XQuery to return all "fruit" colors and names as a comma
separated list (1 Result): separated list (1 Result):
<ul> <ul>
<li>string-join((for $y in (for $x in //fruit return <li>string-join((for $y in (for $x in //fruit return
string-join(($x/color/text() , $x/name/text()), ' ')) return $y), string-join(($x/color/text() , $x/name/text()), ' ')) return $y),
', ')</li> ', ')</li>
</ul> </ul>
</li> </li>
<li>XQuery to return all "fruit" colors and names as a new line <li>XQuery to return all "fruit" colors and names as a new line
separated list (1 Result): separated list (1 Result):
<ul> <ul>
<li>string-join((for $y in (for $x in //fruit return <li>string-join((for $y in (for $x in //fruit return
string-join(($x/color/text() , $x/name/text()), ' ')) return $y), string-join(($x/color/text() , $x/name/text()), ' ')) return $y),
'\n')</li> '\n')</li>
</ul> </ul>
</li> </li>
</ul> </ul>
</body> </body>
</html> </html>

View File

@ -1,100 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<!--
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.
-->
<head>
<meta charset="utf-8" />
<title>ExecuteProcess</title>
<link rel="stylesheet" href="../../css/component-usage.css" type="text/css" />
</head>
<body>
<!-- Processor Documentation ================================================== -->
<h2> Description:</h2>
<p>
Runs an operating system command specified by the user and writes the output of that command to a FlowFile. If the command is expected
to be long-running, the Processor can output the partial data on a specified interval. When this option is used, the output is expected to be in textual
format, as it typically does not make sense to split binary data on arbitrary time-based intervals.
</p>
<p>
<strong>Properties:</strong>
</p>
<p>In the list below, the names of required properties appear
in bold. Any other properties (not in bold) are considered optional.
If a property has a default value, it is indicated. If a property
supports the use of the NiFi Expression Language (or simply,
"expression language"), that is also indicated.</p>
<ul>
<li><strong>Command</strong>
<ul>
<li>Specifies the command to be executed; if just the name of an executable is provided, it must be in the user's environment PATH.</li>
<li>Default value: none</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li>Command Arguments
<ul>
<li>The arguments to supply to the executable delimited by white space. White space can be escaped by enclosing it in double-quotes.</li>
<li>Default value: none</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li>Working Directory
<ul>
<li>The directory to use as the current working directory when executing the command</li>
<li>Default value: none (which means whatever NiFi's root installation directory is)</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li>Batch Duration
<ul>
<li>
If the process is expected to be long-running and produce textual output, a batch duration can be specified so
that the output will be captured for this amount of time and a FlowFile will then be sent out with the results
and a new FlowFile will be started, rather than waiting for the process to finish before sending out the results.
If no value is provided, the process will run to completion and the entire output of the process will be written
to a single FlowFile.
</li>
<li>Default value: none</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li>Redirect Error Stream
<ul>
<li>
If true will redirect any error stream output of the process to the output stream.
This is particularly helpful for processes which write extensively to the error stream or for troubleshooting.
</li>
<li>Default value: false</li>
<li>Allowed Values: true, false</li>
<li>Supports expression language: false</li>
</ul>
</li>
</ul>
<p>
<strong>Relationships:</strong>
</p>
<ul>
<li>success
<ul>
<li>All FlowFiles that are created are routed to this relationship.</li>
</ul>
</li>
</ul>
</body>
</html>

View File

@ -0,0 +1,127 @@
<!DOCTYPE html>
<html lang="en">
<!--
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.
-->
<head>
<meta charset="utf-8" />
<title>HandleHttpRequest</title>
<link rel="stylesheet" href="../../css/component-usage.css" type="text/css" />
</head>
<body>
<h2>Usage Description</h2>
<p>
The pairing of this Processor with a <a href="../org.apache.nifi.processors.standard.HandleHttpResponse/index.html">HandleHttpResponse</a> Processor
provides the ability to use NiFi to visually construct a web server that can carry out any functionality that is available
through the existing Processors. For example, one could construct a Web-based front end to an SFTP Server by constructing a
flow such as:
</p>
<p>
<a href="index.html">HandleHttpRequest</a> ->
<a href="../org.apache.nifi.processors.standard.PutSFTP/index.html">PutSFTP</a> ->
<a href="../org.apache.nifi.processors.standard.HandleHttpResponse/index.html">HandleHttpResponse</a>
</p>
<p>
The HandleHttpRequest Processor provides several Properties to configure which methods are supported, the paths that are
supported, and SSL configuration. The FlowFiles that are generated by this Processor have the following attributes added to
them, providing powerful routing capabilities and traceability of all data:
</p>
<table>
<thead>
<tr>
<th>Attribute Name</th>
<th>Attribute Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>http.context.identifier</td>
<td>An identifier that allows the HandleHttpRequest and HandleHttpResponse to coordinate which FlowFile belongs
to which HTTP Request/Response.</td>
</tr>
<tr>
<td>mime.type</td>
<td>The MIME Type of the data, according to the HTTP Header "Content-Type"</td>
</tr>
<tr>
<td>http.servlet.path</td>
<td>The part of the request URL that is considered the Servlet Path</td>
</tr>
<tr>
<td>http.context.path</td>
<td>The part of the request URL that is considered to be the Context Path</td>
</tr>
<tr>
<td>http.method</td>
<td>The HTTP Method that was used for the request, such as GET or POST</td>
</tr>
<tr>
<td>http.query.string</td>
<td>The query string portion of hte Request URL</td>
</tr>
<tr>
<td>http.remote.host</td>
<td>The hostname of the requestor</td>
</tr>
<tr>
<td>http.remote.addr</td>
<td>The hostname:port combination of the requestor</td>
</tr>
<tr>
<td>http.remote.user</td>
<td>The username of the requestor</td>
</tr>
<tr>
<td>http.request.uri</td>
<td>The full Request URL</td>
</tr>
<tr>
<td>http.auth.type</td>
<td>The type of HTTP Authorization used</td>
</tr>
<tr>
<td>http.principal.name</td>
<td>The name of the authenticated user making the request</td>
</tr>
<tr>
<td>http.subject.dn</td>
<td>The Distinguished Name of the requestor. This value will not be populated unless the Processor is
configured to use an SSLContext Service</td>
</tr>
<tr>
<td>http.issuer.dn</td>
<td>The Distinguished Name of the entity that issued the Subject's certificate. This value will not be
populated unless the Processor is configured to use an SSLContext Service</td>
</tr>
<tr>
<td>http.headers.XXX</td>
<td>Each of the HTTP Headers that is received in the request will be added as an attribute, prefixed
with "http.headers." For example, if the request contains an HTTP Header named "x-my-header",
then the value will be added to an attribute named "http.headers.x-my-header"</td>
</tr>
</tbody>
</table>
<p>
<strong>See Also:</strong><br />
<a href="../org.apache.nifi.processors.standard.HandleHttpResponse/index.html">HandleHttpResponse</a><br />
<a href="../org.apache.nifi.http.StandardHttpContextMap/index.html">StandardHttpContextMap</a><br />
<a href="../org.apache.nifi.ssl.StandardSSLContextService/index.html">StandardSSLContextService</a><br />
</p>
</body>
</html>

View File

@ -1,255 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<!--
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.
-->
<head>
<meta charset="utf-8" />
<title>HandleHttpRequest</title>
<link rel="stylesheet" href="../../css/component-usage.css" type="text/css" />
</head>
<body>
<!-- Processor Documentation ================================================== -->
<h2>Description:</h2>
<p>
This processor starts an HTTP server and creates a FlowFile for each HTTP Request that it receives. The Processor leaves
the HTTP Connection open and is intended to be used in conjunction with a
<a href="../org.apache.nifi.processors.standard.HandleHttpResponse/index.html">HandleHttpResponse</a> Processor.
</p>
<p>
The pairing of this Processor with a <a href="../org.apache.nifi.processors.standard.HandleHttpResponse/index.html">HandleHttpResponse</a> Processor
provides the ability to use NiFi to visually construct a web server that can carry out any functionality that is available
through the existing Processors. For example, one could construct a Web-based front end to an SFTP Server by constructing a
flow such as:
</p>
<p>
<a href="index.html">HandleHttpRequest</a> ->
<a href="../org.apache.nifi.processors.standard.PutSFTP/index.html">PutSFTP</a> ->
<a href="../org.apache.nifi.processors.standard.HandleHttpResponse/index.html">HandleHttpResponse</a>
</p>
<p>
The HandleHttpRequest Processor provides several Properties to configure which methods are supported, the paths that are
supported, and SSL configuration. The FlowFiles that are generated by this Processor have the following attributes added to
them, providing powerful routing capabilities and traceability of all data:
</p>
<table>
<thead>
<th>Attribute Name</th>
<th>Attribute Description</th>
</thead>
<tbody>
<tr>
<td>http.context.identifier</td>
<td>An identifier that allows the HandleHttpRequest and HandleHttpResponse to coordinate which FlowFile belongs
to which HTTP Request/Response.</td>
</tr>
<tr>
<td>mime.type</td>
<td>The MIME Type of the data, according to the HTTP Header "Content-Type"</td>
</tr>
<tr>
<td>http.servlet.path</td>
<td>The part of the request URL that is considered the Servlet Path</td>
</tr>
<tr>
<td>http.context.path</td>
<td>The part of the request URL that is considered to be the Context Path</td>
</tr>
<tr>
<td>http.method</td>
<td>The HTTP Method that was used for the request, such as GET or POST</td>
</tr>
<tr>
<td>http.query.string</td>
<td>The query string portion of hte Request URL</td>
</tr>
<tr>
<td>http.remote.host</td>
<td>The hostname of the requestor</td>
</tr>
<tr>
<td>http.remote.addr</td>
<td>The hostname:port combination of the requestor</td>
</tr>
<tr>
<td>http.remote.user</td>
<td>The username of the requestor</td>
</tr>
<tr>
<td>http.request.uri</td>
<td>The full Request URL</td>
</tr>
<tr>
<td>http.auth.type</td>
<td>The type of HTTP Authorization used</td>
</tr>
<tr>
<td>http.principal.name</td>
<td>The name of the authenticated user making the request</td>
</tr>
<tr>
<td>http.subject.dn</td>
<td>The Distinguished Name of the requestor. This value will not be populated unless the Processor is
configured to use an SSLContext Service</td>
</tr>
<tr>
<td>http.issuer.dn</td>
<td>The Distinguished Name of the entity that issued the Subject's certificate. This value will not be
populated unless the Processor is configured to use an SSLContext Service</td>
</tr>
<tr>
<td>http.headers.XXX</td>
<td>Each of the HTTP Headers that is received in the request will be added as an attribute, prefixed
with "http.headers." For example, if the request contains an HTTP Header named "x-my-header",
then the value will be added to an attribute named "http.headers.x-my-header"</td>
</tr>
</tbody>
</table>
<p>
<strong>Properties:</strong>
</p>
<p>
In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. If a property has a default value, it is indicated. If a property supports the use of the NiFi Expression Language (or simply, "expression language"), that is also indicated.
</p>
<ul>
<li><strong>Listening Port</strong>
<ul>
<li>The port to listen on for incoming HTTP Requests</li>
<li>Default value: no default</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li>Hostname
<ul>
<li>The Hostname to bind to. If not specified, will bind to all hosts</li>
<li>Default value: no default</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li><strong>HTTP Context Map</strong>
<ul>
<li>The HTTP Context Map Controller Service to use for caching the HTTP Request Information</li>
<li>Default value: no default</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li>SSL Context Service
<ul>
<li>The Controller Service to use for obtaining an SSL Context. The SSL Context controller service is a mechanism for providing all the security properties that allow for secure communications between NiFi extensions and other systems. See the User Guide or the Controller Services documentation via the "help" link in the upper-right corner of the GUI for more information about the StandardSSLContextService. The value for this property is the identifier name that is configured in the StandardSSLContextService.</li>
<li>Default value: no default</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li><strong>Allowed Paths</strong>
<ul>
<li>A Regular Expression that specifies the valid HTTP Paths that are allowed in the incoming URL Requests. If this value is specified and the path of the HTTP Requests does not match this Regular Expression, the Processor will respond with a 404: NotFound</li>
<li>Default value: no default</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li><strong>Allow GET</strong>
<ul>
<li>Specifies whether or not to allow HTTP GET Method</li>
<li>Default value: true</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li><strong>Allow POST</strong>
<ul>
<li>Specifies whether or not to allow HTTP POST Method</li>
<li>Default value: true</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li><strong>Allow PUT</strong>
<ul>
<li>Specifies whether or not to allow HTTP PUT Method</li>
<li>Default value: true</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li><strong>Allow DELETE</strong>
<ul>
<li>Specifies whether or not to allow HTTP DELETE Method</li>
<li>Default value: true</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li><strong>Allow HEAD</strong>
<ul>
<li>Specifies whether or not to allow HTTP HEAD Method</li>
<li>Default value: false</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li><strong>Allow OPTIONS</strong>
<ul>
<li>Specifies whether or not to allow HTTP OPTIONS Method</li>
<li>Default value: false</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li>Additional HTTP Methods
<ul>
<li>A comma-separated list of non-standard HTTP Methods that should be allowed</li>
<li>Default value: no default</li>
<li>Supports expression language: false</li>
</ul>
</li>
<li><strong>Client Authentication</strong>
<ul>
<li>Specifies whether or not the Processor should authenticate clients. This value is ignored if the &lt;SSL Context Service&gt; Property is not specified or the SSL Context provided uses only a KeyStore and not a TrustStore.</li>
<li>
The following values are allowed:
<ul>
<li><b>No Authentication</b> - Processor will not authenticate clients. Anyone can communicate with this Processor anonymously</li>
<li><b>Want Authentication</b> - Processor will try to verify the client but if unable to verify will allow the client to communicate anonymously</li>
<li><b>Need Authentication</b> - Processor will reject communications from any client unless the client provides a certificate that is trusted by the TrustStore specified in the SSL Context Service</li>
</ul>
</li>
<li>Default value: No Authentication</li>
<li>Supports expression language: false</li>
</ul>
</li>
</ul>
<p>
<strong>Relationships:</strong>
</p>
<ul>
<li>success
<ul>
<li>All FlowFiles that are created are routed to this relationship.</li>
</ul>
</li>
</ul>
<p>
<strong>See Also:</strong><br />
<a href="../org.apache.nifi.processors.standard.HandleHttpResponse/index.html">HandleHttpResponse</a><br />
<a href="../org.apache.nifi.http.StandardHttpContextMap/index.html">StandardHttpContextMap</a><br />
<a href="../org.apache.nifi.ssl.StandardSSLContextService/index.html">StandardSSLContextService</a><br />
</p>
</body>
</html>

View File

@ -0,0 +1,57 @@
<!DOCTYPE html>
<html lang="en">
<!--
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.
-->
<head>
<meta charset="utf-8" />
<title>HandleHttpResponse</title>
<link rel="stylesheet" href="../../css/component-usage.css" type="text/css" />
</head>
<body>
<!-- Processor Documentation ================================================== -->
<h2>Usage Description:</h2>
<p>
The pairing of this Processor with a <a href="../org.apache.nifi.processors.standard.HandleHttpRequest/index.html">HandleHttpRequest</a> Processor
provides the ability to use NiFi to visually construct a web server that can carry out any functionality that is available
through the existing Processors. For example, one could construct a Web-based front end to an SFTP Server by constructing a
flow such as:
</p>
<p>
<a href="../org.apache.nifi.processors.standard.HandleHttpRequest/index.html">HandleHttpRequest</a> ->
<a href="../org.apache.nifi.processors.standard.PutSFTP/index.html">PutSFTP</a> ->
<a href="index.html">HandleHttpResponse</a>
</p>
<p>
This Processor must be configured with the same &lt;HTTP Context Map&gt; service as the corresponding HandleHttpRequest Processor.
Otherwise, all FlowFiles will be routed to the 'failure' relationship.
</p>
<p>
All FlowFiles must have an attribute named <code>http.context.identifier</code>. The value of this attribute is used to lookup
the HTTP Response so that the proper message can be sent back to the requestor. If this attribute is missing, the FlowFile
will be routed to 'failure.'
</p>
<p>
<strong>See Also:</strong><br />
<a href="../org.apache.nifi.processors.standard.HandleHttpRequest/index.html">HandleHttpRequest</a><br />
<a href="../org.apache.nifi.http.StandardHttpContextMap/index.html">StandardHttpContextMap</a><br />
<a href="../org.apache.nifi.ssl.StandardSSLContextService/index.html">StandardSSLContextService</a><br />
</p>
</body>
</html>

View File

@ -1,112 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<!--
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.
-->
<head>
<meta charset="utf-8" />
<title>HandleHttpResponse</title>
<link rel="stylesheet" href="../../css/component-usage.css" type="text/css" />
</head>
<body>
<!-- Processor Documentation ================================================== -->
<h2>Description:</h2>
<p>
This processor responds to an HTTP request that was received by the
<a href="../org.apache.nifi.processors.standard.HandleHttpRequest/index.html">HandleHttpRequest</a> Processor.
</p>
<p>
The pairing of this Processor with a <a href="../org.apache.nifi.processors.standard.HandleHttpRequest/index.html">HandleHttpRequest</a> Processor
provides the ability to use NiFi to visually construct a web server that can carry out any functionality that is available
through the existing Processors. For example, one could construct a Web-based front end to an SFTP Server by constructing a
flow such as:
</p>
<p>
<a href="../org.apache.nifi.processors.standard.HandleHttpRequest/index.html">HandleHttpRequest</a> ->
<a href="../org.apache.nifi.processors.standard.PutSFTP/index.html">PutSFTP</a> ->
<a href="index.html">HandleHttpResponse</a>
</p>
<p>
This Processor must be configured with the same &lt;HTTP Context Map&gt; service as the corresponding HandleHttpRequest Processor.
Otherwise, all FlowFiles will be routed to the 'failure' relationship.
</p>
<p>
All FlowFiles must have an attribute named <code>http.context.identifier</code>. The value of this attribute is used to lookup
the HTTP Response so that the proper message can be sent back to the requestor. If this attribute is missing, the FlowFile
will be routed to 'failure.'
</p>
<p>
<strong>Properties:</strong>
</p>
<p>
In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. If a property has a default value, it is indicated. If a property supports the use of the NiFi Expression Language (or simply, "expression language"), that is also indicated.
</p>
<ul>
<li><strong>HTTP Status Code</strong>
<ul>
<li>The HTTP Status Code to use when responding to the HTTP Request. See Section 10 of RFC 2616 for more information.</li>
<li>Default value: no default</li>
<li>Supports expression language: true</li>
</ul>
</li>
<li><strong>HTTP Context Map</strong>
<ul>
<li>The HTTP Context Map Controller Service to use for caching the HTTP Request Information</li>
<li>Default value: no default</li>
<li>Supports expression language: false</li>
</ul>
</li>
</ul>
<p>
<strong>Relationships:</strong>
</p>
<ul>
<li>success
<ul>
<li>If a message is successfully sent back to the requestor, the FlowFile is routed to this relationship.</li>
</ul>
</li>
<li>failure
<ul>
<li>
A FlowFile will be routed to failure under the following conditions:
<ul>
<li>The FlowFile does not have an <code>http.context.identifier</code> attribute</li>
<li>The <code>http.context.identifier</code> attribute has a value that cannot be found in the HTTP Context Map</li>
<li>The HTTP Status Code is not a number</li>
<li>There was a communications failure when attempting to write the response to the requestor</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>
<strong>See Also:</strong><br />
<a href="../org.apache.nifi.processors.standard.HandleHttpRequest/index.html">HandleHttpRequest</a><br />
<a href="../org.apache.nifi.http.StandardHttpContextMap/index.html">StandardHttpContextMap</a><br />
<a href="../org.apache.nifi.ssl.StandardSSLContextService/index.html">StandardSSLContextService</a><br />
</p>
</body>
</html>

View File

@ -22,77 +22,23 @@
</head> </head>
<body> <body>
<!-- Processor Documentation ================================================== -->
<h2>Description:</h2>
<p> <p>
This processor attempts to identify the MIME type used for a <strong>Modifies Attributes:</strong>
FlowFile. If the MIME type can be identified, an attribute with the
name
<code>mime.type</code>
is added to the FlowFile, and its value is the detected MIME type.
Some MIME
types require the processor to read a significant amount of data; for
these MIME types, their identification is optional. (See the
properties Identify ZIP and Identify TAR.) The algorithm may have to
read the entire contents of a file for each type of identification. If
the MIME Type cannot be determined, its mime.type attribute will be
set to
<code>application/octet-stream</code>
.
</p> </p>
<table>
<p>The following MIME Types are detected: <thead>
</p> <tr>
<ul> <th>Attribute Name</th>
<li>application/gzip</li> <th>Description</th>
<li>application/bzip2</li> </tr>
<li>application/flowfile-v3</li> </thead>
<li>application/flowfile-v1 (requires Identify TAR be set to true)</li> <tbody>
<li>application/xml</li> <tr>
<li>video/mp4</li> <td>mime.type</td>
<li>video/x-m4v</li> <td>This Processor sets the FlowFile's mime.type attribute to the detected MIME Type. If unable to detect
<li>video/mp4a-latm</li> the MIME Type, the attribute's value will be set to <code>application/octet-stream</code>.</td>
<li>video/quicktime</li> </tr>
<li>video/mpeg</li> </tbody>
<li>audio/wav</li> </table>
<li>audio/mp3</li> </body>
<li>image/bmp</li>
<li>image/png</li>
<li>image/jpg</li>
<li>image/gif</li>
<li>image/tif</li>
<li>application/vnd.ms-works</li>
<li>application/msexcel</li>
<li>application/mspowerpoint</li>
<li>application/msaccess</li>
<li>application/x-ms-wmv</li>
<li>application/pdf</li>
<li>application/x-rpm</li>
<li>application/tar</li>
<li>application/x-7z-compressed</li>
<li>application/java-archive</li>
<li>application/zip</li>
<li>application/x-lzh</li>
</ul>
<p>
<strong>Modifies Attributes:</strong>
</p>
<table>
<thead>
<tr>
<th>Attribute Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>mime.type</td>
<td>This Processor sets the FlowFile's mime.type attribute to the detected MIME Type. If unable to detect
the MIME Type, the attribute's value will be set to <code>application/octet-stream</code>.</td>
</tr>
</tbody>
</table>
</body>
</html> </html>

View File

@ -21,7 +21,7 @@
</head> </head>
<body> <body>
<p> <p>
<strong>Adds Attributes:</strong> <strong>Adds Attributes:</strong>
</p> </p>

View File

@ -23,7 +23,7 @@
<body> <body>
<!-- Processor Documentation ================================================== --> <!-- Processor Documentation ================================================== -->
<p> <p>
<strong>Modifies Attributes:</strong> <strong>Modifies Attributes:</strong>
</p> </p>

View File

@ -25,7 +25,7 @@
<body> <body>
<!-- Processor Documentation ================================================== --> <!-- Processor Documentation ================================================== -->
<p> <p>
<strong>Uses Attributes:</strong> <strong>Uses Attributes:</strong>
</p> </p>

View File

@ -22,7 +22,7 @@
<body> <body>
<!-- Processor Documentation ================================================== --> <!-- Processor Documentation ================================================== -->
<p> <p>
<strong>Optional User-Defined Properties:</strong> <strong>Optional User-Defined Properties:</strong>
</p> </p>
@ -37,30 +37,12 @@
essentially the same as sending quote commands to an FTP server from the command line. essentially the same as sending quote commands to an FTP server from the command line.
</li> </li>
<li><strong>NOTE</strong>: While this is the same as sending a quote command, it is very important that <li><strong>NOTE</strong>: While this is the same as sending a quote command, it is very important that
you leave off the “quote” part of the command from the text value you enter in. For example, if you want you leave off the .
to mimic the command line ftp command quote stat you would give the text value of stat. You have the
option of sending a number of commands to the FTP server before the file is sent. If you have only one
command, then the name of the optional parameter will be pre.cmd.1. If you have a second command, then
the next optional parameter you give is pre.cmd.2, and so on. There is no limit to the number of pre
commands you can send. The commands will be sent in the order of their number, so pre.cmd.1 will be sent
first, pre.cmd.2 will be sent next, etc. This is true regardless of what order they are added to the
processor properties. The property names determine the order.</li>
<li><strong>NOTE</strong>: If the optional property name does not follow the pattern pre.cmd.<em>integer</em>
- then the command will not be sent. If a command is given which is not recognized by the server, then
that will be logged.</li>
<li>Supports expression language: true. FlowFile attributes can be used in commands using the expression language</li>
</ul>
</li>
<li>post.cmd.#
<ul>
<li>Optional properties of this type can be added by the user and should be used for <strong>VERY
RARE</strong> cases only. You will know when you need to use it when the recipient specifies that you must
send FTP commands after the transfer. Otherwise, do not use it. These are the same as the pre commands.
(See pre commands above) except that these commands are sent after the file transfer. (See pre commands above) except that these commands are sent after the file transfer.
</li> </li>
<li>Supports expression language: true. FlowFile attributes can be used in commands using the expression language</li> <li>Supports expression language: true. FlowFile attributes can be used in commands using the expression language</li>
</ul> </ul>
</li> </li>
</ul> </ul>
</body> </body>
</html> </html>

View File

@ -24,11 +24,11 @@
<!-- Processor Documentation ================================================== --> <!-- Processor Documentation ================================================== -->
<p> <p>
<strong>See Also:</strong> <strong>See Also:</strong>
</p> </p>
<ul> <ul>
<li> <li>
<a href="../org.apache.nifi.processors.standard.GetSFTP/index.html">GetSFTP</a> <a href="../org.apache.nifi.processors.standard.GetSFTP/index.html">GetSFTP</a>
</li> </li>
</ul> </ul>
</body> </body>
</html> </html>

View File

@ -22,7 +22,7 @@
</head> </head>
<body> <body>
<h2>Description:</h2> <h2>Usage Example</h2>
<p> <p>
This processor routes FlowFiles based on their attributes This processor routes FlowFiles based on their attributes
using the NiFi Expression Language. Users add properties with using the NiFi Expression Language. Users add properties with

View File

@ -23,7 +23,7 @@
<body> <body>
<!-- Processor Documentation ================================================== --> <!-- Processor Documentation ================================================== -->
<p> <p>
<strong>Modifies Attributes:</strong> <strong>Modifies Attributes:</strong>
</p> </p>

View File

@ -23,7 +23,7 @@
<body> <body>
<!-- Processor Documentation ================================================== --> <!-- Processor Documentation ================================================== -->
<p> <p>
<strong>Adds or Modifies Attributes:</strong> <strong>Adds or Modifies Attributes:</strong>
</p> </p>

View File

@ -23,7 +23,7 @@
<body> <body>
<!-- Processor Documentation ================================================== --> <!-- Processor Documentation ================================================== -->
<p> <p>
<strong>Modifies Attributes:</strong> <strong>Modifies Attributes:</strong>
</p> </p>

View File

@ -1,85 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<!--
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.
-->
<head>
<meta charset="utf-8"/>
<title>SplitJson</title>
<link rel="stylesheet" href="../../css/component-usage.css" type="text/css"/>
</head>
<body>
<!-- Processor Documentation ================================================== -->
<h2>Description:</h2>
<p>
This processor splits a JSON File into multiple, separate FlowFiles for an array element specified by a JsonPath
expression.
Each generated FlowFile is comprised of an element of the specified array and transferred to relationship 'split,'
with the original file transferred to the 'original' relationship. If the specified JsonPath is not found or
does not evaluate to an array element, the original file is routed to 'failure' and no files are generated.
</p>
<p>
<strong>Note:</strong> The underlying JsonPath library loads the entirety of the streamed content into and performs
result evaluations in memory. Accordingly, it is important to consider the anticipated profile of content being
evaluated by this processor and the hardware supporting it especially when working against large JSON documents.
</p>
<strong>Properties:</strong>
</p>
<p>
In the list below, the names of required properties appear in bold. Any other properties (not in bold) are
considered optional. If a property has a default value, it is indicated. If a property supports the use of the NiFi
Expression Language (or simply, "expression language"), that is also indicated.
</p>
<ul>
<li><strong>JsonPath Expression</strong>
<ul>
<li>A JsonPath expression that indicates the array element to split into JSON/scalar fragments.</li>
<li>Supports expression language: false</li>
</ul>
</li>
</ul>
<p>
<strong>Relationships:</strong>
</p>
<ul>
<li>failure
<ul>
<li>If a FlowFile fails processing for any reason (for example, the FlowFile is not valid JSON or the
specified path does not exist) and does not go down the original relationship.
</li>
</ul>
</li>
<li>original
<ul>
<li>If FlowFiles are successfully split, a copy of the original FlowFile follows this relationship.</li>
</ul>
</li>
<li>split
<ul>
<li>If FlowFiles are successfully split into one or more files, those split files follow this
relationship.
</li>
</ul>
</li>
</ul>
</body>
</html>