forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Schaefer <johannes.schae...@uidesign.de>
Subject Re: google desktop search in forrest
Date Fri, 18 Mar 2005 08:58:41 GMT
OK, here is what I've done and some questions.

To experiment I created a project with a local
sitemap.xmap [1]. This contains a fixed search
request to the google search server at port 4664.
"format=xml" gives us a nice XML file back where
we can extract and present the information [2]

So far this works fine.

Now I need to insert the search term dynamically
from the form on the page. I simply don't know how
to do that. Do I need to create a Cocoon action?

To experiment yourself you'll have to look up
<your-security-token> in the Windows registry:
HKEY_CURRENT_USER\Software\Google\Google Desktop\API\search_url
For the final solution I would think the user
hast to specify this in skinconf.xml/search.
Mind you: all this is Windows only and needs
Google Desktop Search installed on the server.

And as I'm writing this: this is only a "live"
solution ... and here we have Lucene. Hum.

Then maybe there's no way to make it work since
the search is only accessible from the machine
it runs on. Will have to think this over again.

Cheers
Johannes


[1] sitemap.xmap
-- 
<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  <map:pipelines>

   <map:pipeline>
    <map:match pattern="google-local-search.xml">
     <map:generate
src="http://127.0.0.1:4664/search&amp;s=<your-security-token>?q=forrest&amp;format=xml&amp;num=100"


     />
     <map:transform 
src="{project:resources.stylesheets}/google2document.xsl" />
     <map:serialize type="xml"/>
    </map:match>
   </map:pipeline>

  </map:pipelines>
</map:sitemap>
-- 

[2]
-- 
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<xsl:template match="/">
   <document>
     <body>
       <section><title>Search Results</title>
         <xsl:apply-templates 
select="results/result[category='web']"/>
       </section>
     </body>
   </document>
</xsl:template>

<xsl:template match="result">
   <section>
     <title><xsl:apply-templates select="title" /></title>
     <p><a href="{url}"><xsl:value-of select="url" /></a></p>
     <p><xsl:apply-templates select="snippet"/></p>
   </section>
</xsl:template>


<xsl:template match="title">
    <xsl:apply-templates/>
</xsl:template>


<xsl:template match="b">
   <strong><xsl:value-of select="."/></strong>
</xsl:template>

</xsl:stylesheet>
-- 



Ross Gardler wrote:
> Johannes Schaefer wrote:
> 
>> Hi!
>>
>> Is there a way to use the Google desktop search
>> from within Google (as an replacement of either
>> Lucene which only works in "live" mode or Google
>> which does not work on an intranet)?
>>
>> Johannes
>>
>> Ref.
>>   http://desktop.google.com/
>>   http://desktop.google.com/developerguide.html#searchapi
>>
> 
> Not currently.
> 
> I don't know Google Desktop search but I think this will be easy to add. 
> The search functionality is added in your skins site2xhtml.xsl file
> 
> Search that file for "start Search" and you'll find the relevant bit.
> 
> If you ge this working this would be a great contribution to our code.
> 
> Ross
> 
> 


-- 
User Interface Design GmbH * Teinacher Str. 38 * D-71634 
Ludwigsburg
Fon +49 (0)7141 377 000 * Fax  +49 (0)7141 377 00-99
Geschäftsstelle: User Interface Design GmbH * 
Lehrer-Götz-Weg 11 * D-81825 München
www.uidesign.de

Buch "User Interface Tuning" von Joachim Machate & Michael 
Burmester
www.user-interface-tuning.de

Besuchen Sie uns auf der Hannover Messe 11.-15. April 2005
Halle 2, Stand C14 auf dem MMI Gemeinschaftsstand
www.uidesign.de/hmi2005

Nächstes TAE-Seminar zu User Interface Design
Ostfildern-Nellingen, 07.-08. April 2005
www.tae.de TAE-Veranstaltung Nr. 31189

Mime
View raw message