Extension talk:Collection/2015



Enhancement of Articles Sources and Contributors section, add last modified timestamp information

The Article Sources and Contributors section show the oldid link and contributors. It would be helpful to show the timestamp for the modification, like is shown at the bottom on each wiki page (i.e. This page was last modified on 15 January 2015, at 02:01). I'm thinking this would be helpful when you've downloaded and printed the PDF so you can quickly compare whether your printed copy is current with the wiki version. Peculiar Investor (talk) 16:17, 20 January 2015 (UTC)

OTOH, if you are opening the PDF on your PC you can just open the link and see its timestamp; while if you print the PDF you'll usually have a timestamp added by the printer. Nemo 14:45, 22 January 2015 (UTC)

[Resolved] RuntimeError: could not get siteinfo

I have 2 environments that I (hope) think are identical. They are both setup with:
MW 1.25alpha
PHP 5.3.17
Collection 1.7.0 (1618025)
In the Dev environment, Collection works perfectly.
In the Prod environment, I'm seeing this error:
<Greenlet at 0xd43eb0: <bound method start_fetcher.run of <mwlib.apps.make_nuwiki.start_fetcher object at 0xdbba50>>> failed with RuntimeError
creating nuwiki in u'/u1/wiki_pdf/cache/2e/2e58aa5a7230f6a6/tmpJuZHDI/nuwiki'
ERR: <urlopen error [Errno 111] Connection refused>
ERR: <urlopen error [Errno 111] Connection refused>
ERR: <urlopen error [Errno 111] Connection refused>
ERR: <urlopen error [Errno 111] Connection refused>
removing tmpdir u'/u1/wiki_pdf/cache/2e/2e58aa5a7230f6a6/tmpJuZHDI'
memory used: res=18.2 virt=152.7
1% error Traceback (most recent call last):
File "/usr/local/bin/mw-zip", line 9, in <module>
load_entry_point('mwlib==0.15.14', 'console_scripts', 'mw-zip')()
File "/usr/local/lib64/python2.6/site-packages/mwlib/apps/buildzip.py", line 155, in main
make_zip(output, options, env.metabook, podclient=podclient, status=status)
File "/usr/local/lib64/python2.6/site-packages/mwlib/apps/buildzip.py", line 50, in make_zip
make_nuwiki(fsdir, metabook=metabook, options=options, podclient=podclient, status=status)
File "/usr/local/lib64/python2.6/site-packages/mwlib/apps/make_nuwiki.py", line 192, in make_nuwiki
pool.join(raise_error=True)
File "/usr/local/lib64/python2.6/site-packages/gevent/pool.py", line 98, in join
raise greenlet.exception
RuntimeError: could not get siteinfo
in function system, file /usr/local/lib64/python2.6/site-packages/mwlib/nslave.py, line 64
So it's failing on the start_fetcher.run method, but I can't seem to figure out why. Is this likely some system configuration thing? Wmat (talk) 17:34, 27 February 2015 (UTC)
Solved.
This was a DNS issue. We had to add and entry to /etc/hosts so that the server could talk to itself, basically. Wmat (talk) 18:15, 27 February 2015 (UTC)
Hi, I am getting the same error. Do you happen to know what you put in your /etc/hosts file to resolve this? 66.77.160.179 (talk) 16:39, 19 October 2017 (UTC)
I am getting same error after enabling SSL. Could you share how did you resolve this issue Ahsan96 (talk) 19:39, 8 August 2018 (UTC)
Yes, please, show us what you did to your /etc/hosts file. I need help with that, too. Ablum010777 (talk) 05:22, 10 September 2019 (UTC)

License: unknown in PDFs

