Tags:
create new tag
, view all tags

Feature Proposal: Printview of Parameterised Search

Motivation

Printview fails after a url-parameterised search, search criteria are forgotten

Details:

Also Question section on PrintviewOfParameterisedSearch#Question

Description

When using TWiki for content management, it is nice to do reports (in my case bug reports).

I use CGI parameters to enable users with a simple report-facility (using a HTML form).

Once the report is shown, users wish to print it, and looses all CGI parameters (in my case) making the report show everything.

I have fixed this by introducing the TWiki variable %CGIPARAMS% and %CGIPARAMS{arg1=test&skin=print}%, ammending the argument to existing CGI query string.

Impact and Available Solutions

Note: No patch is attached frown - hovever code-snippets are supplied in Answer section on PrintviewOfParameterisedSearch#Answer

Documentation

Nil

QUESTION? Well, maybe %CGIPARAMS% and %CGIPARAMS{arg1=test&skin=print}% should be documented?

  • Please tell me if you want me to do that.

Examples

See Answer on PrintviewOfParameterisedSearch#Answer and Sample Case below

Implementation

See code snippets in Answer section of PrintviewOfParameterisedSearch#Answer

-- NielsKoldso - 27 Aug 2005

Discussion:

Refactored topic to fit ChangeProposalForm cf. OldWorkflowNote

QUESTION? Is it possible this enhancement can make its way into Dakar?

-- NielsKoldso - 27 Aug 2005

I think you need to give more detail on how this is used. I can guess, but I might be wrong....

I'm not clear why you think you need code changes to support this. For example, consider the following:

Example: Value of URLPARAM{EXAMPLE} is:

Enter a value, then hit Printview, see what happens

-- CrawfordCurrie - 27 Aug 2005

That was an impressingly quick response Crawford smile

I do not wish to bring user directly to a printview - most of the time users do not wish to print reports.

Sample case:
  1. Change value (user fills out report search criteria)
  2. Hit Set example value (user executes search)
  3. View result (user views report / normal skin)
  4. Hit normal Printable link (user wishes to print report)
  5. Search criteria forgotten (user does not see what she asked for)
Sample form:
Example:

Value of %URLPARAM{EXAMPLE}% is: woops... not set

Another example is to search for new on Sandbox.SearchBookTitles (2 books found), when I choose printable I get the complete library.

-- NielsKoldso - 02 Sep 2005

Hmmmm. For this to work properly, the switch to printable view has to be a POST of the form where the values are. You can't simply append the parameters and do a GET - that would be certain to overflow the size of a URL string.

  • ahhh... didn't know about url string size limits frown -- Niels 13 Sep 2005

You could limit it to a get, I suppose, and take the consequences, which is what I guess you are doing above.

Yes, I can see the point, and the value, of this. Passing parameters on is a problem in a lot of places. (For those who can't see the point, this is how it would work: %CGIPARAMS% would expand to a URL-encoded list of the parameters to the page being visited. So if I visit a page by clicking the URL http://twiki.org/cgi-bin/view/Codev/PrintviewOfParameterisedSearch?sea=green&sky=blue, then %CGIPARAMS% in that page will expand to ?sea=green;sky=blue. Note that the length of the %CGIPARAMS% parameter string is limited to a few hundred characters.

Rewriting the parameter string should be possible using a %CALC expression, if you really must. But if you are doing something this complex, you should be using URLPARAM in a HTML form.

BTW for consistency with the CGI perl module, CGIPARAMS should to be named . See Bugs:Item344

-- CrawfordCurrie - 03 Sep 2005

It would be better if there was a print stylesheet for the standard view. Then you wouldn't need to go to a different page and we wouldn't have to worry about these issues.

-- SamHasler - 04 Sep 2005

Crawford:

  • Is the URL-limitation due to perl CGI querystring or due to GET in http?
  • I guess the url string limitation is due to http GET and think it may be circumvented, by expanding to a form doing a post instead, i.e. a form with each value from %QUERYSTRING% put into a hidden field, and all new values (e.g. style=print ) also in a hidden field.
  • QUESTION? If I do that, do you think this could make its way into Dakar.

Sam:

  • How do you figure a stylesheet (e.g. print.css ) could do the trick?
  • Do you mean something like making printable call a java-script which attach print.css which hides left-menu etc.?
  • Performance would be improved by this, because the server did not have to do search&display-cycle again... Maybe this approach should be addopted... Crawford?

-- NielsKoldso - 13 Sep 2005

  1. Due to HTTP GET
  2. Yes
  3. %QUERYSTRING% is in Dakar, and has been for some time. %QUERYSTRING{...}% is not supported, however. I'm really not convinced; I need to hear more people supporting this with specific examples of how it can be used.

-- CrawfordCurrie - 17 Sep 2005

Bugs:Item2572 pertained to URL parameters being lost in printview. That has been fixed in rev 11793. Please see if this fix also addresses the issue discussed in this topic.

-- ThomasWeigert - 22 Oct 2006

 
Topic revision: r11 - 2006-10-22 - ThomasWeigert
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.