Hi,
still working on template, I realized that there's another issue with them.
We have a system that looks for the template first in the user directory, and then, if not found, looks in the classpath and copies
the content to the data directory.
This allows Geoserver to work out of the box even with an emtpy
data directory, and provides a sample for the user to hack against or copy, so it's good, yet has some issues.
What if the user upgraded Geoserver, and we have new templates?
They won't be replaced because the data directory, which the
user preserved, already has them.
Yet, we should not replace them if the user changed them, because
we would be overwriting its work without mercy.
Finally, during template development, and only for geoserver developers, it would be nice to work against the template in the classpath, and
have the copy in the data dir always replaced.
Hum, though issues. In development mode, I probably would like it
to serve stuff directly from classpath, without the copy.
On upgrade, we would have to tell the users to wipe out stuff, or
else, play like in the above development mode, and give a way to
users to grab the templates (this way, the data directory would
contain only custom ones). The way for users to grab the templates
could be a web page, listing all the templates (this would mean
that we have to register in some central location for the page
to list them).
Ho hum, I accept suggestions
Cheers
Andrea