I'm running the latest version of the extensions on MW1.25alpha and I'm seeing that when I click 'Download as PDF', the licensing information shows License: unknown. I have the following variables configured for the extension, as well as the default for the whole wiki:
$wgLicenseName = "Creative Commons Attribution-Share Alike 3.0 license";
$wgLicenseURL = "http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License";
Shouldn't the licensing info appear on the PDFs as configured?
Thanks Wmat (talk) 15:08, 2 March 2015 (UTC)
I tried setting:
$wgLicenseName = null;
$wgLicenseURL = null;
As I have the following configured:
$wgRightsUrl = "http://creativecommons.org/licenses/by-sa/3.0/";
$wgRightsText = "Creative Commons Attribution-ShareAlike";
According to the ReadMe in the Collections source tree, the license should default to the Rights text in this case. It doesn't. Rendered PDFs and Books still have a License: unknown. Wmat (talk) 15:40, 2 March 2015 (UTC)
It's probably time to report an issue at phabricator. [[kgh]] (talk) 16:03, 2 March 2015 (UTC)
You're right.
https://phabricator.wikimedia.org/T91262 Wmat (talk) 16:16, 2 March 2015 (UTC)
Thank you for doing this. This issue is actually a bit worrisome since licensing is an integral part of providing content. So the correct attribution is something that should not be missed. [[kgh]] (talk) 16:29, 2 March 2015 (UTC)
Indeed, I've already argued that the extension should not output at all any content which can't be attributed. Nemo 18:03, 2 March 2015 (UTC)
I'm very curious how this is working on WP and not my wiki? Can anyone else reproduce this? Wmat (talk) 18:28, 2 March 2015 (UTC)
Same here, I'm on MW 1.27 and Collection 1.7
License for all the images is Unknown even though it is clearly mentioned as CC-BY-SA 4.0 and this is also same for images of commons used with InstantCommons 49.207.57.238 (talk) 12:53, 20 March 2017 (UTC)

Can not get my rendering server to work apart from wikipedia.

