You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Sergio Vieira Rolanski <se...@strategos.com.br> on 2012/09/03 16:37:21 UTC

Creating runtime Navigation Cases

Hi,

I'm dynamically creating a menu (JSCookMenu) by reading the menu and
submenus from the database.

I'm also create navigation cases and add them to RuntimeConfig, this was
working just fine with MyFaces/Tomahawk 1.1.

I'm trying to upgrade to MyFaces/Tomahawk 2.0 and this dynamic menu
creation code only works when I'm in development mode by setting
"javax.faces.PROJECT_STAGE" to "development".

Is this intended behaviour?

--
Sergio

Re: Creating runtime Navigation Cases

Posted by Sergio Vieira Rolanski <se...@gmail.com>.
Ok, will do, thanks a lot.

2012/9/3 Mike Kienenberger <mk...@gmail.com>

> I would say it's intended behavior.   In a production system,
> configuration files do not get reloaded.
>
> However, I suspect you're now in the realm of non-specified JSF
> design.   The way that the Runtime configuration works is specific to
> the MyFaces implementation.
>
> The portable solution is to write a NavigationHandler rather than to
> try to populate the navigation case rules.
>
>
>
> On Mon, Sep 3, 2012 at 1:40 PM, Sergio Vieira Rolanski
> <se...@strategos.com.br> wrote:
> > Do you know if that is the intended behaviour or is it a bug?
> >
> > (Just want to be sure, before I open a bug report.)
> >
> > 2012/9/3 Mike Kienenberger <mk...@gmail.com>
> >
> >> Actually, that's probably exactly the reason, now that you point it out.
> >>
> >> Configuration files are not re-read in production mode, so calling
> >> setNavigationRulesChanged() won't have any effect.
> >>
> >>
> >>
> >> On Mon, Sep 3, 2012 at 1:13 PM, Sergio Vieira Rolanski
> >> <se...@gmail.com> wrote:
> >> > That is nice idea.
> >> >
> >> > Nevertheless, I'm calling
> >> "runtimeConfig.setNavigationRulesChanged(true);"
> >> > and MyFaces doesn't seem to take into account, unless MyFaces is in
> >> > development mode. So, it seems like a bug to me.
> >> >
> >> > 2012/9/3 Mike Kienenberger <mk...@gmail.com>
> >> >
> >> >> I don't use JSCookMenu, but I took a different approach for
> navigation.
> >> >>
> >> >> Rather than creating navigation cases and adding them to the
> >> >> RuntimeConfig, you can create your own navigation handler.   If the
> >> >> navigation case matches your rules, perform the navigation..
> >> >> Otherwise, delegate back to the original navigation handler.
> >> >>
> >> >> On Mon, Sep 3, 2012 at 10:37 AM, Sergio Vieira Rolanski
> >> >> <se...@strategos.com.br> wrote:
> >> >> > Hi,
> >> >> >
> >> >> > I'm dynamically creating a menu (JSCookMenu) by reading the menu
> and
> >> >> > submenus from the database.
> >> >> >
> >> >> > I'm also create navigation cases and add them to RuntimeConfig,
> this
> >> was
> >> >> > working just fine with MyFaces/Tomahawk 1.1.
> >> >> >
> >> >> > I'm trying to upgrade to MyFaces/Tomahawk 2.0 and this dynamic menu
> >> >> > creation code only works when I'm in development mode by setting
> >> >> > "javax.faces.PROJECT_STAGE" to "development".
> >> >> >
> >> >> > Is this intended behaviour?
> >> >> >
> >> >> > --
> >> >> > Sergio
> >> >>
> >>
>

Re: Creating runtime Navigation Cases

Posted by Mike Kienenberger <mk...@gmail.com>.
I would say it's intended behavior.   In a production system,
configuration files do not get reloaded.

However, I suspect you're now in the realm of non-specified JSF
design.   The way that the Runtime configuration works is specific to
the MyFaces implementation.

The portable solution is to write a NavigationHandler rather than to
try to populate the navigation case rules.



