So the execution DOES go straight to the action class, and you have to
manually provide the calls to the Intake service, etc?

If I'm reading this correctly, there is *no* middle man class between
the form submission and the call to the action class. Is that correct?

Thanks

On Thu, 2004-07-08 at 11:12, Jeffery Painter wrote:
> If you are using the Intake service, then you must use the intake tool 
> within your action class for validation. It doesn't happen automatically 
> per se.
> 
>  1. login
>  2. page request made
>  3. intake tool used in .vm to populate field names and default values if 
>     any, if an exception is thrown in the action class, the intake tool
>     can store user's submitted results so they don't have to retype them
>     when making corrections
>  4. action class called from form submit
>  5. action class method asks intake tool for validation of your group
>     -> you handle where to send the user after this.
> 
> 
> action class code to use intake tool:
> ------------------------------------------------------------------------
>     public void doInsert(RunData data, Context context) throws Exception
>     {
>         // Test for valid intake data
>         IntakeTool intake = (IntakeTool) context.get("intake");
>         if ( !intake.isAllValid() ) {
>             log.info("Intake has found an error with user data");
>             return;
>         } else
>         {
>             try
>             {
>                 // get the "Note" Group
>                 Note note = new Note();
>                 Group group = intake.get("Note", IntakeTool.DEFAULT_KEY);
>                 group.setProperties (note);
>                 // now note is properly populated with the form data
>                                                                                      
>                                                            
>                 // save the entry
>                 note.setNew( true );
>                 note.save();
>                                                                                      
>                                                            
>                 /*
>                  * now we must clear the intake group or the data
>                  * will again repopulate the next call to this form
>                  * which we don't want in this case
>                  */
>                 intake.remove( group );
>             }
>             catch ( Exception e ) {
>                 log.error("data exception for inserting a new note occured: " + 
>                               e.toString() );
>                 data.setMessage("An error has occured when attempting to insert a 
> new note: " + 
>                               e.toString() );
>             }
>         }
>     }
> ------------------------------------------------------------------------
> 
> 
> 
> HTH,
> Jeff Painter
> 
> On Thu, 8 Jul 2004, Ryan Gantt wrote:
> 
> > Hello,
> > 
> > I've been wading through pages and pages of the scattered documentation
> > for Turbine (with Velocity), and while there are some things that make
> > so much sense, there are still aspects of the application that baffle
> > me.
> > 
> > My biggest question at this point is: What is actual flow of execution
> > for Turbine once a user submits a form? I'm running the intake service
> > on the forms, so I don't know if it hits Intake first or goes directly
> > to my action class.
> > 
> > All I know is that I set the action of the form, the user submits, and
> > it eventually ends up hitting the Action class with the specified submit
> > method.
> > 
> > Can anyone clear this up for me or point me to some documentation that
> > will?
> > 
> > Thank you very much
> > 
> > P.S. Sorry if this is a double-post -- I sent the e-mail once and then realized I 
> > wasn't properly signed up for the list.
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Ryan Gantt

Active Evolution
www.activeevolution.com
406.579.0156 Cell
406.585.7745 Home


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to