Tags:
create new tag
, view all tags

Archive of UpdateInfoPluginDev

Are there currently plans to address "wikified" words with square backet notation? I really like this plugin, but we have a lot of square brackets...

-- SethTaplin - 27 Feb 2003

I was getting errors in my log with this plugin. It would appear to be a typo on line 57. The diff is very short, so I just included it in line:

[Plugins]# diff -u UpdateInfoPlugin.pm.orig UpdateInfoPlugin.pm
--- UpdateInfoPlugin.pm.orig    2003-04-14 15:48:42.000000000 -0500
+++ UpdateInfoPlugin.pm 2003-04-14 15:48:52.000000000 -0500
@@ -54,7 +54,7 @@
  
     %info = $meta->findOne( "TOPICINFO" );
     $updated = ((time-$info{"date"})/86400) < $params{"days"}; #24*60*60
-    $new = $updated & (($info{"version"}+0) <= ($params{"version"}+0));
+    $new = $updated && (($info{"version"}+0) <= ($params{"version"}+0));
  
     $r = "";
     if ( $updated )

-- DavidBright - 17 Apr 2003

The plugin get into problems when the topic RCS version is in the range of 1.10 - 1.19 (and I guess 1.100 -- 1.199). Any topic within this range is displayed as NEW, not UPDATED as it should.

The problem is on the very same line addressed by David Bright above.

The <= operator is for numeric test, whereas the RCS version is actually a string.

--- UpdateInfoPlugin.pm Mon Apr 15 11:09:22 2002
+++ UpdateInfoPlugin.pm Sat Jul  5 14:55:38 2003
@@ -54,7 +54,7 @@
 
     %info = $meta->findOne( "TOPICINFO" );
     $updated = ((time-$info{"date"})/86400) < $params{"days"}; #24*60*60
-    $new = $updated & (($info{"version"}+0) <= ($params{"version"}+0)); 
+    $new = $updated && (($info{"version"}) le ($params{"version"}));
 
     $r = "";
     if ( $updated )

-- MatsBergstroem - 05 Jul 2003

Here's a patch for the [[]] functionality. I haven't tested it extensively, but it actually should work with all link syntaxes:

  • [[Page]]
  • [[Web.Page]]
  • [[Page][Alias]]
  • [[Web.Page][Alias]]

