Extension:AddPaper

From MediaWiki.org
Jump to: navigation, search

Other languages:
English • ‎italiano • ‎日本語 • ‎中文
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
AddPaper

Release status:Extension status beta

ImplementationTemplate:Extension#type Special page, Search, Data extraction, Page action
DescriptionTemplate:Extension#description Add page with specific custom template about paper data online results
Author(s)Template:Extension#username Alessandra Bilardi (Bilarditalk)
Latest versionTemplate:Extension#version 0.1 (2009-10-13)
MediaWikiTemplate:Extension#mediawiki 1.14+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download v0.1
ParametersTemplate:Extension#parameters
  • $wgAddPaperTemplateName
  • $wgAddPaperCacheDir

Translate the AddPaper extension if it is available at translatewiki.net

Check usage and version matrix.

The AddPaper extension provides a special page that allows to add page with specific custom template about paper data online results. Special:AddPaper is a simple form with choose about paper id types and input text where digit one or more paper ids (monospaced). Extension searches paper id(s) data online and adds one page for each paper id (with a template).

This extension is developed to create specific pages with DPL query about certain papers.

Now it works only with a pubmed id: PMID.

Settings[edit]

In LocalSettings.php add the following code:

// add AddPaper
$wgAddPaperTemplateName = 'Paper'; #optional: default name is Paper 
$wgAddPaperCacheDir = '/tmp/file/directory';
require_once("extensions/AddPaper/AddPaper.php");

Example[edit]

You would like add a paper: PMID:17381884. So that, you open Special:AddPaper page, select PMID id type and digit 17381884 and then click Add Paper button. Extension creates a page with title 17381884 and content:

 {{Paper
 |authors=Vida VL, Angelini A, Ausoni S, Bilardi A, Ori C, Vlassich F,
 Zoso V, Milanesi O, Sartore S, della Barbera M, Zaglia T, Thiene G, Stellin G, 
 |year=2007
 |title=Age is a risk factor for maladaptive changes in rats exposed to
 increased pressure loading of the right ventricular myocardium.
 |journal=Cardiol Young
 |volume=17
 |issue=2
 |pages=202-11
 |pmid=17381884
 }}
 

Following there is a simple template to look paper data (copy, paste and delete all newline):

 <includeonly>
 {| 
 | {{#if: {{{notauthors|}}}| {{!}} {{{notauthors|}}}. | 
 {{#if: {{#explode:{{{authors}}}|,|4}}| {{!}}{{#explode:{{{authors}}}|,|0}}, 
 {{#explode:{{{authors}}}|,|1}}, {{#explode:{{{authors}}}|,|2}}, ''et al.'' | 
 {{#if: {{{authors|}}}| {{!}} {{{authors}}}. }} }} }} 
 {{#if: {{{year|}}}| ({{{year}}}) }} 
 {{#if: {{{title|}}}| ''{{{title}}}'' }} 
 {{#if: {{{journal|}}}| '''{{{journal}}}'''. }}  
 {{#if: {{{volume|}}}| {{{volume}}}{{#if: {{{issue|}}}| ({{{issue}}})}}
 {{#if: {{{pages|}}}|{{Colon}}{{{pages}}}.}}}} 
 {{#if: {{{pmid|}}}| [[pubmed:{{{pmid}}}|Pubmed]]. }}
 |}
 </includeonly>