[ https://issues.apache.org/jira/browse/JSPWIKI-665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Glen Mazza updated JSPWIKI-665: ------------------------------- Attachment: JSPWiki665.patch Enclosed patch does not handle renames (yet), but does appear to handle deletes fine. With a delete, the count in the PageViewPlugin for that page resets to zero. The patch also fully fixes JSPWIKI-750 so a specialized test suite is no longer necessary. In this patch, I created a temporary nonStaticDeleteTestPage in TestEngine (needed because a "delete page" event needs to be thrown) that sits alongside the current static deleteTestPage. If this patch is accepted, I plan on soon sending another patch getting rid of the latter and renaming the former to the latter. I'm holding back on that now because it's a nontrivial amount of work and I don't want to go too far into the patch if there's a problem with it for other reasons. I also noticed the current trunk doesn't seem to do a good job in incrementing page views (perhaps it's just because my IP address viewing it and the page view plugin is careful not to increment multiple times under those circumstances--I'm unsure.) AFAICT that's unrelated to this patch. Test case: Create a list of most frequently accessed pages (show=list), as described here: http://www.jspwiki.org/wiki/PageViewPlugin, along with a few pages that have the PageViewPlugin defined within them. Then delete a page--you'll note the deleted page is still in the PVP's count. After applying this patch, a page delete will result in that page being removed from the PVP's list. > Page View Plugin and page renames and deletions > ----------------------------------------------- > > Key: JSPWIKI-665 > URL: https://issues.apache.org/jira/browse/JSPWIKI-665 > Project: JSPWiki > Issue Type: Improvement > Components: Core & storage > Affects Versions: 2.8.4, 2.9 > Reporter: Bruno Peeters > Priority: Minor > Attachments: JSPWiki665.patch, PVPTpatch.diff > > > When a wiki page is renamed or deleted, the counters used by the > PageViewPlugin (http://www.jspwiki.org/wiki/PageViewPlugin) are not adapted > accordingly. As a results of this, the overview of counters can contains > pages that do not exist anymore. The counters of these pages will not be > incremented anymore, so they will disappear of the top list, but they still > remain in the full list. It would make sense to remove the counters for > deleted pages. It would defnitely make sense to update the counters when a > page is renamed. > A visit to a non existing page is also stored by the PageViewPlugin, eg by > clicking on a link to a page showing the message "This page does not exist. > Why don't you go and create it?" is stored as a valid visit. Counting visits > to non existing pages seems something of very low value. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira