Developing Plugins

517 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
517
On SlideShare
0
From Embeds
0
Number of Embeds
194
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Suite Solutions: DITA Quick Start Training for Authors iDTP, March 16-18, 2009
  • Suite Solutions: DITA Quick Start Training for Authors iDTP, March 16-18, 2009 Open the build file and show them the integrate line. Explain that it takes about a second so this is the most elegant solution.
  • Suite Solutions: DITA Quick Start Training for Authors iDTP, March 16-18, 2009 Open the build file and show them the integrate line. Explain that it takes about a second so this is the most elegant solution.
  • Suite Solutions: DITA Quick Start Training for Authors iDTP, March 16-18, 2009 Open the build file and show them the integrate line. Explain that it takes about a second so this is the most elegant solution.
  • Developing Plugins

    1. 1. Developing Plug-ins and Working With FO Plug-in Extension Points Adena Frazer Suite Solutions
    2. 2. Who Are We? <ul><li>Our Mission </li></ul><ul><li>To increase our customers’ profitability by significantly improving the efficiency of their information development and delivery processes. </li></ul><ul><li>Qualitative Advantage </li></ul><ul><li>Content Lifecycle Implementation (CLI) is Suite Solutions’ comprehensive approach – from concept to publication – to maximizing the value of your information assets. </li></ul><ul><li>Our professionals are with you at every phase, determining, recommending and implementing the most cost-effective, flexible and long term solution for your business. </li></ul>
    3. 3. Clients and Partners Private and Confidential Suite Solutions©2009
    4. 4. Who am I? <ul><li>Background in Computer Science and Education </li></ul><ul><li>Experience in several computer companies over </li></ul><ul><li>the past decade+ </li></ul><ul><ul><li>Web applications </li></ul></ul><ul><ul><li>Telecommunications </li></ul></ul><ul><li>Early member of the Suite Solutions team </li></ul><ul><ul><li>Various webinars and on-site training seminars </li></ul></ul><ul><ul><li>in Boston and Santa Clara </li></ul></ul><ul><ul><li>PDF and HTML style sheet projects </li></ul></ul><ul><ul><li>FO plug-in support for PDF output </li></ul></ul><ul><ul><li>Project Management </li></ul></ul>
    5. 5. Main Training Topics <ul><li>Overview </li></ul><ul><li>Extension Points </li></ul><ul><li>Integrator.xml </li></ul><ul><li>Plugin.xml </li></ul><ul><li>FO Plug-in Extension Point </li></ul><ul><li>Specializations </li></ul>
    6. 6. Overview (1) <ul><li>Plug-in: A separate piece of code that changes or extends the Toolkit’s functionality by integrating with the Toolkit. </li></ul><ul><li>Multiple plug-ins can be integrated into the Toolkit at the same time </li></ul><ul><li>Plug-ins can be dependent on each other </li></ul><ul><li>Must include plugin.xml file. It is integrated into the toolkit by running c:ditaotintegrator.xml </li></ul><ul><li>Usually changes/overrides are made after the preprocess, before XHTML files are generated </li></ul>
    7. 7. Overview (2) <ul><li>Why Use Plug-ins? </li></ul><ul><ul><li>Make use of existing toolkit functionality, and just tweak what’s necessary. </li></ul></ul><ul><ul><li>Preserve changes through toolkit upgrades: more maintainable </li></ul></ul><ul><ul><li>Deploy your changes easily </li></ul></ul>
    8. 8. Overview (3) <ul><li>Common Uses of Plug-ins </li></ul><ul><ul><li>To register a DITA specialization with the toolkit </li></ul></ul><ul><ul><ul><li>Example: Robert Anderson’s Music Plug-in </li></ul></ul></ul><ul><ul><li>To override specific XSLT templates within the toolkit </li></ul></ul><ul><ul><ul><li>Example: Custom branding </li></ul></ul></ul><ul><ul><li>To create new transtypes </li></ul></ul><ul><ul><ul><li>Example: the FO Plug-in </li></ul></ul></ul>
    9. 9. Main Training Topics <ul><li>Overview </li></ul><ul><li>Extension Points </li></ul><ul><li>Integrator.xml </li></ul><ul><li>Plugin.xml </li></ul><ul><li>FO Plug-in Extension Point </li></ul><ul><li>Specializations </li></ul>
    10. 10. Extension Points (1) <ul><li>Plug-ins plug in to Extension Points in the Toolkit </li></ul><ul><li>Extension points are a DITA XML element which identifies a part of a file that can be modified by a user plug-in </li></ul><ul><ul><li>They essentially say: YOUR CODE GOES HERE </li></ul></ul><ul><li>Extension Points are found in _template.xsl files </li></ul><ul><li>Sample Extension Point (from dita2xhtml_template.xsl): </li></ul>
    11. 11. Extension Points (2) <ul><li>Extension Point attributes </li></ul><ul><ul><li>Id – name of the extension point. This must be referenced in the plug-in </li></ul></ul><ul><ul><li>Behavior – how your code should be included in the extension point. Usually either: </li></ul></ul><ul><ul><ul><li>InsertXSLAction – pastes your code in the spot designated by the extension point </li></ul></ul></ul><ul><ul><ul><li>ImportXSLAction – places a statement in the spot designated by the extension point which imports your code. </li></ul></ul></ul><ul><ul><li>Xmlns – defines the DITA namespace which is used by the extension point. </li></ul></ul>
    12. 12. Extension Points (3)
    13. 13. Extension Points (4) <ul><li>Documentation of the Toolkit’s Extension Points: </li></ul><ul><ul><li>http://dita-ot.sourceforge.net/SourceForgeFiles </li></ul></ul><ul><ul><li>/doc/plugin/createplugin.html </li></ul></ul><ul><li>Sample Extension Points: </li></ul><ul><ul><li>dita.specialization.catalog </li></ul></ul><ul><ul><li>dita.conductor.lib.import </li></ul></ul><ul><ul><li>dita.conductor.target </li></ul></ul><ul><ul><li>dita.xsl.xhtml </li></ul></ul>
    14. 14. Main Training Topics <ul><li>Overview </li></ul><ul><li>Extension Points </li></ul><ul><li>Integrator.xml </li></ul><ul><li>Plugin.xml </li></ul><ul><li>FO Plug-in Extension Point </li></ul><ul><li>Specializations </li></ul>
    15. 15. Integrator.xml (1) <ul><li>When integrator.xml runs, it: </li></ul><ul><ul><li>Searches for plug-ins in the plugin and demo directories and validates them </li></ul></ul><ul><ul><li>Copies the information in the _template.xsl files to their corresponding xsl files. </li></ul></ul><ul><ul><li>Replaces the extension points in the _template.xsl files with code identified in the plug-in. </li></ul></ul><ul><ul><li>The project build files runs integrator.xml with each build: </li></ul></ul>
    16. 16. Integrator.xml (2) <ul><li>Initial _template.xsl file: </li></ul><ul><li>Code… -> args.xsl Extension Point -> More Code… </li></ul><ul><li>Plugin.xml file: </li></ul><ul><li>Insert my customized code into the args.xsl Extension Point </li></ul><ul><li>New . xsl file generated by integrator.xml : </li></ul><ul><li>Code… -> my customized code -> More Code… </li></ul>
    17. 17. Integrator.xml (3) <ul><li>BEST PRACTICE: Toolkit customization should be implemented as a plug-in so that changes will not be lost the next time that integrator is run. </li></ul><ul><li>To unplug your plug-in, simply remove the plug-in directory and rerun integrator.xml </li></ul>
    18. 18. Main Training Topics <ul><li>Overview </li></ul><ul><li>Extension Points </li></ul><ul><li>Integrator.xml </li></ul><ul><li>Plugin.xml </li></ul><ul><li>FO Plug-in Extension Point </li></ul><ul><li>Specializations </li></ul>
    19. 19. Plugin.xml (1) <ul><li>Every plug-in must contain a plugin.xml file </li></ul><ul><li>The file includes: </li></ul><ul><ul><li>An id </li></ul></ul><ul><ul><li>As many extensions as necessary to match up with the appropriate extension points in the toolkit </li></ul></ul><ul><ul><li>The text or file location of your customized code </li></ul></ul>
    20. 20. Plugin.xml (2) <ul><li>Sample plugin.xml – suitesol.branding: </li></ul>
    21. 21. Plugin.xml (3) <ul><li>The plugin.xml file should be placed in a folder which also contains other relevant files </li></ul><ul><ul><li>DTD and MOD files for DITA Specializations </li></ul></ul><ul><ul><li>Files containing XSLT templates for template overrides </li></ul></ul><ul><li>This folder should be stored in either the ditaot/plugins or ditaot/demo directory. </li></ul>
    22. 22. Plugin.xml (4) <ul><li>Example of customized code used by a plug-in: suitesol.xsl </li></ul>
    23. 23. Main Training Topics <ul><li>Overview </li></ul><ul><li>Extension Points </li></ul><ul><li>Integrator.xml </li></ul><ul><li>Plugin.xml </li></ul><ul><li>FO Plug-in Extension Point </li></ul><ul><li>Specializations </li></ul>
    24. 24. FO Plug-in Extension Point <ul><li>There is a new extension point in the FO Plug-in: </li></ul><ul><li>DITA-OT1.5.1demofoxslfo opic2fo_shell_1.0.xsl </li></ul><ul><li>Note corresponding template file </li></ul><ul><li>ID: dita.xsl.xslfo </li></ul><ul><li>Behavior: ImportXSLAction </li></ul><ul><li>This Extension Point is useful for PDF customizations that apply across all customization directories. </li></ul><ul><li>It can be used by applying the same methods as used for the DITA-OT Extension Points. </li></ul>
    25. 25. Main Training Topics <ul><li>Overview </li></ul><ul><li>Extension Points </li></ul><ul><li>Integrator.xml </li></ul><ul><li>Plugin.xml </li></ul><ul><li>FO Plug-in Extension Point </li></ul><ul><li>Specializations </li></ul>
    26. 26. Specializations <ul><li>To plug-in a DITA specialization </li></ul><ul><ul><li>Use the dita.specialization.catalog extension point </li></ul></ul><ul><ul><li>Point to the updated catalog file which references the specialized DTD </li></ul></ul><ul><ul><li>Example – Robert Anderson’s music plug-in </li></ul></ul>
    27. 27. Main Training Topics <ul><li>Overview </li></ul><ul><li>Extension Points </li></ul><ul><li>Integrator.xml </li></ul><ul><li>Plugin.xml </li></ul><ul><li>FO Plug-in Extension Point </li></ul><ul><li>Specializations </li></ul>
    28. 29. End of Developing Plug-ins and Working With FO Plug-in Extension Points <ul><li>Be in touch! Adena Frazer [email_address] </li></ul><ul><li>Let us know how we can help you further… </li></ul><ul><ul><li>One-on-one support and training </li></ul></ul><ul><ul><li>CMS Integration </li></ul></ul>

    ×