1 / 29

Power Hour October 2010 Building Custom Formats

Power Hour October 2010 Building Custom Formats. Ben Allums. Power Hour – October 2010. Agenda Survey Results Building Custom Formats Concepts Code Practice Webinars of Interest. Power Hour – October 2010. Survey Results. Survey Results. When to meet:. Survey Results.

fodor
Download Presentation

Power Hour October 2010 Building Custom Formats

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Power HourOctober 2010Building Custom Formats Ben Allums

  2. Power Hour – October 2010 Agenda • Survey Results • Building Custom Formats • Concepts • Code • Practice • Webinars of Interest

  3. Power Hour – October 2010 Survey Results

  4. Survey Results When to meet:

  5. Survey Results Topics to cover:

  6. Survey Results Topics to cover: • Using the XML adapter with DTDs other than DITA • Files needed to customize the WebWorks 5 template - has their location changed since the help doc on the wiki was posted? pre-2008.4

  7. Power Hour – October 2010 Building Custom Formats

  8. Building Custom Formats • Concepts • Code • Practice

  9. Building Custom Formats Concepts

  10. Building Custom Formats Concepts • Start with XML • Script with XSLT • Use the File Library • Finding files • Adding files • Extension Methods, for everything else • Manipulate with file & URI paths • Write files • Log progress

  11. Concepts Start with XML • Structured content • Distinguish with attributes Container id=top Nested id=first type=aaa Nested id=sec type=aaa

  12. Concepts Script with XSLT • Match context • Emit new structure or keep the same Container * Container id=top A Nested Copy Nested id=first type=aaa type=aaa A Nested A Nested id=sec type=aaa Copy

  13. Concepts Use the File Library • Finding files • Adding files Files File path type File path type File path type

  14. Concepts Extension Methods, for everything else • Manipulate with file & URI paths • Write files • Log progress * wwfilesystem Copy wwexsldoc type=aaa A wwlog Copy

  15. Building Custom Formats Code

  16. Building Custom Formats Code • Start with XML • Script with XSLT • Use the File Library • Finding files • Adding files • Extension Methods, for everything else • Manipulate with file & URI paths • Write files • Log progress

  17. Code Start with XML • All content (FrameMaker, Word, DITA) goes to XML • WebWorks Intermediate Format (WIF) <?xml version="1.0" encoding="utf-8"?><Document xmlns="urn:WebWorks-Document-Schema"> <Content> <Paragraph id="5000001" stylename="Heading1"> <TextRun id="5000001-1" stylename="Bold"> <Text value="Example WIF Document" /> </TextRun> <TextRun id="5000001-2"> <Text value=" shows what is possible." /> </TextRun> </Paragraph> </Content></Document>

  18. Code Script with XSLT • Match content • Emit as you like <?xml version="1.0" encoding="utf-8"?><xsl:stylesheet> <xsl:template match="/"> <xsl:apply-templates /> </xsl:template> <xsl:template match="wwdoc:Paragraph[@stylename = 'Heading 1']"> <h1> <xsl:apply-templates /> </h1> </xsl:template> <xsl:template match="*"> <xsl:apply-templates /> </xsl:template> ...</xsl:stylesheet> wwdoc:Paragraph[@stylename = 'Heading 1'] <h1> </h1>

  19. Code Use the File Library • Tracks every file ePublisher knows about • Look for types (and also group and document IDs) <?xml version="1.0" encoding="utf-8"?><Files version="1.0" xmlns="urn:WebWorks-Engine-Files-Schema"> <File path="C:\Temp\WebWorks\ePublisher\Data\resource.fmwif" type="engine:conversion" groupID="WS29Gkg8W7g" documentID="V-d9Aksa5_4"> <Depends path="C:\Desktop\book\resource.fm" groupID="WS29Gkg8W7g" documentID="V-d9Aksa5_4" /> </File> <File path="C:\Temp\WebWorks\ePublisher\Data\resource.wif" type="engine:wif" groupID="WS29Gkg8W7g" documentID="V-d9Aksa5_4"> <Depends path="C:\Temp\WebWorks\ePublisher\Data\resource.fmwif" groupID="WS29Gkg8W7g" documentID="V-d9Aksa5_4" /> </File> type="engine:conversion" type="engine:wif"

  20. Code Use the File Library • Finding files  Query by type • Process all files of a given type at once <?xml version="1.0" encoding="utf-8"?><Files version="1.0" xmlns="urn:WebWorks-Engine-Files-Schema"> <File path="C:\Temp\WebWorks\ePublisher\Data\resource.fmwif" type="engine:conversion" groupID="WS29Gkg8W7g" documentID="V-d9Aksa5_4"> <Depends path="C:\Desktop\book\resource.fm" groupID="WS29Gkg8W7g" documentID="V-d9Aksa5_4" /> </File> <File path="C:\Temp\WebWorks\ePublisher\Data\resource.wif" type="engine:wif" groupID="WS29Gkg8W7g" documentID="V-d9Aksa5_4"> <Depends path="C:\Temp\WebWorks\ePublisher\Data\resource.fmwif" groupID="WS29Gkg8W7g" documentID="V-d9Aksa5_4" /> </File> type="engine:wif"

  21. Code Use the File Library • Adding files  Tell ePublisher what you created • Available to all later processing stages <?xml version="1.0" encoding="utf-8"?><xsl:stylesheet> <xsl:template match="/"> ... <wwfiles:Files> <wwfiles:File path="C:\Desktop\my_new_file.html" type="output:page" groupID="WS29Gkg8W7g" documentID="V-d9Aksa5_4" /> </wwfiles:Files> </xsl:template> ...</xsl:stylesheet> <wwfiles:Files> <wwfiles:File path="C:\Desktop\my_new_file.html" type="output:page" groupID="WS29Gkg8W7g" documentID="V-d9Aksa5_4" /> </wwfiles:Files>

  22. Code Extension Methods, for everything else • XSLT only goes so far • Extension methods enable ePublisher to provide a complete solution <?xml version="1.0" encoding="utf-8"?><xsl:stylesheet> <xsl:template match="/"> ... <xsl:variable name="VarPageAsXML"> <!-- Page content --> </xsl:variable> <xsl:variable name="VarPage" select="msxsl:node-set($VarPageAsXML)" /> <xsl:variable name="VarPath" select="wwfilesystem:Combine($VarOutputDir,'file.html')" /> <xsl:variable name="VarWriteFile" select="wwexsldoc:Document($VarPage, $VarPath)" /> ... </xsl:template> ...</xsl:stylesheet> wwfilesystem:Combine($VarOutputDir,'file.html') wwexsldoc:Document($VarPage, $VarPath)

  23. Building Custom Formats Practice

  24. Building Custom Formats Practice • Minimal format to get started • Customize an existing format Let’s try it!

  25. Power Hour – October 2010 Webinars of Interest

  26. Webinars of Interest Show Me: • November 18th at 11:30am Central • Topic: Single Sourcing your Content & ePublisher 2010.3 • Learn what the ePublisher platform can do for you right out of the box. • Hosted by members of the WebWorks staff • Repeats on the 3rd Thursday of every month Sign-up at http://www.webworks.com/Resources/Events/Show_Me/

  27. Webinars of Interest Study Hall: • November 10th at 1:00pm Central • Open forum for ePublisher users • Ask questions or request help on custom projects • Hosted by members of the WebWorks development staff • Repeats on the 2nd and last Wednesdays of every month Join at http://www.webworks.com/Resources/Events/Study_Hall/

  28. Webinars of Interest Archives: • Power Hourhttp://www.webworks.com/Resources/Events/Power_Hour/Archive/ • Show Me!http://www.webworks.com/Resources/Events/Show_Me/Archive/

  29. Power HourOctober 2010Building Custom Formats Ben Allums

More Related