On Mon, Sep 3, 2012 at 1:40 PM, Sergio Vieira Rolanski
<se...@strategos.com.br> wrote:
> Do you know if that is the intended behaviour or is it a bug?
>
> (Just want to be sure, before I open a bug report.)
>
> 2012/9/3 Mike Kienenberger <mk...@gmail.com>
>
>> Actually, that's probably exactly the reason, now that you point it out.
>>
>> Configuration files are not re-read in production mode, so calling
>> setNavigationRulesChanged() won't have any effect.
>>
>>
>>
>> On Mon, Sep 3, 2012 at 1:13 PM, Sergio Vieira Rolanski
>> <se...@gmail.com> wrote:
>> > That is nice idea.
>> >
>> > Nevertheless, I'm calling
>> "runtimeConfig.setNavigationRulesChanged(true);"
>> > and MyFaces doesn't seem to take into account, unless MyFaces is in
>> > development mode. So, it seems like a bug to me.
>> >
>> > 2012/9/3 Mike Kienenberger <mk...@gmail.com>
>> >
>> >> I don't use JSCookMenu, but I took a different approach for navigation.
>> >>
>> >> Rather than creating navigation cases and adding them to the
>> >> RuntimeConfig, you can create your own navigation handler.   If the
>> >> navigation case matches your rules, perform the navigation..
>> >> Otherwise, delegate back to the original navigation handler.
>> >>
>> >> On Mon, Sep 3, 2012 at 10:37 AM, Sergio Vieira Rolanski
>> >> <se...@strategos.com.br> wrote:
>> >> > Hi,
>> >> >
>> >> > I'm dynamically creating a menu (JSCookMenu) by reading the menu and
>> >> > submenus from the database.
>> >> >
>> >> > I'm also create navigation cases and add them to RuntimeConfig, this
>> was
>> >> > working just fine with MyFaces/Tomahawk 1.1.
>> >> >
>> >> > I'm trying to upgrade to MyFaces/Tomahawk 2.0 and this dynamic menu
>> >> > creation code only works when I'm in development mode by setting
>> >> > "javax.faces.PROJECT_STAGE" to "development".
>> >> >
>> >> > Is this intended behaviour?
>> >> >
>> >> > --
>> >> > Sergio
>> >>
>>

Re: Creating runtime Navigation Cases

Posted by Sergio Vieira Rolanski <se...@strategos.com.br>.
Do you know if that is the intended behaviour or is it a bug?

(Just want to be sure, before I open a bug report.)

2012/9/3 Mike Kienenberger <mk...@gmail.com>

> Actually, that's probably exactly the reason, now that you point it out.
>
> Configuration files are not re-read in production mode, so calling
> setNavigationRulesChanged() won't have any effect.
>
>
>
> On Mon, Sep 3, 2012 at 1:13 PM, Sergio Vieira Rolanski
> <se...@gmail.com> wrote:
> > That is nice idea.
> >
> > Nevertheless, I'm calling
> "runtimeConfig.setNavigationRulesChanged(true);"
> > and MyFaces doesn't seem to take into account, unless MyFaces is in
> > development mode. So, it seems like a bug to me.
> >
> > 2012/9/3 Mike Kienenberger <mk...@gmail.com>
> >
> >> I don't use JSCookMenu, but I took a different approach for navigation.
> >>
> >> Rather than creating navigation cases and adding them to the
> >> RuntimeConfig, you can create your own navigation handler.   If the
> >> navigation case matches your rules, perform the navigation..
> >> Otherwise, delegate back to the original navigation handler.
> >>
> >> On Mon, Sep 3, 2012 at 10:37 AM, Sergio Vieira Rolanski
> >> <se...@strategos.com.br> wrote:
> >> > Hi,
> >> >
> >> > I'm dynamically creating a menu (JSCookMenu) by reading the menu and
> >> > submenus from the database.
> >> >
> >> > I'm also create navigation cases and add them to RuntimeConfig, this
> was
> >> > working just fine with MyFaces/Tomahawk 1.1.
> >> >
> >> > I'm trying to upgrade to MyFaces/Tomahawk 2.0 and this dynamic menu
> >> > creation code only works when I'm in development mode by setting
> >> > "javax.faces.PROJECT_STAGE" to "development".
> >> >
> >> > Is this intended behaviour?
> >> >
> >> > --
> >> > Sergio
> >>
>

Re: Creating runtime Navigation Cases

