summaryrefslogtreecommitdiff
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
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
-rw-r--r--reportbuilder/java/com/sun/star/report/StorageRepository.java3
-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
-rw-r--r--reportbuilder/util/description.xml2
4 files changed, 46 insertions, 11 deletions
diff --git a/reportbuilder/java/com/sun/star/report/StorageRepository.java b/reportbuilder/java/com/sun/star/report/StorageRepository.java
index bf5687da14ae..b32bcb3dab86 100644
--- a/reportbuilder/java/com/sun/star/report/StorageRepository.java
+++ b/reportbuilder/java/com/sun/star/report/StorageRepository.java
@@ -70,6 +70,7 @@ public class StorageRepository implements InputRepository, OutputRepository
{
this.input = input;
this.output = output;
+
}
public StorageRepository(final XStorage storage, final boolean isOutput)
@@ -118,7 +119,7 @@ public class StorageRepository implements InputRepository, OutputRepository
}
try
{
- final XStream stream = (XStream) UnoRuntime.queryInterface(XStream.class, output.openStreamElement(name, ElementModes.WRITE | ElementModes.TRUNCATE));
+ final XStream stream = output.openStreamElement(name, ElementModes.WRITE | ElementModes.TRUNCATE);
stream.getInputStream().closeInput();
if (mimeType != null)
{
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");
+ }
+ }
}
diff --git a/reportbuilder/util/description.xml b/reportbuilder/util/description.xml
index 6e9dc128271a..5a9bef4a5532 100644
--- a/reportbuilder/util/description.xml
+++ b/reportbuilder/util/description.xml
@@ -3,7 +3,7 @@
xmlns:d="http://openoffice.org/extensions/description/2006"
xmlns:xlink="http://www.w3.org/1999/xlink">
<display-name>
- <name lang="en-US">Sun™ Report Builder</name>
+ <name lang="en-US">Sun Report Builder</name>
<!-- <name lang="en-US">Sun(TM) Report Builder</name> -->
</display-name>
<registration>