cancel
Showing results for 
Search instead for 
Did you mean: 

Navigation Rule!

shanmmugarajak
Champ in-the-making
Champ in-the-making
Guys

My understaning is we define all navigations in faces-config-navigation.xml based on the string returned by the controller class of the from-view-id jsp.

I tried modifying the navigation rule of Login.jsp, the original rule is on positive cases from Login.jsp system navigates to browse.jsp, this is defined by the following rule in faces-config-navigatoin.xml

<to-view-id>/jsp/browse/browse.jsp</to-view-id>

I commented the above rule, and included the following
<to-view-id>jsp/wizard/add-content/upload.jsp</to-view-id>

I ran through build.xml and ensured I have a new WAR, inspite of this from Login it navigates to browse.jsp only!?!

Alfresco Developers/Others: Where am I missing? Is my understanding of Alfresco navigation right? Kindly throw lights on this.

Thanks
Raja
4 REPLIES 4

gavinc
Champ in-the-making
Champ in-the-making
Yes, you are doing it correctly.

I just tried doing the same and it worked fine.

The block of config I had is shown below….notice the / before the upload page jsp path, I noticed this was missing.



   <navigation-rule>
      <description>
         The decision rule used by the NavigationHandler to
         determine which view must be displayed after the
         current view, login.jsp is processed.
      </description>
      <from-view-id>/jsp/login.jsp</from-view-id>
      <navigation-case>
         <description>
             Indicates to the NavigationHandler that the browse.jsp
             view must be displayed if the Action referenced by a
             UICommand component on the login.jsp view returns
             the outcome "success".
         </description>
         <from-outcome>success</from-outcome>
         <to-view-id>/jsp/wizard/add-content/upload.jsp</to-view-id>
      </navigation-case>
   </navigation-rule>

shanmmugarajak
Champ in-the-making
Champ in-the-making
Hi Gavin

Thanks for pointing out the issue I had with the root context - not including '/', I have not headed forward positive even after including it!

The modified navigation rule is <to-view-id>/jsp/wizard/add-content/upload.jsp</to-view-id>
I rebuilt the application after making the modification.

I found in LoginBean.java, in the following line the redirectURL is set to browse.jsp

String redirectURL = (String)fc.getExternalContext().getSessionMap().get(LOGIN_REDIRECT_KEY); // HERE redirectURL is getting set to browse.jsp

Where am I missing, kindly help

Raja

kevinr
Star Contributor
Star Contributor
After a login attempt, the BrowseBean is responsible for redirecting to the page that was requested before login. If you start the app by navigating to a page such as browse.jsp then it will try to redirect you there after login, if not e.g. use something like http://yourserver:8080/alfresco then your change should work.

Thanks,

Kevin

shanmmugarajak
Champ in-the-making
Champ in-the-making
Hi

Thanks for your time and efforts. I am still stranded at the same point, BrowseBean sets the redirect URL to browse.jsp and it takes me to browse.jsp after the login.

I tried logging in as admin as well as created a new workarea login and tried the same still no luck in my endeavour.

I understand I am in the right path, but even after building the source code after making the desired changes (mentioned in the previous post of the same thread) the navigation rule change doesn't get effective!

Kindly help
Raja
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.