none
[openafs-wiki.git] / TWiki / TWikiMetaData.mdwn
index e695080..d62175f 100644 (file)
@@ -2,16 +2,14 @@
   <ul>
     <li><a href="#TWiki Meta Data"> TWiki Meta Data</a><ul>
         <li><a href="#Overview"> Overview</a></li>
-        <li><a href="#Meta Data Syntax"> Meta Data Syntax</a><ul>
-            <li><a href="#Specifications"> Specifications</a><ul>
-                <li><a href="#TOPICINFO"> TOPICINFO</a></li>
-                <li><a href="#TOPICMOVED"> TOPICMOVED</a></li>
-                <li><a href="#TOPICPARENT"> TOPICPARENT</a></li>
-                <li><a href="#FILEATTACHMENT"> FILEATTACHMENT</a></li>
-                <li><a href="#FORM"> FORM</a></li>
-                <li><a href="#FIELD"> FIELD</a></li>
-              </ul>
-            </li>
+        <li><a href="#Meta Data Syntax"> Meta Data Syntax</a></li>
+        <li><a href="#Meta Data Specifications"> Meta Data Specifications</a><ul>
+            <li><a href="#META:TOPICINFO"> META:TOPICINFO</a></li>
+            <li><a href="#META:TOPICMOVED"> META:TOPICMOVED</a></li>
+            <li><a href="#META:TOPICPARENT"> META:TOPICPARENT</a></li>
+            <li><a href="#META:FILEATTACHMENT"> META:FILEATTACHMENT</a></li>
+            <li><a href="#META:FORM"> META:FORM</a></li>
+            <li><a href="#META:FIELD"> META:FIELD</a></li>
             <li><a href="#Recommended Sequence"> Recommended Sequence</a></li>
           </ul>
         </li>
 
 # <a name="TWiki Meta Data"></a> TWiki Meta Data
 
-_Topic data not editable from main freeform text box, stored in name/value `META` variable pairs_
+_Additional topic data, program-generated or from [[TWikiForms]], is stored in `META` variable name/value pairs_
 
 ## <a name="Overview"></a> Overview
 
-TWikiMetaData uses `META` variables to store topic data that's separate from the main free-form content. This includes program-generated info like [[FileAttachment]] data, and user-defined [[Form Template|Main/TWikiDocumentation#TWiki_Form_Templates]] info.
+[[TWikiMetaData]] uses `META` variables to store topic data that's separate from the main free-form content. This includes program-generated info like [[FileAttachment]] and topic movement data, and user-defined [[TWikiForms]] info. Use `META` variables to format and display Meta Data.
 
 ## <a name="Meta Data Syntax"></a> Meta Data Syntax
 
