java/code/src/com/redhat/rhn/domain/channel/NewChannelHelper.java | 16
+++++-----
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 4 +-
2 files changed, 10 insertions(+), 10 deletions(-)
New commits:
commit f5c5063d5ff87f319d121e41041dce97e45ccc41
Author: Dimitar Yordanov <dyordano(a)redhat.com>
Date: Thu Aug 29 13:56:23 2013 +0200
1001826 - fix the API error msg
diff --git a/java/code/src/com/redhat/rhn/domain/channel/NewChannelHelper.java
b/java/code/src/com/redhat/rhn/domain/channel/NewChannelHelper.java
index b85b58d..5faa728 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/NewChannelHelper.java
+++ b/java/code/src/com/redhat/rhn/domain/channel/NewChannelHelper.java
@@ -18,6 +18,8 @@ import com.redhat.rhn.domain.errata.Errata;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.manager.errata.ErrataManager;
import com.redhat.rhn.manager.user.UserManager;
+import com.redhat.rhn.frontend.xmlrpc.InvalidChannelLabelException;
+import com.redhat.rhn.frontend.xmlrpc.InvalidChannelNameException;
import java.util.Date;
import java.util.HashSet;
@@ -61,17 +63,15 @@ public class NewChannelHelper {
public Channel clone(boolean originalState, Channel toClone) {
if (!verifyName(name)) {
- throw new InvalidChannelParameter(name, "It must be at least 6
characters " +
- "long, begin with a letter, and contain only lowercase letters,
" +
- "digits, '-', ' / ', '_' and
'.'. Also, it cannot begin with " +
- "'rhn', 'redhat', or 'red hat'.");
+ throw new InvalidChannelNameException(name,
+ InvalidChannelNameException.Reason.REGEX_FAILS,
+ "edit.channel.invalidchannelname.supportedregex",
"");
}
if (!verifyLabel(label)) {
- throw new InvalidChannelParameter(label, "It Must be at least 6
characters " +
- "long, begin with a letter, and contain only lowercase letters,
" +
- "digits, '-', '_', and '.'. Also, it
cannot begin with 'rhn', " +
- "'redhat', or 'red hat'.");
+ throw new InvalidChannelLabelException(label,
+ InvalidChannelLabelException.Reason.REGEX_FAILS,
+ "edit.channel.invalidchannellabel.supportedregex",
"");
}
if (gpgFingerprint != null && !verifyGpgFingerprint(gpgFingerprint)) {
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
index 6e777fe..e6c88fc 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
@@ -7449,7 +7449,7 @@ Follow this url to see the full list of inactive systems:
</context-group>
</trans-unit>
<trans-unit id="edit.channel.invalidchannelname.supportedregex">
- <source>Channel name must begin with a letter and may contain only
lowercase letters, hyphens ('-'), periods ('.'), underscores
('_'), numerals, spaces and forward slashes ('/').</source>
+ <source>Channel name must be at least 6 characters long, begin with a
letter and may contain only lowercase letters, hyphens ('-'), periods
('.'), underscores ('_'), numerals, spaces, parentheses and forward
slashes ('/').</source>
</trans-unit>
<trans-unit id="edit.channel.invalidchannelname.redhat">
<source>Channels names must not start with '{0}'</source>
@@ -7494,7 +7494,7 @@ Follow this url to see the full list of inactive systems:
</context-group>
</trans-unit>
<trans-unit id="edit.channel.invalidchannellabel.supportedregex">
- <source>Channel label must begin with a letter and may contain only
lowercase letters, hyphens ('-'), periods ('.'), underscores
('_'), and numerals.</source>
+ <source>Channel label must be at least 6 characters long, begin with a
letter or digit and may contain only lowercase letters, hyphens ('-'), periods
('.'), underscores ('_'), and numerals.</source>
</trans-unit>
<trans-unit id="edit.channel.invalidchannellabel.redhat">
<source>Channel labels must not start with '{0}'</source>