Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 57440 invoked from network); 4 Feb 2000 20:56:23 -0000 Received: from unknown (HELO host2.altacast.com) (63.84.216.2) by locus.apache.org with SMTP; 4 Feb 2000 20:56:23 -0000 Received: from EXCHANGE by host2.altacast.com via smtpd (for locus.apache.org [63.211.145.10]) with SMTP; 4 Feb 2000 20:56:22 UT Received: by firewall.altacast.com with Internet Mail Service (5.5.2448.0) id <12CQ1L9S>; Fri, 4 Feb 2000 13:56:22 -0700 Message-ID: <85CDFD92C550D311A1A40008C7DFA81A01D622@firewall.altacast.com> From: "Timm, Sean" To: "'cocoon-dev@xml.apache.org'" Subject: RE: XML Resource File? Date: Fri, 4 Feb 2000 13:56:21 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="windows-1252" I may just be expounding upon my ignorance by continuing to follow this line of thought, so please correct my misconceptions. Basically, we've got several processors that may output particular messages that need to be customizable by the end user utilizing some sort of tool. It looks as if the PropertyResourceBundle class works with a text file, so I suppose that it doesn't necessarily have to be XML. I'm going to make an assumption about localization and HTTP requests that I don't necessarily know is true. I assume that Cocoon can detect the locale of the requesting browser. Based on this, I see two ways resource handling could occur within Cocoon: (1) When a request came into Cocoon for a certain processor or producer, Cocoon could set the resource information for the specified producer/processor (this could be specified in the cocoon.properties file) for the locale of the requesting browser as the working resource information. Then you could call to SomeCocoonClass.getResourceString, and get the appropriate string. (2) You could define a XSP resource handling taglib and just kick out the xsp tags wherever you need to load a string from a resource file. It seems like Cocoon preloads all of the processors available to it (or something like that...I know I get an error if I don't have the class installed for a processor mentioned in the cocoon.properties file). At this time, Cocoon could load up the appropriate resource file(s) based on the available locale(s). Basically, I just like an XML format better than the following: s1=blah s2=etc XML is more flexible and I can do magic transformations with XSLT to spit out new and interesting data formats. It's also more extensible for when you decide that you don't just want to do a simple key/value, you want a key/value/URL that passes off the value to the URL and does some magic thing that reinterprets it in Klingonese and passes it back to you. - Sean T. -----Original Message----- From: Mike Engelhart [mailto:mengelhart@earthtrip.com] Sent: Friday, February 04, 2000 12:44 PM To: cocoon-dev@xml.apache.org Subject: Re: XML Resource File? Timm, Sean wrote: > Does anyone else see this as useful, or is this ability already there, and > I'm completely wasting my time? :) > > - Sean T. java.util.ResourceBundle does this except it doesn't use XML but either class files or properties files. The implementation is up to the user if they choose to implement their own classes but most people would use a Map or Hashtable. Anyway, it seems that since there are a lot of other issues that ResourceBundle's handle transparently like class naming conventions that allow the correct bundle to accessed based on the locale, reading files from Properties files if the correct class isn't found, caching of the object so it's available without having to reload it and other things, it seems like you're up a against a pretty good existing model. I'm not sure what the advantage would be to have the resources stored as XML though? Isn't it just a key/value pair when it comes down to it? Mike