Author: bibryam
Date: Thu Mar 18 10:24:14 2010
New Revision: 924685
URL: http://svn.apache.org/viewvc?rev=924685&view=rev
Log:
Check the whole partyId for digits instead of first character only.
The following labels need to be fixed for languages other than English:
party.id_is_digit
partyservices.could_not_create_party_ID_digit
partyservices.cannot_create_affiliate_digit
Modified:
ofbiz/trunk/applications/party/config/PartyErrorUiLabels.xml
ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
Modified: ofbiz/trunk/applications/party/config/PartyErrorUiLabels.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/config/PartyErrorUiLabels.xml?rev=924685&r1=924684&r2=924685&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/config/PartyErrorUiLabels.xml (original)
+++ ofbiz/trunk/applications/party/config/PartyErrorUiLabels.xml Thu Mar 18
10:24:14 2010
@@ -458,7 +458,7 @@
</property>
<property key="party.id_is_digit">
<value xml:lang="de">Die angegebene Akteur ID beginnt mit einer Zahl.
Numerische IDs sind für vom System automatisch erstellte IDs
reserviert.</value>
- <value xml:lang="en">Specified party ID cannot start with a digit,
numeric IDs are reserved for auto-generated IDs</value>
+ <value xml:lang="en">Specified party ID cannot be a digit, numeric IDs
are reserved for auto-generated IDs</value>
<value xml:lang="es">El código no puede empezar con un dÃgito, los
códigos numericos están reservados para ser autogenerados.</value>
<value xml:lang="fr">L'identifiant spécifié pour l'acteur ne peut
démarrer par un chiffre, cela est réservé aux identifiants générés
automatiquement</value>
<value xml:lang="hi_IN">निरà¥à¤¦à¤¿à¤·à¥à¤ पारà¥à¤à¥
à¤à¥à¤°à¤®à¤¾à¤à¤ à¤à¤ à¤
à¤à¤ à¤à¥ साथ शà¥à¤°à¥
नहà¥à¤ à¤à¤° सà¤à¤¤à¥ à¤à¤à¥ à¤à¤¤à¥à¤ªà¤¨à¥à¤¨
à¤à¥à¤°à¤®à¤¾à¤à¤à¥ à¤à¥ लिठà¤
à¤à¤à¥à¤¯ à¤à¥à¤°à¤®à¤¾à¤à¤
à¤à¤°à¤à¥à¤·à¤¿à¤¤ हà¥à¤|</value>
@@ -708,7 +708,7 @@
<value
xml:lang="zh">ä¸è½å建ï¼å·²ç»å卿å®ä¼åæ è¯çéå±ã</value>
</property>
<property key="partyservices.cannot_create_affiliate_digit">
- <value xml:lang="en">Cannot create affiliate, specified party ID
cannot start with a digit, numeric IDs are reserved for auto-generated
IDs.</value>
+ <value xml:lang="en">Cannot create affiliate, specified party ID
cannot be a digit, numeric IDs are reserved for auto-generated IDs.</value>
<value xml:lang="es">No se pudo crear afiliado, el código del
participante no puede empezar con un dÃgito, los códigos numericos están
reservados para ser autogenerados.</value>
<value xml:lang="fr">Impossible de créer l'affilié(e), la réf.
d'acteur ne peut pas commencer par un chiffre, les identifiants numériques
sont réservés aux identifiants générés automatiquement.</value>
<value xml:lang="hi_IN">सà¤à¤¬à¤¦à¥à¤§ नहà¥à¤ बना
सà¤à¤¤à¥, निरà¥à¤¦à¤¿à¤·à¥à¤ पारà¥à¤à¥
à¤à¥à¤°à¤®à¤¾à¤à¤ à¤à¤ à¤
à¤à¤ à¤à¥ साथ शà¥à¤°à¥
नहà¥à¤ à¤à¤° सà¤à¤¤à¥ à¤à¤à¥ à¤à¤¤à¥à¤ªà¤¨à¥à¤¨
à¤à¥à¤°à¤®à¤¾à¤à¤à¥ à¤à¥ लिठà¤
à¤à¤à¥à¤¯ à¤à¥à¤°à¤®à¤¾à¤à¤
à¤à¤°à¤à¥à¤·à¤¿à¤¤ हà¥à¤|</value>
@@ -817,7 +817,7 @@
</property>
<property key="partyservices.could_not_create_party_ID_digit">
<value xml:lang="de">Akteurgruppe kann nicht erstellt werden, Akteur
ID darf nicht mit Zahl beginnen. Numerische Akteur IDs sind für das System
reserviert.</value>
- <value xml:lang="en">Cannot create party group, specified party ID
cannot start with a digit, numeric IDs are reserved for auto-generated
IDs.</value>
+ <value xml:lang="en">Cannot create party group, specified party ID
cannot be a digit, numeric IDs are reserved for auto-generated IDs.</value>
<value xml:lang="es">No se pudo crear grupo de participantes, el
código no puede empezar con un dÃgito, los códigos numericos están
reservados para ser autogenerados</value>
<value xml:lang="fr">Impossible de créer le groupe d'acteur,
L'identifiant spécifié pour l'acteur ne peut démarrer par un chiffre, cela
est réservé aux identifiants générés automatiquement.</value>
<value xml:lang="hi_IN">पारà¥à¤à¥ समà¥à¤¹ नहà¥à¤
बना सà¤à¤¤à¥, निरà¥à¤¦à¤¿à¤·à¥à¤ पारà¥à¤à¥
à¤à¥à¤°à¤®à¤¾à¤à¤ à¤à¤ à¤
à¤à¤ à¤à¥ साथ शà¥à¤°à¥
नहà¥à¤ à¤à¤° सà¤à¤¤à¥ à¤à¤à¥ à¤à¤¤à¥à¤ªà¤¨à¥à¤¨
à¤à¥à¤°à¤®à¤¾à¤à¤à¥ à¤à¥ लिठà¤
à¤à¤à¥à¤¯ à¤à¥à¤°à¤®à¤¾à¤à¤
à¤à¤°à¤à¥à¤·à¤¿à¤¤ हà¥à¤|</value>
Modified:
ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java?rev=924685&r1=924684&r2=924685&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
(original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
Thu Mar 18 10:24:14 2010
@@ -112,7 +112,7 @@ public class PartyServices {
String description = (String) context.get("description");
// if specified partyId starts with a number, return an error
- if (UtilValidate.isNotEmpty(partyId) &&
Character.isDigit(partyId.charAt(0))) {
+ if (UtilValidate.isNotEmpty(partyId) && partyId.matches("\\d+")) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"party.id_is_digit", locale));
}
@@ -348,7 +348,7 @@ public class PartyServices {
}
} else {
// if specified partyId starts with a number, return an error
- if (Character.isDigit(partyId.charAt(0))) {
+ if (partyId.matches("\\d+")) {
errMsg =
UtilProperties.getMessage(resource,"partyservices.could_not_create_party_ID_digit",
locale);
return ServiceUtil.returnError(errMsg);
}
@@ -511,7 +511,7 @@ public class PartyServices {
String partyId = getPartyId(context);
// if specified partyId starts with a number, return an error
- if (Character.isDigit(partyId.charAt(0))) {
+ if (UtilValidate.isNotEmpty(partyId) && partyId.matches("\\d+")) {
errMsg =
UtilProperties.getMessage(resource,"partyservices.cannot_create_affiliate_digit",
locale);
return ServiceUtil.returnError(errMsg);
}