*** Background :
I submitted this patch a week ago.
It's aimed at allowing #include and #parse to find resources with a path relative to
their containing template.
Looking back at it, this first implementation does not fully satisfy me because it is
kind of a hack to try to build a relative path
without knowing if the current ResourceLoader uses pathnames (althought functionnaly
speaking, this hack seems quite ok :-) ).
*** Question 1 :
I can easily write a cleaner implementation, if you think -like me- that this
functionnality is required.
The two main reasons I see are :
- it appears quite natural to refer directly to the current directory... HTTP does
it... why wouldn't VTL ?
- it allows templates subdirectories to easily be moved
- it is backward compatible if the relative search is only issued after the absolute
search failed
So, do you agree ?
*** Question 2 :
If response to question 1 is 'yes', here comes the implementation choice. To get
something cleaner, I just need to know, for a
specific ResourceLoader instance, if it works with pathnames.
My proposal is a new empty interface : PathnameResourceLoading (other names ?) that
would be implemented by FileResourceLoader,
WebappResourceLoader, etc... but not by DataSourceResourceLoader for instance.
Do you still agree ? :-)
Thanx for your opinion,
CloD
> > > This little patch allows one to do
> > >
> > > #parse("foo.vm")
> > >
> > > where foo.vm is located in the same directory as the template
> > > containing the #parse directive.
> > >
> > > It is independant from the resource loader (and shouldn't impact
> > > loaders that don't use path) : the only modified files are Parse.java
> > > and Include.java.
>
> > How could you want this independent of the resource loader? ??
>
> I just mean that this patch will make the relative resource loading behaviour
> available to any resource loader working with
> pathnames.
>
> I just want one to notice that without this patch, it is impossible to have a bunch
> of VTL files that is path-independant : full
> pathnames have to be hardcoded in any #parse and #include directive, which is quite
> ugly.
>
> And in addition, the fact that a template can "see" its current directory appears
> quite natural to me.
>
> If you like the idea but not the way it is implemented, we can discuss it further.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]