|
From: Anthony E. <me...@an...> - 2002-01-16 14:50:07
|
Eric,
I have added this to the CVS and it will be in the next release.
-Anthony
> -----Original Message-----
> From: Eric Beaumier [mailto:eri...@ho...]
> Sent: Wednesday, January 16, 2002 9:24 AM
> To: me...@an...
> Subject: Question on FormProc
>
>
> Following question of previous user.
>
>
> Actually with this configuration :
> ==================================================================
> ...
>
> <element name="age">
> <validator type="group">
> <validator type="rule">
> <rule>org.formproc.example.IsIntRule</rule>
> <error lang="en">Age is not a integer.</error>
> </validator>
> <validator type="expression">
> <pattern>^(1[0-9]|2[0-9])</pattern>
> <error lang="en">Must be between 10-29.</error>
> </validator>
> </validator>
> <message lang="en">Valid age required.</message>
> </element>
>
> ...
> =====================================================================
>
>
> ArrayList formDataList = new ArrayList();
> formDataList.add(new FormData("name", args[0]));
> formDataList.add(new FormData("age", args[1]));
> formDataList.add(new FormData("username", args[2]));
> formDataList.add(new FormData("password", args[3]));
>
> ValidationResultMap results = form.process(formDataList);
> ...
>
>
>
> Could we add these two functions to ValidationResultMap class ?
> ====================================================================
>
> (1) To retrieve error message associated to the first validator in error
> for the element name.
> ------------------------------------------------------------------------
> public String getErrorMessage(String field){
> ValidationResult result = (ValidationResult)get(field);
> if(result != null && !result.isValid()){
> return result.getErrorMessage();
> }
> return null;
> }
>
>
> (2) To retrieve an Enumeration of all elements in error. To avoid to
> call isValid() for each element. Could be an Enumeration or Iteration,
> of ValidationResult.
> ------------------------------------------------------------------------
> public Enumeration getErrorElements(){
> ...
> }
>
>
>
> Thanks.
>
>
> >From: "Anthony Eden" <me...@an...>
> >To: "Eric Beaumier" <eri...@ho...>
> >Subject: RE: [FormProc-developer] Log4J & LogManager in FormProc
> >Date: Mon, 14 Jan 2002 15:25:36 -0500
> >
> >Sorry I didn't get back to you sooner. I am not sure what the problem is
> >but I am going to look into it right now. I will let you know
> when I have
> >found something.
> >
> >-Anthony
> >
> > > -----Original Message-----
> > > From: for...@li...
> > > [mailto:for...@li...]On
> Behalf Of Eric
> > > Beaumier
> > > Sent: Monday, January 14, 2002 3:06 PM
> > > To: for...@li...
> > > Subject: [FormProc-developer] Log4J & LogManager in FormProc
> > >
> > >
> > >
> > >
> > > Hi Anthony,
> > >
> > > I sent you a mail at your personnal email regarding a problem (I
> > > think) with
> > > your LogManager in the EdenLib.
> > >
> > > When I load the properties file, I have traced it and I'm
> > > sure it's the good one, I have remarked the type of logging is not
> > > respected. Example, here the rootCategory must log ERROR, but all
> > > the DEBUG message appears again at the console ... Have you an idea
> > > for this problem.
> > >
> > >
> > >
> > > log.properties
> > > ================================================================
> > > # Set root category
> > > log4j.rootCategory=ERROR,A1
> > >
> > > # A1 is set to be a ConsoleAppender which outputs to System.out.
> > > log4j.appender.A1=org.apache.log4j.ConsoleAppender
> > >
> > > # A1 uses PatternLayout.
> > > log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> > > log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
> > > ================================================================
> > >
> > >
> > >
> > > ExampleApp.java
> > > ================================================================
> > > if(logPropertiesFile.exists()){
> > > // Exist and good one (log.properties)
> > >
> PropertyConfigurator.configure(logPropertiesFile.getAbsolutePath());
> > > } else {
> > > BasicConfigurator.configure();
> > > }
> > >
> > > . . .
> > >
> > > ====================================================================
> > >
> > >
> > >
> > >
> > >
> > > Console
> > > ====================================================================
> > > [DEBUG]:org.formproc.FormManager - Loading formproc configuration
> > > [DEBUG]:org.formproc.FormConfiguration - Loading form configuration
> > > [DEBUG]:org.formproc.FormConfiguration - Element name found.
> > > [DEBUG]:org.formproc.FormElement - Validator type expression.
> > > [DEBUG]:org.formproc.FormElement - Configuring validator.
> > > [DEBUG]:org.formproc.FormConfiguration - Element username found.
> > > [DEBUG]:org.formproc.FormElement - Validator type class.
> > > [DEBUG]:org.formproc.FormElement - Creating Java class validator.
> > > [DEBUG]:org.formproc.FormConfiguration - Element age found.
> > > [DEBUG]:org.formproc.FormElement - Validator type rule.
> > > [DEBUG]:org.formproc.FormElement - Configuring validator.
> > > [DEBUG]:org.formproc.FormConfiguration - Element password found.
> > > [DEBUG]:org.formproc.FormElement - Validator type script.
> > > [DEBUG]:org.formproc.FormElement - Configuring validator.
> > > [DEBUG]:org.formproc.FormConfiguration - Form configuration
> > > loaded for form
> > > example
> > > [DEBUG]:com.anthonyeden.lib.resource.ResourceFileMonitor - Starting
> > > FileMonitor
> > > [DEBUG]:org.formproc.FormManager - Formproc configuration loaded
> > > [DEBUG]:com.anthonyeden.lib.resource.ResourceFileMonitor - FileMonitor
> > > running.
> > >
> > >
> > >
> > >
> > >
> > > Thanks.
> > >
> > > _________________________________________________________________
> > > Send and receive Hotmail on your mobile device: http://mobile.msn.com
> > >
> > >
> > > _______________________________________________
> > > FormProc-developer mailing list
> > > For...@li...
> > > https://lists.sourceforge.net/lists/listinfo/formproc-developer
> > >
> >
>
>
> _________________________________________________________________
> Join the worlds largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>
|