|
From: McDonald, B. <Bru...@ba...> - 2003-08-05 19:06:00
|
David,
You have to specify the -l switch. If you do not, it complains and dies.
Looking at your code, I see that it searches for the file:
URL[] urls = ResourceLoader.getMatchingUrlsInSearchPath("env/config.properties",
EnvironmentLoader.getSearchPaths());
env/config.properties and nothing else.
Not sure how to search all configuration files. It really would represent a lot of information.
Regards,
Bruce.
------
Moving strings into the resource bundle.
There are two kinds of string: those with arguments and those without. For this purpose lets look at the those with arguments:
System.out.println("Filename: "+fileName+" is broken beyond repair");
Now, lets say that we needed to represent this as a resource bundle string and that this existed in the conversion module.
Well, open the modules/conversion/config/i18n/messages.properties file
and add a property:
conversion.bad.broke=Filename: {0} is broken beyond repair
Then goto the code that does the println, and convert the literal string to:
System.out.println(I18n.get("conversion.bad.broke", filename));
And all is done. Notice that the class I18n has the method get overloaded manytimes to cater to lots of additional arguments.
-----Original Message-----
From: David Glick [mailto:dg...@co...]
Sent: Tuesday, August 05, 2003 2:01 PM
To: McDonald, Bruce; bab...@li...
Subject: Re: [Babeldoc-devel] Config file dump committed; questions for
completing
Okay, I understand how you're using it, and I think I can make it work for my
scenario. If the '-l' and '-t' switches aren't present, does it default to
the original functionality, e..g list all config files and their contents?
Also, I had intended for the '-d' switch to be available for all modules to
output appropriate debug information. For example, a soap writer might dump
the soap envelope and all the protocol packets. This can also be
accomplished, I suppose, by increasing (decreasing? I always get confused
which way it goes to show more info) the logging level; is there currently a
way to set the log level on the command line?
Also, I still don't understand how to move hard-coded strings into the
resource bundles...?
Thanks,
David
On Tuesday 05 August 2003 10:34 am, McDonald, Bruce wrote:
> David,
>
> Interesting - I did not think of that but still I think that it will
> probably be just as useful. Here is a usage scenario:
>
> Lets say that the configuration 'pipeline/config' is somehow broken and we
> need to track the configuration key, documentation.type, the command:
>
> C:\work\vap_rpt>babeldoc lightconfig -l pipeline/config -t
> documentation.type Listing urls for the configuration:
> pipeline/config.properties
> 1:
> jar:file:/c:/download/babeldoc/build/lib/babeldoc_core.jar!/core/pipeline/c
>onfig.properties documentation.type = simple
> 0: file:/C:/work/vap_rpt/./pipeline/config.properties
> documentation.type Not defined
>
>
>
> This tells me that the file pipeline/config.properties appears twice in the
> configuration and the configuration key, documentation.type is defined in
> the first configuration only and its value is simple.
>
> regards,
> Bruce.
>
> -----Original Message-----
> From: David Glick [mailto:dg...@co...]
> Sent: Tuesday, August 05, 2003 1:39 PM
> To: McDonald, Bruce; bab...@li...
> Subject: Re: [Babeldoc-devel] Config file dump committed; questions for
> completing
>
>
> Yeah, that's just what I had planned for rev 2... :-)
>
> I like your additional functionality, but I'm unclear as to what the
> advantage is of changing it from a command line switch into a separate
> command. I had assumed that this would be most useful in conjunction with
> another command that was not operating the way you expected. I therefore
> intended for this switch to be added to the original command line so that
> you could re-run it and determine if the problem was in the configuration,
> or elsewhere. If it is now a separate command, how will be above scenario
> play out?
>
>
> David
>
> On Tuesday 05 August 2003 10:05 am, McDonald, Bruce wrote:
> > David,
> >
> > I am spending some time with this tool.
> >
> > Heres what I have done so far:
> >
> > 1. Extracted the code into a new command: lightconfig
> > 2. Added another parameter (-t) which tracks a configuration value. It
> > will indicate those files that override the configuration value.
> >
> > regards,
> > Bruce.
> >
> > -----Original Message-----
> > From: David Glick [mailto:dg...@co...]
> > Sent: Tuesday, August 05, 2003 11:15 AM
> > To: bab...@li...
> > Subject: [Babeldoc-devel] Config file dump committed; questions for
> > completing
> >
> >
> > Hi Bruce,
> >
> > I've committed my changes to dump the configuration files and contents.
> > Hopefully, the following questions will make sense:
> >
> > 1. In the setupCommandLine() method, I've hard-coded the description
> > string. I believe it should be changed into a reference key into the
> > resource bundles (as the other description strings are in the same
> > method), but I'm not sure if there is a formal way to do so. How do I
> > assign the appropriate resource key?
> >
> > 2. I added a method printConfigInfo(). It also has a hard-coded string
> > that should be changed. Same question as in #1 above.
> >
> > 3. Should the new '-d' option be added to the printUsage() method? It
> > wasn't clear to me where it actually should be put.
> >
> >
> > Thanks,
> >
> > David
--
David Glick
Transmit Consulting, Inc
619-475-4052
dg...@tr...
|