[ 
https://issues.apache.org/jira/browse/JSPWIKI-856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14110665#comment-14110665
 ] 

David Vittor commented on JSPWIKI-856:
--------------------------------------

Hi All,

I've tested this now, with the HitCount plugin - 
https://jspwiki-wiki.apache.org/Wiki.jsp?page=HitCountPlugin - and it works.

My *Main.properties* file contains:
{noformat}
#JSPWiki page properties for page Main
#Tue Aug 26 22:35:21 EST 2014
@pageHitCount=10
author=David Vittor
{noformat}

The hitcount plugin works a little funny cause it stores the value in the page 
attribute, and everytime a "save" of the page is done it writes the value to 
the database.

However if lots of people view the site, and the server is restarted, the value 
is never written to the database, as no save was done. So it's only saved from 
the last time the page was editted.

But this is just a limitation of the hitcount plugin. As for plugins having 
access to permanent storage of variables, it looks to me like this patch works.

I've also tested this with the error case by adding the following to my **:
{noformat}

> Enhance FileSystemProvider to be able to save page attributes as properties
> ---------------------------------------------------------------------------
>
>                 Key: JSPWIKI-856
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-856
>             Project: JSPWiki
>          Issue Type: New Feature
>          Components: Core & storage
>    Affects Versions: 2.10.1
>            Reporter: David Vittor
>              Labels: provider
>         Attachments: AbstractFileProvider.java, AbstractFileProvider.java, 
> FileSystemProvider.java, FileSystemProvider.java, 
> VersioningFileProvider.java, VersioningFileProvider.java, WikiPage.java, 
> providers.patch, providers.patch
>
>
> *Requirements:*
> * 1. Plugins and other code should be able to store some page "attributes" 
> into the "properties" of a page, just as author and changenote currently are.
> * 2. This should work for both FileSystemProvider and VersioningFileProvider 
> and any future JDBCProviders or EncryptionProviders
> * 3. The properties added should be dynamic, e.g. all properties starting 
> with "db:" like "db:likes", or "db:hitcount"
> ** 3.1. A "protected" addCustomProperties() method should be done added
> * 4. The property names and property values should be validated
> ** 4.1. A "protected" validateCustomProperties() method should be done added
> ** 4.2 e.g. only contain ascii characters
> ** 4.3 Max property key length
> ** 4.4 Max property value length
> ** 4.5 Max number of properties



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to