Tags:
create new tag
view all tags
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 wink 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

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatcfg TWikiCustom.cfg r1 manage 1.0 K 2003-08-06 - 13:55 UnknownUser TWikiCustom.cfg (example)
Unknown file formatpatch twiki-cfg.patch r2 r1 manage 1.7 K 2003-08-06 - 18:59 UnknownUser TWiki.cfg patch (updated)
Unknown file formatpatch twiki-pm-custom.patch r1 manage 0.9 K 2003-08-06 - 19:01 UnknownUser TWiki.pm patch (updated)
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2003-08-07 - ColasNahaboo
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.