summaryrefslogtreecommitdiff
path: root/reportbuilder/java/com/sun/star/report/pentaho
diff options
context:
space:
mode:
authorHans-Joachim Lankenau <hjs@openoffice.org>2009-03-23 15:36:37 +0000
committerHans-Joachim Lankenau <hjs@openoffice.org>2009-03-23 15:36:37 +0000
commit60b884d262229438377396d1eee614f93a3fd2fd (patch)
treeeb753bf6b6d9135ecf7fa414593fd95698858d8d /reportbuilder/java/com/sun/star/report/pentaho
parentdc0c53db2abd77ae481ba30280b153cca47c3230 (diff)
CWS-TOOLING: integrate CWS dba31j_DEV300
2009-03-11 12:24:24 +0100 iha r269311 : #i100102# report donut charts crash on load 2009-03-11 10:44:35 +0100 oj r269302 : #i100102# export meta.xml 2009-03-11 07:35:03 +0100 oj r269296 : #i99686# not used anymore 2009-03-11 07:34:27 +0100 oj r269295 : #i99686# not used anymore 2009-03-11 07:33:57 +0100 oj r269294 : #i99686# change storage usage 2009-03-10 15:21:41 +0100 mav r269275 : #i99686# test additional scenario 2009-03-10 08:37:10 +0100 mav r269239 : #i100040# calculate the name length correctly 2009-03-10 08:25:16 +0100 mav r269236 : #i99686# workaround to prevent crash while disposing the hierarchical stream 2009-03-10 07:14:05 +0100 oj r269235 : #i99686# fix usage of storage api 2009-03-10 07:13:17 +0100 oj r269234 : #i99686# fix usage of storage api 2009-03-09 13:33:26 +0100 fs r269085 : #i100012# 2009-03-09 13:11:08 +0100 fs r269081 : #i100036# don't store sub documents which have not been touched 2009-03-09 11:21:17 +0100 fs r269070 : #i100040# don't silence errors in impl_storeToStorage_throw 2009-03-09 10:28:48 +0100 oj r269065 : #i100036# throw exception when no activeConnection exists
Diffstat (limited to 'reportbuilder/java/com/sun/star/report/pentaho')
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java22
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java30
2 files changed, 43 insertions, 9 deletions
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java b/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java
index 94f2d4fffad0..9866d1a41c5e 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java
@@ -146,7 +146,7 @@ public class ImageProducer
final byte b = keyData[i];
hashValue = b + hashValue * 23;
}
- this.hashCode = new Integer(hashValue);
+ this.hashCode = Integer.valueOf(hashValue);
return hashValue;
}
}
@@ -154,7 +154,6 @@ public class ImageProducer
private final InputRepository inputRepository;
private final OutputRepository outputRepository;
private final ImageService imageService;
- private final DefaultNameGenerator nameGenerator;
public ImageProducer(final InputRepository inputRepository,
final OutputRepository outputRepository,
@@ -177,7 +176,6 @@ public class ImageProducer
this.outputRepository = outputRepository;
this.imageService = imageService;
this.imageCache = new HashMap();
- this.nameGenerator = new DefaultNameGenerator(outputRepository);
}
/**
@@ -275,8 +273,10 @@ public class ImageProducer
// copy the image into the local output-storage
// todo: Implement data-fingerprinting so that we can detect the mime-type
- final String name = nameGenerator.generateName("Pictures/image", mimeType);
- final OutputStream outputStream = outputRepository.createOutputStream(name, mimeType);
+ final OutputRepository storage = outputRepository.openOutputRepository("Pictures", null);
+ final DefaultNameGenerator nameGenerator = new DefaultNameGenerator(storage);
+ final String name = nameGenerator.generateName("image", mimeType);
+ final OutputStream outputStream = storage.createOutputStream(name, mimeType);
final ByteArrayInputStream bin = new ByteArrayInputStream(data);
try
@@ -285,11 +285,12 @@ public class ImageProducer
} finally
{
outputStream.close();
+ storage.closeOutputRepository();
}
final CSSNumericValue widthVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getWidth() / 100.0);
final CSSNumericValue heightVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getHeight() / 100.0);
- final OfficeImage officeImage = new OfficeImage(name, widthVal, heightVal);
+ final OfficeImage officeImage = new OfficeImage("Pictures/" + name, widthVal, heightVal);
imageCache.put(imageKey, officeImage);
return officeImage;
}
@@ -442,8 +443,10 @@ public class ImageProducer
}
// copy the image into the local output-storage
- final String name = nameGenerator.generateName("Pictures/image", mimeType);
- final OutputStream outputStream = outputRepository.createOutputStream(name, mimeType);
+ final OutputRepository storage = outputRepository.openOutputRepository("Pictures", null);
+ final DefaultNameGenerator nameGenerator = new DefaultNameGenerator(storage);
+ final String name = nameGenerator.generateName("image", mimeType);
+ final OutputStream outputStream = storage.createOutputStream(name, mimeType);
final ByteArrayInputStream bin = new ByteArrayInputStream(data);
try
@@ -452,7 +455,8 @@ public class ImageProducer
} finally
{
outputStream.close();
+ storage.closeOutputRepository();
}
- return name;
+ return "Pictures/" + name;
}
}
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java
index a98b64495579..56a2c036f2e8 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java
@@ -38,12 +38,16 @@ import com.sun.star.report.OfficeToken;
import com.sun.star.report.pentaho.PentahoReportEngineMetaData;
import com.sun.star.report.pentaho.output.OfficeDocumentReportTarget;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import org.jfree.layouting.util.AttributeMap;
import org.jfree.report.DataFlags;
import org.jfree.report.DataSourceException;
import org.jfree.report.ReportProcessingException;
import org.jfree.report.flow.ReportJob;
+import org.jfree.report.flow.ReportStructureRoot;
import org.jfree.report.flow.ReportTargetUtil;
+import org.pentaho.reporting.libraries.base.util.IOUtils;
import org.pentaho.reporting.libraries.resourceloader.ResourceKey;
import org.pentaho.reporting.libraries.resourceloader.ResourceManager;
import org.pentaho.reporting.libraries.xmlns.common.AttributeList;
@@ -253,4 +257,30 @@ public class ChartRawReportTarget extends OfficeDocumentReportTarget
}
super.processText(text);
}
+ public void endReport(final ReportStructureRoot report)
+ throws DataSourceException, ReportProcessingException
+ {
+ super.endReport(report);
+ try
+ {
+ // now copy the meta.xml
+ if (getInputRepository().isReadable("meta.xml"))
+ {
+ final InputStream inputStream = getInputRepository().createInputStream("meta.xml");
+ try
+ {
+ final OutputStream outputMetaStream = getOutputRepository().createOutputStream("meta.xml", "text/xml");
+ IOUtils.getInstance().copyStreams(inputStream, outputMetaStream);
+ outputMetaStream.close();
+ } finally
+ {
+ inputStream.close();
+ }
+ }
+ }
+ catch (IOException ioe)
+ {
+ throw new ReportProcessingException("Failed to write settings document");
+ }
+ }
}