Extension talk:Collection/2011
This page used the LiquidThreads extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
Does Collections extension meet required licensing requirements?
We are considering whether to install the Collections extension on our wiki. To get a feel for the product of the extension, I created a small "book" of 3 articles from Wikipedia. After examining the result, I became concerned that the extension may not meet all of the licensing requirements for the content in the book.
At the end of the book, the extension cites the licenses for the images that appear in the collection and also specifies the text license. However, it doesn't actually include the licenses themselves or links to them (other than for the text license). For example, the Creative Commons Attribution-ShareAlike 2.5 License specifies in section 4 (Restrictions), "You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform." I included the Wikipedia article on Larry Sanger in a collection, the license for his picture is: "License: Creative Commons Attribution-Sharealike 2.5". Nowhere in the collection does this license or a URI to it appear. Consequently, I wonder if the "book" satisfies the terms of the license.
I asked a more general version of this question on Mediawiki-l but no one responded. Dnessett 16:57, 26 May 2011 (UTC)
- You may want to know of the following problem which seems related:
- Bug 28064 - Collection extension needs some way to inform original authors of a work Helder 21:24, 27 May 2011 (UTC)
- Thanks. Dnessett 16:07, 28 May 2011 (UTC)
- I'm aware of two other licence problems:
- Try making a book out of en:Taz people, or simply generate a PDF of the article. It seems that the extension tries to remove bots from the list of contributors, probably since their participation is below the threshold of originality so that they don't need attribution. The extension seems to try to exclude bots by searching for user names containing the word "bot", but note that the article has major contributions by en:User:Abbott, a normal user. Since the word "bot" appears in the middle of this user's user name, he isn't credited, clearly against the licence's attribution requirements. I tried to point this out at m:Book tool/Feedback#Bug: User with major contributions not credited but I'm not sure if this is the right place. Maybe it should go to bugzilla: instead?
- No verbatim copy of the GNU Free Document Licence is included on English Wikipedia (but it seems to be included on German Wikipedia). GFDL doesn't allow any URL – you must include the full licence. Stefan2 13:09, 29 January 2012 (UTC)
- I'm aware of two other licence problems:
Report problem: system overloaded. please try again later.
All worked fine, what could happen? 195.91.134.186 10:45, 31 May 2011 (UTC)
Images are ignored in articles. I don't want this.
How do I get this extension to include the images in articles? I installed it and it is working but no images get exported. Thank you. 24.130.249.87 19:58, 29 June 2011 (UTC)
- Maybe it is some of these bugs:
- Problems w/ images and ODF writer
- The LaTeX formulas are not shown in ODT files Helder 20:41, 29 June 2011 (UTC)
- When I use the pediapress preview option the same problem occurs. The latex renders seem to work. I tested it on a Math example. 24.130.249.87 21:30, 29 June 2011 (UTC)
Collections in a Intranet
Hello, can I generate PDF without access to the internet? My company has an wiki, that only can reach in the intranet. They are need a book generator. But I think Collections generate the PDFs on the pediapress server. Is it right? 141.35.213.246 08:13, 6 July 2011 (UTC)
- Setup your own Server with: PDF Writer 62.99.253.62 13:21, 13 September 2011 (UTC)
collection disappears
i know that collection is available as long as a session lifetime in php.ini. but can i make it aveliable all the time? 85.28.158.38 13:30, 8 August 2011 (UTC)
- adding an image is quite easy, look at the file pdfstyle.py (should be located at mwlib/rl/pdfstyle.py) and just modify one varaible to add the path to the image you want. See this line:
- titlepageimage = # path of an image that is to be displayed on the title page
- just put the complete path into the quotes 194.250.143.49 08:48, 3 December 2012 (UTC)
Collections + PDF Writer on Windows
Successfully installed in Windows (after so much pain in native opted for the cygwin route and it works)
Couple of problems though:
- needed to modify the cgi script to include a delay of 3 seconds (for mw-serve to boot) or else the rendering will be stuck and 0%
- even if the file has been generated the "Rendering page" is not notified and is stuck at 0%
I had to manually hit F5 or refresh the page to see the download link.
Anybody else experienced the same problem? Daimengrui 04:57, 2 September 2011 (UTC)
- Great addition. We're trying to implement the Collection extension here at my corporate office and are running into snags due to IT requiring us to operate on Windows OS and also limited documentation/support for this extension. We would greatly benefit from this tool.
- Could you please provide a small instruction list on what you had to do to get this to work? It would be a great help to all of us! We're also getting the 0% issue as well as some others. Btw we're running on MW 1.18. Dsuess (talk) 00:31, 10 November 2012 (UTC)
Bouncingmolar (talk) 03:29, 30 July 2013 (UTC)
Custom Title Page
Is there any way to replace or alter the Title Page (First Page). We would like to add an image or some text 62.99.253.62 13:14, 13 September 2011 (UTC)
Getting error when downloading PDF in Book Creator in Extensions Collection
Folks, I need some real help here. I keep getting an error (shown below) when I select download using PDF format in the Book Creator under the Collections Extension on the MediaWiki server. The admin who installed the extension used the following guidelines:
- http://edutechwiki.unige.ch/en/Mediawiki_collection_extension_installation - http://code.pediapress.com/wiki/wiki/mwlib-install - Extension:Collection
The server is running Oracle Enterprise Linux 5.2 32bit with 1.5GB RAM and 1 CPU. Please let me know if anyone has suggestions or recognizes the problem in the error message below. I'm about ready to rip out the extension and start over nearly from the beginning here. Any help or recommendations would be greatly appreciated.
Thanks.
Render server error An error occured on the render server: RuntimeError: RuntimeError: command failed with returncode 256: ['mw-zip', '-o', u'cache/71/71642c2f7f3ee0d5/collection.zip', '-m', u'cache/71/71642c2f7f3ee0d5/metabook.json', '--status', u'qserve://localhost:14311/71642c2f7f3ee0d5:makezip', '--template-blacklist', u'MediaWiki:PDF Template Blacklist', '--template-exclusion-category', u'Exclude in print', '--print-template-prefix', u'Print', '--print-template-pattern', u'$1/Print', '--username', u'username', '--password', '{OMITTED}', '--domain', u'companydomain']
Last Output: 2011-10-26T15:34:27 mwlib.options.warn >> Both --print-template-pattern and --print-template-prefix (deprecated) specified. Using --print-template-pattern only.
1% creating nuwiki in u'cache/71/71642c2f7f3ee0d5/tmpy2M8c_/nuwiki' removing tmpdir u'cache/71/71642c2f7f3ee0d5/tmpy2M8c_' memory used: res=10.4 virt=16.2
1% error Traceback (most recent call last):
File "/home/tools/local/bin/mw-zip", line 8, in <module> load_entry_point('mwlib==0.12.17', 'console_scripts', 'mw-zip')()
File "/home/tools/py26/lib/python2.6/site-packages/mwlib-0.12.17-py2.6-linux-x86_64.egg/mwlib/apps/buildzip.py", line 155, in main make_zip(output, options, env.metabook, podclient=podclient, status=status)
File "/home/tools/py26/lib/python2.6/site-packages/mwlib-0.12.17-py2.6-linux-x86_64.egg/mwlib/apps/buildzip.py", line 50, in make_zip make_nuwiki(fsdir, metabook=metabook, options=options, podclient=podclient, status=status)
File "/home/tools/py26/lib/python2.6/site-packages/mwlib-0.12.17-py2.6-linux-x86_64.egg/mwlib/apps/make_nuwiki.py", line 152, in make_nuwiki assert x.wikiident in id2wiki, "no wikiconf for %r (%s)" % (x.wikiident, x)
AssertionError: no wikiconf for None (<article {'_env': <mwlib.wiki.Environment object at 0x84707cc>, 'title': u'Database Refresh', 'url': u'http://10.140.7.52/index.php/Database_Refresh', 'timestamp': u'1300980829', 'currentVersion': 1, 'content_type': u'text/x-wiki', 'revision': u'3595', 'type': 'article', 'latest': u'3595'}>) in function system, file /home/tools/code/sandbox/nslave.py, line 37 in function qaddw, file /home/tools/local/lib/python2.6/site-packages/qserve-0.2.3-py2.6.egg/qs/slave.py, line 66 Return to Main Page.
[root@wikidev wiki]# cat LocalSettings.php <?php
- This file was automatically generated by the MediaWiki 1.17.0
- installer. If you make manual changes, please keep track in case you
- need to recreate them later.
- See includes/DefaultSettings.php for all configurable settings
- and their default values, but don't forget to make changes in _this_
- file, not there.
- Further documentation for configuration settings may be found at:
- Manual:Configuration settings
- Protect against web entry
- if ( !defined( 'MEDIAWIKI' ) ) {
- exit;
- }
if( defined( 'MW_INSTALL_PATH' ) ) { $IP = MW_INSTALL_PATH; } else { $IP = dirname( __FILE__ ); }
$path = array( $IP, "$IP/includes", "$IP/languages" ); set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR . get_include_path() );
require_once( "$IP/includes/DefaultSettings.php" ); require_once("$IP/extensions/embed_document.php");
- this extension is used to mass delete the articles
require_once('extensions/Nuke/Nuke.php');
- If PHP's memory limit is very low, some operations may fail.
ini_set( 'memory_limit', '20M' );
if ( $wgCommandLineMode ) { if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) { die( "This script must be run from the command line\n" ); } }
- Uncomment this to disable output compression
- $wgDisableOutputCompression = true;
$wgSitename = "The Company Wiki"; [root@wikidev wiki]# [root@wikidev wiki]# grep require_once LocalSettings.php require_once( "$IP/includes/DefaultSettings.php" ); require_once("$IP/extensions/embed_document.php"); require_once('extensions/Nuke/Nuke.php'); require_once( "$IP/extensions/LdapAuthentication/LdapAuthentication.php" );
- require_once('includes/Auth_remoteuser.php');
require_once("extensions/PdfExport/PdfExport.php"); require_once("$IP/extensions/pdf.php"); require_once "$IP/extensions/PdfBook.php"; require_once("$IP/extensions/embed_document.php"); require_once( "extensions/FCKeditor/FCKeditor.php" ); require_once("extensions/flash.php"); require_once("$IP/extensions/EmbedVideo/EmbedVideo.php"); require_once('extensions/YouTube.php'); require_once('extensions/aim.php');
- require_once( $IP."/extensions/IM/IMStatus.php");
- require_once( $IP."/extensions/IMStatus/IMStatus.php");
require_once( "{$IP}/extensions/BackAndForth/BackAndForth.php" ); require_once("$IP/extensions/EditOwn/EditOwn.php"); require_once( "$IP/extensions/UsageStatistics/UsageStatistics.php" ); require_once("$IP/extensions/WhosOnline/WhosOnline.php"); require_once ( "$IP/extensions/Contributors/Contributors.php" ); require_once("$IP/extensions/MultiUpload/SpecialMultipleUpload.php"); require_once("$IP/extensions/CategoryTree/CategoryTree.php"); require_once("extensions/accesscontrol/accesscontrolSettings.php"); require_once( 'extensions/SelectCategory/SelectCategory.php' ); require_once("$IP/extensions/DiscussionThreading/DiscussionThreading.php"); require_once("$IP/extensions/Collection/Collection.php"); 71.185.69.246 16:07, 26 October 2011 (UTC)
automatic process
is there any software i can use on my pc to create a book in doc or pdf and automatically download sorted mediawiki articles? so i create a book, select the fonts, colors of headings and then articles are downloaded inside the book in that order? that would be awesome! 85.28.158.38 09:12, 4 November 2011 (UTC)
Collection Extension: RuntimeError: command failed with returncode 256
Hello,
I'm using MediaWiki 1.16.3 with a Windows XAMPP-Stack 1.7.4 (Apache 2.2.17, MySQL 5.5.8, PHP 5.3.5 (VC6 X86 32bit) + PEAR).
I tried to install and configure the Collection extension with the following LocalSettings.php configuration:
require_once("$IP/extensions/Collection/Collection.php");
$wgCollectionMWServeURL = "http://tools.pediapress.com/mw-serve/";
$wgCollectionFormats = array('rl' => 'PDF', 'odf' => 'ODT', );
When I try to download the PDF/ODT offline Version of a new book I get an error message:
Auf dem Render-Server ist ein Fehler aufgetreten: RuntimeError: RuntimeError: command failed with returncode 256: ['mw-zip', '-o', u'cache/ee/ee57ce6375c56696/collection.zip', '-m', u'cache/ee/ee57ce6375c56696/metabook.json', '--status', u'qserve://localhost:14311/ee57ce6375c56696:makezip', '--config', u'http://s10vitl01/wiki', '--template-blacklist', u'MediaWiki:PDF Template Blacklist', '--template-exclusion-category', u'Vom Druck ausschlie\xdfen', '--print-template-prefix', u'Drucken', '--print-template-pattern', u'$1/Druck'] Last Output: 2011-11-04T07:40:17 mwlib.options.warn >> Both --print-template-pattern and --print-template-prefix (deprecated) specified. Using --print-template-pattern only. 1% creating nuwiki in u'cache/ee/ee57ce6375c56696/tmpl0yZuX/nuwiki' ERR: <urlopen error [Errno 4] ARES_ENOTFOUND: Domain name not found> ERR: <urlopen error [Errno 4] ARES_ENOTFOUND: Domain name not found> ERR: <urlopen error [Errno 4] ARES_ENOTFOUND: Domain name not found> ERR: <urlopen error [Errno 4] ARES_ENOTFOUND: Domain name not found> Traceback (most recent call last): File "/home/pp/local/lib/python2.7/site-packages/gevent/greenlet.py", line 402, in run result = self._run(*self.args, **self.kwargs) File "/home/pp/local/lib/python2.7/site-packages/mwlib/apps/make_nuwiki.py", line 120, in run self.fetch_pages_from_metabook(api) File "/home/pp/local/lib/python2.7/site-packages/mwlib/apps/make_nuwiki.py", line 60, in fetch_pages_from_metabook fetch_images=not self.options.noimages) File "/home/pp/local/lib/python2.7/site-packages/mwlib/net/fetch.py", line 268, in __init__ siteinfo = self.get_siteinfo_for(self.api) File "/home/pp/local/lib/python2.7/site-packages/mwlib/net/fetch.py", line 417, in get_siteinfo_for return m.get_siteinfo() File "/home/pp/local/lib/python2.7/site-packages/mwlib/net/sapi.py", line 166, in get_siteinfo raise RuntimeError("could not get siteinfo") RuntimeError: could not get siteinfo <Greenlet at 0x24aff30: <bound method start_fetcher.run of <mwlib.apps.make_nuwiki.start_fetcher object at 0x2540c50>>> failed with RuntimeError removing tmpdir u'cache/ee/ee57ce6375c56696/tmpl0yZuX' memory used: res=16.6 virt=128.9 1% error Traceback (most recent call last): File "/home/pp/local/bin/mw-zip", line 9, in <module> load_entry_point('mwlib==0.12.17', 'console_scripts', 'mw-zip')() File "/home/pp/local/lib/python2.7/site-packages/mwlib/apps/buildzip.py", line 155, in main make_zip(output, options, env.metabook, podclient=podclient, status=status) File "/home/pp/local/lib/python2.7/site-packages/mwlib/apps/buildzip.py", line 50, in make_zip make_nuwiki(fsdir, metabook=metabook, options=options, podclient=podclient, status=status) File "/home/pp/local/lib/python2.7/site-packages/mwlib/apps/make_nuwiki.py", line 193, in make_nuwiki pool.join(raise_error=True) File "/home/pp/local/lib/python2.7/site-packages/gevent/pool.py", line 105, in join raise greenlet.exception RuntimeError: could not get siteinfo in function system, file ./bin/nslave.py, line 37 in function qaddw, file /home/pp/local/lib/python2.7/site-packages/qs/slave.py, line 66
Any help would be appreciated. Anewuserformediawiki 15:45, 4 November 2011 (UTC)
- Hallo i have the same error, even if i use my own render Server or if i use the $wgCollectionMWServeURL = ("http://tools.pediapress.com/mw-serve/"); Server!!!!!
- Please any one can help?
- I'm using wiki 1.17.0 212.66.144.68 08:03, 7 March 2012 (UTC)
- I have the same problem. I use trunk version of this extention and MW 19.2. My settings:
require_once( "$IP/extensions/Collection/Collection.php" ); $wgCollectionFormats = array( 'rl' => 'PDF', 'odf' => 'ODT', ); $wgCollectionArticleNamespaces = array( NS_MAIN, NS_PROJECT, ); $wgCollectionMWServeURL = ("http://tools.pediapress.com/mw-serve/");
- Error message:
- RuntimeError: RuntimeError: command failed with returncode 256: ['mw-zip', '-o', u'/home/pp/cache/ce/ce21a325a1031a95/collection.zip', '-m', u'/home/pp/cache/ce/ce21a325a1031a95/metabook.json', '--status', u'qserve://localhost:14311/ce21a325a1031a95:makezip', '--template-blacklist', u'MediaWiki:PDF Template Blacklist', '--template-exclusion-category', u'\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u043f\u0435\u0447\u0430\u0442\u0438', '--print-template-prefix', u'\u041f\u0435\u0447\u0430\u0442\u044c', '--print-template-pattern', u'$1/\u041f\u0435\u0447\u0430\u0442\u044c'] Last Output: 2012-04-20T22:43:24 mwlib.options.warn >> Both --print-template-pattern and --print-template-prefix (deprecated) specified. Using --print-template-pattern only. 1% creating nuwiki in u'/home/pp/cache/ce/ce21a325a1031a95/tmpkvsX2V/nuwiki' removing tmpdir u'/home/pp/cache/ce/ce21a325a1031a95/tmpkvsX2V' memory used: res=15.7 virt=122.5 1% error Traceback (most recent call last): File "/home/pp/local/bin/mw-zip", line 9, in <module> load_entry_point('mwlib==0.13.3', 'console_scripts', 'mw-zip')() File "/home/pp/local/lib/python2.7/site-packages/mwlib/apps/buildzip.py", line 151, in main make_zip(output, options, env.metabook, podclient=podclient, status=status) File "/home/pp/local/lib/python2.7/site-packages/mwlib/apps/buildzip.py", line 50, in make_zip make_nuwiki(fsdir, metabook=metabook, options=options, podclient=podclient, status=status) File "/home/pp/local/lib/python2.7/site-packages/mwlib/apps/make_nuwiki.py", line 152, in make_nuwiki assert x.wikiident in id2wiki, "no wikiconf for %r (%s)" % (x.wikiident, x) AssertionError: no wikiconf for None (<article {'_env': <mwlib.wiki.Environment object at 0x1666250>, 'content_type': u'text/x-wiki', 'title': u'\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430', 'timestamp': u'1326466208', 'type': 'article', 'revision': u'2311'}>) in function system, file ./bin/nslave.py, line 63 in function qaddw, file /home/pp/local/lib/python2.7/site-packages/qs/slave.py, line 66
46.180.199.47 22:27, 20 April 2012 (UTC)
- You need to specify credentials for the pdf generation to work.
- First try if those commands work on your system:
mw-zip -c http://hostname/wiki --username=yourusername --password=yourpassword -o startpage.zip Main_Page
mw-render -c startpage.zip -o startpage.pdf -w rl
- If this works then you are good to go - without the --username and --password it would not work.
- If this worked you can proceeded by adding the following below your require_once
$wgCollectionMWServeCredentials = "yourusername:yourpassword";
- This worked for me :) Friesoft 10:28, 16 May 2012 (UTC)
- Still not working for me. Anyone else having better luck? Varnent (talk) 05:15, 31 May 2012 (UTC)
- apache access_log on mw-zip with the --username and --password
92.46.175.36 - - [31/May/2012:13:10:26 +0600] "POST /w/api.php HTTP/1.1" 301 317 "-" "Python-urllib/2.7" 92.46.175.36 - - [31/May/2012:13:10:26 +0600] "GET /w/api.php HTTP/1.1" 500 128 "-" "Python-urllib/2.7"
- without the --username and --password
92.46.175.36 - - [31/May/2012:13:15:14 +0600] "GET /w/api.php?action=query&meta=siteinfo&siprop=general|namespaces|interwikimap|namespacealiases|magicwords|rightsinfo&format=json HTTP/1.1" 301 446 "-" "Python-urllib/2.7" 92.46.175.36 - - [31/May/2012:13:15:14 +0600] "GET /w/api.php?action=query&meta=siteinfo&siprop=general|namespaces|interwikimap|namespacealiases|magicwords|rightsinfo&format=json HTTP/1.1" 500 128 "-" "Python-urllib/2.7" 92.46.175.36 - - [31/May/2012:13:15:14 +0600] "GET /w/api.php?action=query&meta=siteinfo&siprop=general|namespaces|interwikimap|namespacealiases|magicwords&format=json HTTP/1.1" 301 435 "-" "Python-urllib/2.7" 92.46.175.36 - - [31/May/2012:13:15:14 +0600] "GET /w/api.php?action=query&meta=siteinfo&siprop=general|namespaces|interwikimap|namespacealiases|magicwords&format=json HTTP/1.1" 500 128 "-" "Python-urllib/2.7" 92.46.175.36 - - [31/May/2012:13:15:14 +0600] "GET /w/api.php?action=query&meta=siteinfo&siprop=general|namespaces|interwikimap|namespacealiases&format=json HTTP/1.1" 301 424 "-" "Python-urllib/2.7" 92.46.175.36 - - [31/May/2012:13:15:14 +0600] "GET /w/api.php?action=query&meta=siteinfo&siprop=general|namespaces|interwikimap|namespacealiases&format=json HTTP/1.1" 500 128 "-" "Python-urllib/2.7" 92.46.175.36 - - [31/May/2012:13:15:14 +0600] "GET /w/api.php?action=query&meta=siteinfo&siprop=general|namespaces|interwikimap&format=json HTTP/1.1" 301 407 "-" "Python-urllib/2.7" 92.46.175.36 - - [31/May/2012:13:15:14 +0600] "GET /w/api.php?action=query&meta=siteinfo&siprop=general|namespaces|interwikimap&format=json HTTP/1.1" 500 128 "-" "Python-urllib/2.7"
- mw-zip says
...
ERR: HTTP Error 500: MediaWiki configuration Error
...
RuntimeError: could not get siteinfo
Pastakhov (talk) 06:45, 31 May 2012 (UTC)
- May be this related with following issue - https://github.com/pediapress/Collection/issues/1 Unikum (talk) 08:20, 4 June 2012 (UTC)
- Newbie on this extension, i have spend my time to have the solution of this.
- You need more than just the module, you must install some local server to translate your wiki page on pdf file.
- You must install firt the tool to access to module install pip
# wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
# tar zxvf setuptools-0.6c11.tar.gz
# cd setuptools-0.6c11
# python setup.py build
# python setup.py install
$ wget http://pypi.python.org/packages/source/p/pip/pip-1.2.tar.gz
$ tar xvf pip-1.2.tar.gz
$ cd pip-1.2
# python setup.py install
- when it is done, you must follow that :
# yum install g++ perl python python-dev python-setuptools python-imaging python-lxml libevent-devel
# yum install python-devel
# yum install libxml2-python.x86_64 libxslt-python.x86_64 libxslt-devel.x86_64
# yum install python-imaging python-lxml pdftk
# wget http://python-distribute.org/distribute_setup.py
# sudo python distribute_setup.py
# sudo easy_install -U virtualenv
$ wget http://effbot.org/downloads/Imaging-1.1.7.tar.gz
$ gtar -zxvf Imaging-1.1.7.tar.gz
$ cd Imaging-1.1.7
$ ~/plone-python/bin/python setup.py install
# pip install -i http://pypi.pediapress.com/simple/ pil
# pip install -i http://pypi.pediapress.com/simple/ mwlib
# pip install -i http://pypi.pediapress.com/simple/ mwlib.rl
# pip install -i http://pypi.pediapress.com/simple/ pyfribidi
- verif de l'install
# mw-zip -c :en -o test.zip Acdc Number
# mw-render -c test.zip -o test.pdf -w rl
- boot script example mw-serve
#!/bin/sh # #chkconfig: 345 20 80 # #description: mw-serve PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin case "$1" in start) su - www-data -c 'nserve.py >> /tmp/mwcache/log.txt 2>&1 &' su - www-data -c 'mw-qserve >> /tmp/mwcache/log.txt 2>&1 &' su - www-data -c 'nslave.py --cachedir /tmp/mwcache/ >> /tmp/mwcache/log.txt 2>&1 &' su - www-data -c 'postman.py >> /tmp/mwcache/log.txt 2>&1 &' ;; stop) mv /data/mwcache/log.txt /data/mwcache/log.old killall nserve.py killall mw-qserve killall nslave.py killall postman.py ;; force-reload|restart) $0 stop $0 start ;; *) echo "Usage: /etc/init.d/mw-serve {start|stop}" exit 1 ;; esac exit 0
# mkdir /tmp/mw-serve
# adduser www-data
# chown www-data /etc/init.d/mw-serve
# chown -R www-data /tmp/mw-serve
# chkconfig --add mw-serve
# /etc/init.d/mw-serve start
- == config file ==
- following an extract of my localsettings.php file
require_once("$IP/extensions/PdfExport/PdfExport.php"); $wgPdfExportMwLibPath = '/usr/bin/mw-render'; $wgPdfExportBackground = "/tmp/background-image/image.jpg"; $wgPdfExportAttach = true; ######################## # creation pdf require_once("$IP/extensions/Collection/Collection.php"); $wgCollectionFormats=array( 'rl' => 'PDF', ); #$wgCollectionPODPartners = false; $wgGroupPermissions['*']['collectionsaveascommunitypage'] = true; $wgGroupPermissions['*']['collectionsaveasuserpage'] = true; $wgEnableAPI = true; $wgCollectionMWServeCredentials = "collection_user:password"; $wgCollectionMaxArticles = 150; # Collection tool for the PediaPress extension $wgCollectionMWServeURL="http://localhost:8899/"; $wgCommunityCollectionNamespace=NS_MEDIAWIKI;
- You can help yourself with this link to complete this previous process
- http://edutechwiki.unige.ch/en/Mediawiki_collection_extension_installation Inkydjango (talk) 15:40, 26 January 2013 (UTC)
- So I have done this process, but it is still not running. The command line is OK. The create PDF page from special page is OK, but the create book on the main nenu NOK.
- On the log.txt, the pdf file is created but the log show that mw-zip can create the file. A file with 0 octet size stay on the cache directory.
- THe firewall on 8899 is open. The cache directory is 777 permission for the moment. I don't find the solution. Is there anybody that a complete install process working ??
- Thanks a lot Inkydjango (talk) 11:10, 27 January 2013 (UTC)
- my error is
- Inkydjango (talk) 11:25, 27 January 2013 (UTC)
File "/usr/lib64/python2.6/site-packages/mwlib/apps/make_nuwiki.py", line 152, in make_nuwiki assert x.wikiident in id2wiki, "no wikiconf for %r (%s)" % (x.wikiident, x) AssertionError: no wikiconf for None (<article {'_env': <mwlib.wiki.Environment object at 0x8eec90>, 'content_type': u'text/x-wiki', 'title': u'Recontruction des handlers', 'timestamp': u'1286529761', 'type': 'article', 'revision': u'661'}>) in function system, file /usr/bin/nslave.py, line 64
- The only way to deal with
- no wikiconf for None
- is to define
$wgScriptPath
in config, making it different from "", i.e. $wgScriptPath = "/w";
- or
$wgScriptPath = "http://server_name"; #WITHOUT SLASH ON END
- but not
$wgScriptPath = "";
- it's a bug in collection extension (see https://github.com/pediapress/Collection/issues/1) 62.231.10.170 13:28, 14 February 2013 (UTC)
- This one is a life-saver. I just added this info to the extensions page. Thank you for sharing. :) Cheers [[kgh]] (talk) 16:54, 17 May 2013 (UTC)
- Setting $wgScriptPath = "http://server_name" messed up my installation. If you, like me, do not want to use any other value but blank, follow codedaves advise - https://github.com/pediapress/Collection/issues/1#issuecomment-3352465
- In "extensions/Collection/Collection.body.php", function "renderCollection"
'base_url' => 'http://server.name' # No slash at end
- and voilà, the book renders. 188.22.199.103 23:54, 21 July 2014 (UTC)
- When following your instructions I discovered some issues on my Centos server. Below is a quote from your instructions:
- start)
su - www-data -c 'nserve.py >> /tmp/mwcache/log.txt 2>&1 &'
su - www-data -c 'mw-qserve >> /tmp/mwcache/log.txt 2>&1 &'
su - www-data -c 'nslave.py --cachedir /tmp/mwcache/ >> /tmp/mwcache/log.txt 2>&1 &'
su - www-data -c 'postman.py >> /tmp/mwcache/log.txt 2>&1 &'
;;
stop)
mv /data/mwcache/log.txt /data/mwcache/log.old
killall nserve.py
killall mw-qserve
killall nslave.py
killall postman.py
;;
- I made the following changes in BOLD:
- start)
su - www-data -c 'nserve >> /tmp/mwcache/log.txt 2>&1 &'
su - www-data -c 'mw-qserve >> /tmp/mwcache/log.txt 2>&1 &'
su - www-data -c 'nslave --cachedir /tmp/mwcache/ >> /tmp/mwcache/log.txt 2>&1 &'
su - www-data -c 'postman >> /tmp/mwcache/log.txt 2>&1 &'
;;
stop)
mv /tmp/mwcache/log.txt /tmp/mwcache/log.old
killall nserve
killall mw-qserve
killall nslave
killall postman
;;
- Thank you for all of your help Special:Contributions/Jecker 19:18, 5 April 2014 (UTC)
- Hi,
- I know this thread is quite old but encountered this problem and none of the suggested fixes worked for me. Just in case anyone else has the same issue still, I thought I'd post my solution.
- I'm running a private render server on the same server as our Wiki.
- CentOS 6.5 x64
- MediaWiki 1.22.6
- PHP 5.3.3
- MySQL 5.1.73
- Collection Version 1.6.1
- The first step is to ensure SELINUX is disabled. If it was not, the curl_exec($ch) didn't work for me (and I couldn't figure out how to make it work with SELinux).
- The second step is to edit
$IP/extensions/Collection/Collection.body.php</pre> In the function <pre>static function mwServeCommand( $command, $args ) {
- Replace
$serveURL = $wgCollectionMWServeURL;</pre> with <pre>$serveURL = 'myservername:8899/';
- For me, this got rid of the "RuntimeError: command failed with returncode 256" error as it seems that, regardless of what is set in LocalSettings.php, $wgCollectionMWServeURL was being set to pediapress. However, I was then left with the "The POST request to server:8899/ failed ($2)" error. I fixed this by replacing
$response = Http::post($serveURL, array('postData' => $args));</pre> with <pre>$boundary = '--myboundary-bps'; $retval= ''; foreach($args as $key => $value){ $retval .= "--$boundary\nContent-Disposition: form-data; name=\"$key\"\n\n$value\n"; } $retval .= "--$boundary--"; $body = $retval; $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: multipart/form-data; boundary=$boundary")); curl_setopt($ch, CURLOPT_URL, $serveURL); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $body); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); $response = curl_exec($ch);
- I got the code from this site and tweaked it
- http://scraperblog.blogspot.co.uk/2013/07/php-curl-multipart-form-posting.html WessexOne (talk) 08:48, 2 June 2014 (UTC)
- I don't see a bug filed for $wgCollectionMWServeURL being overridden, please file one or even better submit a patch. Thanks! Nemo 09:58, 3 June 2014 (UTC)
Unable to download the PDF
Hello all, I got a very strange issue on my MediaWiki 1.16.2 (PHP 5.2.10). I installed PDF Writer and Collections extentions, on the same server. PDF Writer works perfectly, and running manually mw-render the pdf are created without any problem. Trying to generate the pdf from inside the Media Wiki article, it seems to be correctly generated, but when I download it insted of show the document within the browser, I got with Internet Explorer a dialog box to dowload a file called index.pdf which is corrupted and unreadable, while FireFox 7.01 show a page full of unreadable characters (as you open a pdf with a text editor). Looking at the mw-serve log I don't get any error, and following the output cache directory path I was able to find the original file generated from mw-serve, called output.rl. I rename it as output.pdf and opened it with acrobat reader; it results perfect (while the version downloaded with IE8 results corrupted and unreadable). I suspect a problem in the download phase. Looking at httpd error log I found the following errors:
[Tue Nov 08 10:01:11 2011] [error] [client 192.168.1.10] PHP Warning: curl_setopt() [<a href='function.curl-setopt'> function.curl-setopt</a>]: the provided file handle is not writable in /var/www/html/mw/extensions/Collection/ Collection.body.php on line 1324, referer: http://192.168.1.62/mw/index.php?title=Speciale:Libro&bookcmd=rendering return_to=PE02+-+Come+Riavviare+Server+da+ILO&collection_id=0608362be0a6524d&writer=rl [Tue Nov 08 10:01:11 2011] [error] [client 192.168.1.10] PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/mw/extensions/Collection/Collection.body.php:1328) in /var/www/html/mw/extensions /Collection/Collection.body.php on line 1147, referer: http://192.168.1.62/mw/index.php?title=Speciale:Libro& bookcmd=rendering&return_to=PE02+-+Come+Riavviare+Server+da+ILO&collection_id=0608362be0a6524d&writer=rl [Tue Nov 08 10:01:11 2011] [error] [client 192.168.1.10] PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/mw/extensions/Collection/Collection.body.php:1328) in /var/www/html/mw/extensions /Collection/Collection.body.php on line 1148, referer: http://192.168.1.62/mw/index.php?title=Speciale:Libro& bookcmd=rendering&return_to=PE02+-+Come+Riavviare+Server+da+ILO&collection_id=0608362be0a6524d&writer=rl [Tue Nov 08 10:01:40 2011] [error] [client 192.168.1.10] PHP Warning: curl_setopt() [<a href='function.curl- setopt'>function.curl-setopt</a>]: the provided file handle is not writable in /var/www/html/mw/extensions/Collection /Collection.body.php on line 1324 [Tue Nov 08 10:01:40 2011] [error] [client 192.168.1.10] PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/mw/extensions/Collection/Collection.body.php:1328) in /var/www/html/mw/extensions /Collection/Collection.body.php on line 1147 [Tue Nov 08 10:01:40 2011] [error] [client 192.168.1.10] PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/mw/extensions/Collection/Collection.body.php:1328) in /var/www/html/mw/extensions /Collection/Collection.body.php on line 1148
Is there somone who can give me an help !!
Thanks a Lot in advance ! FrancoR 00:35, 7 November 2011 (UTC)
download wiki articles with external software?
is it possible to prepare a document for example in Adobe Publisher (fonts, front page, index page, headings styles, etc), and download my collection to that document. so once a month i generate updated collection articles and place in this document to save it. right now i have manually recreate design all over again every month. 85.28.158.38 08:56, 7 November 2011 (UTC)
any other rendering servers?
are there any free rendering servers for pdf or odt? i need to render 400-600 pages per book once a month (10 books). 85.28.158.38 11:47, 7 November 2011 (UTC)
- You have to install an own Render Server! 212.4.227.9 13:46, 4 May 2015 (UTC)
no version specified
why there is no version displayed? how do i know any important changes have been made? when nested articles will be possible? 213.134.163.135 21:30, 12 November 2011 (UTC)
Render server error
Hi,
I have installed Collection extension on our media wiki portal. I get below error message while i export a book in PDF.
Does anyone have any clue about below error message?
An error occured on the render server: RuntimeError: RuntimeError: command failed with returncode 256: ['mw-zip', '-o', u'cache/0a/0a8642c481e79fb9/collection.zip', '-m', u'cache/0a/0a8642c481e79fb9/metabook.json', '--status', u'qserve://localhost:14311/0a8642c481e79fb9:makezip', '--template-blacklist', u'MediaWiki:PDF Template Blacklist', '--template-exclusion-category', u'Exclude in print', '--print-template-prefix', u'Print', '--print-template-pattern', u'$1/Print', '--username', u'username', '--password', '{OMITTED}', '--domain', u'thehackettgroup'] Last Output: 2011-12-01T10:24:11 mwlib.options.warn >> Both --print-template-pattern and --print-template-prefix (deprecated) specified. Using --print-template-pattern only. 1% creating nuwiki in u'cache/0a/0a8642c481e79fb9/tmptiTpt0/nuwiki' removing tmpdir u'cache/0a/0a8642c481e79fb9/tmptiTpt0' memory used: res=15.6 virt=120.3 1% error Traceback (most recent call last): File "/home/pp/local/bin/mw-zip", line 9, in <module> load_entry_point('mwlib==0.13.0', 'console_scripts', 'mw-zip')() File "/home/pp/local/lib/python2.7/site-packages/mwlib/apps/buildzip.py", line 151, in main make_zip(output, options, env.metabook, podclient=podclient, status=status) File "/home/pp/local/lib/python2.7/site-packages/mwlib/apps/buildzip.py", line 50, in make_zip make_nuwiki(fsdir, metabook=metabook, options=options, podclient=podclient, status=status) File "/home/pp/local/lib/python2.7/site-packages/mwlib/apps/make_nuwiki.py", line 152, in make_nuwiki assert x.wikiident in id2wiki, "no wikiconf for %r (%s)" % (x.wikiident, x) AssertionError: no wikiconf for None (<article {'_env': <mwlib.wiki.Environment object at 0x2a3fcd0>, 'content_type': u'text/x-wiki', 'title': u'Main Page', 'timestamp': u'1305146262', 'type': 'article', 'revision': u'4214'}>) in function system, file ./bin/nslave.py, line 37 in function qaddw, file /home/pp/local/lib/python2.7/site-packages/qs/slave.py, line 66 203.145.189.118 10:39, 1 December 2011 (UTC)