← Back to team overview

mugle-dev team mailing list archive

Re: Mugle UI

 

Hi,

I just had a look at the code and overall it is quite easy to follow what is
happening.

Regarding the management of the right content panel:
#!/user=<user id> causes the correct user information to be loaded but
#!/user=<user name> does not.

I agree with Matt that buildByHistoryToken is likely to become bloated and
code could be moved into the XXXViewBuilder classes. For example, the try
and catch block could go into UserViewBuilder. Then all these classes could
also be called through a common interface (if methods were not static) or at
least through the same static method on all classes (e.g.
XXXViewBuilder.produceView()).

How would the history token be changed when clicking on one of the menu
items in the left panel? Is it enough to call History.newItem(...) in click
handlers associated with each of these menu items?

Jens


On Sat, May 14, 2011 at 10:04 PM, Matt Giuca <matt.giuca@xxxxxxxxx> wrote:

> 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?
>
> --
> Mailing list: https://launchpad.net/~mugle-dev
> Post to     : mugle-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~mugle-dev
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References