From c3733c8731233742006b8d5cb396a3871977302e Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Wed, 19 May 2004 12:20:32 +0000 Subject: INTEGRATION: CWS qwizards1 (1.1.2); FILE ADDED 2004/03/12 16:17:01 rpiterman 1.1.2.4: documentation and small implementation-fixes 2004/03/05 19:11:53 rpiterman 1.1.2.3: Further developement 2004/02/20 18:11:17 rpiterman 1.1.2.2: changes were made to use the Field Support of the DataAware model (beta) 2004/02/13 15:42:55 rpiterman 1.1.2.1: performs a simple export using a filter --- .../star/wizards/web/export/FilterExporter.java | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 wizards/com/sun/star/wizards/web/export/FilterExporter.java (limited to 'wizards') diff --git a/wizards/com/sun/star/wizards/web/export/FilterExporter.java b/wizards/com/sun/star/wizards/web/export/FilterExporter.java new file mode 100644 index 000000000000..8c13a0e54cf0 --- /dev/null +++ b/wizards/com/sun/star/wizards/web/export/FilterExporter.java @@ -0,0 +1,66 @@ +/* + * Created on 17.10.2003 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package com.sun.star.wizards.web.export; + +import com.sun.star.io.IOException; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.wizards.common.Properties; +import com.sun.star.wizards.ui.event.Task; +import com.sun.star.wizards.web.data.CGDocument; +import com.sun.star.wizards.web.data.CGExporter; + +/** + * @author rpiterman + * + * An exporter which is configured with a filter name, and + * uses the specified filter to export documents. + */ +public class FilterExporter extends AbstractExporter { + + protected String filterName; + protected Properties props = new Properties(); + + /* (non-Javadoc) + * @see com.sun.star.wizards.web.export.Exporter#export(java.lang.Object, java.io.File, com.sun.star.wizards.web.data.CGSettings, com.sun.star.lang.XMultiServiceFactory) + */ + public boolean export( + CGDocument source, + String target, + XMultiServiceFactory xmsf, + Task task + ) { + + boolean result = true; + Object document = null; + + try { + document = openDocument(source,xmsf); + task.advance(true); + storeToURL(document,target, filterName, props.getProperties()); + task.advance(true); + + } + catch (IOException iox) { + result = false; + } + finally { + closeDocument(document,xmsf); + calcFileSize(source,target,xmsf); + task.advance(true); + } + return true; + } + + /* (non-Javadoc) + * @see com.sun.star.wizards.web.export.Exporter#init(com.sun.star.wizards.web.data.CGExporter) + */ + public void init(CGExporter exporter_) { + super.init(exporter_); + filterName = getArgument("Filter",exporter_); + } + +} -- cgit v1.2.3