Help:Extension/ExMolFunctions
From Metabolomics.JP
(Difference between revisions)
Line 36: | Line 36: | ||
<ol> | <ol> | ||
<li>Download the source code and rename it to ExMolFunctions.php and updateMol.php.</li> | <li>Download the source code and rename it to ExMolFunctions.php and updateMol.php.</li> | ||
− | <li>Place it in the extensions/ directory.</li> | + | <li>Place it in the extensions/ directory. updateMol.phpはwebからアクセスできない場所へ置いて下さい。</li> |
<li>上記jarファイル二つをダウンロードし、適当な場所へ置いて下さい。</li> | <li>上記jarファイル二つをダウンロードし、適当な場所へ置いて下さい。</li> | ||
<li>Insert the follow lines to LocalSettings.php | <li>Insert the follow lines to LocalSettings.php |
Revision as of 13:50, 22 February 2011
Extension Information | |
Implementation | |
Description | |
Author(s) | K, Suwa |
Version | 0.1 |
MediaWiki | |
License | |
Hooks used | |
Token type | |
Contents |
ExMolFunctionsはMol名前空間にMOLデータを保存すると、自動的に組成式、精密質量、平均質量、SMILESデータを計算し、ページに追加書き込みします。Mol名前空間のページにはMOLファイルの中身をそのまま保存します。そのため、wikiソースはそのままMOLファイルと全く同じ中身になります。
また、MOLデータから自動的に画像も生成し、ページ表示時に画像を差し込みます。ページ内には画像情報は書き込まれません。 画像はID(ページ名).pngとID(ページ名)n.pngの二つが作成されますが、この二つの違いはn付き画像は、原子に番号が振ってあることです。
アップロードされたMOLファイルは、$egMolPathで指定されたディレクトリへID(ページ名)の頭4桁のディレクトリ内に保存されます。
この機能はページ更新時に行われるため、importDumpなどの一括登録した場合には機能しません。そのため、一括登録した場合はupdateMol.phpに対象ページ名を列挙したファイルを渡すことで、強制的にページ更新を行うことが出来ます。
Requirements
- GUI環境(Linuxにおいて、Xサーバが利用できない場合はXvfbが利用できます)
- Java 1.6
- MolCalculator.jar 質量計算等を行うプログラム
- armDrawMetabolomics.jar 画像生成を行うプログラム
Download
version | source | md5 | OperationCheck version |
0.1(March 13,2009) | ExMolFunctions.phps | f5469c2ec82eb807747ba3c95e4ef650 | 1.11.1, 1.16.2 |
version | source | md5 | OperationCheck version |
0.1(March 14,2009) | updateMol.phps | 107b89db96dabde0fcc79d4862d43c49 | 1.11.1, 1.16.2 |
Installtion
- Download the source code and rename it to ExMolFunctions.php and updateMol.php.
- Place it in the extensions/ directory. updateMol.phpはwebからアクセスできない場所へ置いて下さい。
- 上記jarファイル二つをダウンロードし、適当な場所へ置いて下さい。
- Insert the follow lines to LocalSettings.php
require_once( "$IP/extensions/ExMolFunctions.php" ); $egMolCalculatorJar = 'path to MolCalculator.jar'; $egMolImageJar = 'path to armDrawMetabolomics.jar'; $egJavaBin = 'path to java binary from /'; $egTmpPath = 'path to tmp directory from /'; $egMolPath = 'MOLファイルを保存するDocumentRootからのディレクトリパス'; $wgExtraNamespaces = array( ... xxx => "Mol", xxx+1 => "Mol_Talk", ... );
All is required.
Use 100 or larger numbers for xxx.
Usage
updateMol.phpの31行目にWikiRootへのパスを設定します。
$IP = "/var/www/htdocs/mediawiki/";
updateMol.phpに渡すリストは以下のようになっています。これを例えばlist.txtとして保存します。
Mol:Page1 Mol:Page2 Mol:Page3
実行は以下のように行います。
php updateMol.php list.txt
これで、list.txt内に列挙したMol名前空間の全ページが更新され、組成式の計算や画像の生成が行われます。