Hi, I've been trying to set up the Collection extension on my own rendering server, so I can generate pdf files from my wiki. So far no luck.
Here's where I am:
I followed this guide:
http://edutechwiki.unige.ch/en/Mediawiki_collection_extension_installation
And I can create pdf files from wikipedia using:
mw-zip -c :en -o test.zip Acdc Number
mw-render -c test.zip -o test.pdf -w pdf
mw-zip works just as one would expect.
-------------------------
mw-zip -c :en -o test.zip Acdc Number
creating nuwiki in u'tmpuIdHyY/nuwiki'
2013-09-07T10:10:58 mwlib.utils.info >> fetching 'http://en.wikipedia.org/w/index.php?title=Help:Books/License&action=raw&templates=expand'
removing tmpdir u'tmpuIdHyY'
memory used: res=25.0 virt=816.4
--------------------------
I can read those pdf files, so I know my basic render farm setup is working.
The problem is that I cannot get it to work with anything other than wikipedia.
If I try the URL in the guide:
------------------
mw-zip -c http://edutechwiki.unige.ch/mediawiki/ -o test2.zip Mediawiki_collection_extension_installation
creating nuwiki in u'tmpRnDvRH/nuwiki'
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 328, in run
result = self._run(*self.args, **self.kwargs)
File "/usr/local/lib/python2.7/dist-packages/mwlib/net/fetch.py", line 747, in refcall_fun
fun(*args, **kw)
File "/usr/local/lib/python2.7/dist-packages/mwlib/net/fetch.py", line 632, in handle_new_basepath
api = self._get_mwapi_for_path(path)
File "/usr/local/lib/python2.7/dist-packages/mwlib/net/fetch.py", line 684, in _get_mwapi_for_path
raise RuntimeError("cannot guess api url for %r" % (path,))
RuntimeError: cannot guess api url for 'http://edutechwiki.unige.ch/en'
<Greenlet at 0x24d2cd0: refcall_fun> failed with RuntimeError
WARNING: (u'Mediawiki_collection_extension_installation', None) could not be fetched
removing tmpdir u'tmpRnDvRH'
memory used: res=19.3 virt=226.7
-------------------
and if I try my own:
-------------------
mw-zip -c http://IP:PortNo/wiki/index.php/ --username=uuu --password=ppp -o test2.zip Test
creating nuwiki in u'tmpG82RPH/nuwiki'
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gevent/greenlet.py", line 328, in run
result = self._run(*self.args, **self.kwargs)
File "/usr/local/lib/python2.7/dist-packages/mwlib/apps/make_nuwiki.py", line 114, in run
api = self.get_api()
File "/usr/local/lib/python2.7/dist-packages/mwlib/apps/make_nuwiki.py", line 28, in get_api
api.login(self.username, self.password, self.domain)
File "/usr/local/lib/python2.7/dist-packages/mwlib/net/sapi.py", line 186, in login
res = self._post(**args)
File "/usr/local/lib/python2.7/dist-packages/mwlib/net/sapi.py", line 106, in _post
res = loads(self._fetch(req))
File "/usr/local/lib/python2.7/dist-packages/mwlib/net/sapi.py", line 23, in loads
return json.loads(s)
File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line 413, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 402, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 420, in raw_decode
raise JSONDecodeError("No JSON object could be decoded", s, idx)
JSONDecodeError: No JSON object could be decoded: line 1 column 0 (char 0)
<Greenlet at 0x1a7b870: <bound method start_fetcher.run of <mwlib.apps.make_nuwiki.start_fetcher object at 0x1acf790>>> failed with JSONDecodeError
removing tmpdir u'tmpG82RPH'
memory used: res=16.8 virt=152.5
Traceback (most recent call last):
File "/usr/local/bin/mw-zip", line 9, in <module>
load_entry_point('mwlib==0.15.11', 'console_scripts', 'mw-zip')()
File "/usr/local/lib/python2.7/dist-packages/mwlib/apps/buildzip.py", line 155, in main
make_zip(output, options, env.metabook, podclient=podclient, status=status)
File "/usr/local/lib/python2.7/dist-packages/mwlib/apps/buildzip.py", line 50, in make_zip
make_nuwiki(fsdir, metabook=metabook, options=options, podclient=podclient, status=status)
File "/usr/local/lib/python2.7/dist-packages/mwlib/apps/make_nuwiki.py", line 189, in make_nuwiki
pool.join(raise_error=True)
File "/usr/local/lib/python2.7/dist-packages/gevent/pool.py", line 98, in join
raise greenlet.exception
simplejson.decoder.JSONDecodeError: No JSON object could be decoded: line 1 column 0 (char 0)
-----------------
I as using Mediawiki 1.23 and I am not behind any proxy and also I disabled SELinux.
Variables that I am using in LocalSettings file are as follows:
$wgServer = "http://IP:portno";
$wgScriptPath = "/wiki";
require_once "$IP/extensions/Collection/Collection.php";
$wgCollectionMWServeURL = 'http://IP:8899'; (default port of mw-serve)
$wgCollectionMWServeCredentials = "username:password";
$wgEnableAPI = true;
I can't even begin to work on the actual extension interface until I have this working..... Any suggestions? Where do I go next?
Any help would be appreciated!
Thanks! Solanki (talk) 14:09, 3 March 2015 (UTC)
Guys! I would really appreciate any kind of help or just point me in the right direction, coz I am banging my head here.
Thanks! Solanki (talk) 09:06, 11 March 2015 (UTC)
Hello Solanki. Is your server running on Ubuntu? If so did you read Setup a render server on Ubuntu 12.04 LTS? If you follow the guide you should be able to get your server up and running. It currently explains how to setup on Ubuntu 12.04 LTS but I am testing it on 14.04 LTS and this seems to work just fine also. When I am done I will update Setup a render server on Ubuntu 12.04 LTS. Regards. Felipe (talk) 10:32, 11 March 2015 (UTC)
Hi Felipe. No, my server is running on RHEL 6.5. The strange thing am encountering is its different behavior to different sites, like I mentioned above, it works perfectly fine for Wikipedia, however gives a different error to http://edutechwiki.unige.ch/mediawiki/ and a different one for my site i.e. mw-zip -c http://IP:PortNo/wiki/api.php/ --username=uuu --password=ppp -o test2.zip Test.
Now, this is what's boggling my mind. I have almost gone through every document possible.
(Errors related to different sites are given above.) Solanki (talk) 06:10, 12 March 2015 (UTC)
Yay! I'm getting this exact error ("cannot guess api url...")
And my server was working before.... MarkAHershberger(talk) 21:58, 29 June 2016 (UTC)
HI,
we have the similar kind of setup in our RHEL6 server and we render the PDF documents successfully. But, here the issue is the PDF doc could not contain all the embedded JPEG images in the wiki article page and it only intakes .PNG pictures in the PDF document.
Could some one please advise with solution for this issue? It would be really appreciated !
Thanks in Adv,
Sanjay Sanjay (talk) 17:10, 25 October 2017 (UTC)

Collection works, but always prints the <yambe:breadcrumb> Tags in pdf - MW 1.24.2

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


Hi,
Collection works, but always prints the <yambe:breadcrumb> Tags from my Yambe breadcrumbs extension in the pdf documents.
That's quite strange, because I deactivated it on my print.css:
div#yambe { display: none !important; }
When I print on paper, there's no problem, the yambe tag will not be print! Zerano8 (talk) 09:08, 19 March 2015 (UTC)
Which PDF exporter are you using? The default? Nemo 14:03, 19 March 2015 (UTC)
Yes, the default Collection pdf exporter Zerano8 (talk) 12:20, 20 March 2015 (UTC)
Does s.o know where I can set the CSS for the pdf export?
Ist the print.css right for that? Zerano8 (talk) 08:30, 7 April 2015 (UTC)
I finding the same issue display none does not seem to work.
Looking for the fix 148.177.1.215 (talk) 14:23, 25 July 2015 (UTC)
Here is some help <br>
http://edutechwiki.unige.ch/en/Mediawiki_collection_extension_installation#Base_installation_of_the_extension 148.177.1.216 (talk) 11:53, 5 August 2015 (UTC)
Thank you!
Works with:
<div class="noprint"> <yambe:breadcrumb>Content|Content</yambe:breadcrumb> </div>
Now I'm looking for a possibility to let the yambe Extension create that automatically. So if s.o has an idea how to modify the yambe.php code...

Zerano8 (talk) 13:54, 12 August 2015 (UTC)

Ok, problem solved!
I changed yambe.php:
I changed in:
function yambeSetParent(&$textbox, &$title)
...
...
$textbox = "<div class='noprint'>"."<yambe:breadcrumb>$parent[1]|$display</yambe:breadcrumb>"."</div>"; Zerano8 (talk) 14:50, 12 August 2015 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Download as PDF

I've installed Collection on my server. I use my own renderserver. Now, when I want to download a single page as PDF, it always downloads the MainPage, no matter on which page I press "Donwload as PDF". Is this a bug in the new version? And can you help me to fix this? Looking forward for a fast answer and have a nice day. 193.73.106.102 07:13, 1 April 2015 (UTC)

I have the same issue, it seems side portlet generates stable links (Special:Collection&bookcmd=render_article&arttitle=<The first article, called in wiki>&oldid=<The olddid of the first page called>). If manually construct URL (Special:Collection&bookcmd=render_article&arttitle=Expected_article) rendering works fine. (MediaWiki 1.24) Bezik (talk) 15:52, 15 May 2015 (UTC)

Collections with LDAP authentication

I am in the process of setting up a wiki which requires a login, and uses LDAP authentication. How do I go about passing the users login details to render server? I'm struggling to extract the details from the login and assign the details "USERNAME:PASSWORD:DOMAIN" to $wgCollectionMWServeCredentials , and unfortunately I do not have access to create a separate user on the LDAP. Any help would be greatly appreciated

CTU stephen (talk) 12:19, 29 April 2015 (UTC)

Enable and disable book creator

MediaWiki 1.23.9 PHP 5.4.16 (apache2handler) MySQL 5.6.19-log Semantic MediaWiki 2.2

When I select create a book nothing happens, I select printable version and the book creator shows up, disable happens normally. I navigate to another page after I have disabled book creator and book creator is enabled, To disable it I have to select printable version.

I do have my own rendering server that is working on a development server

Any Idea what I may be doing wrong? Legaulph (talk) 17:44, 19 May 2015 (UTC)

After Further Testing
I tried in IE and this works normally
In Chrome I have to do a full page reload after I select create book, and the same to disable. 148.177.1.213 15:00, 20 May 2015 (UTC)

 and <source> 

<pre> and <source> blocks do not render correctly in collection PDFs. See Wikipedia:Hello world for an example. All line breaks and indenting inside <pre> and <source> blocks are collapsed (extra white space removed).

The effect is to make printed programming resources nearly useless as code samples. Please correct this rendering. Dave Braunschweig (talk) 13:49, 8 August 2015 (UTC)

Is the public render server still working?

Anyone knows if http://tools.pediapress.com/mw-serve/ is still working? I just installed this extension but cannot find the parameter in LocalSettings.php, so I added it myself. However, when I clicked "Download as PDF", it just stayed at 1% and then gave me "Failed to render". Thanks! Netnetjoe (talk) 10:40, 12 August 2015 (UTC)

You don't need to add it in LocalSettings.php. It works without adding it, because it's the default server.
Look in Collection.php, there you'll find:
/** URL of mw-serve render server */
$wgCollectionMWServeURL = 'http://tools.pediapress.com/mw-serve/';
Zerano8 (talk) 07:37, 8 September 2015 (UTC)
I experience the same issue. Extension is installed and enabled. Collections can be created and stored. Neither creating PDF nor the presspedia preview is working. While rendering a pdf I get the message: (translated back from German) Book rendering failed: An error occurred while trying to render your book.
I run the wiki version on a hosted environment: curl is activated on phpinfo. The side is using https.
Please let me know what might cause this issue and how to solve this. Aonbheannach (talk) 21:17, 4 November 2015 (UTC)

Hide Articles Sources and Contributors section

Hi,

how can I hide the Articles Sources and Contributors section in the PDF?

I don't want that informations on the rendered PDF... Zerano8 (talk) 08:19, 8 September 2015 (UTC)

See here. There are a lot more options. Regards. Felipe (talk) 09:42, 8 September 2015 (UTC)

Help with OCG

I have got it all up and running and can get a PDF out but I am having trouble getting images in the PDF at the bundler stage. Parsoid renders the page OK if I point my browser at it but when I manually run mw-ocg-bundler it fails to get images from things like the GraphViz or SyntaxHighight extensions.

Where do we go for help on OCG, given the board description here?

Cheers

Jon Gerdesj (talk) 16:49, 22 September 2015 (UTC)

Incompatible with Translate

I have added a T114578 to phabricator to make aware of this issue. Basically the issue is that the tags are not omitted but directly rendered. [[kgh]] (talk) 16:57, 3 October 2015 (UTC)

Mwlib with collection 1.26

Is mwlib working with collection 1.26? I just can't make it work, always get the "Book rendering failed: An error occurred while trying to render your book" error. I use the public render server ('http://tools.pediapress.com/mw-serve/'). 89.135.155.145 (talk) 15:19, 16 December 2015 (UTC)

Hi, I'm using the same version... I can't make it work .. I've tried to build a rendered server on Ubuntu or use the public render server you said.. no matter what I do, I always get the same error 217.12.24.135 (talk) 10:50, 17 February 2016 (UTC)
Hi again, Better to use a own render service 217.12.24.135 (talk) 13:54, 18 February 2016 (UTC)
Follow the instructions on http://mwlib.readthedocs.org/en/latest/installation.html#mwlib-install and launch the listener services such as nserve, etc through console or better on startup as a script 217.12.24.135 (talk) 13:55, 18 February 2016 (UTC)
Now, all of this is working in Ubuntu 64 bits with the last release of Collection extension in mediawiki 1.26 217.12.24.135 (talk) 13:56, 18 February 2016 (UTC)
our organization is using windows only.So is there anway we can create our render server for windows. Ashni rai (talk) 07:20, 24 October 2016 (UTC)