commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject Re: [validator] validator dtd or schema
Date Thu, 11 Sep 2003 00:26:24 GMT

--- Qin Ding <qding@csc.com> wrote:
> 
> Thank you, David:
> Is there a reason that resources does not return Formset object?  I know
> I
> can get each form one by one but if I can get formset then I can go
> through
> a loop to get all the forms at runtime.  I see resources.put(Formset).
> but
> I dont see how you getFormset().

I don't think that's currently supported.

David

> 
> Qin
> 
> 
>
----------------------------------------------------------------------------------------
> 
> This is a PRIVATE message. If you are not the intended recipient, please
> delete without copying and kindly advise us by e-mail of the mistake in
> delivery. NOTE: Regardless of content, this e-mail shall not operate to
> bind CSC to any order or other contract unless pursuant to explicit
> written
> agreement or government initiative expressly permitting the use of
> e-mail
> for such purpose.
>
----------------------------------------------------------------------------------------
> 
> 
> 
> 
>                                                                         
>                                   
>                       David Graham                                      
>                                   
>                       <grahamdavid1980         To:      Jakarta Commons
> Users List                         
>                       @yahoo.com>             
> <commons-user@jakarta.apache.org>                           
>                                                cc:                      
>                                   
>                       09/10/03 04:51           Subject: Re: [validator]
> validator dtd or schema            
>                       PM                                                
>                                   
>                       Please respond                                    
>                                   
>                       to "Jakarta                                       
>                                   
>                       Commons Users                                     
>                                   
>                       List"                                             
>                                   
>                                                                         
>                                   
>                                                                         
>                                   
> 
> 
> 
> 
> --- Qin Ding <qding@csc.com> wrote:
> >
> > Thank you, David, for your quick response.
> >
> > I believe that after the following code, the java objects (Formset,
> > Form,
> > Fields etc) are all populated with the data from validation.xml.  Is
> it
> > true?
> 
> Yes.
> 
> >
> >          InputStream input = null;
> >         BufferedInputStream bis = null;
> >
> >         input = getClass().getResourceAsStream(Constants.CONFIG_DIR +
> > validatorRules);  //validation.xml
> >         if (input != null){
> >           bis = new BufferedInputStream(input);
> >           try{
> >            
> ValidatorResourcesInitializer.initialize(validatorResources,
> > bis);
> >           }catch(Exception e){
> >             e.printStackTrace();
> >           }
> >         }
> >       }
> >
> >       resources.process();
> >
> >       //From this point on, I should be able to get the Formset
> > -->getForm
> > --> getField --> getProperty() and getDepends()
> >      // Manipulated the data and then put the data into
> VelocityContext;
> >
> > If so, I don't need to generate the java objects again.  All I need is
> > to
> > get the data out from the Formset, Form, and Fields objects.  Can you
> > tell
> > me from validatorResources object or something else, how can I get the
> > formset object?  I don't see the method getFormset().  From Formset, I
> > think I can get the fields and their requirements out.   If I have the
> > following simple validation.xml,
> >
> > <formset>
> >     <form name="Aftermarket">
> >       <field property="prdCd" depends="required,mask">
> >         <var>
> >           <var-name>mask</var-name>
> >           <var-value>[a-zA-Z0-9]*</var-value>
> >         </var>
> >       </field>
> >       <field property="dsc" depends="required">
> >       </field>
> >     </form>
> >   </formset>
> >
> > how can I get
> >
> > Form "Aftermaket"
> > Field
> >   property "prdCd"
> >   depends (requirements) "required, mask"
> >   var-value "[a-zA-Z0-9]*"
> 
> Form form = resources.getForm(Locale.getDefault(), "Aftermarket")
> Field field = form.getField("prdCd");
> String depends = field.getDepends();
> 
> David
> 
> 
> > Form "SomeOtherField"
> > Field
> >   property "fieldone"
> >   depends "required"
> > Field....
> > Form "SomeOtherForm"
> >
> > Please help me with this. Thank you.
> >
> > Qin
> >
> >
> >
> >
>
----------------------------------------------------------------------------------------
> 
> >
> > This is a PRIVATE message. If you are not the intended recipient,
> please
> > delete without copying and kindly advise us by e-mail of the mistake
> in
> > delivery. NOTE: Regardless of content, this e-mail shall not operate
> to
> > bind CSC to any order or other contract unless pursuant to explicit
> > written
> > agreement or government initiative expressly permitting the use of
> > e-mail
> > for such purpose.
> >
>
----------------------------------------------------------------------------------------
> 
> >
> >
> >
> >
> >
> >
> >                       David Graham
> >
> >                       <grahamdavid1980         To:      Jakarta
> Commons
> > Users List
> >                       @yahoo.com>
> > <commons-user@jakarta.apache.org>
> >                                                cc:
> >
> >                       09/10/03 03:31           Subject: Re:
> [validator]
> > validator dtd or schema
> >                       PM
> >
> >                       Please respond
> >
> >                       to "Jakarta
> >
> >                       Commons Users
> >
> >                       List"
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --- Qin Ding <qding@csc.com> wrote:
> 
=== message truncated ===


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message