Tag: cws_src680_oj14
User: fs      
Date: 2007-06-20 19:13:18+0000
Modified:
   dba/reportdesign/java/com/sun/star/report/pentaho/output/ImageProducer.java
   
dba/reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java

Log:
 #i78373# no manifest file anymore - output repository is responsible for 
creating it

File Changes:

Directory: /dba/reportdesign/java/com/sun/star/report/pentaho/output/
=====================================================================

File [changed]: ImageProducer.java
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/output/ImageProducer.java?r1=1.1.2.5&r2=1.1.2.6
Delta lines:  +5 -16
--------------------
--- ImageProducer.java  2007-06-19 11:55:07+0000        1.1.2.5
+++ ImageProducer.java  2007-06-20 19:13:15+0000        1.1.2.6
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ImageProducer.java,v $
  *
- *  $Revision: 1.1.2.5 $
+ *  $Revision: 1.1.2.6 $
  *
- *  last change: $Author: fs $ $Date: 2007/06/19 11:55:07 $
+ *  last change: $Author: fs $ $Date: 2007/06/20 19:13:15 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -162,17 +162,11 @@
   private OutputRepository outputRepository;
   private ImageService imageService;
   private DefaultNameGenerator nameGenerator;
-  private OfficeManifest manifest;
 
   public ImageProducer(final InputRepository inputRepository,
                        final OutputRepository outputRepository,
-                       final ImageService imageService,
-                       final OfficeManifest manifest)
+                       final ImageService imageService)
   {
-    if (manifest == null)
-    {
-      throw new NullPointerException();
-    }
     if (inputRepository == null)
     {
       throw new NullPointerException();
@@ -190,7 +184,6 @@
     this.outputRepository = outputRepository;
     this.imageService = imageService;
     this.imageCache = new HashMap();
-    this.manifest = manifest;
     this.nameGenerator = new DefaultNameGenerator(outputRepository);
   }
 
@@ -291,7 +284,7 @@
       // 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);
+      final OutputStream outputStream = 
outputRepository.createOutputStream(name, mimeType);
       final ByteArrayInputStream bin = new ByteArrayInputStream(data);
 
       try
@@ -307,7 +300,6 @@
       final CSSNumericValue heightVal = 
CSSNumericValue.createValue(CSSNumericType.MM, dims.getHeight() / 100.0);
       final OfficeImage officeImage = new OfficeImage(name, widthVal, 
heightVal);
       imageCache.put(imageKey, officeImage);
-      manifest.addEntry(name, mimeType);
       return officeImage;
     }
     catch (IOException e)
@@ -367,7 +359,6 @@
         final String filename = copyToOutputRepository(mimeType, source, data);
         final OfficeImage officeImage = new OfficeImage(filename, widthVal, 
heightVal);
         imageCache.put(source, officeImage);
-        manifest.addEntry(filename, mimeType);
         return officeImage;
       }
       catch (IOException e)
@@ -425,7 +416,6 @@
       final String file = url.getFile();
       final String name = copyToOutputRepository(mimeType, file, data);
       final OfficeImage officeImage = new OfficeImage(name, widthVal, 
heightVal);
-      manifest.addEntry(name, mimeType);
       imageCache.put(url, officeImage);
       return officeImage;
     }
@@ -464,7 +454,7 @@
 
     // copy the image into the local output-storage
     final String name = nameGenerator.generateName("Pictures/image", mimeType);
-    final OutputStream outputStream = 
outputRepository.createOutputStream(name);
+    final OutputStream outputStream = 
outputRepository.createOutputStream(name, mimeType);
     final ByteArrayInputStream bin = new ByteArrayInputStream(data);
 
     try
@@ -475,7 +465,6 @@
     {
       outputStream.close();
     }
-    manifest.addEntry("Pictures/", "");
     return name;
   }
 

File [changed]: OfficeDocumentReportTarget.java
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java?r1=1.1.2.10&r2=1.1.2.11
Delta lines:  +5 -22
--------------------
--- OfficeDocumentReportTarget.java     2007-06-19 11:55:08+0000        1.1.2.10
+++ OfficeDocumentReportTarget.java     2007-06-20 19:13:15+0000        1.1.2.11
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: OfficeDocumentReportTarget.java,v $
  *
- *  $Revision: 1.1.2.10 $
+ *  $Revision: 1.1.2.11 $
  *
- *  last change: $Author: fs $ $Date: 2007/06/19 11:55:08 $
+ *  last change: $Author: fs $ $Date: 2007/06/20 19:13:15 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -247,7 +247,6 @@
   private static final boolean DEBUG_ELEMENTS =
       JFreeReportBoot.getInstance().getExtendedConfig().getBoolProperty
       ("com.sun.star.report.pentaho.output.DebugElements");
-  private OfficeManifest manifest;
 
   protected OfficeDocumentReportTarget(final ReportJob reportJob,
                                        final ResourceManager resourceManager,
@@ -277,20 +276,7 @@
     this.xmlWriters = new FastStack();
     this.imageNames = new AttributeNameGenerator();
 
-    this.manifest = new OfficeManifest();
-    this.manifest.addEntry("/", getTargetMimeType());
-    this.manifest.addEntry("content.xml", "text/xml");
-
-    if (outputRepository.exists("settings.xml"))
-    {
-      manifest.addEntry("settings.xml", "text/xml");
-    }
-    if (outputRepository.exists("meta.xml"))
-    {
-      manifest.addEntry("meta.xml", "text/xml");
-    }
-
-    this.imageProducer = new ImageProducer(inputRepository, outputRepository, 
imageService, manifest);
+    this.imageProducer = new ImageProducer(inputRepository, outputRepository, 
imageService);
 
     try
     {
@@ -327,7 +313,7 @@
     final DefaultTagDescription tagDescription = createTagDescription();
     try
     {
-      final OutputStream outputStream = 
outputRepository.createOutputStream(target);
+      final OutputStream outputStream = 
outputRepository.createOutputStream(target,"text/xml");
       final Writer writer = new OutputStreamWriter(outputStream, "UTF-8");
 
       this.rootXmlWriter = new XmlWriter(writer, tagDescription);
@@ -937,9 +923,8 @@
       final BufferState state = finishBuffering();
       this.rootXmlWriter.writeStream(state.getXmlAsReader());
 
-      manifest.addEntry("styles.xml", "text/xml");
       final OutputStream stylesOutStream =
-          outputRepository.createOutputStream("styles.xml");
+          outputRepository.createOutputStream("styles.xml","text/xml");
       final OutputStreamWriter osw =
           new OutputStreamWriter(stylesOutStream, "UTF-8");
       final StylesWriter stylesWriter = new StylesWriter(osw);
@@ -949,8 +934,6 @@
 
       this.rootXmlWriter.writeCloseTag();
       this.rootXmlWriter.close();
-
-      manifest.write(outputRepository);
     }
     catch (IOException e)
     {




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to