<?xml version='1.0' encoding='UTF-8'?>
<!-- This file is part of the DITA Open Toolkit project hosted on 
     Sourceforge.net. See the accompanying license.txt file for 
     applicable licenses.-->
<!-- (C) Copyright IBM Corporation 2005, 2006. All Rights Reserved. -->
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "..\..\..\dtd\topic.dtd" []>
<topic xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" id="usecase">
  <title>Use Case: plugin architecture for DITA-OT</title>
  <body>
    <section>
      <title>Use Case for developer</title>
      <p>
        <b>1. Brief Description</b>
      </p>
      <p>This use case describes how a Developer create new plugins for DITA open toolkit.</p>
      <p>
        <b>2. Preconditions</b>
      </p>
      <p>
        <ol>
          <li>User read the document of dita-ot.</li>
          <li>User setup required software on local machine.</li>
          <li>User installed DITA OT tool to local.</li>
        </ol>
      </p>
      <p>
        <b>3. Basic Flow</b>
      </p>
      <p>
        <ol>
          <li>Developer creates a new directory in /demo for this plugin. For example, /plugin/pluginA. Under this plugin root directory, there will the following sub directories demo/ pluginA/ dtd schema catalog xsl lib</li>
          <li>Developer specializes from topic or other types of topic (like task, reference, concept .....) and put the dtd files into dtd directory schema files into schema directory</li>
          <li>Developer puts the catalog information into his own catalog file in catalog directory and inherit the original information from catalog-dita.xml in the root directory.</li>
          <li>Developer defines the transformation for the new specialization and put them to xsl directory.</li>
          <li>Developer provides the Ant script to use his xsl file with preprocess with default ant script template into plugin root directory</li>
          <li>Developer puts compiled JAR files which is necessary for this plugin into lib directory.</li>
          <li>Developer packages all the subdirectories and files under pluginA to a zip binary file and thus create a DITA OT plugin file for distribution.</li>
          <li>Developer tests the plugin file will run successfully when integrated into DITA OT base. </li>
          <li>Developer finishes testing. </li>
          <li>The basic flow is complete.</li>
        </ol>
      </p>
    </section>
    <section>
      <title>Use Case for end user</title>
      <p>
        <b>1. Brief Description</b>
      </p>
      <p>This use case describes how an end user get, install and use a plugin developed for DITA open toolkit There are 2 options for the plugin architecture to load the plugins. One is just like eclipse plugin architecture. We load the plugins every time a build is invoked. The other one is like mozilla firefox. Every time when we installed new plugin, we should start a program to install those plugin and integrate them with toolkit. Currently we decided to use the first option.</p>
      <p>
        <b>2. Preconditions</b>
      </p>
      <p>None</p>
      <p>
        <b>3. Basic Flow</b>
      </p>
      <p>
        <ol>
          <li>User goes to the DITA OT SourceForge website to download the DITA OT base binary file </li>
          <li>User goes to the DITA OT SourceForge website (or other website) to download a DITA OT plugin binary file. e.g. DITA OT plugin A</li>
          <li>User installs DITA OT to the his/her local computer by following the installation instruction. The installed directory is &lt;DITA OT root directory&gt;</li>
          <li>User configs DITA OT and can run DITA OT basic functions successfully.</li>
          <li>User extract the plugin A package to &lt;DITA OT root directory&gt;/plugin or &lt;DITA OT root directory&gt;/demo </li>
          <li>
            <ol>
              <li> User uses Ant to call the new function provided by plugin A.</li>
              <li>Use uses Java command line to call the new function provided by plugin A.</li>
            </ol>
          </li>
          <li>User runs the plugin A function successfully.</li>
          <li>The basic flow is complete.</li>
        </ol>
      </p>
      <p>
        <b>4. Alternative Flows</b>
      </p>
      <p>#1 install plugin (option 1) The plugin is integrated to toolkit dynamically by integrator every time a build is invoked. User just need to unzip the package to the specific directory and it&apos;s not necessary to do anything else.</p>
      <p> #2 remove plugin (option 1) User remove the directory containing the plugin files and doesn&apos;t need to do anything else.</p>
    </section>
  </body>
</topic>
