You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by alopresto <gi...@git.apache.org> on 2018/01/05 15:26:29 UTC
[GitHub] nifi pull request #2222: NIFI-3926 - Edit Template information
Github user alopresto commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2222#discussion_r159901869
--- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/groups/StandardProcessGroup.java ---
@@ -2601,6 +2601,25 @@ public MutableVariableRegistry getVariableRegistry() {
return variableRegistry;
}
+ @Override
+ public void verifyCanUpdateTemplate(final String name, final String templateId) {
+ // ensure the name is specified
+ if (StringUtils.isBlank(name)) {
+ throw new IllegalArgumentException("Template name cannot be blank.");
+ }
+
+ for (final Template template : getTemplates()) {
+ canUpdateTemplate(name, templateId, template.getDetails());
+ }
+ }
+
+ private void canUpdateTemplate(final String name, final String templateId, final TemplateDTO processGroupTemplate) {
+ // prevent renaming to another template's name
+ if (name.equals(processGroupTemplate.getName()) && !templateId.equals(processGroupTemplate.getId())) {
--- End diff --
Do we want the name comparison to be case-insensitive?
---