You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hop.apache.org by ha...@apache.org on 2022/02/18 07:31:37 UTC
[hop] branch master updated: HOP-3214 Check the name of a metadata
This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/master by this push:
new 4aeac5d HOP-3214 Check the name of a metadata
new c4b57d0 Merge pull request #1376 from gvdutra/HOP-3214
4aeac5d is described below
commit 4aeac5dab1143b9fdc0f9f43b59fc530afaeb09a
Author: Gabriel Dutra <gv...@gmail.com>
AuthorDate: Thu Feb 17 21:24:24 2022 -0800
HOP-3214 Check the name of a metadata
---
ui/src/main/java/org/apache/hop/ui/core/metadata/MetadataEditor.java | 4 ++++
.../apache/hop/ui/core/metadata/messages/messages_en_US.properties | 1 +
2 files changed, 5 insertions(+)
diff --git a/ui/src/main/java/org/apache/hop/ui/core/metadata/MetadataEditor.java b/ui/src/main/java/org/apache/hop/ui/core/metadata/MetadataEditor.java
index e7935aa..cba91c2 100644
--- a/ui/src/main/java/org/apache/hop/ui/core/metadata/MetadataEditor.java
+++ b/ui/src/main/java/org/apache/hop/ui/core/metadata/MetadataEditor.java
@@ -264,6 +264,10 @@ public abstract class MetadataEditor<T extends IHopMetadata> extends MetadataFil
throw new HopException(BaseMessages.getString(PKG, "MetadataEditor.Error.NoName"));
}
+ if(StringUtils.startsWith(name, "$")) {
+ throw new HopException(BaseMessages.getString(PKG, "MetadataEditor.Error.IncorrectName"));
+ }
+
// The serializer of the metadata
//
IHopMetadataSerializer<T> serializer = manager.getSerializer();
diff --git a/ui/src/main/resources/org/apache/hop/ui/core/metadata/messages/messages_en_US.properties b/ui/src/main/resources/org/apache/hop/ui/core/metadata/messages/messages_en_US.properties
index b3f06f6..f719c18 100644
--- a/ui/src/main/resources/org/apache/hop/ui/core/metadata/messages/messages_en_US.properties
+++ b/ui/src/main/resources/org/apache/hop/ui/core/metadata/messages/messages_en_US.properties
@@ -18,6 +18,7 @@
#
#
MetadataEditor.Error.NoName=You must define a name !
+MetadataEditor.Error.IncorrectName=Name cannot start with '$'
MetadataEditor.Error.NameAlreadyExists=Name ''{0}'' already exists.
MetadataEditor.Error.Save=Error saving ''{0}''.
MetadataEditor.WantToSaveBeforeClosing.Message=Do you want to save ''{0}'' before closing ?