Author: ndkhoiits
Date: 2010-04-08 05:51:17 -0400 (Thu, 08 Apr 2010)
New Revision: 2530
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.properties
Log:
GTNPORTAL-1033 Change warning message and add ResourceValidator for gadget name field
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java 2010-04-08
07:34:10 UTC (rev 2529)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java 2010-04-08
09:51:17 UTC (rev 2530)
@@ -47,6 +47,8 @@
import org.exoplatform.webui.form.validator.ExpressionValidator;
import org.exoplatform.webui.form.validator.IdentifierValidator;
import org.exoplatform.webui.form.validator.MandatoryValidator;
+import org.exoplatform.webui.form.validator.ResourceValidator;
+import org.exoplatform.webui.form.validator.StringLengthValidator;
import org.exoplatform.webui.form.validator.Validator;
import java.io.Serializable;
@@ -79,8 +81,10 @@
Param param = initParams.getParam("SampleGadget");
WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
String sample = (String)param.getMapGroovyObject(context);
- addUIFormInput(new UIFormStringInput(FIELD_NAME, null,
null).addValidator(MandatoryValidator.class).addValidator(ExpressionValidator.class,
"^[\\p{L}][\\p{ASCII}]+$",
- "UIGadgetEditor.msg.Invalid"));
+ addUIFormInput(new UIFormStringInput(FIELD_NAME, FIELD_NAME,
null).addValidator(MandatoryValidator.class)
+ .addValidator(StringLengthValidator.class, 2, 50)
+ .addValidator(ResourceValidator.class)
+ .addValidator(ExpressionValidator.class,
"^[\\p{L}][\\p{L}._\\-\\d]+$","UIGadgetEditor.msg.Invalid-firstChar"));
addUIFormInput(new UIFormTextAreaInput(FIELD_SOURCE, FIELD_SOURCE,
sample).addValidator(MandatoryValidator.class)
.addValidator(GadgetSpecValidator.class));
}
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.properties
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.properties 2010-04-08
07:34:10 UTC (rev 2529)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.properties 2010-04-08
09:51:17 UTC (rev 2530)
@@ -145,7 +145,7 @@
UIGadgetEditor.action.Cancel=#{word.cancel}
UIGadgetEditor.msg.invalidSpec=This source is invalid gadget specification.
UIGadgetEditor.gadget.msg.gadgetIsExist=This name already exists, please enter a
different name.
-UIGadgetEditor.msg.Invalid=The "{0}" field must not contains special
characters.
+UIGadgetEditor.msg.Invalid-firstChar=The "{0}" field must start with a
character.
##package org.exoplatform.organization.webui.component.UIListPermissionSelector
UIListPermissionSelector.header.groupId=Group
UIListPermissionSelector.header.membership=Membership
Show replies by date