You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jspwiki.apache.org by Brian Burch <br...@pingtoo.com> on 2014/01/12 15:04:46 UTC

Conversion of a wiki from FileSystemProvider to VersioningFileProvider

I have a large wiki entirely created under 2.8.4 using the 
FileSystemProvider. This means my single directory contains pairs of 
files, e.g. MyPage.txt and MyPage.properties.

I am converting to 2.10 and would like to have the facility to backout 
unwanted changes. I thought the VersioningFileProvider would be the 
simplest choice, especially as..

https://jspwiki-wiki.apache.org/Wiki.jsp?page=WikiPageProviders

.. still points to..

http://www.ecyrd.com/JSPWiki/wiki/ContributedProviders

.. which indicates these other Providers, e.g. CVS, have not yet been 
converted.

I created a Main page in my test 2.10 system and confirmed the "OLD" 
directory structure was created as documented.


I then cloned one of my production page-pairs into the new wiki directory:

1. The page displayed perfectly (that is a relief!).

2. I made a minor change to the page, which worked (excellent).

3. The info tab of the page said it knew about two versions of the page 
(excellent - I didn't expect a prior history to magically appear!)

4. The info tab identified me as the author of the most recent version 
(excellent - it had picked up my userid from Container authentication 
via the tomcat SingleSignonValve and my LDAP directory).

5. The info tab listed the initial version of the page as having 
"UnknownAuthor" and a date modified corresponding (probably) to the time 
I cloned the page (7 minutes earlier than my update).

I'm disappointed the original FilmsToWatch.properties file contents have 
been ignored.

* Cloned page properties file:
     #JSPWiki page properties for page FilmsToWatch
     #Fri Jan 03 14:40:07 GMT 2014
     author=brian

* Updated page properties file:
     # JSPWiki page properties for FilmsToWatch. DO NOT MODIFY!
     #Sun Jan 12 13:41:29 GMT 2014
     2.author=brian

Is this expected behaviour? I suppose I could write a conversion script, 
but I wonder whether there is a better way to convert these wiki pages 
along with their minimal but still meaningful history.

Regards,

Brian

Re: Conversion of a wiki from FileSystemProvider to VersioningFileProvider

Posted by Brian Burch <br...@pingtoo.com>.
On 15/01/14 11:50, Juan Pablo Santos Rodríguez wrote:
> Hi Brian,
>
> would you mind filing a JIRA with your expected behaviour at
> https://issues.apache.org/jira/browse/JSPWIKI so it doesn't get lost?

Sure, I will do it soon...

I have converted my PhotoCollectionPlugin to work with 2.10, so I want 
to add the new wiki page and release it tomorrow.

I'll be away for a few days, but will file the JIRA within a week of now 
- I won't forget!

Regards,

Brian

> thanks + br,
> juan pablo
>
>
> On Mon, Jan 13, 2014 at 11:43 AM, Brian Burch <br...@pingtoo.com> wrote:
>
>> On 12/01/14 21:44, Juan Pablo Santos Rodríguez wrote:
>>
>>> Hi Brian,
>>> not sure if I understand you correctly,
>>>
>>
>> Yes, your reply is basically consistent with my view. However, there are
>> some detail differences that I won't go into yet.
>>
>> I took a quick look at the source and can see it is fairly old and due
>> some tidying, e.g. lots of FIXME's and inline tabs.
>>
>> I think "my" problem is caused by VersioningFileProvider not detecting the
>> case where it is about to update a non-versioned page BUT which already has
>> a rudimentary FileSystemProvider metadata properties file.
>>
>> In my ideal world, it would detect and use the original MyPage.properties
>> file, converting it to become a properly named/located/formatted "version
>> 1" properties file. That way the original metadata would be incorporated
>> into the new versioning metadata.
>>
>> I've also found the unit tests, so I think I will write a new test case to
>> demonstrate how it ought to work. It shouldn't be too hard to add the new
>> logic to support my use case. I'll ask for advice if I get stuck, but
>> otherwise I'll submit a patch when I have something worth committing.
>>
>> Regards,
>>
>> Brian
>>
>>
>>   cloned page + properties file ==
>>> 1st version of page on VersioningFileProvider?
>>>
>>> in that case, it should have the following contents:
>>>       #JSPWiki page properties for page FilmsToWatch
>>>       #Fri Jan 03 14:40:07 GMT 2014
>>>       1.author=brian
>>>
>>> so the metadata for the first version is recognized. In your case, as
>>> there
>>> isn't author metadata for the first version (1.author=..), you're getting
>>> the unkwon author. The rest of the metadata is taken from the versioned
>>> file itself, that's why you see it. Once you update the page the
>>> properties
>>> file should look like something like this:
>>>       # JSPWiki page properties for FilmsToWatch. DO NOT MODIFY!
>>>       #Sun Jan 12 13:41:29 GMT 2014
>>>       1.author=brian
>>>       2.author=brian
>>>
>>> (note that the order of the metadata's versions could vary, they don't
>>> have
>>> to appear in order, and also changenotes could appear following the
>>> VERSION.changenote schema)
>>>
>>> In your case, as you don't have valid metadata, it's ignored, so when you
>>> save a new version, the original content is ignored (the Properties object
>>> with the versioned metadata is stored directly into the properties file).
>>> Lastly, the properties file, if I recall correctly should be named
>>> "page.properties", not "PageName.properties"
>>>
>>>
>>> HTH,
>>> juan pablo
>>>
>>>
>>>
>>>
>>> On Sun, Jan 12, 2014 at 3:04 PM, Brian Burch <br...@pingtoo.com> wrote:
>>>
>>>   I have a large wiki entirely created under 2.8.4 using the
>>>> FileSystemProvider. This means my single directory contains pairs of
>>>> files,
>>>> e.g. MyPage.txt and MyPage.properties.
>>>>
>>>> I am converting to 2.10 and would like to have the facility to backout
>>>> unwanted changes. I thought the VersioningFileProvider would be the
>>>> simplest choice, especially as..
>>>>
>>>> https://jspwiki-wiki.apache.org/Wiki.jsp?page=WikiPageProviders
>>>>
>>>> .. still points to..
>>>>
>>>> http://www.ecyrd.com/JSPWiki/wiki/ContributedProviders
>>>>
>>>> .. which indicates these other Providers, e.g. CVS, have not yet been
>>>> converted.
>>>>
>>>> I created a Main page in my test 2.10 system and confirmed the "OLD"
>>>> directory structure was created as documented.
>>>>
>>>>
>>>> I then cloned one of my production page-pairs into the new wiki
>>>> directory:
>>>>
>>>> 1. The page displayed perfectly (that is a relief!).
>>>>
>>>> 2. I made a minor change to the page, which worked (excellent).
>>>>
>>>> 3. The info tab of the page said it knew about two versions of the page
>>>> (excellent - I didn't expect a prior history to magically appear!)
>>>>
>>>> 4. The info tab identified me as the author of the most recent version
>>>> (excellent - it had picked up my userid from Container authentication via
>>>> the tomcat SingleSignonValve and my LDAP directory).
>>>>
>>>> 5. The info tab listed the initial version of the page as having
>>>> "UnknownAuthor" and a date modified corresponding (probably) to the time
>>>> I
>>>> cloned the page (7 minutes earlier than my update).
>>>>
>>>> I'm disappointed the original FilmsToWatch.properties file contents have
>>>> been ignored.
>>>>
>>>> * Cloned page properties file:
>>>>       #JSPWiki page properties for page FilmsToWatch
>>>>       #Fri Jan 03 14:40:07 GMT 2014
>>>>       author=brian
>>>>
>>>> * Updated page properties file:
>>>>       # JSPWiki page properties for FilmsToWatch. DO NOT MODIFY!
>>>>       #Sun Jan 12 13:41:29 GMT 2014
>>>>       2.author=brian
>>>>
>>>> Is this expected behaviour? I suppose I could write a conversion script,
>>>> but I wonder whether there is a better way to convert these wiki pages
>>>> along with their minimal but still meaningful history.
>>>>
>>>> Regards,
>>>>
>>>> Brian
>>>>
>>>>
>>>
>>
>


Re: Conversion of a wiki from FileSystemProvider to VersioningFileProvider

Posted by Juan Pablo Santos Rodríguez <ju...@gmail.com>.
Hi Brian,

would you mind filing a JIRA with your expected behaviour at
https://issues.apache.org/jira/browse/JSPWIKI so it doesn't get lost?


thanks + br,
juan pablo


On Mon, Jan 13, 2014 at 11:43 AM, Brian Burch <br...@pingtoo.com> wrote:

> On 12/01/14 21:44, Juan Pablo Santos Rodríguez wrote:
>
>> Hi Brian,
>> not sure if I understand you correctly,
>>
>
> Yes, your reply is basically consistent with my view. However, there are
> some detail differences that I won't go into yet.
>
> I took a quick look at the source and can see it is fairly old and due
> some tidying, e.g. lots of FIXME's and inline tabs.
>
> I think "my" problem is caused by VersioningFileProvider not detecting the
> case where it is about to update a non-versioned page BUT which already has
> a rudimentary FileSystemProvider metadata properties file.
>
> In my ideal world, it would detect and use the original MyPage.properties
> file, converting it to become a properly named/located/formatted "version
> 1" properties file. That way the original metadata would be incorporated
> into the new versioning metadata.
>
> I've also found the unit tests, so I think I will write a new test case to
> demonstrate how it ought to work. It shouldn't be too hard to add the new
> logic to support my use case. I'll ask for advice if I get stuck, but
> otherwise I'll submit a patch when I have something worth committing.
>
> Regards,
>
> Brian
>
>
>  cloned page + properties file ==
>> 1st version of page on VersioningFileProvider?
>>
>> in that case, it should have the following contents:
>>      #JSPWiki page properties for page FilmsToWatch
>>      #Fri Jan 03 14:40:07 GMT 2014
>>      1.author=brian
>>
>> so the metadata for the first version is recognized. In your case, as
>> there
>> isn't author metadata for the first version (1.author=..), you're getting
>> the unkwon author. The rest of the metadata is taken from the versioned
>> file itself, that's why you see it. Once you update the page the
>> properties
>> file should look like something like this:
>>      # JSPWiki page properties for FilmsToWatch. DO NOT MODIFY!
>>      #Sun Jan 12 13:41:29 GMT 2014
>>      1.author=brian
>>      2.author=brian
>>
>> (note that the order of the metadata's versions could vary, they don't
>> have
>> to appear in order, and also changenotes could appear following the
>> VERSION.changenote schema)
>>
>> In your case, as you don't have valid metadata, it's ignored, so when you
>> save a new version, the original content is ignored (the Properties object
>> with the versioned metadata is stored directly into the properties file).
>> Lastly, the properties file, if I recall correctly should be named
>> "page.properties", not "PageName.properties"
>>
>>
>> HTH,
>> juan pablo
>>
>>
>>
>>
>> On Sun, Jan 12, 2014 at 3:04 PM, Brian Burch <br...@pingtoo.com> wrote:
>>
>>  I have a large wiki entirely created under 2.8.4 using the
>>> FileSystemProvider. This means my single directory contains pairs of
>>> files,
>>> e.g. MyPage.txt and MyPage.properties.
>>>
>>> I am converting to 2.10 and would like to have the facility to backout
>>> unwanted changes. I thought the VersioningFileProvider would be the
>>> simplest choice, especially as..
>>>
>>> https://jspwiki-wiki.apache.org/Wiki.jsp?page=WikiPageProviders
>>>
>>> .. still points to..
>>>
>>> http://www.ecyrd.com/JSPWiki/wiki/ContributedProviders
>>>
>>> .. which indicates these other Providers, e.g. CVS, have not yet been
>>> converted.
>>>
>>> I created a Main page in my test 2.10 system and confirmed the "OLD"
>>> directory structure was created as documented.
>>>
>>>
>>> I then cloned one of my production page-pairs into the new wiki
>>> directory:
>>>
>>> 1. The page displayed perfectly (that is a relief!).
>>>
>>> 2. I made a minor change to the page, which worked (excellent).
>>>
>>> 3. The info tab of the page said it knew about two versions of the page
>>> (excellent - I didn't expect a prior history to magically appear!)
>>>
>>> 4. The info tab identified me as the author of the most recent version
>>> (excellent - it had picked up my userid from Container authentication via
>>> the tomcat SingleSignonValve and my LDAP directory).
>>>
>>> 5. The info tab listed the initial version of the page as having
>>> "UnknownAuthor" and a date modified corresponding (probably) to the time
>>> I
>>> cloned the page (7 minutes earlier than my update).
>>>
>>> I'm disappointed the original FilmsToWatch.properties file contents have
>>> been ignored.
>>>
>>> * Cloned page properties file:
>>>      #JSPWiki page properties for page FilmsToWatch
>>>      #Fri Jan 03 14:40:07 GMT 2014
>>>      author=brian
>>>
>>> * Updated page properties file:
>>>      # JSPWiki page properties for FilmsToWatch. DO NOT MODIFY!
>>>      #Sun Jan 12 13:41:29 GMT 2014
>>>      2.author=brian
>>>
>>> Is this expected behaviour? I suppose I could write a conversion script,
>>> but I wonder whether there is a better way to convert these wiki pages
>>> along with their minimal but still meaningful history.
>>>
>>> Regards,
>>>
>>> Brian
>>>
>>>
>>
>

Re: Conversion of a wiki from FileSystemProvider to VersioningFileProvider

Posted by Brian Burch <br...@pingtoo.com>.
On 12/01/14 21:44, Juan Pablo Santos Rodríguez wrote:
> Hi Brian,
> not sure if I understand you correctly,

Yes, your reply is basically consistent with my view. However, there are 
some detail differences that I won't go into yet.

I took a quick look at the source and can see it is fairly old and due 
some tidying, e.g. lots of FIXME's and inline tabs.

I think "my" problem is caused by VersioningFileProvider not detecting 
the case where it is about to update a non-versioned page BUT which 
already has a rudimentary FileSystemProvider metadata properties file.

In my ideal world, it would detect and use the original 
MyPage.properties file, converting it to become a properly 
named/located/formatted "version 1" properties file. That way the 
original metadata would be incorporated into the new versioning metadata.

I've also found the unit tests, so I think I will write a new test case 
to demonstrate how it ought to work. It shouldn't be too hard to add the 
new logic to support my use case. I'll ask for advice if I get stuck, 
but otherwise I'll submit a patch when I have something worth committing.

Regards,

Brian

> cloned page + properties file ==
> 1st version of page on VersioningFileProvider?
>
> in that case, it should have the following contents:
>      #JSPWiki page properties for page FilmsToWatch
>      #Fri Jan 03 14:40:07 GMT 2014
>      1.author=brian
>
> so the metadata for the first version is recognized. In your case, as there
> isn't author metadata for the first version (1.author=..), you're getting
> the unkwon author. The rest of the metadata is taken from the versioned
> file itself, that's why you see it. Once you update the page the properties
> file should look like something like this:
>      # JSPWiki page properties for FilmsToWatch. DO NOT MODIFY!
>      #Sun Jan 12 13:41:29 GMT 2014
>      1.author=brian
>      2.author=brian
>
> (note that the order of the metadata's versions could vary, they don't have
> to appear in order, and also changenotes could appear following the
> VERSION.changenote schema)
>
> In your case, as you don't have valid metadata, it's ignored, so when you
> save a new version, the original content is ignored (the Properties object
> with the versioned metadata is stored directly into the properties file).
> Lastly, the properties file, if I recall correctly should be named
> "page.properties", not "PageName.properties"
>
>
> HTH,
> juan pablo
>
>
>
>
> On Sun, Jan 12, 2014 at 3:04 PM, Brian Burch <br...@pingtoo.com> wrote:
>
>> I have a large wiki entirely created under 2.8.4 using the
>> FileSystemProvider. This means my single directory contains pairs of files,
>> e.g. MyPage.txt and MyPage.properties.
>>
>> I am converting to 2.10 and would like to have the facility to backout
>> unwanted changes. I thought the VersioningFileProvider would be the
>> simplest choice, especially as..
>>
>> https://jspwiki-wiki.apache.org/Wiki.jsp?page=WikiPageProviders
>>
>> .. still points to..
>>
>> http://www.ecyrd.com/JSPWiki/wiki/ContributedProviders
>>
>> .. which indicates these other Providers, e.g. CVS, have not yet been
>> converted.
>>
>> I created a Main page in my test 2.10 system and confirmed the "OLD"
>> directory structure was created as documented.
>>
>>
>> I then cloned one of my production page-pairs into the new wiki directory:
>>
>> 1. The page displayed perfectly (that is a relief!).
>>
>> 2. I made a minor change to the page, which worked (excellent).
>>
>> 3. The info tab of the page said it knew about two versions of the page
>> (excellent - I didn't expect a prior history to magically appear!)
>>
>> 4. The info tab identified me as the author of the most recent version
>> (excellent - it had picked up my userid from Container authentication via
>> the tomcat SingleSignonValve and my LDAP directory).
>>
>> 5. The info tab listed the initial version of the page as having
>> "UnknownAuthor" and a date modified corresponding (probably) to the time I
>> cloned the page (7 minutes earlier than my update).
>>
>> I'm disappointed the original FilmsToWatch.properties file contents have
>> been ignored.
>>
>> * Cloned page properties file:
>>      #JSPWiki page properties for page FilmsToWatch
>>      #Fri Jan 03 14:40:07 GMT 2014
>>      author=brian
>>
>> * Updated page properties file:
>>      # JSPWiki page properties for FilmsToWatch. DO NOT MODIFY!
>>      #Sun Jan 12 13:41:29 GMT 2014
>>      2.author=brian
>>
>> Is this expected behaviour? I suppose I could write a conversion script,
>> but I wonder whether there is a better way to convert these wiki pages
>> along with their minimal but still meaningful history.
>>
>> Regards,
>>
>> Brian
>>
>


Re: Conversion of a wiki from FileSystemProvider to VersioningFileProvider

Posted by Juan Pablo Santos Rodríguez <ju...@gmail.com>.
Hi Brian,

not sure if I understand you correctly, cloned page + properties file ==
1st version of page on VersioningFileProvider?

in that case, it should have the following contents:
    #JSPWiki page properties for page FilmsToWatch
    #Fri Jan 03 14:40:07 GMT 2014
    1.author=brian

so the metadata for the first version is recognized. In your case, as there
isn't author metadata for the first version (1.author=..), you're getting
the unkwon author. The rest of the metadata is taken from the versioned
file itself, that's why you see it. Once you update the page the properties
file should look like something like this:
    # JSPWiki page properties for FilmsToWatch. DO NOT MODIFY!
    #Sun Jan 12 13:41:29 GMT 2014
    1.author=brian
    2.author=brian

(note that the order of the metadata's versions could vary, they don't have
to appear in order, and also changenotes could appear following the
VERSION.changenote schema)

In your case, as you don't have valid metadata, it's ignored, so when you
save a new version, the original content is ignored (the Properties object
with the versioned metadata is stored directly into the properties file).
Lastly, the properties file, if I recall correctly should be named
"page.properties", not "PageName.properties"


HTH,
juan pablo




On Sun, Jan 12, 2014 at 3:04 PM, Brian Burch <br...@pingtoo.com> wrote:

> I have a large wiki entirely created under 2.8.4 using the
> FileSystemProvider. This means my single directory contains pairs of files,
> e.g. MyPage.txt and MyPage.properties.
>
> I am converting to 2.10 and would like to have the facility to backout
> unwanted changes. I thought the VersioningFileProvider would be the
> simplest choice, especially as..
>
> https://jspwiki-wiki.apache.org/Wiki.jsp?page=WikiPageProviders
>
> .. still points to..
>
> http://www.ecyrd.com/JSPWiki/wiki/ContributedProviders
>
> .. which indicates these other Providers, e.g. CVS, have not yet been
> converted.
>
> I created a Main page in my test 2.10 system and confirmed the "OLD"
> directory structure was created as documented.
>
>
> I then cloned one of my production page-pairs into the new wiki directory:
>
> 1. The page displayed perfectly (that is a relief!).
>
> 2. I made a minor change to the page, which worked (excellent).
>
> 3. The info tab of the page said it knew about two versions of the page
> (excellent - I didn't expect a prior history to magically appear!)
>
> 4. The info tab identified me as the author of the most recent version
> (excellent - it had picked up my userid from Container authentication via
> the tomcat SingleSignonValve and my LDAP directory).
>
> 5. The info tab listed the initial version of the page as having
> "UnknownAuthor" and a date modified corresponding (probably) to the time I
> cloned the page (7 minutes earlier than my update).
>
> I'm disappointed the original FilmsToWatch.properties file contents have
> been ignored.
>
> * Cloned page properties file:
>     #JSPWiki page properties for page FilmsToWatch
>     #Fri Jan 03 14:40:07 GMT 2014
>     author=brian
>
> * Updated page properties file:
>     # JSPWiki page properties for FilmsToWatch. DO NOT MODIFY!
>     #Sun Jan 12 13:41:29 GMT 2014
>     2.author=brian
>
> Is this expected behaviour? I suppose I could write a conversion script,
> but I wonder whether there is a better way to convert these wiki pages
> along with their minimal but still meaningful history.
>
> Regards,
>
> Brian
>