----- Original Message ----- From: "John Nikolai" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, February 27, 2003 2:24 PM Subject: Re: Tiles: dynamically adding definitions
> Thanks Cedric, I look forward to seeing the document. > > Is this a feature which may be added to Tiles at a future date? > Or is this too specialized? > > Thanks again, > - John > > On Thursday, February 27, 2003, at 10:46 AM, Cedric Dumoulin wrote: > > > > > Hi, > > > > The answer is yes, but it need some coding. > > > > The default definition factory doesn't provide a well know API to add > > dynamically new definitions. > > What you can do is to implement your own definition factory to > > provide such functionality. You can extends the existing factory and > > add the methods you need. > > You have to know that the "extends" mechanism is resolved statically > > when the config file is loaded. After that, definitions are stored > > resolved. So, you have to resolve yourself your extend. This is > > however simple to do: get the definition referenced by "extend", > > create a new definition initialized with the previously loaded one, > > add your own attributes, store your definition in the factory. > > I have a short document describing how to write a factory. I will > > make it accessible asap. > > > > Cedric > > > > John Nikolai wrote: > > > >> > >> Is it possible to define a few base tiles definitions (loaded using > >> TilesPlugin) and, during runtime, read in other definitions which > >> extend these base definitions? > >> > >> Here is an example use: > >> > >> We have an XML file which defines a web site and used to generate the > >> web site navigation. If we add a new page to the site we need to > >> update this XML file to update the navigation as well. Can I add a > >> tiles definition to this XML file and add that definition into tiles > >> for processing? > >> > >> <nav path="/events" file="events.jsp"> > >> <leftnav> Events & Activities </leftnav> > >> <breadcrumb> Events & Activities </breadcrumb> > >> <definition name="events.page" extends="master.page"> > >> <put name="body" value="/events/events.jsp" /> > >> ... > >> </definition> > >> </nav> > >> > >> NOTE: "master.page" is defined in the default definitions loaded at > >> startup using TilesPlugin. > >> > >> Doing it this way when I add a new file I only need to update a > >> single XML file as opposed to several. > >> > >> Thanks for your help! > >> - John > >> > >> > >> --------------------------------------------------------------------- > >> 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] > > > > > --------------------------------------------------------------------- > 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]