Is there a way to avoid the colon(:) sign in a Place's prefix ???

214 views
Skip to first unread message

karthik reddy

unread,
Jan 2, 2011, 2:50:03 AM1/2/11
to google-we...@googlegroups.com
.....................#prefix:token      Vs         ...........#prefix           

I am trying to achieve the latter. Is there a way to do it??? 

Making prefix empty using @Prefix("") does not seem to cut it.

FYI:   The new google groups UI which seems to have to been built using GWT, is successfully able to do this but am not able to figure out how.



Would appreciate any thoughts/ideas

thanks

Thomas Broyer

unread,
Jan 2, 2011, 9:46:56 AM1/2/11
to google-we...@googlegroups.com
The PlaceHistoryMapper implementation generated by GWT.create() enforces these prefix+token pairs (it extends AbstractPlaceHistoryMapper), but PlaceHistoryHandler does not, and you can very well implement the PlaceHistoryMapper interface by yourself, using the "pattern" you like. In this case though, you have to do everything by yourself, you cannot benefit from the @WithTokenizers/@Prefix and/or factory that are used by the code generator.

karthik reddy

unread,
Jan 2, 2011, 1:06:45 PM1/2/11
to google-we...@googlegroups.com
I do not want to re-invent the wheel here if someone has already customized the behavior of the prefix by implementing the PlaceHistoryMapper  interface, as Thomas mentioned. If someone has already done it , would appreciate if you could provide the code samples.

Thomas

I see that you have submitted related to this.


"Then, the empty-prefix (@Prefix("")) is special-cased to:
 - not insert the ":" separator when generating tokens"
I guess, the patch has not made it to 2.1.1.

thanks

Thomas Broyer

unread,
Jan 2, 2011, 1:41:12 PM1/2/11
to google-we...@googlegroups.com


On Sunday, January 2, 2011 7:06:45 PM UTC+1, karthik reddy wrote:
Thomas

I see that you have submitted related to this.


"Then, the empty-prefix (@Prefix("")) is special-cased to:
 - not insert the ":" separator when generating tokens"
I guess, the patch has not made it to 2.1.1.

chm124

unread,
Jan 18, 2011, 10:41:42 AM1/18/11
to Google Web Toolkit
Hi
I've read the notes from karthik reddy and the following answers from
Thomas Broyer.
Simply said i want to do the same like karthik asked for in the
initial posting.
I've also read Th.Broyers articles about (GWT-2.1) activities and
places and also "Allow a fallback PlaceTokenizer, or pre-
processor" (https://jira.springsource.org/browse/ROO-1276) ... but,
to be honest, i do not completly understand all, yet. :(

I'm currently using GWT_2.2.1 (at time i cannot be more precise
concerning the version); and at time i use

// in MyModule.java i use the "standard/default classes"
AppPlaceHistoryMapper historyMapper =
GWT.create(AppPlaceHistoryMapper.class);
PlaceHistoryHandler historyHandler = new
PlaceHistoryHandler(historyMapper);
// ...
ActivityMapper activityMapper = new AppActivityMapper(clientFactory);
ActivityManager activityManager = new ActivityManager(activityMapper,
eventBus);

AppPlaceHistoryMapper is the "standard" from "HelloMvp"-demoApp:
@WithTokenizers({HomePlace.Tokenizer.class,
UserPrefsPlace.Tokenizer.class})
public interface AppPlaceHistoryMapper extends PlaceHistoryMapper {}

I can use now one time '@Prefix("")', but when i use '@Prefix("")'
several times, i got the following error:
"Deferred binding failed for
'ch.webmover.test.gwt.playgroundModul.client.mvp.AppPlaceHistoryMapper' (did
you forget to inherit a required module?) ..."

So what is (on GWT_2.1.1/mvp-framework) "best practice" to have more
flexability over historyToken-Places-Mapping?
Our Project isn't as simple as the HelloMVP,
i dream about tokens like '#contactList',
'#contactDetail;cid=5467946',
maybe also things like
'#campaign/setup', '#campaign/start' ... which could be also
'#campaign:setup', '#campaign:start' ... but several times the same
prefix seams to be forbidden. so ... what "exactly" should i do ...
... or, what concrete classes (implementing which interfaces) do i
have to implement?
In "GWT 2.1 Places – Part II" (http://tbroyer.posterous.com/gwt-21-
places-part-ii) "Using a factory for your PlaceTokenizer" Th.Broyers
taks about using PlaceHistoryHandlerWithFactory or
PlaceHistoryMapperWithFactory<F> ...

i would be very thankful for a +/- precise guidance like in the way
of:
"implement concrete class Xyz which must implement $Interface ... etc.
etc."
Thanks in advance,
greez, _christoph


Martin Ždila

unread,
Jan 20, 2011, 9:25:36 AM1/20/11
to Google Web Toolkit
Hello

You can star the issue at http://code.google.com/p/google-web-toolkit/issues/detail?id=5899.

Best regards
--
Martin Ždila

karthik...@gmail.com

unread,
Jan 20, 2011, 11:58:30 AM1/20/11
to google-we...@googlegroups.com
Thanks Martin for opening an issue. Also, please feel to share with us any code related to implementing your own PlaceHistoryMapper, Tokenizers ,  to circumvent this issue. 

This is an issue a lot of developers would eventually face . I would encourage developers to star this issue in the aforementioned location. Hopefully, the GWT team will pick it up for 2.3. 

Nick Siderakis

unread,
May 10, 2012, 4:36:32 PM5/10/12
to google-we...@googlegroups.com
Workaround for using "/" rather than ":" as the place delimiter post here http://puretech.siderakis.com/2012/05/custom-delimiter-in-gwt-places.html
Reply all
Reply to author
Forward
0 new messages