NIFI-250: - Moving files into the appropriate renamed directories. Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/f2b9f2c8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/f2b9f2c8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/f2b9f2c8
Branch: refs/heads/NIFI-250 Commit: f2b9f2c8d418d14fd982d721ccbb6b2bb0874de1 Parents: c5d452c Author: Matt Gilman <[email protected]> Authored: Wed Jan 21 08:02:50 2015 -0500 Committer: Matt Gilman <[email protected]> Committed: Wed Jan 21 08:02:50 2015 -0500 ---------------------------------------------------------------------- .../entity/ControllerServiceTypesEntity.java | 46 ++++ .../api/entity/ReportingTaskTypesEntity.java | 46 ++++ .../canvas/new-controller-service-dialog.jsp | 48 ++++ .../css/new-controller-service-dialog.css | 133 +++++++++++ .../js/jquery/tagcloud/jquery.tagcloud.css | 62 +++++ .../js/jquery/tagcloud/jquery.tagcloud.js | 238 +++++++++++++++++++ 6 files changed, 573 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f2b9f2c8/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ControllerServiceTypesEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ControllerServiceTypesEntity.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ControllerServiceTypesEntity.java new file mode 100644 index 0000000..dafb8c2 --- /dev/null +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ControllerServiceTypesEntity.java @@ -0,0 +1,46 @@ +/* + * 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.web.api.entity; + +import java.util.Set; +import javax.xml.bind.annotation.XmlRootElement; +import org.apache.nifi.web.api.dto.DocumentedTypeDTO; + +/** + * A serialized representation of this class can be placed in the entity body of + * a response to the API. This particular entity holds a reference to a list of + * controller service types. + */ +@XmlRootElement(name = "controllerServiceTypesEntity") +public class ControllerServiceTypesEntity extends Entity { + + private Set<DocumentedTypeDTO> controllerServiceTypes; + + /** + * The list of controller service types that are being serialized. + * + * @return + */ + public Set<DocumentedTypeDTO> getControllerServiceTypes() { + return controllerServiceTypes; + } + + public void setControllerServiceTypes(Set<DocumentedTypeDTO> controllerServiceTypes) { + this.controllerServiceTypes = controllerServiceTypes; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f2b9f2c8/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ReportingTaskTypesEntity.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ReportingTaskTypesEntity.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ReportingTaskTypesEntity.java new file mode 100644 index 0000000..4b021ef --- /dev/null +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/entity/ReportingTaskTypesEntity.java @@ -0,0 +1,46 @@ +/* + * 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.web.api.entity; + +import java.util.Set; +import javax.xml.bind.annotation.XmlRootElement; +import org.apache.nifi.web.api.dto.DocumentedTypeDTO; + +/** + * A serialized representation of this class can be placed in the entity body of + * a response to the API. This particular entity holds a reference to a list of + * reporting task types. + */ +@XmlRootElement(name = "reportingTaskTypesEntity") +public class ReportingTaskTypesEntity extends Entity { + + private Set<DocumentedTypeDTO> reportingTaskTypes; + + /** + * The list of reporting task types that are being serialized. + * + * @return + */ + public Set<DocumentedTypeDTO> getReportingTaskTypes() { + return reportingTaskTypes; + } + + public void setReportingTaskTypes(Set<DocumentedTypeDTO> reportingTaskTypes) { + this.reportingTaskTypes = reportingTaskTypes; + } + +} http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f2b9f2c8/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/new-controller-service-dialog.jsp ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/new-controller-service-dialog.jsp b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/new-controller-service-dialog.jsp new file mode 100644 index 0000000..b896d8a --- /dev/null +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/new-controller-service-dialog.jsp @@ -0,0 +1,48 @@ +<%-- + 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. +--%> +<%@ page contentType="text/html" pageEncoding="UTF-8" session="false" %> +<div id="new-controller-service-dialog"> + <div class="dialog-content"> + <div id="controller-service-type-filter-controls"> + <div id="controller-service-type-filter-container"> + <input type="text" id="controller-service-type-filter"/> + <div id="controller-service-type-filter-options"></div> + </div> + <div id="controller-service-type-filter-status"> + Displaying <span id="displayed-controller-service-types"></span> of <span id="total-controller-service-types"></span> + </div> + </div> + <div id="controller-service-tag-cloud-container"> + <div class="setting"> + <div class="setting-name">Tags</div> + <div class="setting-field"> + <div id="controller-service-tag-cloud"></div> + </div> + </div> + </div> + <div id="controller-service-types-container"> + <div id="controller-service-types-table" class="unselectable"></div> + <div id="controller-service-description-container"> + <div id="controller-service-type-name" class="ellipsis"></div> + <div id="controller-service-type-description" class="ellipsis multiline"></div> + <span class="hidden" id="selected-controller-service-name"></span> + <span class="hidden" id="selected-controller-service-type"></span> + </div> + </div> + <div class="clear"></div> + </div> +</div> http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f2b9f2c8/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/new-controller-service-dialog.css ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/new-controller-service-dialog.css b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/new-controller-service-dialog.css new file mode 100644 index 0000000..67492ce --- /dev/null +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/new-controller-service-dialog.css @@ -0,0 +1,133 @@ +/* + * 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. + */ + +/* + New controller dialog. +*/ + +#new-controller-service-dialog { + z-index: 1301; + display: none; + width: 800px; + height: 450px; + border: 1px solid #eee; + line-height: normal; +} + +#controller-service-tag-cloud-container { + float: left; + width: 190px; + height: 350px; +} + +#controller-service-types-container { + float: left; + width: 588px; + height: 350px; +} + +#controller-service-description-container { + width: 588px; + height: 100px; + margin-top: 10px; +} + +#controller-service-type-name { + font-size: 12pt; + font-weight: bold; + color: #527991; + margin-bottom: 8px; + width: 588px; +} + +#controller-service-type-description { + width: 588px; + height: 60px; +} + +#controller-service-types-table { + width: 586px; + height: 249px; + border: 1px solid #666; +} + +#controller-service-types-table-container th { + vertical-align: middle; +} + +/* + Processor tag cloud +*/ + +#controller-service-tag-cloud ul.tag-cloud { + max-height: 257px; +} + +#controller-service-tag-cloud ul.tag-cloud li { + max-width: 180px; +} + +#controller-service-tag-cloud div.tag-cloud-separator { + width: 180px; +} + +#controller-service-tag-cloud ul.tag-filter li { + width: 180px; +} + +#controller-service-tag-cloud div.selected-tag-text { + width: 160px; +} + +/* + Processor type table filter +*/ + +#controller-service-type-filter-controls { + float: right; + margin-top: -35px; + margin-right: 2px; + margin-bottom: 7px; +} + +#controller-service-type-filter-status { + font-size: 9px; + font-weight: bold; + color: #9f6000; + clear: left; + line-height: normal; + margin-left: 5px; +} + +#controller-service-type-filter { + padding: 3px 0px 1px 3px; + font-size: 12px; + height: 18px; + line-height: 20px; + width: 173px; + border: 1px solid #ccc; + margin-right: 3px; + float: left; +} + +#controller-service-type-filter-options { + float: left; + height: 17px; + line-height: 17px; + width: 85px; + margin-top: 1px; +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f2b9f2c8/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/tagcloud/jquery.tagcloud.css ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/tagcloud/jquery.tagcloud.css b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/tagcloud/jquery.tagcloud.css new file mode 100644 index 0000000..dda7474 --- /dev/null +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/tagcloud/jquery.tagcloud.css @@ -0,0 +1,62 @@ +/* + * 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. + */ + +/* + Styles for the Nifi tag cloud. +*/ + +ul.tag-cloud { + font-size: 90%; + padding: 2px; + margin-left: -5px; + overflow: hidden; +} + +ul.tag-cloud li { + float: left; + list-style-type: none; + margin: 0 3px; + height: 20px; + line-height: 20px; + overflow: hidden; + white-space: nowrap; +} + +div.tag-cloud-separator { + height: 1px; + border-bottom: 1px solid #aaa; + margin: 3px 0; +} + +ul.tag-filter { + overflow: hidden; +} + +ul.tag-filter li { + height: 18px; + line-height: 18px; + padding: 2px; +} + +div.selected-tag-text { + float: left; +} + +img.remove-selected-tag { + float: right; + margin-top: 1px; +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f2b9f2c8/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/tagcloud/jquery.tagcloud.js ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/tagcloud/jquery.tagcloud.js b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/tagcloud/jquery.tagcloud.js new file mode 100644 index 0000000..51aa7d8 --- /dev/null +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/jquery/tagcloud/jquery.tagcloud.js @@ -0,0 +1,238 @@ +/* + * 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. + */ + +/** + * Create a tag cloud. The options are specified in the following + * format: + * + * { + * tags: ['attributes', 'copy', 'regex', 'xml', 'copy', 'xml', 'attributes'], + * select: selectHandler, + * remove: removeHandler + * } + * + * Options have a label (specified as the text property that is rendered + * to users) and a value which is not. Additionally, options can be marked + * as disabled. A disabled option cannot be selected by a user but may be + * programmatically selected (supporting the restoration of options that have + * become invalid). It is up to the developer to ensure that the selected + * option is not disabled. + * + * The optionClass option supports specifying a class to apply to the + * option element. + */ + +/** + * jQuery plugin for a NiFi style tag cloud. + * + * @param {type} $ + * @returns {undefined} + */ +(function ($) { + + var isUndefined = function (obj) { + return typeof obj === 'undefined'; + }; + + var isNull = function (obj) { + return obj === null; + }; + + var isDefinedAndNotNull = function (obj) { + return !isUndefined(obj) && !isNull(obj); + }; + + var isBlank = function (str) { + return isUndefined(str) || isNull(str) || str === ''; + }; + + var config = { + maxTags: 25, + maxTagFontSize: 2, + minTagFontSize: 1, + minWidth: 20 + }; + + /** + * Adds the specified tag filter. + * + * @argument {jQuery} cloudContainer The tag cloud container + * @argument {string} tag The tag to add + */ + var addTagFilter = function (cloudContainer, tag) { + var config = cloudContainer.data('options'); + var tagFilter = cloudContainer.find('ul.tag-filter'); + + // ensure this tag hasn't already been added + var tagFilterExists = false; + tagFilter.find('li div.selected-tag-text').each(function () { + if (tag === $(this).text()) { + tagFilterExists = true; + return false; + } + }); + + // add this tag filter if applicable + if (!tagFilterExists) { + // create the list item content + var tagText = $('<div class="selected-tag-text"></div>').text(tag); + var removeTagIcon = $('<img src="images/iconDelete.png" class="remove-selected-tag pointer"></img>').click(function () { + // remove this tag + $(this).closest('li').remove(); + + // fire a remove event if applicable + if (isDefinedAndNotNull(config.remove)) { + config.remove.call(cloudContainer, tag); + } + }); + var selectedTagItem = $('<div></div>').append(tagText).append(removeTagIcon); + + // create the list item and update the tag filter list + $('<li></li>').append(selectedTagItem).appendTo(tagFilter); + + // fire a select event if applicable + if (isDefinedAndNotNull(config.select)) { + config.select.call(cloudContainer, tag); + } + } + }; + + var methods = { + + /** + * Initializes the tag cloud. + * + * @argument {object} options The options for the tag cloud + */ + init: function (options) { + return this.each(function () { + // ensure the options have been properly specified + if (isDefinedAndNotNull(options) && isDefinedAndNotNull(options.tags)) { + // get the tag cloud + var cloudContainer = $(this); + + // clear any current contents, remote events, and store options + cloudContainer.empty().unbind().data('options', options); + + // build the component + var cloud = $('<ul class="tag-cloud"></ul>').appendTo(cloudContainer); + $('<div class="tag-cloud-separator">').appendTo(cloudContainer); + var filter = $('<ul class="tag-filter"></ul>').appendTo(cloudContainer); + + var tagCloud = {}; + var tags = []; + + // count the frequency of each tag for this type + $.each(options.tags, function (i, tag) { + var normalizedTagName = tag.toLowerCase(); + + if (nf.Common.isDefinedAndNotNull(tagCloud[normalizedTagName])) { + tagCloud[normalizedTagName].count = tagCloud[normalizedTagName].count + 1; + } else { + var tagCloudEntry = { + term: normalizedTagName, + count: 1 + }; + tags.push(tagCloudEntry); + tagCloud[normalizedTagName] = tagCloudEntry; + } + }); + + // handle the case when no tags are present + if (tags.length > 0) { + // sort the tags by frequency to limit the less frequent tags + tags.sort(function (a, b) { + return b.count - a.count; + }); + + // limit to the most frequest tags + if (tags.length > config.maxTags) { + tags = tags.slice(0, config.maxTags); + } + + // determine the max frequency + var maxFrequency = tags[0].count; + + // sort the tags alphabetically + tags.sort(function (a, b) { + var compA = a.term.toUpperCase(); + var compB = b.term.toUpperCase(); + return (compA < compB) ? -1 : (compA > compB) ? 1 : 0; + }); + + // set the tag content + $.each(tags, function (i, tag) { + // determine the appropriate font size + var fontSize = Math.log(tag.count) / Math.log(maxFrequency) * (config.maxTagFontSize - config.minTagFontSize) + config.minTagFontSize; + var minWidth = config.minWidth * fontSize; + + // create the tag cloud entry + $('<li></li>').append($('<span class="link"></span>').text(tag.term).css({ + 'font-size': fontSize + 'em' + })).css({ + 'min-width': minWidth + 'px' + }).click(function () { + // ensure we don't exceed 5 selected + if (filter.children('li').length < 5) { + var tagText = $(this).children('span').text(); + addTagFilter(cloudContainer, tagText); + } + }).appendTo(cloud).ellipsis(); + }); + } else { + // indicate when no tags are found + $('<li><span class="unset">No tags specified</span></li>').appendTo(cloud); + } + } + }); + }, + + /** + * Resets the selected tags from the tag cloud. + */ + clearSelectedTags: function () { + return this.each(function() { + var cloudContainer = $(this); + cloudContainer.find('img.remove-selected-tag').trigger('click'); + }); + }, + + /** + * Returns the selected tags of the first matching element. + */ + getSelectedTags: function () { + var tags = []; + + this.each(function () { + var cloudContainer = $(this); + cloudContainer.find('div.selected-tag-text').each(function() { + tags.push($(this).text()); + }); + }); + + return tags; + } + }; + + $.fn.tagcloud = function (method) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } else { + return methods.init.apply(this, arguments); + } + }; +})(jQuery); \ No newline at end of file
