ProxyPlace: converting a token to EntityProxy

23 views
Skip to first unread message

Y2i

unread,
Nov 7, 2010, 12:59:58 PM11/7/10
to Google Web Toolkit
I'd like to implement something similar to non-existent ProxyPlace:
http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/index.html?com/google/gwt/app/place/ProxyPlace.html

Is there a standard way to convert a token to a sub-class of
EntityProxy in PlaceTokenizer<P>.getPlace(String token)?
Should I use my own sub-class of AbstractPlaceHistoryMapper<F> instead
of combination of PlaceTokenizer<P> and PlaceHistoryMapper?
If AbstractPlaceHistoryMapper<F> is the best alternative, what would
be the best candidate for a token? Should it be a string
representation of Entity's ID or something else?

Your thoughts will be greatly appreciated!
Yuri

Thomas Broyer

unread,
Nov 7, 2010, 3:57:05 PM11/7/10
to Google Web Toolkit


On 7 nov, 18:59, Y2i <yur...@gmail.com> wrote:
> I'd like to implement something similar to non-existent ProxyPlace:http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/index.html?c...
>
> Is there a standard way to convert a token to a sub-class of
> EntityProxy in PlaceTokenizer<P>.getPlace(String token)?

RequestFactory#getProxyId
http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/requestfactory/shared/RequestFactory.html#getProxyId(java.lang.String)
(if you used getHistoryToken to generate the token, of course)

> Should I use my own sub-class of AbstractPlaceHistoryMapper<F> instead
> of combination of PlaceTokenizer<P> and PlaceHistoryMapper?

No, you have to create a PlaceTokenizer for the ProxyPlace, which
you'll initialize with a RequestFactory instance (which means you have
to use PlaceHistoryMapperWithFactory with a method in your factory
creating the PlaceTokenizer with the RequestFactory)

You can actually find the code for ProxyPlace et al. if you go back in
history in the SVN repository.
(or download GWT 2.1 M3 for example, which contained them)

Y2i

unread,
Nov 8, 2010, 1:11:43 AM11/8/10
to Google Web Toolkit
Thomas,

Thanks a lot for your response, it was very helpful!

Yuri

On Nov 7, 11:57 pm, Thomas Broyer <t.bro...@gmail.com> wrote:
> On 7 nov, 18:59, Y2i <yur...@gmail.com> wrote:
>
> > I'd like to implement something similar to non-existent ProxyPlace:http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/index.html?c...
>
> > Is there a standard way to convert a token to a sub-class of
> > EntityProxy in PlaceTokenizer<P>.getPlace(String token)?
>
> RequestFactory#getProxyIdhttp://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/g...)
Reply all
Reply to author
Forward
0 new messages