--- UpdateInfoPlugin.pm         Tue Aug 26 13:14:18 2003
+++ UpdateInfoPlugin.pm         Tue Aug 26 13:19:19 2003
@@ -30,6 +30,7 @@
 {
   my ( $defweb, $wikiword, $opts ) = @_;

+  ( $wikiword ) = $wikiword =~ /^\[*([\w\.]*)\]*.*/;
   ( $web, $topic ) = split ( /\./, $wikiword );
   if ( !$topic ) {
     $topic = $web;
@@ -76,7 +77,7 @@

     # This is the place to define customized tags and variables
     # Called by sub handleCommonTags, after %INCLUDE:"..."%
-    $_[0] =~ s/([\w\.]+) %ISNEW(({.*?})?)%/"$1".update_info($web, $1, $2)/geo;
+    $_[0] =~ s/([\[\]\w\.]+) %ISNEW(({.*?})?)%/"$1".update_info($web, $1, $2)/geo;
 }

I'm not a Perl programmer - I just started coding Perl for twiddling with TWiki and it's plugins. So maybe there's a better way of doing the extraction of the actual link from $wikiword - feel free to tell me. smile

-- ThomasJachmann - 26 Aug 2003

I got a problem if i use blancs in the description part of a [[topic][description]] link. I changed the regular expression above to read like this one

$_[0] =~ s/(\[\[[\w\.]+\].*\]|[\w\.]+) %ISNEW(({.*?})?)%/"$1".update_info($web, $1, $2)/geo;

Now it works.

-- PetricFrank - 4 Oct 2003

Uploaded a new version to UpdateInfoPlugin, incorporating the above fixes. Plugin seems to be compatible with the new DEVELOP branch in SVN (and ModPerl too, whee!). Looks like the only issue with this plugin now is with I18N topics.

-- SteffenPoulsen - 30 Mar 2005

Steffen, I made some changes to the Plugin topic text: Fixed heading levels; fixed position of nop-escape in %ISNEW%; fixed TWiki.org specific links to Interwiki and %TWIKIWEB% web links; reformatted the Plugin info table to latest format. You can take that into the next release if you wish.

How about measuring and documenting the PluginBenchmarks?

-- PeterThoeny - 01 Apr 2005

Thanks for the input - I might just try that PluginBenchmarks out smile

I uploaded a new version with your changes, and the plugin is now I18N-aware (so we won't miss a single update to the "BlåBærGrød"-topic in our TWiki :-)).

BTW: This plugin isn't in neither CVS or SVN afaik - can I do anything to put it there?

-- SteffenPoulsen - 01 Apr 2005

You can put it into CVS if you are a Plugin developer (see ReadmeFirst)

I made a small change to the SHORTDESCRIPTION: Removed "this plugin" text since it is obvious. You can take that back into the next release if you wish.

-- PeterThoeny - 03 Apr 2005

I tried to get this to work in the format field of a FormattedSearch using the $percntISNEW$percnt syntax after a link, and it didn't expand... is there some trick to this?

-- DieterWeber - 06 Apr 2005

IIRC, the changes I made to DevelopBranch will allow you too override TWiki's rendering of any wikiword. You might use that to provide this functionality implicitly - so any new topic gets marked as new without needing to mention the ISNEW tag after them.

-- MartinCleaver - 06 Apr 2005

I have gotten it to work now. My formatted search was generating output like this:

     _[[WikiTopic][Answer...]]_ %ISNEW%

Which isn't handled by the plugin. When I removed the '_' around the link, it worked.

After fixing the problem with the '_', I couldn't get the search to work with the %ISNEW{days="14"}% syntax. (I have a nested search in my topic) So I modified my version of the plugin to fetch the default days and new version from wiki variables. Searching first in the web preferences, and then in the plugin if we can't find it. If you want these diffs I can post them.

In any case when I was playing around with the code, I noticed the default number of days in UpdateInfoPlugin doesn't match the default value in the code that I downloaded (the code says 2, the doc says 5).

-- DieterWeber - 06 Apr 2005

Glad you made it work - nested searchs are always a PITA smile A syntax like this should work OK, though (only tested with DEVELOP branch) - else please state your example here, I'd like to take a look.

%SEARCH{ "culture" format="   * $topic is referenced by:$n      * $percntSEARCH{ \"$topic\" \
format=\"[[$dollartopic]] $dollarpercntISNEW{days=\\"15\\"}$dollarpercnt\" nosearch=\"on\" \
nototal=\"on\" separator=\", \" }$nop%" nosearch="on" nototal="on" }%

(I have added the trick to FormattedSearch).

Diff are always welcome - please upload smile It sounds like a nice idea, being able to set the "default" pr. web and (perhaps even?) pr. topic. You're right about the 2/5 stuff - I'll fix that in the next release (it should be 5 in both doc and code, I guess). Also minor stuff like using $_[0] instead of "my'ing" the variables could be fixed - that's the recommended practise now, it seems.

BTW: I wondered if there'd be any point in moving the hook from commonTagsHandler to startRenderingHandler, but I wasn't able to tell the difference, really, so I'll just leave it be smile

Martin, overriding the rendering sounds very exiting(!) - can you post an example?

-- SteffenPoulsen - 06 Apr 2005

Here are the diffs that I mentioned:

  • params.diff: Diff for setting the parameters in the topics or the Plugin

Here is my nested search, and an example of how I use the default parameter in my topic:

<!--
This is the number of days since last change that we see the update or new
tags at the end of an answer.

   * Set UPDATEINFODAYS = 9
-->

The questions and answers are available as a [[AllInOneFaq][single page]]
with all the questions on one page.  Or you can view individual topics by
clicking below.  Topics that are new or updated in the past %UPDATEINFODAYS%
days have been marked.

%SEARCH{ "__Back to FAQ\:__ %TOPIC%" scope="text" regex="on" nosearch="on" nototal="on" \
noheader="on" format="---+++ [[$topic][$pattern(.*?---\+!?!?\s*([^\n\r]+).*)]]$n\
$percntSEARCH{ \"__Category\:__ $topic\" scope=\"text\" regex=\"on\" nosearch=\"on\" \
nototal=\"on\" noheader=\"on\" format=\"   * $dollarpattern(.*?FAQ\:[\n\r]*([^\n\r]+).*) \
<i>[[$dollartopic][Answer...]] $percntISNEW$percnt </i> \" }$percnt" }%

I am running the lastest released version, Cairo or TWikiRelease02Sep2004, and I tried to get mine to work with \\" and other variations, none of them worked (and all made a mess of the rendering). frown

So that was why I decided to hack the module to pick up the parameters from a variable in the topic.

-- DieterWeber - 06 Apr 2005

I just tried the search with TWikiRelease02Sep2004, and it works OK with that release too. So I guess you could have gotten away with a few $dollarpercnt substitutions hehe!

But hey - instead we have a new version of the plugin - v1.6! Thanks for contributing thumbs up

-- SteffenPoulsen - 06 Apr 2005

Steffen, rename the settings from UPDATEINFOPLUGIN_VERSION to just VERSION, and from UPDATEINFOPLUGIN_DAYS to DAYS or the like. The Plugin handler prefixes UPDATEINFOPLUGIN_ to the setting, e.g. your UPDATEINFOPLUGIN_VERSION setting is now known as %UPDATEINFOPLUGIN_UPDATEINFOPLUGIN_VERSION% preferences setting.

-- PeterThoeny - 07 Apr 2005

Oh, I see it - yeah, that's a cut'n'paste no-brainer. As long as you only test the plugin on the UpdateInfoPlugin topic it works just fine (of course) - I guess I'll have to expand my test-case smile

New version uploaded, renamed the variable names to be consistent from default plugin settings to overriding topic settings - thanks for pointing out, Peter.

-- SteffenPoulsen - 07 Apr 2005

I was having trouble getting parameters to properly override the variables (06Apr2005 version). The following changes seem to correct the problem:

$ diff UpdateInfoPlugin.pm twiki/lib/TWiki/Plugins/UpdateInfoPlugin.pm 
96c96
<         $val =~ tr [\"] [ ];
---
>       $val =~ s/"(.*)"/\1/; # rr 20050606

-- RonRisley - 06 Jun 2005

I added a signature to the Plugin topic; the report on the PluginPackage topic depends on it.

-- PeterThoeny - 23 Aug 2005

I've just noticed that my httpd error_log is filling up with view: Use of uninitialized value in split at /var/www/twiki/lib/TWiki/Plugins/UpdateInfoPlugin.pm line 95.

Adding

sub update_info
{
  my ( $defweb, $wikiword, $opts ) = @_;
  $opts ||= ''; # pre-define $opts to prevent error messages
stops it

-- MagnusLewisSmith - 23 Sep 2005

Thanks, Magnus. This has been bothering me, too.

-- SteveJonesST - 23 Sep 2005

Just installed and enabled the latest UpdateInfoPlugin into TWiki 4.0.1 and got the following error message (data/warn200602.log):

| 13 Feb 2006 - 16:47 | Undefined subroutine &TWiki::Store::readTopMeta called at /var/www/localhost/wiki/lib/TWiki/Plugins/UpdateInfoPlugin.p m line 86. at /var/www/localhost/wiki/lib/TWiki/Plugins/UpdateInfoPlugin.pm line 86

Has anybody a clue, whats the problem. Is UpdateInfoPlugin not ready for DakarRelease?

-- TobiasRoeser - 13 Feb 2006

Correct, this Plugin no longer works in TWikiRelease04x00x00 because it calls the TWiki internal TWiki::Store::readTopMeta function.

To the Plugin maintainer: Please consider fixing the Plugin so that it runs on Cairo and Dakar codebase. HandlingCairoDakarPluginDifferences has more.

-- PeterThoeny - 13 Feb 2006

I could use a little hint on how to gracefully handle default regular expressions from both Cairo and Dakar in the same plugin, before uploading a new version. The version in SVN is updated and fully compatible with Dakar though (if you'd like to try out the plugin now, that is, Tobias).

-- SteffenPoulsen - 13 Feb 2006

Could you please post a link to the current SVN which hold this Plugin. The "CVS" link on the LeftBar is 3 years old. frown

-- TobiasRoeser - 13 Feb 2006

It seems to me that the parameter version="1.x" is not properly handled. I always get "updated" instead of the expected "new" tag. I am running the latest version of the plugin using the Cairo release.

-- MichaelSchmidt - 16 Feb 2006

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2006-04-20 - SteffenPoulsen
 
  • 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.