de.init.service
Class ItsOdtIOManager

java.lang.Object
  extended by de.init.service.ItsOdtIOManager

public class ItsOdtIOManager
extends java.lang.Object

Main Class for ODT File import and export.

Use this class to perform any processing concerning ITS markup in ODT files. In General this class SHALL be used to load and save TextDocument, that contain ITS markup. OpenOffice forbids the direct integration into the io processing, hence this class shall be called from a controller linked to some UI element: A toolbar or something.

Author:
mkandora

Method Summary
 boolean exportDocument(java.net.URI resource, com.sun.star.text.XTextDocument xDocument)
          Exports (Saves) a document.
static ItsOdtIOManager getIoManager(com.sun.star.frame.XComponentLoader loader)
          Obtains an instance of the ItsOdtIOManager
 com.sun.star.text.XTextDocument importDocument(java.lang.String resource)
          Imports an ODT Writer document
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIoManager

public static ItsOdtIOManager getIoManager(com.sun.star.frame.XComponentLoader loader)
Obtains an instance of the ItsOdtIOManager

Parameters:
loader - the XComponentLoader derived from XDesktop
Returns:
an instance of the ItsOdtIOManager

importDocument

public com.sun.star.text.XTextDocument importDocument(java.lang.String resource)
                                               throws java.lang.Exception
Imports an ODT Writer document

Parameters:
resource -
Returns:
Throws:
java.lang.Exception

exportDocument

public boolean exportDocument(java.net.URI resource,
                              com.sun.star.text.XTextDocument xDocument)
                       throws java.lang.Exception
Exports (Saves) a document.

In order to circumvent a direct ODT File Implementation, the ODT File will be saved natively via the UNO API, the pre-saved document will be further processed by ItsProcessor to insert the appropriate data categories.

Parameters:
xDocument - the XTextDocument to save
doctype -
Returns:
Throws:
java.lang.Exception