Class OpenOfficeRemoteConverterPlugin

  • 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 OpenOfficeRemoteConverterPlugin
    extends Object
    Conversion des fichiers à partir de OpenOffice.
    Author:
    npiedeloup
    • Field Summary

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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      VFile convertToFormat​(VFile file, String targetFormat)
      Retourne le fichier converti L'appel à l'OOO distant est synchronisé, car il supporte mal les converssions concurrentes.
      protected static 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 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 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 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 start()
      void stop()
      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.
    • Field Detail

      • DEFAULT_UNO_PORT

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

      • OpenOfficeRemoteConverterPlugin

        @Inject
        public OpenOfficeRemoteConverterPlugin​(String unoHost,
                                               String unoPort,
                                               Optional<Integer> convertTimeoutSecondsOpt)
        Constructor.
        Parameters:
        unoHost - Hote du serveur OpenOffice
        unoPort - Port de connexion au serveur OpenOffice
        convertTimeoutSecondsOpt - Timeout de conversion des documents
    • Method Detail

      • 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 VFile convertToFormat​(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