{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-06-12", use one of these two options: • parameter baseformfields="Title=Chief Scientist, Date=2026年06月12日", or: • parameter baseformfields="Title, Date" and set URL parameters Title=Chief+Scientist;Date=2026年06月12日 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: $TWiki::cfg{Plugins}{CopyTopicTreePlugin}{Debug} # Debug plugin. See output in data/debug.txt
{CopyRevisions} = 0 mode; fix parent if topic substitution is used
| I | Attachment | History | Action | Size | Date | Who | Comment |
|---|---|---|---|---|---|---|---|
| Unknown file formatmd5 | CopyTopicTreePlugin.md5 | r10 r9 r8 r7 r6 | manage | 0.2 K | 2015年06月24日 - 08:55 | PeterThoeny | |
| Compressed Zip archivetgz | CopyTopicTreePlugin.tgz | r10 r9 r8 r7 r6 | manage | 71.4 K | 2015年06月24日 - 08:55 | PeterThoeny | |
| Compressed Zip archivezip | CopyTopicTreePlugin.zip | r10 r9 r8 r7 r6 | manage | 74.8 K | 2015年06月24日 - 08:55 | PeterThoeny | |
| Unknown file formatext | CopyTopicTreePlugin_installer | r2 r1 | manage | 3.6 K | 2015年06月24日 - 08:55 | PeterThoeny |