Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Produce & Publish Single-‐Source MulF-‐Channel Publishing mit Plone
von Andreas Jung
Die Autorenumgebung für hochwerFge PDF-‐Dokumente, e-‐Books und Office-‐Formate
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Andreas Jung
• Python, Zope & Plone Entwickler seit 1993 • Mitgründer und Vorstand DZUG e.V. • Director der Zope FoundaFon • ZOPYX Limited: – SoZware-‐Entwicklung und Beratung im Umfeld Python, Zope und Plone
– Electronic Publishing
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Agenda • Was ist Single-‐Source Mul.-‐Channel-‐Publishing?
• Was ist Produce & Publish? • Produce & Publish Demo • Ein Blick auf die Technik • Plone Erweiterungen • Verschiedenes
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Single-‐Source MulF-‐Channel Publishing (1/2) Single-‐Source-‐Mul--‐Channel-‐Publishing ist eine Strategie, um die verschiedenen Produk-onsprozesse weitestgehend zu integrieren und zu automa-sieren. Der Content wird medienneutral in einer Quelldatei (Single Source) abgespeichert und abschließend in mehrere Kanäle publiziert (Mul- Channeling) [KN 2004; S. 40]. Bei einer medienneutralen Datenspeicherung spricht man von Inhaltslas-gkeit, da eine strikte Trennung von Inhalt, Struktur und Layout erfolgt. Der medienneutrale Content besitzt somit kein festdefiniertes Endformat. Darüber hinaus enVällt eine mehrfache Datenpflege, da nur eine Quelldatei be-‐ und verarbeitet werden muss [PS 2003; S. 5].
(Quelle: Diplomarbeit Oliver Zmorek, HTWK Leipzig)
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig
Produce & Publish
Single-‐Source MulF-‐Channel Publishing (2/2)
Vorlagen
SFlvorlagen
Logos etc.
Trenntabellen
Zeichensätze
RTF
Word
EPUB
ODT
HTML
Grafiken
XML
Web
Export
Dropbox
ImporFeren/Bearbeiten
KonverFeren Publizieren
HTML
S5
Word Web service
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Was ist Produce & Publish
• Plaiorm für Web-‐to-‐Print und automaFschen Satz
• hoch-‐qualitaFves PDF, EPUB, Word, Open-‐Office, RTF
• Eingabeformate: HTML oder XML • Styling: CSS • offene Architektur • plaiorm-‐unabhängig
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Features und Anwendungsfälle
Web-‐to-‐Print Automa0scher Satz
• Layout-‐orienFerte Dokumente • Zusammenführung von Daten und
Templates • AlternaFve zu teuren Web-‐to-‐Print
Lösungen für einfache bis mimelkomplexen Layouts
• vergleichbar mit TeX • Fussnoten, Randziffern • Mehrsprachigkeit/Unicode • Spaltensatz • Trenntabellen (mehrsprachig) • LTR/RTL Unterstützung • Tabellen (über mehrere Seiten) • Bilder, BildunterschriZen • Tabellen-‐, Grafikverzeichnisse • automaFsches Inhaltsverzeichnis • Deckseiten • PDF Bookmarks • sehr hohe PDF Qualität
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Produce & Publish im Schnelldurchlauf
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig
Plone 4
Produce & Publish Architektur (1/2) -‐ Full Python/Plone Stack -‐
P&P ZIP Client
Plone Client Connector
Authoring Environment
Produce & Publish Server
zopyx.convert2
Calibre
PrinceXM
L
Apache
FOP
XINC
XFC
PISA
XML-‐RPC
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig
Typo 3
P&P PHP Client
Typo 3
Produce & Publish Server
zopyx.convert2
Calibre
PrinceXM
L
Apache
FOP
XINC
XFC
PISA
XML-‐RPC
Produce & Publish Architektur (1/2) -‐ Non-‐Python IntegraFon -‐
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Import und Datenpflege
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Import und Datenpflege (1/3)
• Plone als Content-‐Management-‐System – benutzerfreudlich – fein-‐granulares Sicherheits-‐ und Rechtekonzept – Workflows
• HTML als primäres Eingabeformat (XML möglich) • Speicherung und Bearbeitung der Inhalte Through-‐the-‐Browser direkt in Plone
• Verwaltung aller Assets in Plone
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Import und Datenpflege (2/3)
• Behandlung von Autorenmanuskripten – Copy & Paste von Word in Plone – Export von Word nach HTML in Plone – manuelle Neuerfassung
• Probleme: – Word „HTML“ – Plone filtert besFmmte Tags, Amribute und Styles – hoher händischer Aufwand (fehlerträchFg, schlechte „User-‐Experience“)
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig
Import und Datenpflege (3/3)
Produce & Publish
Upload
HTTP/POST (Word/ZIP) HTML/CSS/Grafiken
Web service
DOC/DOCX
HTML CSS
Grafiken
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Aggrega0on
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig
AggregaFon (1/3)
Kapitel 1
Abschnim 1.1
Unterabschnim 1.1.1
Unterabschnim 1.1.2
Abschnim 1.2
Kapitel 2
Abschnim 2.1
Abschnim 2.2 Unterabschnim 2.2.1
Kapitel 3
Abschnim 3.1
...
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
AggregaFon (2/3)
• IntegraFon in Plone – Plone Folder zur Strukturierung – Plone Documents für Inhalte – eigene Inhaltstypen möglich
• Ausnutzung der Zope Component Architecture – jeder Inhaltstyp stellt @@asHTML View bereit – @@asHTML() liefert HTML Snippet des jeweiligen Inhaltsobjektes
• Erstellung eines angereichterten und konsolidierten HTML Dokuments als Grundlage aller weiteren KonverFerungsschrime
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
AggregaFon (3/3) <div class=„boundary-level-0“>
<div class=„portal-type-document“> <h1>...</h1> <div class=„description>..</div>
<div class=„body“>...</div> </div> <div class=„boundary-level-1“>
<div class=„portal-type-document“> <h1>...</h1> <div class=„description>..</div> <div class=„body“>...</div>
</div> </div> <div class=„portal-type-myevent“>
<h1>Mein Termin</h1> <div class=„startdate“>12.09.2011</div> <div class=„enddate“>13.09.2011</div> </div>
</div>
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Transforma0on
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
TransformaFonen (1/2)
• IdenFsche HTML Eingabe für alle KonverFerungen
• dedizierte KonverFerungen und Anreicherungen je Ausgabeformat notwendig – Inhaltsverzeichnis, Bildverzeichnis für PDF – HTML aggregiert/konsolidiert für Web-‐Ausgabe – Grafiken in Print-‐Auflösung für PDF – Grafiken mit 72dpi Auflösung für EPUB
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
TransformaFonen (2/2)
aggregiertes HTML
TransformaFonen • exportImages • addImageList • addTOC • addTableList • imagesOriginal • imagesCapFons
HTML für PDF KonverFerung
aggregiertes HTML
TransformaFonen • exportImages • imagesPreview • imageCapFons • cleanupEPUB
HTML für EPUB KonverFerung
lxml basierte TransformaFonspipeline
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Konver0erung
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
KonverFerung (1/2) • Ausgabeformat-‐spezifisches HTML als Grundlage für KonverFerung
• KonverFerungsdienst als Client-‐Server Architektur realisiert
• KonverFerung über externe (kommerzielle) Konverter: – PrinceXML für PDF (unterstützt) – Calibre für EPUB (unterstützt) – XFC für Word/ODT/RTF (unterstützt) – Apache FOP/Xinc für PDF (nicht unterstützt) – PISA für PDF (nicht unterstützt)
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig
Python Pyramid
KonverFerung (2/2)
Produce & Publish (Plone)
Produce & Publish Server
Calibre
PrinceXM
L
XINC
Apache
FOP
PISA
XML-‐RPC
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Veröffentlichen
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Veröffentlichen • Veröffentlichung der Einzelformate zum Download
• HTML (aggregiert/kapitelweise) + Einzelformate zum Download
• Export als ZIP Archiv • Publish-‐to-‐Dropbox
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Plone Erweiterungen
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
PDF Generierung Print vs. Web
• PDF Dateien werden sowohl für Print als auch für elektronische Medien benöFgt – Print: hohe Grafikauflösung: 300dpi – E-‐Books/Tablets: mimlere Auflösung: 150 dpi – Web/Desktop: geringe Auflösung: 72dpi
• Lösung: – Export aller Grafiken in Originalauflösung aus Plone – Generierung eines PDFs mit Grafiken in hoher Auflösung
– Downsampling der Grafiken im PDF über Ghostscript
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Plone Erweiterungen (1/3)
• Hauptproblem von Produce & Publish: – Usability der WYSIWYG Editoren – Redakteure sind Word gewöhnt – EdiFeren längerer Inhalte through-‐the-‐web ist eine Zumutung
– alle browser-‐basierten Editoren sind Schrom – TinyMCE ist halbwegs brauchbar – Products.TinyMCE ist ziemlich veraltet
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Plone Erweiterungen (2/3)
• Verbesserungen an TinyMCE – Anzeige der Strukturelemente
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Plone Erweiterungen (3/3)
• Verbesserungen an TinyMCE – LinkTool für Querverweise auf • Headings • Tabellen • Grafiken • Listen (-‐elemente)
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Plone Erweiterungen (3/3)
• Verbesserungen an TinyMCE – LinkTool für Querverweise auf • Headings • Tabellen • Grafiken • Listen(-‐elemente)
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Produce & Publish OpFonen
• In-‐House InstallaFon • SaaS OpFonen: – P&P Authoring Environment
– P&P Server: KonverFerung nach PDF und EPUB
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
demo.produce-‐and-‐publish.com
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Fragen
Andreas Jung – www.zopyx.com PyCon-‐DE 2011 -‐ Leipzig Andreas Jung – www.zopyx.com
Weitere Informa0onen www.produce-‐and-‐publish.com
Demo
demo.produce-‐and-‐publish.com
www.zopyx.com
Vielen Dank für Ihre Aufmerksamkeit