You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Georges Roux <ge...@pacageek.org> on 2003/06/12 12:12:54 UTC

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: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: OOo and ZipArchive serializer

Posted by Upayavira <uv...@upaya.co.uk>.
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: cocoon-users-unsubscribe@xml.apache.org For
> >additional commands, e-mail: cocoon-users-help@xml.apache.org
> >
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Get values from Postgres database

Posted by Markus Blasl <bl...@fzi.de>.
Hello,

i want to set up an application with a postgres database.
It's my first contact with cocoon so far, maybe someone can help.
What I did so far:
Installed  Postgres, Apache, Tomcat and Cocoon.
Everything is working fine, and I also played a little bit with the 
cocoon features.

Now I  downloaded the JDBC-Driver for Postgres and put it into cocoons 
lib dir.
then edited web.xml:

<init-param>
     <param-name>load-class</param-name>
     <param-value>
       <!-- For IBM WebSphere:
       com.ibm.servlet.classloader.Handler -->

       <!-- For Database Driver: -->
       org.hsqldb.jdbcDriver
   org.postgresql.Driver
       <!-- For parent ComponentManager sample:
       org.apache.cocoon.samples.parentcm.Configurator
       -->
     </param-value>
   </init-param>

And I also edited cocoon.xconf:

<datasources>
   <jdbc name="films">
     <pool-controller min="5" max="10"/>
   <dburl>jdbc:postgresql:test://localhost:5432</dburl>
     <user>blasl</user>
     <password/>
   </jdbc>
 </datasources>

If i put there something other then test (my database) thn on tty0 comes 
up DATABASE ... not found. So I guess that everything is set up ok so far.

Now I created a new directory under mount and put an xml-file in there:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:sql="http://apache.org/cocoon/SQL/v2"
 >
<page>
 <sql:connection>
   <sql:pool>films</sql:pool>
   <transactions>
     <sql:execute-query>
     <sql:query>
       select * from films
     </sql:query>
     <sql:results>
            <sql:row-results>
              <trans>
                <id>
                  <sql:get-string column="code"/>
                </id>
        <my_title>
          <sql:get-string column="title"/>
        </my_title>
                <date1>
                  <sql:get-date column="date_prod"
                     format="dd. MMM. yyyy"/>
                </date1>
                <date2>
                  <sql:get-date column="date_in"
                     format="dd. MMM. yyyy"/>
                </date2>
                <account>
                  <sql:get-string column="kind"/>
                </account>
              </trans>
            </sql:row-results>
          </sql:results>
          <sql:no-results>
            No records found...
          </sql:no-results>
          <sql:error-results>
            SQL Exception: <sql:get-message/>
          </sql:error-results>
        </sql:execute-query>
      </transactions>
    </sql:connection>
  </page>
  </xsp:page>

I also have my own sitemap.xmap file in there:

<?xml version="1.0" encoding="iso-8859-1"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">

   <!-- use the standard components -->
   <map:components>
       <map:generators default="file"/>
       <map:transformers default="xslt"/>
       <map:readers default="resource"/>
       <map:serializers default="html"/>
       <map:selectors default="browser"/>
       <map:matchers default="wildcard"/>
   </map:components>
       <map:pipelines>
       <map:pipeline>
           <!-- respond to *.html requests with
                our docs processed by doc2html.xsl -->
           <map:match pattern="*.html">
               <map:generate src="{1}.xml"/>
               <map:transform src="doc2html.xsl"/>
               <map:serialize type="html"/>
           </map:match>
         <map:match pattern="sql/*">

    <map:transform type="sql">
    <map:parameter name="use-connection" value="films"/>
    </map:transform>
    <map:transform src="stylesheets/simple-sql2html.xsl"/>
    <map:serialize/>
   </map:match>
   </map:pipeline>
   </map:pipelines>
</map:sitemap>

This is the table of my database:
             Table "public.films"
 Column   |          Type           | Modifiers
-----------+-------------------------+-----------
code      | character(5)            | not null
title     | character varying(40)   | not null
date_prod | date                    |
date_in   | date                    |
kind      | character(15)           |
len       | interval hour to minute |
Indexes: firstkey primary key btree (code)



When I now try to get the html-output of the xml file, all i get is this:

films select * from films No records found... SQL Exception:


Please, if anyone has an idea how to fix  it, I'd really be happy.

Thanks in advance,

Markus




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: OOo and ZipArchive serializer

Posted by Georges Roux <ge...@pacageek.org>.
 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: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>

Re: OOo and ZipArchive serializer

Posted by Upayavira <uv...@upaya.co.uk>.
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

Re: OOo and ZipArchive serializer

Posted by Georges Roux <ge...@pacageek.org>.
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: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: OOo and ZipArchive serializer

Posted by Upayavira <uv...@upaya.co.uk>.
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: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org