As others have mentioned, the MessageResources work was moved over to the
Commons sandbox. The plan is to move Struts over to that when it is
released, but that has not happened yet. I wrote a simple
XMLMessageResources implementation over there some time ago, so that will be
a part of the release, when it happens.

I'd be interested in hearing if you have particular ideas about what the XML
DTD/schema should look like - but further discussion of this should really
happen on the commons-dev list, rather than here.

--
Martin Cooper


> -----Original Message-----
> From: James Mitchell [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 19, 2002 8:36 PM
> To: Tero P Paananen
> Cc: Struts Developers List
> Subject: RE: MessageResources
> 
> 
> Let's bounce this on the dev list.
> 
> Struts gurus, this was in response to someone (I doubt that 
> I'm the only
> one) asking about having the resource bundle loaded from xml file(s).
> 
> (and yes....I'm well aware of the "thanks for volunteering" 
> approach to
> requests for enhancements ;)
> 
> Is this ok for pursuing further?
> What kind of priority would it be?
> 
> Personally, I'd also like to be able to load the resources from a JDBC
> source.
> 
> 
> Your thoughts?
> 
> 
> James Mitchell
> Software Engineer\Struts Evangelist
> Struts-Atlanta, the "Open Minded Developer Network"
> http://struts-atlanta.open-tools.org
> 
> > -----Original Message-----
> > From: Tero P Paananen [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, June 19, 2002 6:07 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: MessageResources
> >
> >
> > > Would you care to donate the source for the cause?
> >
> > James,
> >
> > Got a major deadline over and done with today, so I
> > got some time.
> >
> > Here's how the XMLMessageResources.java will work:
> >
> > The XML content files follow Interwoven's dcr4.5.dtd
> > DTD, which is the default DTD for content exported into
> > XML files from Interwoven. The format is as follows:
> >
> > <record type="content" name="Name for the XML file">
> >     <item name="message.key">
> >             <value>message value</value>
> >     </item>
> >     <!-- multiple items -->
> > </record>
> >
> > The current implementation has four java classes:
> >
> > XMLMessageResources.java
> > XMLMessageResourcesFactory.java
> > LocaleXMLFilenameFilter.java
> >     - FilenameFilter that returns a list of XML files
> >       that contain messages for the given locale
> > XMLUtils.java
> >     - the XML parsing routines. Uses Digester to parse
> >       the XML files into Properties objects
> >
> >
> > XMLMessageResources extends PropertyMessageResources and
> > overloads the loadLocale() method to read XML files instead
> > of .properties files.
> >
> > XMLMessageResources will read messages from multiple XML
> > files and the messages can be specified in as many XML files
> > your operating system will allow you to have. This means
> > that you can easily group your messages in logical groups:
> > errorMessages.en_US.xml, login.en_US.xml, logout.en_US.xml,
> > etc. without having to specify that stuff anywhere in your
> > application.
> >
> > The current implementation reads files from one directory,
> > but I'm thinking to change that to read them from locale
> > specific directories:
> >
> >     /WEB-INF/messages/en_US/errorMessages.xml
> >                             login.xml
> >     /WEB-INF/messages/en/errorMessages.xml
> >                          login.xml
> >
> > I think that's a better way to organize the files. And it
> > would also get rid of some of the sillyness in
> > LocaleXMLFilenameFilter.
> >
> > That's pretty much it.
> >
> > We also developed on-the-fly message resources reloading
> > the Struts framework could use, unless it's already in
> > the 1.1 version.
> >
> > Sound good?
> >
> >                             -TPP
> >
> >
> > > > -----Original Message-----
> > > > From: Tero P Paananen [mailto:[EMAIL PROTECTED]]
> > > > Sent: Monday, June 10, 2002 5:57 PM
> > > > To: Struts Users Mailing List; [EMAIL PROTECTED]
> > > > Subject: RE: MessageResources
> > > >
> > > >
> > > > > I agree, in fact, I wonder if it can be extended to load from
> > > > > other means
> > > > > such as xml, rdbms, or call to a url (ftp/http/whatever)
> > > >
> > > > We implemented XMLMessageResources.java on our current
> > > > project.
> > > >
> > > > Interwoven had problems getting stuff into .properties
> > > > files, so we had to read XML files instead.
> > > >
> > > > The implementation was so remarkably easy that it felt almost
> > > > like cheating :)
> > > >
> > > >         -TPP <- likes frameworks that make my life easier
> > > >
> > >
> >
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[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]>

Reply via email to