On 10/10/2012, at 13:59, programming...@mac.com wrote:

> The problem is that you are setting up conditionally displaying different 
> sets of tabs, but then not providing the method in the session class to do 
> so. Since you are only using one set of tabs, you really don't need that line.
> 
> If you want to see how "session.navigationRootChoice" is used, there is an 
> example in SimpleBlog that sets up simple Role based conditions for 
> displaying sets of tabs. 
> 
> You'll see the method returns "adminuser" if the administrator logs in and 
> "home" otherwise. You have already provided the "home" choices in your 
> existing plist, so you would now have to add the "adminuser" choices.


Now I understand why there is that "home = (...)" inside childrenChoices. And I 
will use this feature in the near future, so I won't change the plist like you 
advised...

The tutorial doesn't say *I* have to implement Session.navigationRootChoice(). 
Aside from that, my inexperience is also a serious issue: I still can't trust 
myself to know when something is "WOMagic" or something I have to do myself.

The tutorial, as it is, may be confusing to beginners like me. Pascal, I 
suggest you include that or simplify the plist.

> From your example it would be along the lines of: 
> 
> childrenChoices = {
> home = (
> "Produtos",
> "Fabricantes",
> );
> adminuser = (
> "Produtos",
> "Fabricantes",
> "AdminFunctions",
> );
> };
> 
> The method on session looks like this:
> 
>   public String navigationRootChoice() { 
>     Person user = (Person) user();
>     if(user != null ) {
>       if(user.isAdmin()==true) {
>         return"adminuser";
>       }
>       return "home";
>     }
>     return "none";
>   }


I made a simple "hack". I implemented the method like this:

public String navigationRootChoice() { 
      return "home";
}

And it worked, indeed!

I think it's "case closed" for now. Thanks go to David Holt, David LeBer, 
Pascal and Theodore for the huge help again!


Cheers,
Flavio
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to