Fullscreen
[Show/Hide Left Column]
[Show/Hide Right Column]

Define an archive that can be downloaded
3d browser Print

Plugin Archive Builder


New in Tiki5

Wikis are a great central repository for everyone to access the information. However, when used within the boundaries of an organization, it may be hard to provide only a portion of the information to an external group of people. Although it may be possible through assigning permissions, it still requires to grant them access to the wiki, provide them with accounts and walk them through the process of finding what they need. Just sending them a zip with the information they need might just be easier.

Example


This plugin does just that. Through arguments, it allows to define the content of an archive. Once rendered, it displays a Download archive button to generate the archive on the fly.

Sample usage
{ARCHIVEBUILDER(name=DF120-Summary.zip)}
page-as-pdf:DF120/Vision.pdf:VisionDF120
page-as-pdf:DF120/Team.pdf:TeamDF120
tracker-attachments:DF120/Requirements/:2232
{ARCHIVEBUILDER}


The output of the available plugin might look like:
  • DF120-Summary.zip
    • DF120/
      • Requirements/
        • performance.doc
        • mockup.png
      • Vision.pdf
      • Team.pdf
    • manifest.txt (automatically generated, containing the list of files)

Syntax


The body of the plugin simply contains a list of rules to determine which file to create and where to take the content from. Each line is independent. Arguments are separated by colons. The first argument indicates how to treat the rest of the line. The following tokens may be used:

  • page-as-pdf to take render the content of a page as a pdf.
    • First argument is the name and location of the PDF in the zip file.
    • Second argument is the page name.
  • tracker-attachments to collect all attachments on a tracker item and store them in a folder.
    • First argument is the name of the folder in which files will be added.
    • Second argument is the ID of the tracker item.

Requirements


The print as PDF mechanism uses the standard wiki print feature. However, the PDF generation is done through external HTML to PDF tools. These must be enabled and configured. Here are the alternatives:

  1. Webkit (external link) (wkhtmltopdf)
    • Download wkhtmltopdf from the site above and place the executable somewhere on the host. Make sure it is executable from the web server.
    • Set PDF from URL to Webkit
    • Set Webkit path to the full path to your executable. For example /home/doc.tikiwiki.org/webkit/wkhtmltopdf.
  2. Webservice
    • Set PDF from URL to Webservice
    • Set Webservice URL to the service location. The webservice must take the URL as the query string. A sample PHP script is available below.

Why is configuration required?
Because of licensing issues, wkhtmltopdf cannot be bundled with TikiWiki. The GPL licence is not compatible with the more permissive LGPL used by TikiWiki.

Moreover, some servers may not allow shell execution, which is required. This can be worked around by installing it on a different server and accessing it remotely.


Access rights

Because the content of the page is accessed through a URL, access rights must be managed correctly. If permissions protect the page from being visible to anonymous or plugins render it differently for them, an additional feature must be enabled.

The Token Access feature allows the archive builder to generate tokens bound to a specific URL. The PDF generator will then include the token as part of the URL. Doing so will grant the same groups to the PDF generator as the groups used by the archive requester. By default, the token will be available for 30 seconds.

Sample webservice

generate_pdf.php
<?php
 
$query = $_SERVER['QUERY_STRING'];
 
if( ! empty( $query ) ) {
        header( 'Content-Type: application/pdf' );
        $query = escapeshellarg( urldecode( $query ) );
        echo `../wkhtmltopdf-i386 $query -`;
}
 
?>


Contributors to this page: lindon1701 points  , marclaporte4510 points  and lphuberdeau119 points  .
Page last modified on Tuesday 02 March, 2010 15:11:07 UTC by lindon1701 points .

To register

To have an account at this site, please register at Tikiwiki.org (external link), and then use that user name and password to log in here.

Find by Page Name

Exact match

Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki documentation and should correspond to development keywords (bug reports and feature requests):

Accessibility (WAI – 508)
Action log 2.x
Alert 3.x
Articles & Submissions
Backlinks
Banners
Blog
Bookmark
Browser Compatibility
Cache
Calendar
Category
Chat
Clean URLs
Comments
Communication Center
Compression (gzip)
Contacts Address book
Contact us
Content template
Contribution 2.x
Cookie
Copyright
Custom Home (and Groups Home Page)
Date and Time
Debugger Console
Directory (of hyperlinks)
Documentation link from Tiki to doc.tikiwiki.org (Help System)
DogFood
Dynamic Content
Dynamic Variable
External Authentication
FAQ
Featured links
File Gallery
Forum
Friendship Network (Community)
Gmap Google maps
Groups
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interaction
Inter-User Messages
InterTiki
Karma
Live Support
Login
Look and Feel
Lost edit protection
Mail-in
Map with Mapserver
Menu
Meta Tags
Mobile Tiki and Voice Tiki
Mods
Module
MultiTiki
MyTiki
Newsletter
Notepad
Payment
Performance Speed / Load
Permissions
Platform independence (Linux-Apache, Windows/IIS, Mac, BSD)
Polls
Profile Manager
Quicktags
Quiz
Rating
Feeds
Score
Search engine optimization
Search
Security
Semantic links 3.x
Shadowbox
Shoutbox
Slideshow
Smarty Template
Smiley
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Stats
Surveys
System log
Tags 2.x
Task
Tell a Friend + Social Bookmarking 2.x
TikiTests 2.x
Theme
Trackers
TRIM
User Administration including registration and banning
User Files
User Menu
Watch
WebHelp
Webmail
Webservices
Wiki 3D
Wiki History, page rename, etc
Wiki Page Staging and Approval 2.x
Wiki Plugins extends basic syntax
Wiki Syntax
Wiki structure (book and table of content)
WYSIWYCA
WYSIWYG 2.x
XMLRPC