Class UNOPublisher
java.lang.Object
org.openoffice.da.comp.w2lcommon.filter.UNOPublisher
- Direct Known Subclasses:
LaTeXUNOPublisher,XhtmlUNOPublisher
This class converts an open office document to another format
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUNOPublisher(com.sun.star.uno.XComponentContext xContext, com.sun.star.frame.XFrame xFrame, String sAppName) Create a newUNOPublisherbased on a loaded office document -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck that the document is saved in a location, we can useprotected StringfilterFileName(String sFileName) Filter the file name to avoid unwanted charactersGet the target file name (or null if the document is not saved)Get the target path (or null if the document is not saved)protected Stringprotected voidpostProcess(String sTargetURL, UNOPublisher.TargetFormat format) Post process the document after conversion.protected com.sun.star.beans.PropertyValue[]postProcessMediaProps(com.sun.star.beans.PropertyValue[] mediaProps) Post process the media properties after displaying the dialogbooleanpublish(UNOPublisher.TargetFormat format) Publish the document associated with thisUNOPublisher.
-
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 newUNOPublisherbased on a loaded office document- Parameters:
xContext- the component context from which new UNO services are instantiatedxFrame- the current framesAppName- the name of the application using theUNOPublisher
-
-
Method Details
-
publish
Publish the document associated with thisUNOPublisher. 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
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
Post process the document after conversion.- Parameters:
sTargetURL- URL of the converted documentformat- 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
Get the target path (or null if the document is not saved)- Returns:
- the path
-
getTargetFileName
Get the target file name (or null if the document is not saved)- Returns:
- the file name
-
getTargetURL
-