Class UNOPublisher

java.lang.Object
org.openoffice.da.comp.w2lcommon.filter.UNOPublisher
Direct Known Subclasses:
LaTeXUNOPublisher, XhtmlUNOPublisher

public class UNOPublisher extends Object
This class converts an open office document to another format
  • Field Details

    • xContext

      protected com.sun.star.uno.XComponentContext xContext
    • xFrame

      protected com.sun.star.frame.XFrame xFrame
  • Constructor Details

    • UNOPublisher

      public UNOPublisher(com.sun.star.uno.XComponentContext xContext, com.sun.star.frame.XFrame xFrame, String sAppName)
      Create a new UNOPublisher based on a loaded office document
      Parameters:
      xContext - the component context from which new UNO services are instantiated
      xFrame - the current frame
      sAppName - the name of the application using the UNOPublisher
  • Method Details

    • publish

      public boolean publish(UNOPublisher.TargetFormat format)
      Publish the document associated with this UNOPublisher. This involves five steps: (1) Check that the document is saved in the local file system. (2) Display the options dialog. (3) Save the document (if the modified flag is true). (4) Convert the document. (5) Post process the document, e.g. displaying the result
      Parameters:
      format - the target format
      Returns:
      true if the publishing was successful
    • filterFileName

      protected String filterFileName(String sFileName)
      Filter the file name to avoid unwanted characters
      Parameters:
      sFileName - the original file name
      Returns:
      the filtered file name
    • postProcessMediaProps

      protected com.sun.star.beans.PropertyValue[] postProcessMediaProps(com.sun.star.beans.PropertyValue[] mediaProps)
      Post process the media properties after displaying the dialog
      Parameters:
      mediaProps - the media properties as set by the dialog
      Returns:
      the updated media properties
    • postProcess

      protected void postProcess(String sTargetURL, UNOPublisher.TargetFormat format)
      Post process the document after conversion.
      Parameters:
      sTargetURL - URL of the converted document
      format - the target format
    • documentSaved

      public boolean documentSaved()
      Check that the document is saved in a location, we can use
      Returns:
      true if everthing is o.k.
    • getTargetPath

      public String getTargetPath()
      Get the target path (or null if the document is not saved)
      Returns:
      the path
    • getTargetFileName

      public String getTargetFileName()
      Get the target file name (or null if the document is not saved)
      Returns:
      the file name
    • getTargetURL

      protected String getTargetURL(UNOPublisher.TargetFormat format)