Skip to main content.
home | support | download

Back to List Archive

Re: Templates and swishcgi.conf

From: Thomas Nyman <thomas(at)not-real.teg.pp.se>
Date: Sat May 14 2005 - 08:19:12 GMT
Seeker of rewards

The goal

I wish to use templates so that I can incorporate the swish.cgi 
appearance to conform with my other webpages. Beyond that I would like 
to be able to deal with multiple indexes and understand metanames.

What I did

I read the swish.cgi and copied

{
#           title           => 'Search Our Site',
#           swish_index     => 'index.web',
#
#           template => {
#            package         => 'SWISH::TemplateToolkit',
#            file            => 'search.tt',
#            options         => {
#                INCLUDE_PATH    => '/home/user/swish-e/example',
#            },
#       };

to my .swishcgi.conf which contained as follows (before I pasted)


return {

         {
         title => 'Dokument Arkiv',
         swish_binary => '/usr/local/bin/swish-e',
         swish_index => '/Users/medarbetare/Public/index/index.swish-e',
         prepend_path => '/arkiv/'
         }
}

Thus, after my creativity my .swishcgi.conf looks like this

return {

         {
         title => 'Dokument Arkiv',
         swish_binary => '/usr/local/bin/swish-e',
         swish_index => '/Users/medarbetare/Public/index/index.swish-e',
         prepend_path => '/arkiv/'
         }


         {
            title           => 'Search Our Site',
            swish_index     => 'index.swish-e',

            template => {
                         package         => 'SWISH::TemplateToolkit',
                         file            => 'search.tt',
                         options         => {
                         INCLUDE_PATH    => 
'/usr/local/share/doc/swish-e/examples',
                         },
        };
}

In this state it does not work


After monkeying about I have the following swishcgi.conf

return {

         {
         title => 'Advokatteamets Dokument Arkiv',
         swish_binary => '/usr/local/bin/swish-e',
         swish_index => '/Users/medarbetare/Public/index/index.swish-e',
         prepend_path => '/arkiv/'




            template => {
                         package         => 'SWISH::TemplateToolkit',
                         file            => 
'/usr/local/share/swish-e/search.tt',
                         }
         }
}

which alas does not work

My apache error log shows

Config file '.swishcgi.conf': syntax error at .swishcgi.conf line 13, 
near "template"
[Sat May 14 10:11:44 2005] [error] [client 10.10.10.7] Premature end of 
script headers: /Library/WebServer/CGI-Executables/swish.cgi
Odd number of elements in anonymous hash at .swishcgi.conf line 5.
Odd number of elements in anonymous hash at .swishcgi.conf line 5.
Odd number of elements in anonymous hash at .swishcgi.conf line 5.

And so I here I stand, at a loss, a thick gooey fluid trickles down the 
left side of my chin, my eyes are glazed, and it would really not be 
that hard to convince me that miracles do happen

..in other words..arrrghhhhh!




2005-05-13 kl. 15.58 skrev Bill Moseley:

> On Thu, May 12, 2005 at 10:24:09PM -0700, Thomas Nyman wrote:
>> Hi
>>
>> I've been trying to get template to work with little success so far. I
>> tried to follow the config suggestion mentioned in swish.cgi. I have
>> installed the necessary perl modules as far as I know, but I cant seem
>> to get a .swishcgi.conf file that works. Could someone perhaps post
>> their .swishcgi.conf file as it pertains to usiing templates?
>
> There's an example at the top of swish.cgi.
>
> Describe what you want to do and show what you have tried and what
> happens or doesn't happen when you run the script and you will be
> rewarded.
>
> -- 
> Bill Moseley
> moseley@hank.org
>
> Unsubscribe from or help with the swish-e list:
>    http://swish-e.org/Discussion/
>
> Help with Swish-e:
>    http://swish-e.org/current/docs
>    swish-e@sunsite.berkeley.edu
>
Received on Sat May 14 01:19:16 2005