summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2004-05-19 12:20:32 +0000
committerKurt Zenker <kz@openoffice.org>2004-05-19 12:20:32 +0000
commitc3733c8731233742006b8d5cb396a3871977302e (patch)
tree7fa755138cd4443e8a85aa7ffa3125efb52be74f /wizards
parent1055e7ed960c1da7e7ff066578728b0b5a116918 (diff)
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
Diffstat (limited to 'wizards')
-rw-r--r--wizards/com/sun/star/wizards/web/export/FilterExporter.java66
1 files changed, 66 insertions, 0 deletions
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_);
+ }
+
+}