-- Format is the same as in [[TWikiVariables|Main/TWikiDocumentation#TWiki_Variables]], except all fields have a key.
-  - %META:&lt;type&gt;\{key1="value1" [key2="value2" [...]]\}%
+- Format is the same as in [[TWikiVariables]], except all fields have a key.
+  - `%META:<type>{key1="value1" key2="value2" ...}%`
 
 - Order of fields within the meta variables is not defined, except that if there is a field with key `name`, this appears first for easier searching (note the order of the variables themselves is defined).
 
@@ -46,22 +44,22 @@ TWikiMetaData uses `META` variables to store topic data that's separate from the
 
 > **Example of Format**
 >
->     %<nop>META:TOPICINFO{version="1.6" date="976762663" author="PeterThoeny" format="1.0"}%
->        text of the topic
->     %<nop>META:TOPICMOVED{from="Codev.OldName" to="CoDev.NewName"
->        by="JohnTalintyre" date="976762680"}%
->     %<nop>META:TOPICPARENT{name="NavigationByTopicContext"}%
->     %<nop>META:FILEATTACHMENT{name="Sample.txt" version="1.3" ... }%
->     %<nop>META:FILEATTACHMENT{name="Smile.gif" version="1.1" ... }%
->     %<nop>META:FORM{name="WebFormTemplate"}%
->     %<nop>META:FIELD{name="OperatingSystem" value="OsWin"}%
->     %<nop>META:FIELD{name="TopicClassification" value="PublicFAQ"}%
-
-### <a name="Specifications"></a> Specifications
+>     %META:TOPICINFO{version="1.6" date="976762663" author="PeterThoeny" format="1.0"}%
+>      text of the topic
+>     %META:TOPICMOVED{from="Codev.OldName" to="Codev.NewName"
+>      by="JohnTalintyre" date="976762680"}%
+>     %META:TOPICPARENT{name="NavigationByTopicContext"}%
+>     %META:FILEATTACHMENT{name="Sample.txt" version="1.3" ... }%
+>     %META:FILEATTACHMENT{name="Smile.gif" version="1.1" ... }%
+>     %META:FORM{name="WebFormTemplate"}%
+>     %META:FIELD{name="OperatingSystem" value="OsWin"}%
+>     %META:FIELD{name="TopicClassification" value="PublicFAQ"}%
+
+## <a name="Meta Data Specifications"></a> Meta Data Specifications
 
 The current version of Meta Data is 1.0, with support for the following variables.
 
-#### <a name="TOPICINFO"></a> TOPICINFO
+### <a name="META:TOPICINFO"></a> META:TOPICINFO
 
 <table border="1" cellpadding="0" cellspacing="0">
   <tr>
@@ -86,11 +84,11 @@ The current version of Meta Data is 1.0, with support for the following variable
   </tr>
 </table>
 
-#### <a name="TOPICMOVED"></a> TOPICMOVED
+### <a name="META:TOPICMOVED"></a> META:TOPICMOVED
 
-This is optional, exists if topic has ever been moved. If a topic is moved more than once, only the most recent TOPICMOVED meta variable exists in the topic, older ones are to be found in the rcs history.
+This is optional, exists if topic has ever been moved. If a topic is moved more than once, only the most recent META:TOPICMOVED meta variable exists in the topic, older ones are to be found in the rcs history.
 
-%META:TOPICMOVED\{from="Codev.OldName" to="CoDev.NewName" by="talintj" date="976762680"\}%
+`%META:TOPICMOVED{from="Codev.OldName" to="Codev.NewName" by="talintj" date="976762680"}%`
 
 <table border="1" cellpadding="0" cellspacing="0">
   <tr>
@@ -99,11 +97,11 @@ This is optional, exists if topic has ever been moved. If a topic is moved more
   </tr>
   <tr>
     <td> from </td>
-    <td> Full name i.e. web.topic </td>
+    <td> Full name, i.e., web.topic </td>
   </tr>
   <tr>
     <td> to </td>
-    <td> Full name i.e. web.topic </td>
+    <td> Full name, i.e., web.topic </td>
   </tr>
   <tr>
     <td> by </td>
@@ -120,7 +118,7 @@ Notes:
 - at present version number is not supported directly, it can be inferred from the RCS history.
 - there is only one META:TOPICMOVED in a topic, older move information can be found in the RCS history.
 
-#### <a name="TOPICPARENT"></a> TOPICPARENT
+### <a name="META:TOPICPARENT"></a> META:TOPICPARENT
 
 <table border="1" cellpadding="0" cellspacing="0">
   <tr>
@@ -133,7 +131,7 @@ Notes:
   </tr>
 </table>
 
-#### <a name="FILEATTACHMENT"></a> FILEATTACHMENT
+### <a name="META:FILEATTACHMENT"></a> META:FILEATTACHMENT
 
 <table border="1" cellpadding="0" cellspacing="0">
   <tr>
@@ -178,6 +176,10 @@ Extra fields that are added if an attachment is moved:
 
 <table border="1" cellpadding="0" cellspacing="0">
   <tr>
+    <th bgcolor="#99CCCC"><strong> Key </strong></th>
+    <th bgcolor="#99CCCC"><strong> Comment </strong></th>
+  </tr>
+  <tr>
     <td> movedfrom </td>
     <td> full topic name - web.topic </td>
   </tr>
@@ -195,7 +197,7 @@ Extra fields that are added if an attachment is moved:
   </tr>
 </table>
 
-#### <a name="FORM"></a> FORM
+### <a name="META:FORM"></a> META:FORM
 
 <table border="1" cellpadding="0" cellspacing="0">
   <tr>
@@ -204,13 +206,13 @@ Extra fields that are added if an attachment is moved:
   </tr>
   <tr>
     <td> name </td>
-    <td> A topic name - the topic is a [[Main/TWikiDocumentation#Form_Template]]. Can optionally include the web name i.e. web.topic, but doesn't normally </td>
+    <td> A topic name - the topic represents one of the [[Main/TWikiForms]]. Can optionally include the web name (i.e., web.topic), but doesn't normally </td>
   </tr>
 </table>
 
-#### <a name="FIELD"></a> FIELD
+### <a name="META:FIELD"></a> META:FIELD
 
-Should only be present if there is a FORM entry. Note that this data is used when viewing a topic, the form template definition is not read.
+Should only be present if there is a META:FORM entry. Note that this data is used when viewing a topic, the form template definition is not read.
 
 <table border="1" cellpadding="0" cellspacing="0">
   <tr>
@@ -219,11 +221,11 @@ Should only be present if there is a FORM entry. Note that this data is used whe
   </tr>
   <tr>
     <td> name </td>
-    <td> Ties to entry in [[Main/TWikiDocumentation#Form_Template]], is title with all bar alphanumerics and . removed </td>
+    <td> Ties to entry in [[Main/TWikiForms]] template, is title with all bar alphanumerics and . removed </td>
   </tr>
   <tr>
     <td> title </td>
-    <td> Full text from [[Main/TWikiDocumentation#Form_Template]]</td>
+    <td> Full text from [[Main/TWikiForms]] template </td>
   </tr>
   <tr>
     <td> value </td>
@@ -240,17 +242,17 @@ There is no absolute need for Meta Data variables to be listed in a specific ord
 
 The recommended sequence is:
 
-- TOPICINFO
+- META:TOPICINFO
 - `text of topic`
-- TOPICMOVED (optional)
-- TOPICPARENT (optional)
-- FILEATTACHMENT (0 or more entries)
-- FORM (optional)
-- FIELD (0 or more entries; FORM required)
+- META:TOPICMOVED (optional)
+- META:TOPICPARENT (optional)
+- META:FILEATTACHMENT (0 or more entries)
+- META:FORM (optional)
+- META:FIELD (0 or more entries; FORM required)
 
 ## <a name="Viewing Meta Data in Page Source"></a> Viewing Meta Data in Page Source
 
-When viewing a topic the <code>**Raw Text**</code> link can be clicked to show the text of a topic (ie: as seen when editing). This is done by adding `raw=on` to URL. `raw=debug` shows the meta data as well as the topic data, ex: [debug view for this topic](http://www.dementia.org/twiki//view/%WEB%/%TOPIC%?raw=debug)
+When viewing a topic the <code>**Raw Text**</code> link can be clicked to show the text of a topic (i.e., as seen when editing). This is done by adding `raw=on` to URL. `raw=debug` shows the meta data as well as the topic data, ex: [debug view for this topic](http://www.dementia.org/twiki//view/%WEB%/%TOPIC%?raw=debug)
 
 <a name="MetaDataRendering"></a>
 
@@ -258,6 +260,8 @@ When viewing a topic the <code>**Raw Text**</code> link can be clicked to show t
 
 Meta Data is rendered with the %META% variable. This is mostly used in the `view`, `preview` and `edit` scripts.
 
+**_Note:_** Rendering meta data is currently not supported in topic text. As a workaround, use [[FormattedSearch]] on the current topic only to render form fields.
+
 Current support covers:
 
 <table border="1" cellpadding="0" cellspacing="0">
@@ -266,57 +270,29 @@ Current support covers:
     <th bgcolor="#99CCCC"><strong> Comment: </strong></th>
   </tr>
   <tr>
-    <td> %META{"form"}% </td>
-    <td> Show form data, see [[Main/TWikiDocumentation#Form_Templates]]</td>
-  </tr>
-  <tr>
-    <td> %META{"attachments"}% </td>
-    <td> Show attachments, exclude hidden </td>
-  </tr>
-  <tr>
-    <td> Options for [[Main/FileAttachments]]: </td>
-    <td>   </td>
+    <td><code>%META{"form"}%</code></td>
+    <td> Show form data, see [[Main/TWikiForms]]. </td>
   </tr>
   <tr>
-    <td> all="on" </td>
-    <td> Show ALL attachments (including hidden) </td>
+    <td><code>%META{"formfield"}%</code></td>
+    <td> Show form field value. Parameter: <code><b>name="field_name"</b></code>. Example:%BR% <code>%META{ "formfield" name="TopicClassification" }%</code></td>
   </tr>
   <tr>
-    <td> %META{"moved"}% </td>
-    <td> Details of any topic moves </td>
+    <td><code>%META{"attachments"}%</code></td>
+    <td> Show attachments, except for hidden ones. Options: <br /><code><b>all="on"</b></code>: Show all attachments, including hidden ones. </td>
   </tr>
   <tr>
-    <td> %META{"parent [options]"}% </td>
-    <td> Show topic parent </td>
+    <td><code>%META{"moved"}%</code></td>
+    <td> Details of any topic moves. </td>
   </tr>
   <tr>
-    <td> Options for parent: </td>
-    <td>   </td>
-  </tr>
-  <tr>
-    <td> dontrecurse="on" </td>
-    <td> By default recurses up tree, at some cost </td>
-  </tr>
-  <tr>
-    <td> prefix="..." </td>
-    <td> Prefix for parents, only if there are parents; default "" </td>
-  </tr>
-  <tr>
-    <td> suffix="..." </td>
-    <td> Suffix, only appears if there are parents; default "" </td>
-  </tr>
-  <tr>
-    <td> seperator="..." </td>
-    <td> Separator between parents, default is " &gt; " </td>
+    <td><code>%META{"parent"}%</code></td>
+    <td> Show topic parent. Options: <br /><code><b>dontrecurse="on"</b></code>: By default recurses up tree, at some cost. <br /><code><b>nowebhome="on"</b></code>: Suppress WebHome. <br /><code><b>prefix="..."</b></code>: Prefix for parents, only if there are parents, default <code>""</code>. <br /><code><b>suffix="..."</b></code>: Suffix, only appears if there are parents, default <code>""</code>. <br /><code><b>separator="..."</b></code>: Separator between parents, default is <code>" &gt; "</code>. </td>
   </tr>
 </table>
 
-- **Future Development:** There are numerous development directions and specific features to consider. A couple of obvious possibilities:
-  - Rendering to formats other than tables: bullet lists, formatted body text;
-  - Specifying templates to be used for rendering.
-
 ## <a name="Known Issues"></a> Known Issues
 
 At present, there is no Meta Data support for Plugins. However, the format is readily extendable and the `Meta.pm` code that supports the format needs only minor alteration.
 
--- [[JohnTalintyre]] - 29 Aug 2001 <br />
+-- [[JohnTalintyre]] - 29 Aug 2001 <br /> -- [[MikeMannix]] - 03 Dec 2001 <br /> -- [[PeterThoeny]] - 10 Jan 2002