create new tag
, view all tags

YetAnotherFormQueryPluginDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on YetAnotherFormQueryPlugin contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please report bugs below

Feedback on YetAnotherFormQueryPlugin

-- ThomasWeigert - 02 Oct 2006

Thanks Thomas for sharing this enhanced plugin with the TWikiCommunity. Crawford/Thomas, please consider merging the YetAnotherFormQueryPlugin soon into the FormQueryPlugin.

-- PeterThoeny - 03 Oct 2006

Differences between this plugin and FormQueryPlugin are roughly as follows:

  • In DBCacheContrib I have made changes that hopefully are non-controversial. In detail I
    • made some fixes
    • replaced the parser with a table-driven parser in order to have more flexibility
    • support summing of subfields
    • handle subfield searches
    • allow expansion of fields on rhs of query expression
    • add caseinsensitivity as option
    • add web to cache for topics
    • integrate the Attribute parser from DakarRelease
    • interpret bare string as text=~'string' query
    • allow use of SpreadSheetPlugin in search expression
    • deleted the time-specific operations in favor of using SpreadSheetPlugin to convert dates to numeric format
  • In FormQueryPlugin the situation is not as clear. By now, this is almost a different plugin with much functionality and code borrowed from your original work. My main goal was to get as close to %SEARCH% as possible to be able to replace any %SEARCH% by a form query. In detail, I
    • added support for searches over multiple webs
    • support %MATCHCOUNT% as suggested above
    • allow SpreadSheetPlugin computation to be applied to the result of a query as discussed above
    • made "moan" a preference rather than a per call option
    • removed %TOPICCREATOR%
    • removed %ARITHMETIC% (as you can use the SpreadSheetPlugin)
    • removed the color map feature
    • extended %FQPINFO% to support showing results of queries
    • integrate the Attribute parser from DakarRelease
    • add caseinsensitivity as option
    • handle one line at a time so that query memory can be reused in another query
    • added the special variables supported by FormattedSearch
    • changed some of the option names to be more consistent with TWikiSearch (e.g., row_count)
    • numerous fixes
    • more flexibility for using tables
    • add a %DOANDSHOWQUERY% tag
    • support embedding of %SEARCH% and %FORMQUERY% in the format option to allow searches and queries to be applied to the result of a query (a poor man's intersection)

-- ThomasWeigert - 11 Nov 2006

Fix for forms that use $createdate, $username, $wikiname or $wikiusername

(Thank You very much for providing this and other modules to the comunity!!)

I'm moving a twiki installation (02 Sep 2004 $Rev: 1742 $) to version 4.1.1 and found a problem between Search.pm and YetAnotherFormQueryPlugin::TableFormat. The problem exists in forms that use $createdate, $username, $wikiname or $wikiusername; this uses _getRev1Info internaly in TableFormat and it is not passing the session variable that _getRev1Info needs.

I dont know enough about TWiki internals to know if this is the best way to fix the problem (or if you can request a patch to Search.pm) but here is the diff anyway. The changes are :

  • TableFormat.pm provides the TWiki::Plugins::SESSION to _getRev1Info
  • Search.pm uses TWiki::Plugins::SESSION instead of this->{session}

diff twiki_4.1.1/lib/TWiki/Plugins/FormQueryPlugin/TableFormat.pm lib/TWiki/Plugins/FormQueryPlugin/TableFormat.pm
<                 $row =~ s/\$createdate/&TWiki::Search::_getRev1Info( $TWiki::Plugins::SESSION, $sub->get("web"), $topic, "date" )/geos;
<                 $row =~ s/\$createusername/&TWiki::Search::_getRev1Info( $TWiki::Plugins::SESSION, $sub->get("web"), $topic, "username" )/geos;
<                 $row =~ s/\$createwikiname/&TWiki::Search::_getRev1Info( $TWiki::Plugins::SESSION, $sub->get("web"), $topic, "wikiname" )/geos;
<                 $row =~ s/\$createwikiusername/&TWiki::Search::_getRev1Info( $TWiki::Plugins::SESSION, $sub->get("web"), $topic, "wikiusername" )/geos;
>                 $row =~ s/\$createdate/&TWiki::Search::_getRev1Info( $sub->get("web"), $topic, "date" )/geos;
>                 $row =~ s/\$createusername/&TWiki::Search::_getRev1Info( $sub->get("web"), $topic, "username" )/geos;
>                 $row =~ s/\$createwikiname/&TWiki::Search::_getRev1Info( $sub->get("web"), $topic, "wikiname" )/geos;
>                 $row =~ s/\$createwikiusername/&TWiki::Search::_getRev1Info( $sub->get("web"), $topic, "wikiusername" )/geos;

diff /var/www/twiki_4.1.1/lib/TWiki/Search.pm lib/TWiki/Search.pm
<     my $store = $TWiki::Plugins::SESSION->{store};
>     my $store = $this->{session}->{store};
<         my $meta = new TWiki::Meta( $TWiki::Plugins::SESSION, $web, $topic );
>         my $meta = new TWiki::Meta( $this->{session}, $web, $topic );

-- JoseVenceslau - 03 Apr 2007

I just merged this plugin with FormQueryPlugin; I didn't release it yet, though the fixes are in subversion; Thomas, could you review please?

-- CrawfordCurrie - 25 Apr 2007

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2007-04-25 - CrawfordCurrie
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.