[Laszlo-dev] Re: Can anyone explain to me the path of lps.properties
Eric Bloch
bloch at laszlosystems.com
Fri Jan 14 16:07:06 PST 2005
P T Withington wrote:
> We'd like to add a property like:
>
> compiler.runtime.default=swf7
>
> to lps.properties and have it get passed down and used in the dozen or
> so places the string "swf6" is currently embedded in our code. I'd do
> it, but I can't figure out how lps.properties gets processed and/or
> whether it gets passed in to the script compiler. I'm m-.-ing around
> and will probably figure it out, but if one of you already know the
> story, you could save me some time...
This stuff is a bit of a mess and could really use some clean up!
The org.openlaszlo.server.LPS class reads in the
WEB-INF/lps/config/lps.properties in LPS.loadProperties() and creates a
new Properties object that merges the current java system properties and
the contents of lps.properties.
The idea was that you could simply call call LPS.getProperty() or
LPS.getProperties() anywhere (instead of System.getPropert{y,ies}()).
We could debate whether this was a good decision, too. I think it's ok,
although it might be better if the properties object returned was final.
The LPS.getProp* APIs were added after some of the API calls and
constructors that take a Properties object were designed/implemented and
not all the code has been modified to use LPS.getProp*.
LZServlet stores a pointer to the LPS properties object and hands it off
to each responder at init time. The ResponderCompile responder passes
the properties object off to the CompilationManager constructor who I
htink pass if off to some other classes (CompilationEnvironment and
ultimately SWFWriter, too)... and I think there might even be a place in
the Compiler class where a new Properties object is constructed based on
a previously existing one. Hmm...
Oliver or Henry (or others?) could explain how the Props get from there
to the ScriptCompiler class. Or you could probably just call
LPS.getProp* from the jython code directly.
-Eric
More information about the Laszlo-dev
mailing list