Ien2012 DITA Open Toolkit Extension

22
www.sperotech.com DITA Open Toolkit Extensions IEn2012

description

What is the DITA Open Tolkit and how to extend it with your own processing. Check out the OT Customization Course at www.sperotech.com

Transcript of Ien2012 DITA Open Toolkit Extension

Page 1: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

DITA Open Toolkit Extensions

IEn2012

Page 2: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

Table of contents

Who I amThe OT overview - what is it and how does it worksAdding your own custom processingConclusionsQ&A

Page 3: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

3

Sperotech BackgroundSoftware and services company

Founded in 2009, located in Amsterdam

Specializes in solutions for ECM, CCM and user assistance Traditional manuals and online helpInteractive (embedded) user guidance and support systems Authoring and publishing (workflow and collaboration based) solutions

Expertise (10+ years):SharePoint and OpenText Enterprise Content Management and CollaborationDesign and implement information architecturesContent processes and workflowXMetaL, Oxygen XML and FrameMaker authoring toolsCSS, XSLT and XSL-FO stylesheets, DITA Open Toolkit customizationsDevelop and deliver end user trainingsLegacy content migrationUser assistance RIA applications

Page 4: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

WHAT IS THE OT AND HOW DOES IT WORKS

Page 5: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

The DITA Open Toolkit

A set of Java-based, open source tools that provide processing for DITA maps and topic content Can be downloaded and installed for free on a computer to get started with topic-based writing and publishing

5

Page 6: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

Initialize build

• Name• Default target• Working

directory

Set properties

• OT base directory

• (any other properties)

Import build files

• Integrator build file to install plug-ins and extensions

Build target

• Call main build with input, output, and transtype

User Build Flow

6

Page 7: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

Main Build Flow

Initialize build

• Name• Default target• Base directory

Import build files

• Initialization• Preprocess• General• Transform

types

Set class path for

• FO processing• DITA processing

engine

Transformation

• Parse transtype argument to call transformation type build file

7

Page 8: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

Build InitializationStart

processing Initialize logger

Configure URI resolver

Initialize software tool

usage

Check arguments

Output parameter info and warnings

1 2

3 4

5 6

ANT built-inJava pipeline

8

Page 9: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

Main Build Flow

Initialize build

• Name• Default target• Base directory

Import build files

• Initialization• Preprocess• General• Transform

types

Set class path for

• FO processing• DITA processing

engine

Transformation

• Parse transtype argument to call transformation type build file

9

Page 10: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

Build PreprocessStart preprocess Generate list of

filesDebug and filter

input filesCopy files to

output folder

Content reference push

resolve

Content reference resolve

Move metadata into topics

Key references resolve

Code reference resolve

Map reference resolve

Pull <navtitle> and <topicmeta>

into mapProcess chunks

Find and generate link info

Move related link info to topics

Pull metadata for <link> and <xref>

into topic

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15Java pipeline

XSLTANT built-in

10

Page 11: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

Main Build Flow

Initialize build

• Name• Default target• Base directory

Import build files

• Initialization• Preprocess• General• Transform

types

Set class path for

• FO processing• DITA processing

engine

Transformation

• Parse transtype argument to call transformation type build file

11

Page 12: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

Transformation Type Build Flow

Initialize build

• Name• Default target

Set properties

• Transformation type

Run build targets

• Initialization• Preprocess• Topic transform

Specific tasks

• Files specific to output deliverable

12

Page 13: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

Supports multiple output formats

XHTMLPDFEclipse HelpHTML HelpJavaHelpEPUBMOBI…

13

Page 14: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

Pipeline processing

output

OTJava Engine

XSLT Rendering Engine

ANT (Build file and scripts)

•Input files and arguments•Output specifications

9/27/2010 14

Introduction to the DITA Open Toolkit Customization Webinar

Page 15: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

dita2xhtml

Initialize build Preprocess

Create index.html from map

Copy revision flag image to

output dir

Copy CSS file to output dir

Transform topics to xhtml

1 2

3 4

5 6

ANT built-inXSLT

15

Page 16: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

ADDING YOUR OWN CUSTOM PROCESSING

Page 17: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

plugin.xml

❶ - unique id of plugin❷ - type of extension❸ - value for the feature (type)❹ - type ("text" or "file")❺ - name of plug-in it depends on; use "|"

to separate multiple plug-ins❻ - Set to "optional" to allow integration to

continue of plug-in is missing❼ - Name of the file that must be treated

as a template if plug-in has extension points

ExamplesAdd version info and processing before preprocessing<plugin id="com.sample.myplugin" <feature

extension="package.support.version" value="1.2" /> <feature extension="depend.preprocess.post" value="myTargetAfterPreprocess"

type="text“ /></plugin>

<plugin id=" ">❶ <feature extension="❷" value="❸" type="❹"/> <require plugin="❺" importance="❻"/> <template file="❼"/> </plugin>

17

Page 18: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

How to package a plug-in

doc Documentation

dtd Document Type Definitions

xsd XML Schema files

xsl XSL transformation files

Sample Sample files

Page 19: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

How to add your own XSLT processing

XSLT template files have an extension instruction <dita:extension>You plug in your XSLT processing through and <xsl:import>

19

Your XSLT

Plug-in

transtype XSLT template

Extension element

Feature extension

Plug-in Integration

transtype XSLT

<xsl:import href="…"/>

Page 20: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

Conclusions

Open Toolkit (OT) is a set of Java-based open source tools for processing DITA Maps and TopicsThe OT can be used to create different types of output deliverables (transformation types)Only proper way to extend the OT is through pluginsANT scripts define and control the build flowMost extensions (custom processing) are done through by plugging in your own processing at extension points using ANT and XSLTFormatting is best done afterwards through formatting instructions (CSS, XSL:FO)Plug-ins must be packaged into a folder structure and installed into the demo or plugins folder of the OT

Page 21: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

Page 22: Ien2012 DITA Open Toolkit Extension

www.sperotech.com

Thank you

Marc SpeyerMobile: +31 655 117 459Email: [email protected]: www.sperotech.comTwitter: #sperotech

Leave your business card or send me an email for a white paper on a tool to help you create DITA specializations.