Motivation
A TWiki application has its data as topics. When you create a new instance of an app by cloning a web, you may want to exclude data topics. Once an application is established, you can create a template web having only scaffolding without data, with which you can create a new instance of the app by using the template web without hassle. But a web app may evolve incrementally. In that case, it's handy to clone a TWiki app excluding data topics.
Description and Documentation
Let's introduce
excludetopic parameter to the
createweb action of the
manage script. The
excludetopic parameter will work just like the same parameter of SEARCH{}.
Let's assume data topics are named
AppPrefixAUTOINC0. In that case,
AppPrefixTemplate and
AppPrefixForm topics are likely there. If so,
AppPrefeixTemplate and
AppPrefixForm need to be made exception of the exclusion.
Besides,
WebPreferences must exist for a web to be recognized by TWiki.
To avoid some topics to be excluded, the
excludeexception parameter will be used, whose default value will be specified by
%CREATE_WEB_EXCLUDE_EXCEPTION%.
The
excludeexception parameter's value will be in the same format as
excludetopic.
As such, TWiki.TWikiPreferences will have:
* Set CREATE_WEB_EXCLUDE_EXCEPTION = *Template, *Form, WebPreferences
The following row will be added to the new web creation form on
ManagingWebs.
Examples
Data*
Impact
Implementation
--
Contributors:
Hideyo Imazu - 2017-05-31
Discussion
In the sense of being easy-to-understand and (rather) easy-to-implement, this is a good solution for the problem. In TWiki applications, data topics are usually created with the AUTOINC mechanism, so I'd expect that one needs very few, in most cases just one,
AppPrefix* entry to exclude all data topics from being copied over.
Two minor caveats: Care must be taken by the creator of the new web that the EXCLUDE entries don't per accident exclude topics like
AppPrefixForm and
AppPrefixTemplate which are needed to run the application, and by the programmer that "mandatory" topics (in particular
WebPreferences) are not excluded.
--
Harald Jörg - 2017-06-02
Thank you for pointing out about
*Form,
*Template, and
WebPreferences. I modified the proposal accordingly.
--
Hideyo Imazu - 2017-06-05