Extension:Collection
Collection Release status: stable |
|||
---|---|---|---|
![]() |
|||
Implementation | Special page, MyWiki | ||
Description | Allows to organize personal selections of pages in a collection that can be edited, persisted and optionally retrieved as PDF, ODF or DocBook (XML) | ||
Author(s) | PediaPress.com, Siebrand Mazeland, Marcin Cieślak | ||
Latest version | 1.7.0 (2014-04-18) | ||
MediaWiki | 1.17+ | ||
Database changes | No | ||
License | GPL | ||
Download |
README.txt |
||
Example | wiki.openoffice.org | ||
|
|||
|
|||
|
|||
Translate the Collection extension if it is available at translatewiki.net |
|||
Check usage and version matrix; code metrics | |||
Bugs: list open list all report |
The Collection extension allows a user to organize personal selections of pages in a collection. Collections can be
- edited and structured using chapters
- persisted, loaded and shared
- rendered as PDF (see Extension:PDF_Writer)
- exported as ODF Text Document (see Extension:OpenDocument_Export)
- exported as DocBook XML (see Extension:XML_Bridge)
- ordered as a printed book at http://pediapress.com/
- exported as ZIM file (see Extension:Collection/openZIM)
See the press release Wikis Go Printable for more information on this project.
Contents
Documentation & Support[edit | edit source]
The documentation for the collection can be found at http://mwlib.readthedocs.org/en/latest/collection.html
There is also a Google group for support and discussion of mwlib, mwlib.rl and the Collection extension.
mwlib developers have also been spotted on the pediapress IRC channel:
- Server: irc.freenode.net
- Channel: #pediapress
A detailed guide on how to prepare your wiki (templates, help pages, categories) if you setup the extension is available at meta.wikimedia.org.
Screencast[edit | edit source]
There is a screencast demoing the basic functionality available at youtube (in German) (2:45 minutes).
Creating cross-wiki article collections[edit | edit source]
It's best to use http://pediapress.com/collection/ for this purpose, see ticket 408.
Download[edit | edit source]
You can download the extension directly from the MediaWiki source code repository (browse code). You can get:
- One of the extension's tags
Not all extensions have tags. Some extensions have tags for each release, in which case those tags have the same stability as the release. To download a tag
- Go to the tags list
- Click the name of the tag you want to download
- Click "snapshot"
- The latest version of one of the extension's branches
Each extension has a master branch containing the latest code (might be unstable). Extensions may have further branches as well.
- Go to the branches list
- Click the branch name
- Click "snapshot"
- A snapshot made during the release of a MediaWiki version.
This might be unstable and is not guaranteed to work with the associated MediaWiki version.
After you've got the code, save it into the extensions/Collection directory of your wiki.
If you are familiar with git and have shell access to your server, you can obtain the extension, with all its tags and branches, as follows:
cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Collection.git
Installation[edit | edit source]
- Download and extract the file(s) in a directory called
Collection
in yourextensions/
folder. If you're a developer and this extension is in a Git repository, then instead you should clone the repository. - Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/Collection/Collection.php";
- Configure the extension as required
- Done! Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.
Please also read the included README for detailed configuration instructions of the extension.
$wgScriptPath = "";
Make sure that this parameter is either set to the default setting
$wgScriptPath = "/wiki";
or filled like this, e.g.
$wgScriptPath = "http://www.example.com"; #WITHOUT SLASH ON END
If that messes up your site, you may also patch "extensions/Collection/Collection.body.php": In function "renderCollection" change
'base_url' => 'http://www.example.com', #WITHOUT SLASH ON END
Configuration[edit | edit source]
Since version 1.6 (r113740) the extension offers the variable $wgCollectionPODPartners
that is used to define available providers of the print-on-demand service.
By default it uses PediaPress service:
$wgCollectionPODPartners = array( 'pediapress' => array( 'name' => 'PediaPress', 'url' => 'http://pediapress.com/', 'posturl' => 'http://pediapress.com/api/collections/', 'infopagetitle' => 'coll-order_info_article', ), );
It is an array of elements, every of them will be listed as a possible print-on-demand provider. The parameters are:
- name
- short name of the provider
- url
- URL to point for more information if there is no information page
- posturl
- URL of the actual printing web service
- infopagetitle
- MediaWiki system message name (as visible in the MediaWiki: namespace) that contains page title of the page that will be used to shortly describe the provider. The default (for PediaPress) is MediaWiki:Coll-order_info_article, which defaults to Help:Books/PediaPress order information. If this page exists, it is used to display information about PediaPress book printing service.
It is also possible to disable print on demand altogether by setting:
$wgCollectionPODPartners = false;
Please see bug 33536 and commit entry for more information about this feature.
You can also configure which file formats are available:
$wgCollectionFormats = array( 'rl' => 'PDF', # enabled by default 'odf' => 'ODT', 'docbook' => 'DocBook XML', 'xhtml' => 'XHTML 1.0 Transitional', 'epub' => 'e-book (EPUB)', 'zim' => 'Kiwix (OpenZIM)', );
See README.txt for more configuration options.
User rights for saving books[edit | edit source]
To allow users to save books in both their user space and the community space, add the following lines to your LocalSettings.php
:
$wgGroupPermissions['user']['collectionsaveascommunitypage'] = true; $wgGroupPermissions['user']['collectionsaveasuserpage'] = true;
Add the links at another place[edit | edit source]
If you want to add the links at another place, e.g. in the menu "Personal Tools", you can do that by adding them into the according portlet. For example, in the Vector skin you can do that by adding to the file skins/Vector.php so that it looks like this:
<h3><?php $this->msg( 'personaltools' ) ?></h3> <ul<?php $this->html( 'userlangattributes' ) ?>> <?php $personalTools = $this->getPersonalTools(); /* Links to create a PDF file/a book start */ if ( class_exists('CollectionHooks') ) { $collectionURLs = CollectionHooks::getPortlet($this->getSkin()); if ( $collectionURLs !== false ) { /* Put the links of the Collection extension below the last item. */ $personalTools += $collectionURLs; } } /* Links to create a PDF file/a book end */ foreach ( $personalTools as $key => $item ) { echo $this->makeListItem( $key, $item ); }
You can still modify the order of the links in the portlet by modifying $personalTools directly before the foreach loop is executed.
The above implementation has the drawback, that the two newly inserted links do not show their tooltip. A solution for that is still outstanding and would be greatly appreciated.
Setting book prefix[edit | edit source]
To change the default prefix for book name edit the message MediaWiki:Coll-community book prefix
Generating PDFs, OpenDocument- & DocBook-Exports[edit | edit source]
It's easy to enable PDF (ODF, DocBook) support with this Extension. It is configured by default to use the server http://tools.pediapress.com/. Therefore (low traffic) sites that are accessible from the internet don't need to install their own PDF Server.
Simply install and configure the Collection extension using the default value http://tools.pediapress.com/mw-serve/ for $wgCollectionMWServeURL (see README.txt of the Collection Extension for instructions) and make sure the MediaWiki API (api.php) is enabled on your MediaWiki installation.
No installation of Python, ReportLab, mwlib etc. required! Note however, that in order to use this service, your wiki must be accessible from the internet and must be either accessible for non-logged-in users or login credentials are configured (see README.txt for instructions).
If you either have a wiki which is not accessible from the outside or your site has high traffic, you need to install your own render server. The server is included with mwlib and can be used as a stand-alone HTTP server (which is the default protocol) or as FastCGI or SCGI server or as a CGI script.
Have a look at the Solar system, example article from the English language Wikipedia, rendered as PDF using this technology.
Setup your own render server[edit | edit source]
For documentation on how to do this on Ubuntu 12.04 look on Setup a render server on Ubuntu 12.04 LTS.
For documentation on how to do this on OSX Mavericks look on Setup a render server on OSX. There are useful tips for localhost installations for other systems too.
Performance[edit | edit source]
![]() |
Please expand this page. |
Performance of Collection is...
Cache[edit | edit source]
Recent versions store rendered "books" in a cache. Collections which have been previously exported by users should be available for download almost immediately, rather than after several minutes of rendering; the cached version can be updated by following a link offered in the download page.
Help improving the extension[edit | edit source]
If you want to help to make the extension better, you can:
- open a ticket for a bug or feature request in the bug tracker (use MediaWiki Extensions/Collection as component name),
- please also test etherpad:BugTriage-Collection and etherpad:BugTriage-mwlib;
- fix and add translations using translatewiki.net.
Printed Books with PediaPress[edit | edit source]
PediaPress is a service that offers printed books based from wiki content. This service is seamlessly integrated in this extension (can be disabled).
Related[edit | edit source]
External links[edit | edit source]
- A comprehensive guide about Extension:Collection installation and configuration with instructions for installing on local machines - by edutechwiki (TECFA, University of Geneva).
![]() |
This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page. |
- GPL licensed extensions
- Stable extensions
- Special page extensions
- Personalization extensions
- Extensions in Wikimedia version control
- Extensions which add rights
- SkinTemplateBuildNavUrlsNav urlsAfterPermalink extensions
- OutputPageCheckLastModified extensions
- ResourceLoaderGetConfigVars extensions
- SiteNoticeAfter extensions
- SkinBuildSidebar extensions
- All extensions
- Articles to be expanded
- Extensions used on Wikimedia
- Output extensions