I am rather new to Turbine, so I am wondering why it would not be a good idea to use a modules/navigations/Menu.java class to do the DB pull?
Lynne Lawrence > -----Original Message----- > From: Harriett Y. Xing (HYX) [mailto:[EMAIL PROTECTED] > Sent: Monday, December 29, 2003 6:24 PM > To: 'Turbine Users List' > Subject: Dynamic Navigation > > > I had just set up TDK and created an app. The next step was > to modify the > navigation menu so that it could dynamically retrieve a list > of options from > a database table. I extended VelocityNavigation to create a > new navigation > class and assigned it to services.VelocityService.default.navigation. > However, when I tried to run the app, I got the following message: > > Error processing navigation template:/Menu.vm using module: > org.company.app.modules.navigation.Navigation > > > The new navigation class is: > > package org.mycompany.newapp.modules.navigation; > > import org.apache.turbine.modules.navigations.VelocityNavigation; > import org.apache.turbine.util.RunData; > import org.apache.velocity.context.Context; > import org.apache.torque.util.Criteria; > import org.apache.ecs.ConcreteElement; > import org.company.app.om.MenuItemsPeer; > > import java.util.List; > > public class Navigation extends VelocityNavigation{ > > public void doBuildTemplate(RunData runData, Context context) throws > Exception { > super.doBuildTemplate(runData, context); > > Criteria criteria = new Criteria(); > List menuItems = MenuItemsPeer.doSelect(criteria); > > context.put("menuItems", menuItems); > } > > > } > > > What am I missing? > > Thank you very much for your help. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
