On Jan 27, 2012, at 2:04 PM, Julien Viet wrote:
looking in webui there is already a configuration for validation in
the package org.exoplatform.webui.config.
The class org.exoplatform.webui.config.Component class has a list of validators
associated with it, each validator has an InitParams objects.
This can be loaded from XML, a sample is visible there
http://anonsvn.jboss.org/repos/gatein/portal/trunk/webui/core/src/test/re...
it contains among other:
<validators>
<validator>
<type>class.name</type>
<init-params>
<param><name>name</name><value>value</value></param>
</init-params>
</validator>
</validators>
Good to know, I will look into it.
The class we want to make configured externally is the class
UIGroupMembershipForm.
I actually don't think that's the only place. See for example UIAccountInputSet,
UIAccountProfiles, UIRegisterInputSet, UIAccountEditInputSet and possibly others. There
are way too many spots where usernames are dealt with and they are not dealt with in a
consistent way.
https://issues.jboss.org/browse/GTNPORTAL-2186 changed some of the validation process in
some spots but didn't in other for unknown reasons. Regardless of what is being done
with the configuration aspects of the validation, a rational validation process for
usernames (and other important data) needs to be put in place.
I foresee two steps to investigate
1/ we should try to see if we can first remove the validation hardcoded in
UIGroupMembershipForm and instead use XML.
2/ we should find a way to make this configuration overridden externally with additional
configuration in conf directory.
I will investigate these issues but we need to think about cleaning up the validation of
data more deeply.
Cordialement / Best,
Chris
==
Principal Software Engineer / JBoss Enterprise Middleware Red Hat, Inc.
Follow GateIn:
http://blog.gatein.org /
http://twitter.com/gatein
Follow me:
http://metacosm.info/metacosm /
http://twitter.com/metacosm