Reading from the code these are the current rules:

Terminology:
pathname = the path to resolve eg. href attribute of include tag
base = the dir from where the entry lzx file resides

Search path is constructed as follows

1)
if pathname starts with "/"
- add JVM's user.dir property (probably the dir from which servlet container was started)
- add WebappRoot/lps/components

2)
- always add base

3)
if runtime is dhtml and pathname does not end in swf extension
- add base/autoPng

4)
if pathname does not start with ./ or ../
- add WebappRoot/lps/components
- add WebappRoot/lps/fonts
- add WebappRoot/[value of compiler.runtime.dir from lps.properties] (which by default is lps/includes/lfc)

From this we can see that if pathname starts with / then WebappRoot/lps/components is searched twice (which is of no consequence just a cosmetic flaw)

ebloch's comment "this vector should be in a properties file" is a bit unclear.

The whole vector can not be calculated from properties file because it has logic like
if pathname starts with x then do y

To me the only reasonable interpretation seems that we could add properties to lps.properties file like
searchpath = i/am/relative
searchpath.1 = /i/am/absolute
searchpath.2 = /some/other/path
...

or

searchpath = i/am/relative, /i/am/absolute, /some/other/path

These would be then added between steps 2 and 3 (or some other place)
relative paths would be resolved from the under base and absolute paths under WebappRoot

But I don't think that adding additional search paths is that important because it is easy to deploy your own applications
components under WebappRoot/lps/components.

I think the most useful thing to do would be to put these rules into documentation somewhere
(eg. a pointer from include tag's reference to these rules)

What do you think?

P T Withington wrote:
Are you talking about <include>'s?

They are expanded by:

http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/FileResolver.java

and you will see a comment on line 137 saying that the search list _should_ be in a property file, but unfortunately it is not. We're an open source project, though -- maybe you'd like to make such a change and contribute it back?

On 2009-08-12, at 08:46EDT, Rami Ojares / AMG Oy wrote:

It seems that href attribute is searched the following way

1) protocol_hostname_port/webappCtx/path_to_entry_lzx_file
2) protocol_hostname_port/webappCtx/lps/components

Is this true?
Is there some documentation about this?
Can this search path be modified?

- Rami Ojares




Reply via email to