Posted by Mike Kienenberger <mk...@gmail.com>.
Actually, that's probably exactly the reason, now that you point it out.

Configuration files are not re-read in production mode, so calling
setNavigationRulesChanged() won't have any effect.



On Mon, Sep 3, 2012 at 1:13 PM, Sergio Vieira Rolanski
<se...@gmail.com> wrote:
> That is nice idea.
>
> Nevertheless, I'm calling "runtimeConfig.setNavigationRulesChanged(true);"
> and MyFaces doesn't seem to take into account, unless MyFaces is in
> development mode. So, it seems like a bug to me.
>
> 2012/9/3 Mike Kienenberger <mk...@gmail.com>
>
>> I don't use JSCookMenu, but I took a different approach for navigation.
>>
>> Rather than creating navigation cases and adding them to the
>> RuntimeConfig, you can create your own navigation handler.   If the
>> navigation case matches your rules, perform the navigation..
>> Otherwise, delegate back to the original navigation handler.
>>
>> On Mon, Sep 3, 2012 at 10:37 AM, Sergio Vieira Rolanski
>> <se...@strategos.com.br> wrote:
>> > Hi,
>> >
>> > I'm dynamically creating a menu (JSCookMenu) by reading the menu and
>> > submenus from the database.
>> >
>> > I'm also create navigation cases and add them to RuntimeConfig, this was
>> > working just fine with MyFaces/Tomahawk 1.1.
>> >
>> > I'm trying to upgrade to MyFaces/Tomahawk 2.0 and this dynamic menu
>> > creation code only works when I'm in development mode by setting
>> > "javax.faces.PROJECT_STAGE" to "development".
>> >
>> > Is this intended behaviour?
>> >
>> > --
>> > Sergio
>>

Re: Creating runtime Navigation Cases

Posted by Sergio Vieira Rolanski <se...@gmail.com>.
That is nice idea.

Nevertheless, I'm calling "runtimeConfig.setNavigationRulesChanged(true);"
and MyFaces doesn't seem to take into account, unless MyFaces is in
development mode. So, it seems like a bug to me.

2012/9/3 Mike Kienenberger <mk...@gmail.com>

> I don't use JSCookMenu, but I took a different approach for navigation.
>
> Rather than creating navigation cases and adding them to the
> RuntimeConfig, you can create your own navigation handler.   If the
> navigation case matches your rules, perform the navigation..
> Otherwise, delegate back to the original navigation handler.
>
> On Mon, Sep 3, 2012 at 10:37 AM, Sergio Vieira Rolanski
> <se...@strategos.com.br> wrote:
> > Hi,
> >
> > I'm dynamically creating a menu (JSCookMenu) by reading the menu and
> > submenus from the database.
> >
> > I'm also create navigation cases and add them to RuntimeConfig, this was
> > working just fine with MyFaces/Tomahawk 1.1.
> >
> > I'm trying to upgrade to MyFaces/Tomahawk 2.0 and this dynamic menu
> > creation code only works when I'm in development mode by setting
> > "javax.faces.PROJECT_STAGE" to "development".
> >
> > Is this intended behaviour?
> >
> > --
> > Sergio
>

Re: Creating runtime Navigation Cases

Posted by Mike Kienenberger <mk...@gmail.com>.
I don't use JSCookMenu, but I took a different approach for navigation.

Rather than creating navigation cases and adding them to the
RuntimeConfig, you can create your own navigation handler.   If the
navigation case matches your rules, perform the navigation..
Otherwise, delegate back to the original navigation handler.

On Mon, Sep 3, 2012 at 10:37 AM, Sergio Vieira Rolanski
<se...@strategos.com.br> wrote:
> Hi,
>
> I'm dynamically creating a menu (JSCookMenu) by reading the menu and
> submenus from the database.
>
> I'm also create navigation cases and add them to RuntimeConfig, this was
> working just fine with MyFaces/Tomahawk 1.1.
>
> I'm trying to upgrade to MyFaces/Tomahawk 2.0 and this dynamic menu
> creation code only works when I'm in development mode by setting
> "javax.faces.PROJECT_STAGE" to "development".
>
> Is this intended behaviour?
>
> --
> Sergio