Class OpenOfficeLocalConverterPlugin

java.lang.Object
io.vertigo.quarto.plugins.converter.openoffice.OpenOfficeLocalConverterPlugin
All Implemented Interfaces:
io.vertigo.core.node.component.Activeable, io.vertigo.core.node.component.CoreComponent, io.vertigo.core.node.component.Plugin, ConverterPlugin

public final class OpenOfficeLocalConverterPlugin extends Object
Conversion des fichiers à partir de OpenOffice.
Author:
npiedeloup
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Le port par défaut pour accéder à OpenOffice est 8100.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OpenOfficeLocalConverterPlugin(String unoPort, Optional<Integer> convertTimeoutSecondsOpt)
    Constructeur.
  • Method Summary

    Modifier and Type
    Method
    Description
    final io.vertigo.datastore.filestore.model.VFile
    convertToFormat(io.vertigo.datastore.filestore.model.VFile file, String targetFormat)
    Retourne le fichier converti L'appel à l'OOO distant est synchronisé, car il supporte mal les converssions concurrentes.
    protected static final com.sun.star.beans.PropertyValue[]
    getFileProperties(io.vertigo.quarto.plugins.converter.openoffice.ConverterFormat docType)
    Fournit les proterties de fichier pour un format de conversion.
    protected static final com.sun.star.beans.PropertyValue[]
    getFileProperties(io.vertigo.quarto.plugins.converter.openoffice.ConverterFormat docType, com.sun.star.io.XInputStream inputStream)
    Fournit les proterties de fichier pour un format de conversion et un flux de lecture.
    protected static final com.sun.star.beans.PropertyValue[]
    getFileProperties(io.vertigo.quarto.plugins.converter.openoffice.ConverterFormat docType, com.sun.star.io.XOutputStream outputStream)
    Fournit les proterties de fichier pour un format de conversion et un flux d'ecriture.
    protected static final String
    getFilterNameFromExtension(io.vertigo.quarto.plugins.converter.openoffice.ConverterFormat docType)
     
    protected com.sun.star.lang.XComponent
    loadDocument(File inputFile, io.vertigo.quarto.plugins.converter.openoffice.OpenOfficeConnection openOfficeConnection)
    Lecture d'un docuement.
    void
    void
    protected void
    storeDocument(File outputFile, com.sun.star.lang.XComponent xDoc, io.vertigo.quarto.plugins.converter.openoffice.ConverterFormat targetFormat, io.vertigo.quarto.plugins.converter.openoffice.OpenOfficeConnection openOfficeConnection)
    Ecriture du document.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_UNO_PORT

      public static final int DEFAULT_UNO_PORT
      Le port par défaut pour accéder à OpenOffice est 8100.
      See Also:
  • Constructor Details

    • OpenOfficeLocalConverterPlugin

      @Inject public OpenOfficeLocalConverterPlugin(String unoPort, Optional<Integer> convertTimeoutSecondsOpt)
      Constructeur.
      Parameters:
      unoPort - Port de connexion au serveur OpenOffice
      convertTimeoutSecondsOpt - Timeout de conversion des documents
  • Method Details

    • storeDocument

      protected void storeDocument(File outputFile, com.sun.star.lang.XComponent xDoc, io.vertigo.quarto.plugins.converter.openoffice.ConverterFormat targetFormat, io.vertigo.quarto.plugins.converter.openoffice.OpenOfficeConnection openOfficeConnection) throws Exception
      Ecriture du document.
      Parameters:
      outputFile - Fichier de sortie
      xDoc - Document OpenOffice source
      targetFormat - Format de sortie
      openOfficeConnection - Connection à OpenOffice
      Throws:
      Exception - Erreur de traitement
    • loadDocument

      protected com.sun.star.lang.XComponent loadDocument(File inputFile, io.vertigo.quarto.plugins.converter.openoffice.OpenOfficeConnection openOfficeConnection) throws Exception
      Lecture d'un docuement.
      Parameters:
      inputFile - Fichier source
      openOfficeConnection - Connection à OpenOffice
      Returns:
      Document OpenOffice
      Throws:
      Exception - Erreur de traitement
    • start

      public void start()
      Specified by:
      start in interface io.vertigo.core.node.component.Activeable
    • stop

      public void stop()
      Specified by:
      stop in interface io.vertigo.core.node.component.Activeable
    • convertToFormat

      public final io.vertigo.datastore.filestore.model.VFile convertToFormat(io.vertigo.datastore.filestore.model.VFile file, String targetFormat)
      Retourne le fichier converti L'appel à l'OOO distant est synchronisé, car il supporte mal les converssions concurrentes.
      Specified by:
      convertToFormat in interface ConverterPlugin
      Parameters:
      file - Fichier à convertir
      targetFormat - Type de document de sortie ODT,RTF,DOC,CSV,PDF
      Returns:
      Fichier converti
    • getFileProperties

      protected static final com.sun.star.beans.PropertyValue[] getFileProperties(io.vertigo.quarto.plugins.converter.openoffice.ConverterFormat docType)
      Fournit les proterties de fichier pour un format de conversion.
      Parameters:
      docType - format
      Returns:
      Proterties
    • getFileProperties

      protected static final com.sun.star.beans.PropertyValue[] getFileProperties(io.vertigo.quarto.plugins.converter.openoffice.ConverterFormat docType, com.sun.star.io.XOutputStream outputStream)
      Fournit les proterties de fichier pour un format de conversion et un flux d'ecriture.
      Parameters:
      docType - docType format
      outputStream - Flux d'ecriture
      Returns:
      Proterties
    • getFileProperties

      protected static final com.sun.star.beans.PropertyValue[] getFileProperties(io.vertigo.quarto.plugins.converter.openoffice.ConverterFormat docType, com.sun.star.io.XInputStream inputStream)
      Fournit les proterties de fichier pour un format de conversion et un flux de lecture.
      Parameters:
      docType - docType format
      inputStream - Flux de lecture
      Returns:
      Proterties
    • getFilterNameFromExtension

      protected static final String getFilterNameFromExtension(io.vertigo.quarto.plugins.converter.openoffice.ConverterFormat docType)
      Parameters:
      docType - Format de conversion
      Returns:
      filterName géré par OpenOffice pour lui préciser le format de conversion