Repository: incubator-nifi Updated Branches: refs/heads/NIFI-292 45e3c945b -> 48625b73b
NIFI-292: - Continuing to template the updated REST documentation. Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/48625b73 Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/48625b73 Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/48625b73 Branch: refs/heads/NIFI-292 Commit: 48625b73bbf59f7755d8934933c0f83ff4903204 Parents: 45e3c94 Author: Matt Gilman <[email protected]> Authored: Thu Apr 30 22:45:42 2015 -0400 Committer: Matt Gilman <[email protected]> Committed: Thu Apr 30 22:45:42 2015 -0400 ---------------------------------------------------------------------- .../nifi-web/nifi-web-api/pom.xml | 75 ++++++---- .../src/main/resources/images/bgNifiLogo.png | Bin 0 -> 4232 bytes .../src/main/resources/images/nifi16.ico | Bin 0 -> 1150 bytes .../src/main/resources/templates/index.html.hbs | 142 +++++++++++++++++-- 4 files changed, 183 insertions(+), 34 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/48625b73/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/pom.xml ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/pom.xml b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/pom.xml index 7484564..20afb61 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/pom.xml +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/pom.xml @@ -43,37 +43,62 @@ <groupId>com.github.kongchen</groupId> <artifactId>swagger-maven-plugin</artifactId> <version>3.0-M1</version> - <configuration> - <apiSources> - <apiSource> - <locations>org.apache.nifi.web.api</locations> - <schemes>http,https</schemes> - <basePath>/nifi-api</basePath> - <info> - <title>NiFi Rest Api</title> - <version>${project.version}</version> - <!--<description>This is a sample for swagger-maven-plugin</description>--> - <contact> - <email>[email protected]</email> - <url>https://nifi.incubator.apache.org/</url> - </contact> - <license> - <url>http://www.apache.org/licenses/LICENSE-2.0.html</url> - <name>Apache 2.0</name> - </license> - </info> - <templatePath>classpath:/templates/index.html.hbs</templatePath> - <outputPath>${project.build.directory}/${project.artifactId}-${project.version}/docs/rest-api/index.html</outputPath> - <swaggerDirectory>${project.build.directory}/swagger-ui</swaggerDirectory> - </apiSource> - </apiSources> - </configuration> <executions> <execution> <phase>compile</phase> <goals> <goal>generate</goal> </goals> + <configuration> + <apiSources> + <apiSource> + <locations>org.apache.nifi.web.api</locations> + <schemes>http,https</schemes> + <basePath>/nifi-api</basePath> + <info> + <title>NiFi Rest Api</title> + <version>${project.version}</version> + <description> + The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and + stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, + definitions of the expected input and output, potential response codes, and the authorities required + to invoke each service. + </description> + <contact> + <email>[email protected]</email> + <url>https://nifi.incubator.apache.org</url> + </contact> + <license> + <url>http://www.apache.org/licenses/LICENSE-2.0.html</url> + <name>Apache 2.0</name> + </license> + </info> + <templatePath>classpath:/templates/index.html.hbs</templatePath> + <outputPath>${project.build.directory}/${project.artifactId}-${project.version}/docs/rest-api/index.html</outputPath> + <swaggerDirectory>${project.build.directory}/swagger-ui</swaggerDirectory> + </apiSource> + </apiSources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <executions> + <execution> + <id>copy-resources</id> + <phase>validate</phase> + <goals> + <goal>copy-resources</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/docs/rest-api/images</outputDirectory> + <resources> + <resource> + <directory>src/main/resources/images</directory> + </resource> + </resources> + </configuration> </execution> </executions> </plugin> http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/48625b73/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/images/bgNifiLogo.png ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/images/bgNifiLogo.png b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/images/bgNifiLogo.png new file mode 100644 index 0000000..d92c484 Binary files /dev/null and b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/images/bgNifiLogo.png differ http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/48625b73/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/images/nifi16.ico ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/images/nifi16.ico b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/images/nifi16.ico new file mode 100644 index 0000000..2ac3670 Binary files /dev/null and b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/images/nifi16.ico differ http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/48625b73/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/index.html.hbs ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/index.html.hbs b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/index.html.hbs index de9ed3c..fa4c88d 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/index.html.hbs +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/resources/templates/index.html.hbs @@ -16,6 +16,8 @@ <html> <head> <title>{{info.title}}-{{info.version}}</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <link rel="shortcut icon" href="images/nifi16.ico"/> <script type="text/javascript" src="../nifi/js/jquery/jquery-2.1.1.min.js"></script> <script type="text/javascript"> if (typeof window.jQuery === 'undefined') { @@ -37,8 +39,28 @@ font-family: "Open Sans", "DejaVu Sans", sans-serif; } + div.header { + margin-top: 10px; + } + + img.logo { + float: left; + margin-right: 10px; + } + + div.header > div.title { + font-size: 30px; + height: 50px; + line-height: 50px; + } + + div.sub-title { + font-style: italic; + color: #aaa; + } + div.overview { - margin-bottom: 10px; + margin-bottom: 15px; } div.endpoint { @@ -213,7 +235,11 @@ } div.close:hover { - background-color: #c8c8c8; + background-color: #d1d1d1; + } + + div.section-endpoints { + margin-top: 10px; } /* tables */ @@ -286,13 +312,13 @@ display: none; } - a { + a, .link { cursor: pointer; color: #1e373f; font-weight: normal; } - a:hover { + a:hover, .link:hover { color: #264c58; text-decoration: underline; } @@ -372,16 +398,114 @@ $('div.close').on('click', function() { $(this).closest('div.type').hide(); }); + + // function for organizing the endpoints + var organizeEndpoints = function(term, container) { + $('div.unorganized > div.endpoints').each(function() { + var endpoints = $(this); + var path = endpoints.find('div.path').text(); + + if (term === null || path.indexOf(term) > 0) { + endpoints.detach().appendTo(container); + } + }); + }; + + // organize the endpoints + organizeEndpoints('cluster', $('#cluster-endpoints')); + organizeEndpoints('history', $('#history-endpoints')); + organizeEndpoints('provenance', $('#provenance-endpoints')); + organizeEndpoints('user', $('#user-endpoints')); + organizeEndpoints('controller-service', $('#controller-service-endpoints')); + organizeEndpoints('reporting-task', $('#reporting-task-endpoints')); + organizeEndpoints('connections', $('#connection-endpoints')); + organizeEndpoints('processors', $('#processor-endpoints')); + organizeEndpoints('funnels', $('#funnel-endpoints')); + organizeEndpoints('input-ports', $('#input-port-endpoints')); + organizeEndpoints('output-ports', $('#output-port-endpoints')); + organizeEndpoints('remote-process-groups', $('#remote-process-group-endpoints')); + organizeEndpoints('labels', $('#label-endpoints')); + organizeEndpoints('process-groups', $('#process-group-endpoints')); + organizeEndpoints(null, $('#controller-endpoints')); + + + // handle expanding/collapsing the sections + $('div.section > div.title').on('click', function() { + $(this).next('div.section-endpoints').slideToggle(); + }); }); </script> </head> <body> - <div class="overview"> - <div class="title">{{info.title}}-{{info.version}}</div> + <div class="header"> + <img class="logo" src="images/bgNifiLogo.png" alt="NiFi Logo"/> + <div class="title">{{basePath}}</div> + <div class="sub-title">{{info.title}} {{info.version}}</div> + <div class="clear"></div> + </div> + <div class="clear"></div> + <div class="overview">{{info.description}}</div> + <div class="section"> + <div class="title link">Cluster</div> + <div id="cluster-endpoints" class="section-endpoints hidden"></div> + </div> + <div class="section"> + <div class="title link">History</div> + <div id="history-endpoints" class="section-endpoints hidden"></div> + </div> + <div class="section"> + <div class="title link">Provenance</div> + <div id="provenance-endpoints" class="section-endpoints hidden"></div> + </div> + <div class="section"> + <div class="title link">Users</div> + <div id="user-endpoints" class="section-endpoints hidden"></div> + </div> + <div class="section"> + <div class="title link">Controller Services</div> + <div id="controller-service-endpoints" class="section-endpoints hidden"></div> + </div> + <div class="section"> + <div class="title link">Connections</div> + <div id="connection-endpoints" class="section-endpoints hidden"></div> + </div> + <div class="section"> + <div class="title link">Processors</div> + <div id="reporting-task-endpoints" class="section-endpoints hidden"></div> + </div> + <div class="section"> + <div class="title link">Funnels</div> + <div id="funnel-endpoints" class="section-endpoints hidden"></div> + </div> + <div class="section"> + <div class="title link">Input Ports</div> + <div id="input-port-endpoints" class="section-endpoints hidden"></div> + </div> + <div class="section"> + <div class="title link">Output Ports</div> + <div id="output-port-endpoints" class="section-endpoints hidden"></div> + </div> + <div class="section"> + <div class="title link">Remote Process Groups</div> + <div id="remote-process-group-endpoints" class="section-endpoints hidden"></div> + </div> + <div class="section"> + <div class="title link">Labels</div> + <div id="label-endpoints" class="section-endpoints hidden"></div> + </div> + <div class="section"> + <div class="title link">Process Groups</div> + <div id="process-group-endpoints" class="section-endpoints hidden"></div> + </div> + <div class="section"> + <div class="title link">Controller</div> + <div id="controller-endpoints" class="section-endpoints hidden"></div> + </div> + <div class="unorganized"> + {{#each paths}} + {{> endpoint}} + {{/each}} </div> - {{#each paths}} - {{> endpoint}} - {{/each}} {{#each definitions}} {{> type}} {{/each}}
