← Back to team overview

mugle-dev team mailing list archive

Re: Mugle UI

 

Hi Scott,

Thanks for the details.

> The framework is working, but i have no idea whether its final or not, i
> spent last weekend wrapping my head around it, and getting just a basic
> module to load, as its all based on Prageeth's code.

Which framework? The UI framework, or the data access framework?

> As far as adding on to what's existing, you want to look at the last method
> in MugleUIBuilder - buildByHistory() token.
>
> Inside the function you get access to the historyToken, the details of the
> currently logged in User (the LoginInfo details provided by GAE, and the
> User class from the datastore) and the HorizontalPanel panel, which is what
> you need to add GWT elements to to render the desired content in that
> section.
>
> based on the historyToken this function builds the dynamic content in the
> main right panel once you're logged in, and follows the basic layout of;

So "historyToken" is just the fragment part of the URL, right? (The
part that comes after the '#'). Is that a standard terminology? The
name implies it's something to do with the browser's back button. If
that isn't standard terminology, could we call it 'urlFragment'?

>
> if (historyToken.substring().equals(!/moduleName=) {
>    panel.add( <GWT elements which contain all the desired info for this
> view> )
> }
>
> I've had currently planned to separate each of these "views" out into
> separate classes, the one existing at the moment is UserViewBuilder - which
> basically builds up a separate panel, which is returned, and then added to
> the panel in build
>
> Anything that builds within this function i have been planning to put in
> separate classes - UserViewBuilder being the current working example.

OK. So that function could get quite large. I would recommend moving
the handler code for each URL into the individual ViewBuilder class.

So you're saying that we have a XXXViewBuilder class for each view,
and that gets instantiated by MugleUiBuilder.buildByHistoryToken based
on the fragment part of the URL? So I just need to create a new
XXXViewBuilder, such as GameViewBuilder.

Does this work yet? I tried changing the URL to
#!/user=test@xxxxxxxxxxx but nothing happened. How do I trigger
buildByHistoryToken?


Follow ups

References