On Jan 31, 2012, at 2:36 PM, Julien Viet wrote:
I would like to avoid the creation of a service only for this purpose
/ scope.
can you avoid this part and make it more straightforward ?
I guess UserConfigurableUsernameValidator could parse the configuration file directly,
assuming it's possible to retrieve the gatein.conf.dir value from that part of the
code.
I would also like to avoid the admin part because it implies to have
persistence of configuration somehow and we cannot afford it. But you said it's
optional.
The admin part could just overwrite the config file when it is saved but that might indeed
be too much trouble for not much gain.
On Jan 31, 2012, at 2:28 PM, Christophe Laprun wrote:
> Simplest way to do it, to me, is as follows:
> - Identify where user names are validated in the current code. Remove unneeded
validation (in particular where it processes read-only data).
> - Replace all instances of validators in all places we want users to configure
username validation by a single UserConfigurableUsernameValidator.
> - Implement a simple service that will look for a configuration file in
gatein.conf.dir to allow users to define which regular expression should be used (as well
as other parameters as we see fit, e.g. min and max length). If no such configuration is
found, use the default logic as it currently exists in UsernameValidator.
> - Have instances of UserConfigurableUsernameValidator gets their configuration from
that service.
> - Optionally, add a user interface in the admin part of the portal to do this
configuration from within portal.
>
> I think this solution will require the minimal amount of risk/work and still achieve
our goals of user configurable validation of user names without added complexity.
>
> On Jan 31, 2012, at 1:22 PM, Julien Viet wrote:
>
>> I want this to be done with the existing webui metadata objects, i.e the
org.exoplatform.webui.application.ConfigurationManager objects takes care of getting the
override and override the Validator configuration and then let webui construct the
validator from the metadata defined by the org.exoplatform.webui.config.Component class.
>>
>> it implies also that the ui component that we want to have pluggable validation
should not hardcode the definition and instead define default validation using the
annotation and not the programmatic manner.
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