There is an example form on the intake service document. It is not the how-to, but the docs for the service itself. Here is a link to the doc on the jakarta site... http://jakarta.apache.org/turbine/turbine-2/services/intake-service.html
Take a look at that. It should answer the rest of your questions. If you have already been through that documents, let me know and I will try explain it a little better. > -----Original Message----- > From: Eigen Technology Pty Ltd [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 23, 2002 6:08 AM > To: [EMAIL PROTECTED] > Subject: RE: Intake Example > > > I am still a bit unclear... Below is the Test.java file I > copied from intake-howto.html and my FORM.vm > > > Q1: Does the name in FORM.vm > <input type=text name=" HERE " <----- need to match that in > > String username = (String)group.get("Username").getValue(); ? > > Q2: How is Group in Test.java file being used? It is not > anywhere in my FORM.vm file? > > Q3: If the Action is successful, LoginSuccess.vm will be > displayed, else Login.vm will be displayed? > > cheers > micahel > > > <FORM action="$link.setAction('Test')" method="POST"> > <input type=text name="CompanyName" value=""> > <input type=submit> > $intake.declareGroups() > </FORM> > > > package org.mycompany.medici.modules.actions; > import org.apache.velocity.context.Context; > import org.apache.turbine.util.RunData; > import org.apache.turbine.util.db.Criteria; > import org.apache.turbine.modules.actions.VelocityAction; > import org.mycompany.medici.om.Contact; > import org.mycompany.medici.om.ContactPeer; > import org.apache.turbine.services.intake.IntakeTool; > import org.apache.turbine.services.intake.model.*; > > public class Test extends SecureAction > { > > public void doLogin(RunData data, Context context) > throws Exception { > IntakeTool intake = (IntakeTool)context.get("intake"); > Group group = intake.get("LoginGroup", IntakeTool.DEFAULT_KEY); > if (!group.isAllValid()) { > //Log.debug("Group elements INVALID"); > setTemplate(data, "Login.vm"); > return; > } else { > setTemplate(data, "LoginSuccess.vm"); > } > String username = (String)group.get("Username").getValue(); > String password = (String)group.get("Password").getValue(); > } > > } > > > > > > > import org.apache.turbine.services.intake.IntakeTool; > > import org.apache.turbine.services.intake.model.*; > > > > Btw - You class name of your action might need to be Test > instead of > > TEST. You will want to follow the standard naming conventions for > > packages and class names for Turbine to correctly load the > classes for > > you. > > > >> -----Original Message----- > >> From: Eigen Technology Pty Ltd [mailto:[EMAIL PROTECTED]] > >> Sent: Monday, December 23, 2002 5:33 AM > >> To: [EMAIL PROTECTED] > >> Subject: RE: Intake Example > >> > >> > >> I think I have followed things correctly. In that action > file, what > >> packages do I need to import so that IntakeTool becomes > part of it? I > >> compile a file as given in the intake-howto, errors occur. > >> > >> compile: > >> [javac] Compiling 4 source files to > >> /usr/local/tdk/webapps/medici/WEB-INF/cl > >> asses > >> [javac] > >> > /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/ > >> modules/actions/TEST.java:22: cannot resolve symbol > >> [javac] symbol : class IntakeTool > >> [javac] location: class > org.mycompany.medici.modules.actions.TEST > >> [javac] IntakeTool intake = > >> (IntakeTool)context.get("intake"); > >> [javac] ^ > >> [javac] > >> > /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/ > >> modules/actions/TEST.java:22: cannot resolve symbol > >> [javac] symbol : class IntakeTool > >> [javac] location: class > org.mycompany.medici.modules.actions.TEST > >> [javac] IntakeTool intake = > >> (IntakeTool)context.get("intake"); > >> [javac] ^ > >> [javac] > >> > /usr/local/tdk/webapps/medici/WEB-INF/src/java/org/mycompany/medici/ > >> modules/actions/TEST.java:26: cannot resolve symbol > >> [javac] symbol : class Group > >> [javac] location: class > org.mycompany.medici.modules.actions.TEST > >> [javac] Group group = intake.get("LoginGroup", > >> IntakeTool.DEFAULT_KEY > >> ); > >> > >> > The intake.xml file should be located in your WEB-INF/conf > >> directory. > >> > > >> > For the action, the name of the calls should match the > >> action name. > >> > It should be located in your modules.actions package. Make > >> sure that > >> > your setting for module.packages includes the name of your > >> > applications, modules as well as those for turbine. For > >> exmaple, if > >> > your actions are under > com.mycompany.sampleapp.modules.actions, the > >> entry in TurbineResource.properties should read: > >> > > >> > > >> > module.packages=com.mycompany.sampleapp.modules,org.apache.turbine.mo > >> d > >> > ul > >> > es > >> > > >> > For all of the details on how actions work, look at the > >> Velocity Site > >> > how-to and the Action Events how-to. > >> > > >> > > >> >> -----Original Message----- > >> >> From: Eigen Technology Pty Ltd > >> >> [mailto:[EMAIL PROTECTED]] > >> Sent: Monday, December 23, 2002 4:42 AM > >> >> To: [EMAIL PROTECTED] > >> >> Subject: Intake Example > >> >> > >> >> > >> >> I am learning how to use Intake. I am a bit confused by a > >> couple of > >> >> things. > >> >> > >> >> 1. The intake.xml file, I checked in the archive about its > >> location > >> >> in the file system. Britta Ladwig-Attinger on 28th June 2001 has > >> posted this exact question, but it does not seem to be conclusive. > >> So, where should this file be located? I have uncommented the three > >> >> fields for Intake in TurbineResrouces.properties, tried adding a > >> intake.xml file under app/WBE-INF/conf and "ant init" again. Don't > >> know what to expect at this stage. > >> >> > >> >> 2. The Action file used in the Intake howto, where should > >> this file > >> >> be located? and What should the .java file be named? > >> Should I put it > >> >> under ./src/java/org/mycompany/medici/modules/actions/ > and call > >> >> it > >> myAction.java ... > >> >> > >> >> thanks > >> >> michael > >> >> > >> >> > >> >> > >> >> > >> >> -- > >> >> To unsubscribe, e-mail: > >> >> <mailto:turbine-user-> [EMAIL PROTECTED]> For > >> >> additional commands, > >> >> e-mail: <mailto:[EMAIL PROTECTED]> > >> >> > >> >> > >> > >> > >> > >> > >> -- > >> To unsubscribe, e-mail: > >> <mailto:turbine-user-> [EMAIL PROTECTED]> > >> For > >> additional commands, > >> e-mail: <mailto:[EMAIL PROTECTED]> > >> > >> > > > > > -- > To unsubscribe, e-mail: > <mailto:turbine-user-> [EMAIL PROTECTED]> > For > additional commands, > e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
