17f6d651d40d564dfcda6b6eb811e4ba75013857
[openafs-wiki.git] / TWiki / ManagingTopics.mdwn
1 <div>
2   <ul>
3     <li><a href="#Rename/move/delete a topic"> Rename/move/delete a topic</a><ul>
4         <li><a href="#Referring topics"> Referring topics</a></li>
5         <li><a href="#Deleting a topic"> Deleting a topic</a></li>
6         <li><a href="#Redirection from old topic"> Redirection from old topic</a></li>
7         <li><a href="#Permissions"> Permissions</a></li>
8         <li><a href="#Approach"> Approach</a></li>
9         <li><a href="#Limitations"> Limitations</a></li>
10       </ul>
11     </li>
12   </ul>
13 </div>
14
15 ## <a name="Rename/move/delete a topic"></a> Rename/move/delete a topic
16
17 Select rename/move when viewing a topic to change its name, delete it or move it
18
19 1. Select target Web if other than existing Web
20 2. Fill in new name - defaults to current name
21 3. You will be warned if there are locks or if there is a name clash
22 4. A list of _links_ to the topic will be listed, by default these links will be updated, click checkbox to prevent this
23 5. Press the Rename/Move button, topic will be renamed and links to the topic updated as requested.
24   - If any of the referring pages are locked then they will be listed
25   - You can correct these later by again pressing Rename/Move
26
27 ### <a name="Referring topics"></a> Referring topics
28
29 Referring topics are found using the the %SEARCH% variable, see the template <code>**searchrenameview.tmpl**</code>. First, matching topics in the current Web are listed - matches are to _topic_. Next, all Webs (including the current one) are listed that match _web.topic_. Because %SEARCH% is used, Webs marked in [[WebPreferences]] as NOSEARCHALL will not show up in the search for refernces to the _topic_ being changed.
30
31 Changed references are kept are as short as possible, i.e. _topic_ is used in preference to _web.topic_.
32
33 ### <a name="Deleting a topic"></a> Deleting a topic
34
35 Topics can be _deleted_ by moving them to the <code>**Trash Web**</code>. Note that topics from all Webs go into this, so there could be name clashes, the user is warned of this and asked to choose a new name. When TWiki support sub-webs, these could be created on demand in the Trash Web, which would avoid this name clash problem.
36
37 It is up to the administrator of a TWiki installation to clean the Trash Web periodically e.g. by archiving to tape of CDROM entries older than 6 months.
38
39 ### <a name="Redirection from old topic"></a> Redirection from old topic
40
41 Something like the following can be put in [[WebTopicViewTemplate]] and [[WebTopicNonWikiTemplate]] to show if a topic has moved. It does this by searching for the tag %META:TOPICMOVED\{...\}%.
42
43     %METASEARCH{type="topicmoved" web="%WEB%" topic="%TOPIC%" title="This topic used to exist and was moved to: "}%
44
45 ### <a name="Permissions"></a> Permissions
46
47 Permissions affect rename in various ways. To rename a topic you need both change and rename permissions. To alter refering topics, you need change permission. See [[TWikiDocumentation#TWiki_Access_Control]] for information on setting up permissions.
48
49 ### <a name="Approach"></a> Approach
50
51 - %SEARCH% is used with a special template to show text in topics that requires alteration to point to the new topic name. This includes relavent [[meta data|Main/TWikiDocumentation#Meta_Data_Definition]]
52   - User chooses which topics will be altered
53 - &lt;PRE&gt; and &lt;verbatim&gt; are honoured - no changes to text within these areas
54 - Topic is moved (if locks allow)
55 - References are changed (locks and permissions allowing)
56 - Any refering topics that can't be changed due to locks are listed - user can try getting these references changed at any time.
57
58 ### <a name="Limitations"></a> Limitations
59
60 Rename in TWiki is fairly complicated due to the dynamic generation of links. Ideally it would be possible to run the required part of rendering in a way that would allow identification of the text to be changed. Unfortunately, these hooks don't exist in TWiki at present. Instead, %SEARCH% is used with a special template to show the text to be changed. And the selected topics and then altered. Search can show matches that will not be updated e.g. because of case differences. Other mis-matches to actual rendered output are also possible as the approaches are so different.
61
62 The following shows some limitations of square bracket processing.
63
64     [[Old Topic]]  => [[NewTopic][Old Topic]]
65     [[old topic]]  => [[NewTopic][old topic]]
66     [[old t opic]] => not changed
67     [[OldTopic]]   => [[NewTopic]]