DiType User Guide/Integrating DiType

From Docs

Jump to: navigation, search

< DiType User Guide

DiType can be used in many diverse environments. For this reason, it provides a number of ways to integrate with other applications and systems. The internal functionality of DiType and its integration methods are described in the following sections.


DiType Processing Flow

The logical flow of processing a document is:

  • Transform - The transformer does one of two things. Either it determines the document type and applies the necessary transformations to convert it to XSL-FO. Or it applies the stylesheet referred to in the xml-stylesheet processing instructions.
  • Preprocess - The preprocessor converts the XSL into FOSI, an internal format that is suitable for the formatting process.
  • Render - The document is rendered to XEPOUT and passed to the back ends to generate the final output (PostScript, PDF or SVG).

The logical flow of document processing is shown in the following figure:

Document Processing
Document Processing

Universal Plugin Connector

Many interactive applications use XEP DiType uniformly by using the following procedure.

  1. Initiate a session.
  2. Set formatting options.
  3. Send documents to DiType for formatting.
  4. Retrieve formatting log and display it to the user while the formatting continues to run.

A Universal Plugin Connector (UPC) is available so that the same algorithms need not be re-implemented in each application. UPC provides the calls via XML-RPC, the protocol used in AJAX and inside XEP-DITYPE core. It is a robust way to interconnect pieces of a program using diverse technologies and even running on different computers. Applications connect to UPC and use it as a proxy to format documents and receive formatting logs. An application becomes an XML-RPC client, a simple role supported by well-developed libraries in most programming languages and environments.

API and Connectors

DiType provides a rendering API and connectors for some popular programming languages. APIs for Java and C# provide new interfaces and legacy versions that are compatible with the current interfaces. The Java and C# APIs and Connectors are described in the following sections.

Java API and Connectors

DiType provides a number of Java APIs that allow you to write your own code in Java to process XSL-FO and XML documents in multiple environments. The Java APIs and Connectors include a servlet component and an Ant connector.

Servlet Component

The servlet component provides the ability to use the DiType formatter for implementing web-applications. With the servlet component, it is possible to do the following:

  • Design electronic libraries where all the books are stored on the server in XML/XSL format. Each e-library user has the opportunity to download any book in either PDF or PostScript format.
  • Design a web service where each user can upload an XML/XSL-FO document to the server, or specify the URL of the document, and download the PDF or PostScript output.

Ant Connector

Apache Ant is a Java-based build tool used for automating software build processes. It is similar to make , but is written in the Java language and is extended using Java classes.

DiType Ant component gives an opportunity to create a task, which can format XML documents to a printable format - PDF or PostScript.

jEdit connector

jEdit is a mature programmer's text editor. jEdit is written in Java and runs on Windows, Linux, Mac OS X and a number of other operating systems. The product is available under the GNU General Public License. There are dozens of plug-ins for numerous application areas. All this makes it the most commonly used among java developers.

jEdit connector is a jEdit plug-in, which gives an opportunity to format XML documents directly from the editor.

<oXygen/> XML Editor connector

The simple look of the <oXygen/> XML Editor combined with the complete coverage of the XML editing features have made it popular in both the corporate and academic worlds. It provides the necessary tools for the document creation and presentation.

oXygen connector is plug-in, which gives an opportunity to format XML documents directly from the editor by choosing "Plugins->Ditype" from context menu.

Apache Cocoon connector

Apache Cocoon is a web development framework built around the concepts of pipeline, separation of concerns and component-based web development. The framework focuses on XML and XSLT publishing and is built using the Java programming language.

DiType Connector for Apache Cocoon is a PDF/PostScript serializer for Cocoon. It generates PDF or PostScript documents from XML/XSL Formatting Objects instances.

Enterprise Java Beans

This component contains a Java Enterprise Bean wrapper for DiType. The bean runs on a remote computer in a Java application server; clients connect to the bean, call its methods to format XSL FO document and receive the formatting results over the network.

C# API and Connectors

DiType provides a C# API, which is a .Net based library that allows you to write your own code in the .Net environment to process XSL-FO and XML documents. The .Net API includes the following:

  • RenderX.DiType.dll : The.Net assembly. The assembly is strongly named and can be installed to the %SYSTEMROOT%\assembly directory.
  • DiType.Net API source code.
  • DiType.Net API documentation.
  • Examples directory containing sources and binaries of examples written in C# and VB.Net.
  • build.proj : An MSBuild project file to build from the sources.

C API and Connectors

This package includes:

  • C API source code.
  • C API documentation.
  • Examples directory containing sources and binaries of examples written in C.
  • Files to build from sources

C++ API and Connectors

This package includes:

  • C++ API source code.
  • C++ API documentation.
  • Examples directory containing sources and binaries of examples written in C++.
  • Files to build from sources

Python API and Connectors

Python API provides high-level API for document processing via DiType Formatter.

Package contents:

  • source code.
  • API documentation.
  • Example (see diclick.py).

Python API uncludes the following modules:

  • diclient.py - client side CLISER-protocol implementation.
  • formatter.py - interface to DiType formatting engine
  • logger.py - reference implementation for processing log events.

Personal tools