User:Aurimas/CiteByDOI

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
CiteByDOI

Release status: experimental

Implementation Parser extension
Description Allows citing documents using their DOI
Author(s) Aurimastalk
Latest version 1.0a (18 May, 2011)
MediaWiki 1.16.0
License GPLv3
Download Project page
Download snapshot
Mercurial [Help]

Browse source code
View code changes
Note Note: No localisation updates provided by Translatewiki.net.

Parameters

$wgCBDOI_askToValidate

Tags
<doi>
Hooks used
EditPage::importFormData

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

What can this extension do?[edit | edit source]

This extension allows users to create styled document citations by using only the Digital Object Identifier (DOI).

The extension creates a pseudo-tag <doi></doi>. It is not a real parser tag, because the tags and their contents are replaced with actual wiki text before they are saved to the database.

The contents of the <doi> tags are queried at the data.crossref.org servers. If the supplied DOI is correct, the document metadata is retrieved and formatted (currently only AMA formatting style is supported).

This extension integrates very well with the Cite extension. Simply use the <doi> tags inside the <ref> tags.

Usage[edit | edit source]

Place the DOI of the document you wish to cite inside the <doi> tags.

<doi>10.1126/science.1197258</doi>

Download instructions[edit | edit source]

You can find the latest revision of this extension at http://code.google.com/p/cite-by-doi-mediawiki/

Installation[edit | edit source]

To install this extension, add the following to LocalSettings.php:

#CiteByDOI extension
require_once("$IP/extensions/CiteByDOI/CiteByDOI.php");

Package Dependencies[edit | edit source]

This extension requires PHP cURL library.

Known Issues[edit | edit source]

Error: "parameter expected to be a reference, value given"[edit | edit source]

When using PHP version 5.3.1 or higher, it is currently necessary to make a change in the MediaWiki source code for this extension to work. The intended functionality of some of MediaWiki's code was broken by changes introduced in 5.3.1. For more information see comment by 'tstarling at wikimedia dot org' at http://bugs.php.net/bug.php?id=50394

File includes/EditPage.php must be edited as follows:

// Allow extensions to modify form data
wfRunHooks( 'EditPage::importFormData', array( $this, $request ) );

Needs to be changed to:

// Allow extensions to modify form data
wfRunHooks( 'EditPage::importFormData', array( &$this, $request ) );

Note the & before $this.

Configuration parameters[edit | edit source]

By default, whenever the doi tags are used, the user is asked to verify that the DOI substitutions occurred properly before the edit form data is submitted to the database. This functionality can be disabled by adding the following to the LocalSettings.php file right after the required_once statement.

$wgCBDOI_askToValidate = false;

See also[edit | edit source]

Extension:Cite