You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Johan Compagner <jc...@gmail.com> on 2007/02/09 22:22:49 UTC

Page.getVersion... shouldn't we depricate it in 1.3/2.0?

/**
     * Override this method to implement a custom way of producing a version
of
     * a Page when it cannot be found in the Session.
     *
     * @param versionNumber
     *            The version desired
     * @return A Page object with the component/model hierarchy that was
     *         attached to this page at the time represented by the
requested
     *         version.
     */
    public Page getVersion(final int versionNumber)

because that is really a thing for the IPageStore now..

johan

Re: [Vote] Page.getVersion... shouldn't we depricate it in 1.3/2.0?

Posted by Jan Vermeulen <ja...@isencia.com>.

Jan Vermeulen wrote:
> 
> And you should manipulate the versionManager of that copy, so that it
> points to the correct versionNumber.
> 

Sorry, not needed. That's done by the rollback.

Jan.

-- 
View this message in context: http://www.nabble.com/Page.getVersion...-shouldn%27t-we-depricate-it-in-1.3-2.0--tf3202885.html#a8929000
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: [Vote] Page.getVersion... shouldn't we depricate it in 1.3/2.0?

Posted by Jan Vermeulen <ja...@isencia.com>.

Johan Compagner wrote:
> 
> or i can make it so that it returns really an page copy with that version.
> 

Just some thoughts about the idea of copying a page:

I have been experimenting with making copies of pages, and there are some
tricky things to take care of. The page has internal flags that indicate
temporary state, which you might not want in the copy. And you should
manipulate the versionManager of that copy, so that it points to the correct
versionNumber.


Johan Compagner wrote:
> 
> The question is what api doe we want:
> 
> Page page = page.getVersion(versionnumber)
> Page page = pagemap.get(pageid,versionnumber)
> 

I prefer:

Page page = pagemap.get(pageid,versionnumber)

Jan.
-- 
View this message in context: http://www.nabble.com/Page.getVersion...-shouldn%27t-we-depricate-it-in-1.3-2.0--tf3202885.html#a8928893
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: [Vote] Page.getVersion... shouldn't we depricate it in 1.3/2.0?

Posted by Igor Vaynberg <ig...@gmail.com>.
i think we should externalize it away from the page. the page doesnt need to
know HOW it is versioned, all it needs to have is a listener for when its
state is changed and we have that through addStateChange

-igor


On 2/12/07, Johan Compagner <jc...@gmail.com> wrote:
>
> or i can make it so that it returns really an page copy with that version.
>
> But only SecondLevel can do that ofcourse i can make it so that also
> AccessStack does that..
> That when it sees that a page version is asked for that is not the
> current.
> It first makes a copy and then rollbacks the changes..
>
> The question is what api doe we want:
>
>
> Page page = page.getVersion(versionnumber)
>
> Page page = pagemap.get(pageid,versionnumber)
>
> johan
>
>
>
>
> On 2/12/07, Jan Vermeulen <ja...@isencia.com> wrote:
> >
> >
> > I think you should, because it can leave your page in an inconsistent
> > state,
> > when calling this method while a new version is being created. So it is
> > better that the user of the framework has no access to this option.
> >
> > Jan.
> > --
> > View this message in context:
> >
> http://www.nabble.com/Page.getVersion...-shouldn%27t-we-depricate-it-in-1.3-2.0--tf3202885.html#a8922120
> > Sent from the Wicket - Dev mailing list archive at Nabble.com.
> >
> >
>

Re: [Vote] Page.getVersion... shouldn't we depricate it in 1.3/2.0?

Posted by Johan Compagner <jc...@gmail.com>.
or i can make it so that it returns really an page copy with that version.

But only SecondLevel can do that ofcourse i can make it so that also
AccessStack does that..
That when it sees that a page version is asked for that is not the current.
It first makes a copy and then rollbacks the changes..

The question is what api doe we want:


Page page = page.getVersion(versionnumber)

Page page = pagemap.get(pageid,versionnumber)

johan




On 2/12/07, Jan Vermeulen <ja...@isencia.com> wrote:
>
>
> I think you should, because it can leave your page in an inconsistent
> state,
> when calling this method while a new version is being created. So it is
> better that the user of the framework has no access to this option.
>
> Jan.
> --
> View this message in context:
> http://www.nabble.com/Page.getVersion...-shouldn%27t-we-depricate-it-in-1.3-2.0--tf3202885.html#a8922120
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>

Re: [Vote] Page.getVersion... shouldn't we depricate it in 1.3/2.0?

Posted by Jan Vermeulen <ja...@isencia.com>.
I think you should, because it can leave your page in an inconsistent state,
when calling this method while a new version is being created. So it is
better that the user of the framework has no access to this option.

Jan. 
-- 
View this message in context: http://www.nabble.com/Page.getVersion...-shouldn%27t-we-depricate-it-in-1.3-2.0--tf3202885.html#a8922120
Sent from the Wicket - Dev mailing list archive at Nabble.com.