Kaydet (Commit) 60b884d2 authored tarafından Hans-Joachim Lankenau's avatar Hans-Joachim Lankenau

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
üst dc0c53db
......@@ -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)
{
......
......@@ -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;
}
}
......@@ -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");
}
}
}
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment