User:Aurimas/CiteByDOI

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

Release status: experimental

Implementation Parser extension
Description Allows citing documents using their DOI
Author(s) AurimasTalk
Last 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

Parameters

$wgCBDOI_askToValidate

Tags
<doi>
Hooks used
EditPage::importFormData

Contents

[edit] What can this extension do?

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.

[edit] Usage

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

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

[edit] Download instructions

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

[edit] Installation

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

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

[edit] Package Dependencies

This extension requires PHP cURL library.

[edit] Known Issues

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

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.

[edit] Configuration parameters

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;

[edit] See also

Extension:Cite

Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox