cogApplication that uses the multipagepdfexport Api to provide an interface for the export of a space using a hierarchy based UI.
TypeXAR
Developed by

Anca Luca

Rating
Rate!
0 Votes
LicenseGNU Lesser General Public License 2.1
Installable with the Extension Manager

Description

This Application provides an interface for the Multipage PDF Export Api, that allows to export all the pages in a space with a hierarchy-like UI (uses the Hierarchy macro).

How to use

Navigate to the WebHome of the space you want to export pages from and add ?sheet=XWiki.PDFExportSheet at the end of the URL. You can add this link in a panel, or in the WebHome itself, if you need it to be available to the users as a clickable menu.

The export interface shows the pages in the space in a tree (built by the parent/child relation and the relations defined by the hierarchy macro, if any) and allows to configure the type of export (for details about the export options you can also see the options of the multipage pdf export API).

This application is tailored for pages that are part of an application created with app within minutes, so the Class / Sheet / Template of this application are excluded from the export by default, as well as the WebHome (which, for an app within minutes, doesn't contain interesting information but a livetable (which will be exported as empty)).

How to workaround XWIKI-7942

The consequence of XWIKI-7942 is that, in the list of documents to export, the titles of the documents to export will be all the same, and always the title of the current page instead of the actual titles of the documents.
To fix that, you will have to include the XWiki.PDFExportSheet in the WebHome of the space you want to export instead of using it as a parameter. You could also be able to include it in a different page in the space to export, but you might need to modify the code of the sheet in this case to correctly identify the list of pages to exclude.

Example

We created a space, "Alice in Wonderland", with the text of the book as presented here http://www.cs.cmu.edu/~rgs/alice-table.html , which we want to export in a single PDF file. 

spaceIndex.png

We go to the export interface, as explained in the "How to use" section above, and we have the document hierarchy where we can choose pages to export.

exportAlice.png

We can drag and drop the chapters in the correct order and configure the type of pdf export we want and then perform the export.

exportAliceConfigured.png

We can equally export the data of an application created with app within minutes, in which we previously imported some data with the Batch Import Application

awmIndex.png

In the PDF export UI this will be displayed something like this: 

exportDanceLibrary.png

Since there is a lot of data in a rather flat hierarchy, we can even create subtrees only for the purpose of easier manipulation of the order of export, the subtrees will not be saved nor reflected in the exported PDF, only the order is preserved.

Also, for such a type of application, we can find interesting the option to export each page on "recto", which will allow us to print a catalogue where each new item begins on a front of a page, regardless of where the previous item ends.

exportDanceLibraryConfigured.png

Tested on

This extension has been tested with the following configurations.

Extension VersionXWiki FlavorNotes
1.0XWiki Enterprise 4.4-RC-1

Needs workaround for versions affected by XWIKI-7942.

1.1XWiki Enterprise 7.1.2

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

If the XWiki Version is lower than 4.3, you need to add the XWiki.PDFExportTranslations document as a i18n bundle in Administration -> Localization.

Dependencies

Dependencies for this extension (org.xwiki.contrib:xwiki-multipagepdfexport-application-spaceexport 1.0):

Tags: export
Created by Anca Luca on 2012/12/28 17:19
    

Get Connected