One idea (+ patches) to separate custom preferences from the ones distributed with the installation package. See
SeparateCustomPreferences and
EasierUpgrades for details.
The idea of this approach: having
two topics for TWiki site-level preferences. Make
PrefsDotPm read both of them every time, just to be able to put installation (non-modifiable) configuration values in
TWikiPreferences and custom configuration values in
TWikiCustomPreferences. A similar technique is used in
TWiki.cfg (the custom configuration goes in
TWikiCustom.cfg).
For this to work, you need to do the following:
- Patch
TWiki.pm with twiki-pm-custom-patch.
- Copy
TWiki.cfg to TWikiCustom.cfg (ideally, you would also delete everything not customized to make it as short as possible; you can find out what you have changed doing a diff against the original TWiki.cfg).
- Patch
TWiki.cfg with twiki-cfg.patch.
- Create the topic
TWikiCustomPreferences using TWikiPreferences as a template, with an URL like this: .../edit/Codev/TWikiCustomPreferences?templatetopic=TWikiPreferences.
- Delete/comment out the FINALPREFERENCES value in
TWikiPreferences (leave it as is in TWikiCustomPreferences, though)
--
EstebanManchado - 06 Aug 2003
Esteban, I think that for simplicity sake, your patch should
not implement
WebCustomPreferences for 2 reasons:
- Per-web installation preferences should be empty, as it they thus really are site preferences and should belong to TWikiPreferences. they are actually empty, except for the web color, which should not be changed by engine upgrades anyways... (but by the skin)
- Having a
WebCustomPreferences and a WebPreferences will still imply some manual update on upgrades to reproduce the changes on installed webs.
And it will be faster.
So, I urge you to only implement
TWikiCustomPreferences, not
WebCustomPreferences
--
ColasNahaboo - 06 Aug 2003
Thanks for you comments, Colas. I think I hated
so much having to merge preferences that I didn't think about
not needing to do it for
WebPreferences 
As I'm also worried about performance, I think you're completely right. I will remake the patches as soon as I can.
--
EstebanManchado - 06 Aug 2003
I just uploaded the updated patches. Any comments welcome!
--
EstebanManchado - 06 Aug 2003
By thinking a bit more, I am wondering if we need your patch at all...
If some values are to be in
TWikiPreferences, that means that they should not be modified
during site install, so... why aren't there imbedded in the TWiki code???
They could be in a module named
lib/TWiki/Builtinprefs.pm, with a plugin hook so that plugins could add their default values there without having the user need to edit topics for this.
That means that we would keep the current file
TWikiPreferences and modify the distrib
to
NOT include this file, and have the install instruction to create an empty one on first install (or to copy a distributed sample one).
Same thing could be done for TWiki.cfg also (embed the default values in the code).
A side remark on TWiki, not on your patch: Having extensive comments in config files seems like
a good idea at first, but they become quite cumbersome in the long run, and make it very difficult to spot errors. Now that we edit files with screens able to hold more than one
text window, having an edit window with just the non-default values, and another on the doc is much more confortable...
--
ColasNahaboo - 07 Aug 2003