Skip to main content.
home | support | download

Back to List Archive

[swish-e] Passing Parameters through Swish-e to use in additional hyperlinks/forms

From: Richard Byrne MRCVS Partner <richard(at)not-real.westbarvets.co.uk>
Date: Tue Dec 16 2008 - 10:02:36 GMT
Dear Peter

Thank you very much  - I simply cloned the default Template.pm module being 
used as per your instructions and inserted a little snippet of html code in 
the sub show_result section such:-
--SNIP
 return <<EOF;
    <dl>
        <dt>$this_result->{swishreccount} 
<a href="$this_result->{swishdocpath_href}">$title</a> 
<small>-- rank: <b>$this_result->{swishrank}</b></small></dt>
        <dd>$description
        <HR>
<form name="form1" method="post" action="/cgi-bin/email.pl">
<input name="File" type="hidden" id="File" value="$this_result->
{swishdocpath}">
E-mail this file to ...
<input name="Email" size="60" type=text value="";>
<small> (insert full email address of recipient)</small>
<input type="submit" name="Submit" 
value="Send!">
</form>
<HR>
        $props
        </dd>
    </dl>

EOF
--SNIP

However I have one more request please.

We start the program that runs swish from a Unix shell script and pass the 
search parameters from this script. As you can see from the snippet above we 
have to enter the email address into the 'html form' created in swish before 
we can email the indexed PDF to the recipient - we know broadly what is in 
the file so don't need to read it.

Is there any way of including 1 or more 'dummy / user defined parameters' in 
the swish-e shell script that are simply passed through the swish program ( 
and ignored by it ) but are 'recoverable' and usable in the form snippet so 
that one would not have to manually reenter the email address etc manually  -
 you would just simply click on the Send button

e.g.
--SNIP
 <dd>$description
        <HR>
<form name="form1" method="post" action="/cgi-bin/email.pl">
<input name="File" type="hidden" id="File" value="$this_result->
{swishdocpath}">
<input name="Email" type"hidden" id="Email" value="$this_result->
{dummy_param_passedthroswish_emailaddress}">
E-mail this file to $this_result->{dummy_param_passedthroswish_emailaddress}
--SNIP


Other parameters that would be useful to pass through would be for example 
client_name , user_name, unix_user_name, pdf_printer_name.

Thank you

Richard

On Sun, 14 Dec 2008 20:15:37 -0600, Peter Karman wrote
> Richard Byrne MRCVS Partner wrote on 12/13/08 10:21 AM:
> > Dear Sir
> > 
> > We are using Swish-e Version 2.4.3 to index hundreds of PDFs documents 
on a 
> > server. I would very much like to have an additional hyperlink or even 
html 
> > form that is generated for each document and appears on the web page in 
the 
> > search list when the search is run. The idea is that the user can simply 
> > click this link to do something to the document rather than simply 
display 
> > it  for example send it directly to a PDF printer
> 
> are you using swish.cgi ? read this:
> http://swish-
e.org/docs/swish.cgi.html#how_do_i_change_the_way_the_output_looks_
> 
> -- 
> Peter Karman  .  http://peknet.com/  .  peter(at)not-real.peknet.com
> _______________________________________________
> Users mailing list
> Users@lists.swish-e.org
> http://lists.swish-e.org/listinfo/users


_______________________________________________
Users mailing list
Users@lists.swish-e.org
http://lists.swish-e.org/listinfo/users
Received on Tue Dec 16 04:59:37 2008