devel:metadata
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
devel:metadata [2013-02-26 19:15] – 146.60.141.165 | devel:metadata [2023-02-28 07:43] (current) – Link to new dokuwiki repo saggi | ||
---|---|---|---|
Line 11: | Line 11: | ||
===== Metadata Renderer ===== | ===== Metadata Renderer ===== | ||
- | Info in the '' | + | Info in the '' |
==== Data Structure ==== | ==== Data Structure ==== | ||
Line 17: | Line 17: | ||
Currently, the following metadata is saved by the core metadata renderer: | Currently, the following metadata is saved by the core metadata renderer: | ||
- | * ' | + | * ''title'' -- string, first heading |
- | * ' | + | * '' |
- | * ' | + | * ''user'' -- string, the login name of the user who created the page |
- | * ' | + | * '' |
- | * ' | + | * '' |
- | * ' | + | * '' |
- | * ' | + | * '' |
- | * ' | + | * ''date'' -- array |
- | * ' | + | * '' |
- | * ' | + | * '' |
- | * ' | + | * ''valid'' |
- | * ' | + | * ''age'' -- seconds, period in seconds before the page should be refreshed (used by ' |
- | * ' | + | * '' |
- | * ' | + | * ''date'' -- timestamp, date of the last change |
- | * ' | + | * ''ip'' -- ip of the user editing |
- | * ' | + | * ''type'' -- type of the edit (C create, E edit, e minor edit, D delete, R revert) |
- | * ' | + | * ''id'' -- id of the page |
- | * ' | + | * ''user'' -- username of the user editing |
- | * ' | + | * ''sum'' -- summary of the editor |
- | * ' | + | * ''extra'' -- extra data, used for storing the revision (timestamp) in the case of a revert |
- | * ' | + | * '' |
- | * ' | + | * '' |
- | * ' | + | * '' |
- | * ' | + | * '' |
- | * ' | + | * '' |
- | * ' | + | * '' |
- | * ' | + | * '' |
- | * ' | + | * ''cache'' -- boolean, if the cache may be used |
+ | * ''toc'' -- boolean, if the toc shall be displayed | ||
Additionally, | Additionally, | ||
- | * ' | + | * '' |
- | * ' | + | * '' |
- | * ' | + | * '' |
- | * ' | + | * '' |
- | * ' | + | * '' |
+ | * ''type'' -- string, ' | ||
+ | * ''geo'' -- array, list of geographic tags ([[plugin: | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
It's recommended to use keys from the [[http:// | It's recommended to use keys from the [[http:// | ||
+ | |||
+ | For plugin internal data it is recommended to store your keys under the '' | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
This data is stored in an associative array with two keys: ' | This data is stored in an associative array with two keys: ' | ||
Line 69: | Line 84: | ||
==== Running of metadata rendering ==== | ==== Running of metadata rendering ==== | ||
- | The metadata rendering is only started by the '' | + | The metadata rendering is only started by the '' |
- | //capture only the first few sections, is switched off by eg. section metarenderer | + | |
+ | The metadata | ||
+ | <code php> | ||
+ | // capture only the first few sections. | ||
+ | // Is switched off as well by eg. section metarenderer | ||
if ($this-> | if ($this-> | ||
if($linktitle) { | if($linktitle) { | ||
Line 79: | Line 98: | ||
} | } | ||
</ | </ | ||
- | The timing is thus not equal to xhtml renderer, but depends on render flags given to the '' | + | |
+ | The timing is thus not equal to xhtml renderer, but depends on render flags given to the '' | ||
==== Metadata and Plugins ==== | ==== Metadata and Plugins ==== | ||
Line 93: | Line 113: | ||
Note that persistent metadata is never cleaned and always used as basis for the current metadata so when switching from persistent to non-persistent metadata in a plugin make sure you implement a cleanup routine which removes persistent metadata from your plugin whenever it exists. For this reason non-persistent metadata should also be preferred whenever possible. | Note that persistent metadata is never cleaned and always used as basis for the current metadata so when switching from persistent to non-persistent metadata in a plugin make sure you implement a cleanup routine which removes persistent metadata from your plugin whenever it exists. For this reason non-persistent metadata should also be preferred whenever possible. | ||
- | If you want to make sure that your plugins | + | If you want to make sure that your plugin' |
As it is very difficult to cleanly update persistent metadata properties that are arrays from various places (in most cases you don't know which is old metadata that should be cleaned up and which is metadata from other plugins that should be kept - or not because the plugin was disabled) consider using keys that are unique to your plugin for this case and merge them manually into the current metadata using the [[.event: | As it is very difficult to cleanly update persistent metadata properties that are arrays from various places (in most cases you don't know which is old metadata that should be cleaned up and which is metadata from other plugins that should be kept - or not because the plugin was disabled) consider using keys that are unique to your plugin for this case and merge them manually into the current metadata using the [[.event: | ||
Line 113: | Line 133: | ||
* '' | * '' | ||
* '' | * '' | ||
- | * '' | + | * '' |
* '' | * '' | ||
* '' | * '' | ||
Line 139: | Line 159: | ||
Example for getting the ids of all pages that link to a certain page: <code php> | Example for getting the ids of all pages that link to a certain page: <code php> | ||
- | For more advanced queries (like getting all values stored for a certain metadata property) can be needed to access the index files directly using '' | + | For more advanced queries (like getting all values stored for a certain metadata property) can be needed to access the index files directly using '' |
The [[plugin: | The [[plugin: |
devel/metadata.1361902525.txt.gz · Last modified: 2013-02-26 19:15 by 146.60.141.165