You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Ugo Cei <u....@cbim.it> on 2002/04/19 09:54:18 UTC

Google Web APIs and Cocoon

Thanks to the SOAP taglib, using the Google Web APIs from Cocoon is as 
simple as taking the attached XSP file, filling in your Google key 
(after having registered at http://www.google.com/apis) and putting it 
in your sitemap with a stylesheet of your liking.

You can see it live here:

<http://www.beblogging.com/blog/20020418-222559>

Just two small problems:

- caching results: this should be easy
- encoding: looks like the results are specified to be encoded in UTF-8, 
but sometimes the encoding is invalid and the following exception is 
generated:

java.io.UTFDataFormatException: invalid byte 1 of 1-byte UTF-8 sequence 
(0xfd)

Does anyone have a clue about it?

	Ugo

-- 
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: u.cei@cbim.it


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


Re: Google Web APIs and Cocoon

Posted by Ivelin Ivanov <iv...@apache.org>.
Thanks for the nice example.
It should be part of the users intro doc to Cocoon.


----- Original Message -----
From: "Ugo Cei" <u....@cbim.it>
To: <co...@xml.apache.org>
Cc: <co...@xml.apache.org>
Sent: Friday, April 19, 2002 3:21 AM
Subject: Re: Google Web APIs and Cocoon


> Ugo Cei wrote:
> > Thanks to the SOAP taglib, using the Google Web APIs from Cocoon is as
> > simple as taking the attached XSP file, filling in your Google key
>
> Oops! As usual, I forgot to attach the file. Here it goes.
>
> --
> Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
> P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
> Phone: +39.0382.525100 - E-mail: u.cei@cbim.it
>


----------------------------------------------------------------------------
----


> <?xml version="1.0" encoding="UTF-8"?>
> <xsp:page
>   language="java"
>   xmlns:xsp="http://apache.org/xsp"
>   xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>   xmlns:soap="http://apache.org/xsp/soap/3.0"
>   >
>
>   <search-results>
>     <soap:call url="http://api.google.com:80/search/beta2"
>             xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
>             xmlns:xsd="http://www.w3.org/1999/XMLSchema">
>       <ns1:doGoogleSearch xmlns:ns1="urn:GoogleSearch">
>         <key xsi:type="xsd:string">GETYOURSELFAKEY</key>
>         <q xsi:type="xsd:string"><xsp-request:get-parameter name="q"/></q>
>         <start xsi:type="xsd:int">0</start>
>         <maxResults xsi:type="xsd:int">10</maxResults>
>         <filter xsi:type="xsd:boolean">true</filter>
>         <restrict xsi:type="xsd:string"></restrict>
>         <safeSearch xsi:type="xsd:boolean">false</safeSearch>
>         <lr xsi:type="xsd:string"></lr>
>         <ie xsi:type="xsd:string">latin1</ie>
>         <oe xsi:type="xsd:string">latin1</oe>
>       </ns1:doGoogleSearch>
>     </soap:call>
>   </search-results>
> </xsp:page>
>
>


----------------------------------------------------------------------------
----


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


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


Re: Google Web APIs and Cocoon

Posted by Ugo Cei <u....@cbim.it>.
Ugo Cei wrote:
> Thanks to the SOAP taglib, using the Google Web APIs from Cocoon is as 
> simple as taking the attached XSP file, filling in your Google key 

Oops! As usual, I forgot to attach the file. Here it goes.

-- 
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: u.cei@cbim.it

Re: Google Web APIs and Cocoon

Posted by Ugo Cei <u....@cbim.it>.
Ugo Cei wrote:
> Thanks to the SOAP taglib, using the Google Web APIs from Cocoon is as 
> simple as taking the attached XSP file, filling in your Google key 

Oops! As usual, I forgot to attach the file. Here it goes.

-- 
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: u.cei@cbim.it

RE: Google Web APIs and Cocoon

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Alex McLintock [mailto:alex@OWAL.co.uk]
> 
> At 08:54 19/04/2002, Ugo Cei wrote:
> >Thanks to the SOAP taglib, using the Google Web APIs from Cocoon is
as
> >simple as taking the attached XSP file, filling in your Google key
(after
> >having registered at http://www.google.com/apis) and putting it in
your
> >sitemap with a stylesheet of your liking.
> >
> 
> 
> This looks really cool - except I am a bit confused about one thing.
Does
> Cocoon come with the necessary SOAP functionality by default or do I
need
> to install an optional component.
> 
> I have a fairly recent CVs snapshot of cocoon and it is telling me....
> 
> 
> The org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode
> notifies that org.apache.cocoon.ProcessingException says:
> SAX2 driver class org.apache.xerces.parsers.SAXParser does not
implement
> XMLReader

What's your servlet engine?
If it is Tomcat 4.0.2-4.0.3, try with 4.0.4

Vadim

> More precisely:
> org.apache.cocoon.ProcessingException: SAX2 driver class
> org.apache.xerces.parsers.SAXParser does not implement XMLReader:
> java.lang.ClassCastException:
> org.apache.xerces.parsers.StandardParserConfiguration
> 
> 
> Does this mean it doesn't understand the SOAP tags?
> 
> (Yes - I have gotten my Google API key and entered it into google.xsp
)
> 
> Alex
> 
> 
> 
> Openweb Analysts Ltd, London: Software For Complex Websites
> http://www.OWAL.co.uk/
> Free Consultancy for London Companies thinking of Open Source
Software.
> 


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Google Web APIs and Cocoon

Posted by Alex McLintock <al...@OWAL.co.uk>.
At 08:54 19/04/2002, Ugo Cei wrote:
>Thanks to the SOAP taglib, using the Google Web APIs from Cocoon is as 
>simple as taking the attached XSP file, filling in your Google key (after 
>having registered at http://www.google.com/apis) and putting it in your 
>sitemap with a stylesheet of your liking.
>


This looks really cool - except I am a bit confused about one thing. Does 
Cocoon come with the necessary SOAP functionality by default or do I need 
to install an optional component.

I have a fairly recent CVs snapshot of cocoon and it is telling me....


The org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode 
notifies that org.apache.cocoon.ProcessingException says:
SAX2 driver class org.apache.xerces.parsers.SAXParser does not implement 
XMLReader
More precisely:
org.apache.cocoon.ProcessingException: SAX2 driver class 
org.apache.xerces.parsers.SAXParser does not implement XMLReader: 
java.lang.ClassCastException: 
org.apache.xerces.parsers.StandardParserConfiguration


Does this mean it doesn't understand the SOAP tags?

(Yes - I have gotten my Google API key and entered it into google.xsp )

Alex



Openweb Analysts Ltd, London: Software For Complex Websites 
http://www.OWAL.co.uk/
Free Consultancy for London Companies thinking of Open Source Software.


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>