What dynamic page information do you need? I'd suggest having a single page. Said page would get a parameter from the url specifying which page-name to render. You said you didn't want to use a db... you could store the files as flat files and "include" them dynamically into the tapestry page. What your tapestry page will need to do is to setup the velocity context with the appropriate objects needed by the pages. If you're looking at getting this "up and running" in a hurry, check out the "Include" component on tassel (http://www.tapestrycomponents.org/Tassel/app?service=external/ViewComponent&sp=SInclude) Give it an asset and it will include it. You can define your asset dynamically in your page-class code, based on the parameters passed to your page. Tell include to always treat the asset as text (it can figure out that your asset is text... but since you know it always will be, you can speed the process up :). Finally, since you're using velocity, create an instance of "org.rz.include.VelocityProcessor" (comes with Include). You can pass in a hash map of objects to place into the context. VelocityProcessor will take care of everything else for you (though you'll need to have the velocity jar on the classpath). Voila. Then tell include to use your velocity processor as a "postprocessor",and voila. Dynamic pages with velocity content and even access to tapestry page properties, etc. as needed (pass them into the context).
Include is fairly well documented. VelocityProcessor documentation is a bit on the sparse side right now; if you have questions, don't hesitate to ask. Robert Vinicius Carvalho wrote: > Hello there. I guess this was already asked, but I search the list and could > not find an answer. I need to add pages on the fly, is this possible? The > idea is the user is going to create new tutorials on our JUG page, and they > we'll be generated using velocity. Since the pages need some dinamic page > info they must be tapestry pages. One might answer why not putting it on the > database, well we're avoiding data access. To be quite honest, I'd rather > even generate static content for it, but we do need some info that are not > static. > So how can I add new pages to the application on runtime? > > Regards > > -- > Vinicius Caldeira Carvalho > Arquiteto de Sistemas > [EMAIL PROTECTED] > www.synos.com.br <http://www.synos.com.br> > > "Everything should be made as simple as possible, but not simpler." > Albert Einstein > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
