Re: OOo and ZipArchive serializer
Matthias, unfortunately your patch doesn't work. The STORED method expects the file size and the crc code, which is not set. Is it possible to set the file size and CRC after the content has been written to the outputstream? If so, we can calculate/set them easily. Attached is a patch with a small sample for the ZipArchiveSerializer. The sample takes three files from the hello-world sample and returns a hello.zip file. AFAIK there's no example atm. The hello_zip.xml file should be put in src/webapp/samples/hello-world/content/. I've just committed your patch. Thanks. Upayavira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OOo and ZipArchive serializer
Hi Upayavira, unfortunately your patch doesn't work. The STORED method expects the file size and the crc code, which is not set. Attached is a patch with a small sample for the ZipArchiveSerializer. The sample takes three files from the hello-world sample and returns a hello.zip file. AFAIK there's no example atm. The hello_zip.xml file should be put in src/webapp/samples/hello-world/content/. Cheers Matthias -Ursprüngliche Nachricht- Von: Upayavira [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 12. Juni 2003 22:01 An: [EMAIL PROTECTED] Betreff: Re: OOo and ZipArchive serializer Let me know what version of Cocoon you're using and I'll try to send a correct patch. Upayavira hello_zip.xml Description: Binary data Index: src/webapp/samples/hello-world/samples.xml === RCS file: /home/cvspublic/cocoon-2.1/src/webapp/samples/hello-world/samples.xml,v retrieving revision 1.8 diff -u -r1.8 samples.xml --- src/webapp/samples/hello-world/samples.xml 4 Jun 2003 22:45:07 - 1.8 +++ src/webapp/samples/hello-world/samples.xml 13 Jun 2003 10:46:36 - @@ -70,6 +70,9 @@ Flash ... You need the appropriate plugin for your browser. (Requires block-swf.) /sample + sample name=Zip archive href=hello.zip +Some samples in a Zip archive. + /sample /group group name=Hello Office! Index: src/webapp/samples/hello-world/sitemap.xmap === RCS file: /home/cvspublic/cocoon-2.1/src/webapp/samples/hello-world/sitemap.xmap,v retrieving revision 1.10 diff -u -r1.10 sitemap.xmap --- src/webapp/samples/hello-world/sitemap.xmap 4 Jun 2003 22:45:07 - 1.10 +++ src/webapp/samples/hello-world/sitemap.xmap 13 Jun 2003 10:46:36 - @@ -101,6 +101,11 @@ map:serialize type=sxd/ /map:match + map:match pattern=hello.zip +map:generate src=content/hello_zip.xml/ +map:serialize type=zip/ + /map:match /map:pipeline + /map:pipelines /map:sitemap - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OOo and ZipArchive serializer
Well, I m not ready to post, because have some problems with ZipArchive serializer In OpenOffice Writer document (sxw) there is 4 files: meta.xml styles.xml content.xml settings.xml and a directory META-INF/ meta.xml is not compressed to allow easy searching and extraction of the meta data. Well, How can I do that, is there a ZipArchive parameter to fixe the compression level to 0% for this file? Georges Upayavira wrote: Georges, Sounds great! Well done! Now, would you be willing to write this up for the benefit of others on the Cocoon wiki? If you go to: http://wiki.cocoondev.org/Edit.jsp?page=OpenOfficeSerialization You can create a page there. That would be really helpful. Regards, Upayavira On 11 Jun 2003 at 2:23, Georges Roux wrote: It work perfectly now, but there is some error in the ZipArchive serializer documentation the end tag is wrong. /zip:archive:zip must be /zip:archive I am very happy cause now I can use this format to transform to OOo documents Thanks everybody Georges - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OOo and ZipArchive serializer
The following section of this message contains a file attachment prepared for transmission using the Internet MIME message format. If you are using Pegasus Mail, or any another MIME-compliant system, you should be able to save it or view it from within your mailer. If you cannot, please ask your system administrator for assistance. File information --- File: ZipSerializer.patch Date: 12 Jun 2003, 12:29 Size: 1968 bytes. Type: Unknown ZipSerializer.patch Description: Binary data - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OOo and ZipArchive serializer
Georges, Well, I m not ready to post, because have some problems with ZipArchive serializer In OpenOffice Writer document (sxw) there is 4 files: meta.xml styles.xml content.xml settings.xml and a directory META-INF/ meta.xml is not compressed to allow easy searching and extraction of the meta data. Well, How can I do that, is there a ZipArchive parameter to fixe the compression level to 0% for this file? Does meta.xml need to not be compressed? Won't it work with a compressed meta.xml? I've just looked into the code for the ZipSerializer (which I've never used). It doesn't allow you to specify a compression level. Now, I'm assuming you're using Cocoon 2.1. I've attached an untested patch to the ZipSerializer that should make it do what you want by adding a 'method' attribute to the 'entry' node. Have a go at applying the patch (at worst by cutting and pasting the changes, marked by +) into the code for the ZipSerializer and rebuild Cocoon. Do you think you can handle that? If it works, I'll apply it to the latest CVS. Regards, Upayavira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OOo and ZipArchive serializer
Thanks I try that way, it' usable with compression but I don't know why not to be OOo fully compliant there is a lot of documentation on SXW file format. http://xml.openoffice.org/faq.html#4 and http://xml.openoffice.org/faq.html#10 Georges Upayavira wrote: Georges, Well, I m not ready to post, because have some problems with ZipArchive serializer In OpenOffice Writer document (sxw) there is 4 files: meta.xml styles.xml content.xml settings.xml and a directory META-INF/ meta.xml is not compressed to allow easy searching and extraction of the meta data. Well, How can I do that, is there a ZipArchive parameter to fixe the compression level to 0% for this file? Does meta.xml need to not be compressed? Won't it work with a compressed meta.xml? I've just looked into the code for the ZipSerializer (which I've never used). It doesn't allow you to specify a compression level. Now, I'm assuming you're using Cocoon 2.1. I've attached an untested patch to the ZipSerializer that should make it do what you want by adding a 'method' attribute to the 'entry' node. Have a go at applying the patch (at worst by cutting and pasting the changes, marked by +) into the code for the ZipSerializer and rebuild Cocoon. Do you think you can handle that? If it works, I'll apply it to the latest CVS. Regards, Upayavira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OOo and ZipArchive serializer
Sorry, the patch fail I think, it's better to wait some time a next version, to have a Zip serializer more efficient. patch ZipSerializer.patch patching file ZipArchiveSerializer.java Hunk #1 FAILED at 111. Hunk #2 FAILED at 288. 2 out of 2 hunks FAILED -- saving rejects to file ZipArchiveSerializer.java.rej Georges Upayavira wrote: The following section of this message contains a file attachment prepared for transmission using the Internet MIME message format. If you are using Pegasus Mail, or any another MIME-compliant system, you should be able to save it or view it from within your mailer. If you cannot, please ask your system administrator for assistance. File information --- File: ZipSerializer.patch Date: 12 Jun 2003, 12:29 Size: 1968 bytes. Type: Unknown - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** *** 111,120 // TODO (2) : handle more attributes on entry for properties of ZipEntry //(compression method and level, time, comment, etc.) - public class ZipArchiveSerializer - extends AbstractSerializer implements Composable, Disposable { - /** * The namespace for elements handled by this serializer, * http://apache.org/cocoon/zip-archive/1.0;. --- 111,120 // TODO (2) : handle more attributes on entry for properties of ZipEntry //(compression method and level, time, comment, etc.) + public class ZipArchiveSerializer + extends AbstractSerializer implements Composable, Disposable { + /** * The namespace for elements handled by this serializer, * http://apache.org/cocoon/zip-archive/1.0;. *** *** 288,297 new SAXException(Cannot specify both 'src' and 'serializer' on a Zip entry ' + name + '); } Source source = null; try { // Create a new Zip entry ZipEntry entry = new ZipEntry(name); this.zipOutput.putNextEntry(entry); if (src != null) { --- 288,311 new SAXException(Cannot specify both 'src' and 'serializer' on a Zip entry ' + name + '); } + String method = atts.getValue(method); + if (method!=null) { + if (!method.equalsIgnoreCase(STORED) !method.equalsIgnoreCase(DEFLATED)) { + throw this.exception = +new SAXException(Method attribute must be either STORED or DEFLATED); + } + } Source source = null; try { // Create a new Zip entry ZipEntry entry = new ZipEntry(name); + + if (STORED.equalsIgnoreCase(method)) { + entry.setMethod(ZipEntry.STORED); + } else if (DEFLATED.equalsIgnoreCase(method)) { + entry.setMethod(ZipEntry.DEFLATED); + } + this.zipOutput.putNextEntry(entry); if (src != null) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OOo and ZipArchive serializer
Let me know what version of Cocoon you're using and I'll try to send a correct patch. Upayavira On 12 Jun 2003 at 19:49, Georges Roux wrote: Sorry, the patch fail I think, it's better to wait some time a next version, to have a Zip serializer more efficient. patch ZipSerializer.patch patching file ZipArchiveSerializer.java Hunk #1 FAILED at 111. Hunk #2 FAILED at 288. 2 out of 2 hunks FAILED -- saving rejects to file ZipArchiveSerializer.java.rej Georges Upayavira wrote: The following section of this message contains a file attachment prepared for transmission using the Internet MIME message format. If you are using Pegasus Mail, or any another MIME-compliant system, you should be able to save it or view it from within your mailer. If you cannot, please ask your system administrator for assistance. File information --- File: ZipSerializer.patch Date: 12 Jun 2003, 12:29 Size: 1968 bytes. Type: Unknown - --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OOo
Georges, Sounds great! Well done! Now, would you be willing to write this up for the benefit of others on the Cocoon wiki? If you go to: http://wiki.cocoondev.org/Edit.jsp?page=OpenOfficeSerialization You can create a page there. That would be really helpful. Regards, Upayavira On 11 Jun 2003 at 2:23, Georges Roux wrote: It work perfectly now, but there is some error in the ZipArchive serializer documentation the end tag is wrong. /zip:archive:zip must be /zip:archive I am very happy cause now I can use this format to transform to OOo documents Thanks everybody Georges - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OOo
Hi Georges, your snippet looks nice to me ! But beware of strange 'duplicate zip entry'-Exceptions. Usually they are caused by a nonexisting or empty src-URL. I am going to check the existence of the content before calling the zip serializer. Good Luck Andrew zip:archive xmlns:zip=http://apache.org/cocoon/zip-archive/1.0; zip:entry name=content.xml src=cocoon://OOo/content.xml/ zip:entry name=meta.xml src=cocoon://OOo/meta.xml/ zip:entry name=settings.xml src=cocoon://OOo/settings.xml/ zip:entry name=styles.xml src=cocoon://OOo/styles.xml/ /zip:archive Mit der Grupppen-SMS von WEB.DE FreeMail können Sie eine SMS an alle Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OOo
Ok, thanks but I get an Exception UnamedSelector: ComponentSelector could not find the component for int[OOo] I try the with the zip serializer but with the same exeption [zip] something is wrong georges Andreas Kühne wrote: Hi Georges, your snippet looks nice to me ! But beware of strange 'duplicate zip entry'-Exceptions. Usually they are caused by a nonexisting or empty src-URL. I am going to check the existence of the content before calling the zip serializer. Good Luck Andrew zip:archive xmlns:zip=http://apache.org/cocoon/zip-archive/1.0; zip:entry name=content.xml src=cocoon://OOo/content.xml/ zip:entry name=meta.xml src=cocoon://OOo/meta.xml/ zip:entry name=settings.xml src=cocoon://OOo/settings.xml/ zip:entry name=styles.xml src=cocoon://OOo/styles.xml/ /zip:archive Mit der Grupppen-SMS von WEB.DE FreeMail können Sie eine SMS an alle Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OOo
Sounds like the zip serializer is not declared in your sitemap or any higher level sitemaps. I don't think it's declared by default in the root sitemap in the distribution. Geoff At 10:55 AM 6/10/2003, you wrote: Ok, thanks but I get an Exception UnamedSelector: ComponentSelector could not find the component for int[OOo] I try the with the zip serializer but with the same exeption [zip] something is wrong georges Andreas Kühne wrote: Hi Georges, your snippet looks nice to me ! But beware of strange 'duplicate zip entry'-Exceptions. Usually they are caused by a nonexisting or empty src-URL. I am going to check the existence of the content before calling the zip serializer. Good Luck Andrew zip:archive xmlns:zip=http://apache.org/cocoon/zip-archive/1.0; zip:entry name=content.xml src=cocoon://OOo/content.xml/ zip:entry name=meta.xml src=cocoon://OOo/meta.xml/ zip:entry name=settings.xml src=cocoon://OOo/settings.xml/ zip:entry name=styles.xml src=cocoon://OOo/styles.xml/ /zip:archive Mit der Grupppen-SMS von WEB.DE FreeMail können Sie eine SMS an alle Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OOo
It work perfectly now, but there is some error in the ZipArchive serializer documentation the end tag is wrong. /zip:archive:zip must be /zip:archive I am very happy cause now I can use this format to transform to OOo documents Thanks everybody Georges Geoff Howard wrote: Sounds like the zip serializer is not declared in your sitemap or any higher level sitemaps. I don't think it's declared by default in the root sitemap in the distribution. Geoff At 10:55 AM 6/10/2003, you wrote: Ok, thanks but I get an Exception UnamedSelector: ComponentSelector could not find the component for int[OOo] I try the with the zip serializer but with the same exeption [zip] something is wrong georges Andreas Kühne wrote: Hi Georges, your snippet looks nice to me ! But beware of strange 'duplicate zip entry'-Exceptions. Usually they are caused by a nonexisting or empty src-URL. I am going to check the existence of the content before calling the zip serializer. Good Luck Andrew zip:archive xmlns:zip=http://apache.org/cocoon/zip-archive/1.0; zip:entry name=content.xml src=cocoon://OOo/content.xml/ zip:entry name=meta.xml src=cocoon://OOo/meta.xml/ zip:entry name=settings.xml src=cocoon://OOo/settings.xml/ zip:entry name=styles.xml src=cocoon://OOo/styles.xml/ /zip:archive Mit der Grupppen-SMS von WEB.DE FreeMail können Sie eine SMS an alle Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]