Hi Winfried,
It is possible to change a zip file using the API. To overwrite a
stream, a PackageStream should be retrieved from the PackageFolder, and
the interface ::com::sun::star::io::XActiveDataSink allows to provide an
input stream with a new contents for the zip-entry.
Please see the documentation in
offapi/com/sun/star/packages/PackageStream.idl for details.
But since you are changing the ODF document I would recommend to use
::com::sun::star::embed::Storage service. This API is more comfortable,
and less error-prone in use from my point of view. Please use
::com::sun::star::embed::StorageFactory service to create a storage. The
documentation in the IDL files ( StorageFactory.idl, Storage.idl, and
related services ) should give a good overview about service usage.
Questions are welcome.
Best regards,
Mikhail.
Carsten Driesner wrote:
Hi Mikhail,
kannst du Winfried helfen?
Gruß
Carsten
------------------------------------------------------------------------
Subject:
OOo: zip into ODF with Basic
From:
Winfried Rohr <[EMAIL PROTECTED]>
Date:
Sat, 19 Jan 2008 06:39:39 +0100
To:
[EMAIL PROTECTED]
To:
[EMAIL PROTECTED]
Hi Carsten,
I'm in the middle of writing an OOo extension to patch document's information
(http://extensions.services.openoffice.org/project/OOoDIP).
In order to set a user defined change date/time I need to tweak the information
in meta.xml of an ODF.
I found Laurent's routine ZipAFile() in Andrew Pitonyak's document and used it
to extract the meta.xml, which contains the info to change.
Unfortuantely (if I read the com.sun.star.packages.zip documentation correctly)
there is no *write* access to a package with that service.
By any chance: could you give me a hint HOW to write -better say- replace the meta.xml to
an ODF file structure? Any "native" OOo way (instead of using a system depended
call to a have-to-be installed ZIP utility)
Thanks alot in advance
Winfried
OOo extension author of: DateTime2, ATL2, BTL2, OOoDIL
probe1 at openoffice.org and oooforum.org
komma4 at de.openoffice.info
posting from webmailer, because still on vacation:
8°52'55"N 98°16'1" E actually 28°C
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]