{CopyRevisions} = 0 - ignore the topic revisions of the source topic, e.g. start destination topic with revision 1 based on latest revision of source topic.
{CopyRevisions} = 1 - copy all revisions, e.g. clone topic.
{CopyRevisions} = 2 - copy all revisions and create a new revision on top of it, with author set to person who does the copy topic tree action.
%COPYTOPICTREE{"..."}% variable. The default "..." parameter or action="..." parameter determines the action. Currently only action="copytopictree" is supported.
%COPYTOPICTREE{ action="copytopictree" ... }% supports these parameters:
| Parameter | Explanation | Default |
|---|---|---|
from="..." |
Topic name or Web.TopicName of source base topic | (none, required) |
to="..." |
Topic name or Web.TopicName of destination base topic. The topic can be auto-incremented using AUTOINCn, such as "SID-AUTOINC0001" to get new base topic SID-1235, assuming the existing latest topic is SID-1234. |
(none, required) |
includes="..." |
RegularExpression of topic names of descendants to include in the copy action. Use this to speed up the search for topics. For example, if all descendant topics start with SID-, specify "^SID-". An empty value will include all descendants. |
"" |
excludes="..." |
RegularExpression of topic names of descendants to exclude from the copy action. Use this to speed up the search for descendants. | "" |
substitute="/.../.../" |
RegularExpression substitution rule on how to change the name of descendant topics. Leave this empty if you copy a tree from one web to another and you want to keep the same names. Format: "/pattern/replacement/". The pattern is a regular expression that identifies text to replace, the replacement indicates what to replace it with. Use pairs of parenthesis in the pattern to remember snippets of text. Those snippets of text can be retrieved in the replacement part with $1, $2, $3, $4, respectively. Tokens $fromBaseTopic and $toBaseTopic in the pattern and replacement part resolve to the source base topic name and destination base topic name, respectively. Examples: • "/$/Backup/" - append Backup to all children topic names, e.g. FooBar becomes FooBarBackup. • "/^SID-(.*)/BID-$1/" - all names starting with SID-* are changed to start with BID-*. • "/^($fromBaseTopic)/$toBaseTopic/" - all children's base name is changed, such as SID-0001-0123 to SID-0005-0123 assuming destination base topic is SID-0005 |
"" |
baseparent="..." |
Set the parent of the destination base topic. The parent can be auto-incremented using AUTOINCn, such as "PID-AUTOINC001" to get new parent topic PID-124, assuming existing latest topic is PID-123. The parent is not changed if the parameter is empty or not specified. |
"" |
baseformfields="..., ..., ..." |
Set form fields of the destination base topic. Specify a comma list of form field names, or name=value pairs. The value is taken from the named URL parameter in case only the name is specified. For example, to set the form field Title to "Chief Scientist", and the form field Date to "2026-02-08", use one of these two options: • parameter baseformfields="Title=Chief Scientist, Date=2026-02-08", or: • parameter baseformfields="Title, Date" and set URL parameters Title=Chief+Scientist;Date=2026-02-08 Note: Watch out for commas in values. Use the URL parameter option if there is a chance that values contain commas. |
"" |
nomessage="1" |
Set to 1 to suppress all output. Use this in template topics, such as:%STARTSECTION{ type="expandvariables" }%%COPYTOPICTREE{ action="%URLPARAM{copyttaction}%" ... nomessage="1" }%%ENDSECTION{ type="expandvariables" }% |
"0" |
{CopyRevisions} = 1 and 2 mode on TWiki installations older than TWiki-6.0.
CopyTopicTreePlugin.zip in your twiki installation directory. Content: | File: | Description: |
|---|---|
data/TWiki/CopyTopicTreePlugin.txt | Plugin topic |
lib/TWiki/Plugins/CopyTopicTreePlugin.pm | Plugin Perl module |
lib/TWiki/Plugins/CopyTopicTreePlugin/Core.pm | Plugin core module |
lib/TWiki/Plugins/CopyTopicTreePlugin/Config.spec | Plugin configuration spec |
pub/TWiki/CopyTopicTreePlugin/copy-tree.png | Copy tree diagram |
$TWiki::cfg{Plugins}{CopyTopicTreePlugin}{CopyRevisions} # How to copy revisions: | * Specify 0 to ignore the topic revisions of the source topic, e.g. start destination topic with revision 1 based on latest revision of source topic. |
| * Specify 1 to copy all revisions, e.g. to clone topic. |
| * Specify 2 to copy all revisions and create a new revision on top of it, with author set to person who does the copy topic tree action. |
$TWiki::cfg{Plugins}{CopyTopicTreePlugin}{Debug} # Debug plugin. See output in data/debug.txt
| Plugin Author: | TWiki:Main.PeterThoeny |
| Copyright: | © 2014-2015 Alba Power Quality Solutions. © 2014-2015 TWiki:Main.PeterThoeny © 2014-2015 TWiki:TWiki.TWikiContributor |
| License: | GPL (GNU General Public License |
| Sponsor: | Alba Power Quality Solutions |
| Plugin Version: | 2015-05-24 |
| Change History: | |
| 2015-05-24: | TWikibug:Item7665 |
| 2015-05-18: | TWikibug:Item7665 |
| 2015-05-09: | TWikibug:Item7665 |
| 2015-05-07: | TWikibug:Item7665 |
| 2014-03-29: | TWikibug:Item7468 |
| 2014-03-28: | TWikibug:Item7468{CopyRevisions} = 0 mode; fix parent if topic substitution is used |
| 2014-03-27: | TWikibug:Item7468 |
| TWiki Dependency: | $TWiki::Plugins::VERSION 1.2 |
| CPAN Dependencies: | none |
| Other Dependencies: | none |
| Perl Version: | 5.005 |
| Plugin Benchmark |
GoodStyle nn%, FormattedSearch nn%, CopyTopicTreePlugin nn% |
| Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/CopyTopicTreePlugin |
| Feedback: | http://TWiki.org/cgi-bin/view/Plugins/CopyTopicTreePluginDev |
| Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/CopyTopicTreePluginAppraisal |
| I | Attachment | History | Action | Size | Date | Who | Comment |
|---|---|---|---|---|---|---|---|
| |
CopyTopicTreePlugin.md5 | r10 r9 r8 r7 r6 | manage | 0.2 K | 2015-06-24 - 08:55 | PeterThoeny | |
| |
CopyTopicTreePlugin.tgz | r10 r9 r8 r7 r6 | manage | 71.4 K | 2015-06-24 - 08:55 | PeterThoeny | |
| |
CopyTopicTreePlugin.zip | r10 r9 r8 r7 r6 | manage | 74.8 K | 2015-06-24 - 08:55 | PeterThoeny | |
| |
CopyTopicTreePlugin_installer | r2 r1 | manage | 3.6 K | 2015-06-24 - 08:55 | PeterThoeny |