Help:Extension/Persistency
From Metabolomics.JP
(Difference between revisions)
(9 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
{{Extension | {{Extension | ||
|author=K, Suwa | |author=K, Suwa | ||
− | |version=0. | + | |version=0.41 |
− | | | + | |type=Parser function |
}} | }} | ||
Line 12: | Line 12: | ||
; Persist namespace : There is no need to create pages. When a specified page title exists, the contents will be overwritten. | ; Persist namespace : There is no need to create pages. When a specified page title exists, the contents will be overwritten. | ||
+ | |||
+ | ; {{#upcase:__update_all_persistencies__ }}: Persistencyはログインユーザがボタンをクリックした時に、ページの作成・更新を行います。しかし大量にページを作成したい場合、一つ一つクリックして作成するのは時間がかかるため、mediawiki自体にページの作成を依頼することができます。この文字列を書いてページを保存すると、作成するページを全てwikiデータベースのjobテーブルに挿入し、遅延作成・更新を行ってくれます。 | ||
+ | |||
+ | == Example == | ||
+ | === <nowiki>{{#persist:作成・更新するPersist名前空間のページ名|表示名|テンプレート名|引数の数|引数|引数のセパレータ(=;)|再帰展開するか(=true)}}</nowiki> === | ||
+ | 一つ目の例は、テンプレートを再帰的に展開するもので、二つ目は一度だけ展開して保存するものです。 | ||
+ | * ソース | ||
+ | <nowiki>{{#persist:Test_recursive|click me(recursive)|PersistTest|1|PerRec|;|true}}</nowiki> | ||
+ | <nowiki>{{#persist:Test_non_recursive|click me(non recursive)|PersistTest|1|PerNonRec|;|false}}</nowiki> | ||
+ | |||
+ | * テンプレートソース | ||
+ | ** Template:PersistTest <pre><nowiki>First persist {{PersistTest2|{{{1}}}}}</nowiki></pre> | ||
+ | ** Template:PersistTest2 <pre><nowiki>Second persist data is {{{1}}}</nowiki></pre> | ||
+ | |||
+ | * 実行例 | ||
+ | {{#persist:Test_recursive|click me(recursive)|PersistTest|1|PerRec|;|true}} | ||
+ | {{#persist:Test_non_recursive|click me(non recursive)|PersistTest|1|PerNonRec|;|false}} | ||
+ | |||
+ | <span style="color: red">※ ログインしていないユーザでは反映結果は変わりません。</span> | ||
== Requirements == | == Requirements == | ||
Line 18: | Line 37: | ||
== Download == | == Download == | ||
<table border="1" cellpadding="3" cellspacing="1"> | <table border="1" cellpadding="3" cellspacing="1"> | ||
− | <tr><td>version</td><td>source</td><td>md5</td></tr> | + | <tr><td>version</td><td>source</td><td>md5</td><td>OperationCheck version</td></tr> |
− | <tr><td>0.3(March 5,2010)</td><td>{{#ifexistfile:/data/src/Persistency/Persistency.phps}}</td><td><pre style="border: 0px; background-color: white; padding: 0em; line-height: 0em">adba9c4b3b5e530e7d1b80e4cc78217b</pre></td></tr> | + | <tr><td>0.41(February 22,2011)</td><td>{{#ifexistfile:/data/src/Persistency/Persistency.phps}}</td><td><pre style="border: 0px; background-color: white; padding: 0em; line-height: 0em">22877c0d98744f74294f0ebe86ba59d5</pre></td><td>1.16.2</td></tr> |
− | <tr><td>0.2(December 4,2008)</td><td>{{#ifexistfile:/data/src/Persistency/previous/Persistency-0.2.phps}}</td><td><pre style="border: 0px; background-color: white; padding: 0em; line-height: 0em">7710adada75055803559dc5cd01b1e82</pre></td></tr> | + | <tr><td>0.4(February 18,2011)</td><td>{{#ifexistfile:/data/src/Persistency/previous/Persistency-0.4.phps}}</td><td><pre style="border: 0px; background-color: white; padding: 0em; line-height: 0em">eccc046fedebbad66c5abefd7f670220</pre></td><td>1.16.2</td></tr> |
+ | <tr><td>0.3(March 5,2010)</td><td>{{#ifexistfile:/data/src/Persistency/previous/Persistency-0.3.phps}}</td><td><pre style="border: 0px; background-color: white; padding: 0em; line-height: 0em">adba9c4b3b5e530e7d1b80e4cc78217b</pre></td><td>1.11.1</td></tr> | ||
+ | <tr><td>0.2(December 4,2008)</td><td>{{#ifexistfile:/data/src/Persistency/previous/Persistency-0.2.phps}}</td><td><pre style="border: 0px; background-color: white; padding: 0em; line-height: 0em">7710adada75055803559dc5cd01b1e82</pre></td><td>1.11.1</td></tr> | ||
</table> | </table> | ||
Line 40: | Line 61: | ||
== Function == | == Function == | ||
− | # [[Help:Extensions# | + | # [[Help:Extensions#Persist_Page_.7B.7B.23persist:pagename.7Cbutton_title.7Ctemplate_name.7Cnumber_of_args.7Cargs.7Cseparator.3D.3B.7Crecursive.3Dfalse.7D.7D|Persist]] |
== ChangeLog == | == ChangeLog == | ||
+ | 0.41 | ||
+ | * 編集権限を持つユーザのタブで「edit」と出る部分が「view source」と表示されてしまうバグを修正しました。 | ||
+ | 0.4 | ||
+ | * 1.16.2に対応しました。 | ||
0.3 | 0.3 | ||
* recursiveオプションを追加しました。 | * recursiveオプションを追加しました。 | ||
0.2 | 0.2 | ||
* _<nowiki>_UPDATE_ALL_PERSISTENCIES__と書いて保存することにより、対象ページをjobテーブルに保存し、ページの作成/更新を行います。</nowiki> | * _<nowiki>_UPDATE_ALL_PERSISTENCIES__と書いて保存することにより、対象ページをjobテーブルに保存し、ページの作成/更新を行います。</nowiki> |
Latest revision as of 14:12, 1 March 2011
Extension Information | |
Implementation | |
Description | |
Author(s) | K, Suwa |
Version | 0.41 |
MediaWiki | |
License | |
Hooks used | |
Token type | Parser function |
Contents |
Persistency is achieved by Persist link and Persist namespace. This function is allowed only for logged-in users. See also Volatile.
- Persist link
- [[Persist:name|template|params|name]] specifies a page title in Persist namespace, a template, and its parameters. In the specified page, the template is expanded with the parameters and its wiki code is saved as the page contents (without cash).
- Persist namespace
- There is no need to create pages. When a specified page title exists, the contents will be overwritten.
- __UPDATE_ALL_PERSISTENCIES__
- Persistencyはログインユーザがボタンをクリックした時に、ページの作成・更新を行います。しかし大量にページを作成したい場合、一つ一つクリックして作成するのは時間がかかるため、mediawiki自体にページの作成を依頼することができます。この文字列を書いてページを保存すると、作成するページを全てwikiデータベースのjobテーブルに挿入し、遅延作成・更新を行ってくれます。
[edit] Example
[edit] {{#persist:作成・更新するPersist名前空間のページ名|表示名|テンプレート名|引数の数|引数|引数のセパレータ(=;)|再帰展開するか(=true)}}
一つ目の例は、テンプレートを再帰的に展開するもので、二つ目は一度だけ展開して保存するものです。
- ソース
{{#persist:Test_recursive|click me(recursive)|PersistTest|1|PerRec|;|true}} {{#persist:Test_non_recursive|click me(non recursive)|PersistTest|1|PerNonRec|;|false}}
- テンプレートソース
- Template:PersistTest
First persist {{PersistTest2|{{{1}}}}}
- Template:PersistTest2
Second persist data is {{{1}}}
- Template:PersistTest
- 実行例
※ ログインしていないユーザでは反映結果は変わりません。
[edit] Requirements
[edit] Download
version | source | md5 | OperationCheck version |
0.41(February 22,2011) | Persistency.phps | 22877c0d98744f74294f0ebe86ba59d5 | 1.16.2 |
0.4(February 18,2011) | Persistency-0.4.phps | eccc046fedebbad66c5abefd7f670220 | 1.16.2 |
0.3(March 5,2010) | Persistency-0.3.phps | adba9c4b3b5e530e7d1b80e4cc78217b | 1.11.1 |
0.2(December 4,2008) | Persistency-0.2.phps | 7710adada75055803559dc5cd01b1e82 | 1.11.1 |
[edit] Installtion
- Download the source code and rename it to Persistency.php.
- Place it in the extensions/ directory.
- Insert the follow lines to LocalSettings.php
require_once( "$IP/extensions/Persistency.php" ); $egPhpBin = "path to php binary"; // ex. /usr/bin/php $egTmpPath = "path to tmp directory"; ( default: "/tmp" ) $wgExtraNamespaces = array( ... xxx => "Persist", xxx+1 => "Persist_Talk", ... );
$egPhpBin is required. Use 100 or larger numbers for xxx.
$egTmpPath is a temporary place to save import xml file.
[edit] Function
[edit] ChangeLog
0.41
- 編集権限を持つユーザのタブで「edit」と出る部分が「view source」と表示されてしまうバグを修正しました。
0.4
- 1.16.2に対応しました。
0.3
- recursiveオプションを追加しました。
0.2
- __UPDATE_ALL_PERSISTENCIES__と書いて保存することにより、対象ページをjobテーブルに保存し、ページの作成/更新を行います。