cancel
Showing results for 
Search instead for 
Did you mean: 

Problem overriding navigation to add custom jsp

lnagra
Champ in-the-making
Champ in-the-making
I've been greatly helped by the SDK. It's been a great hint on how to develop for Alfresco.

But, I am having some trouble adding a custom jsp to Alfresco 1.4

I have added a new browse page as follows:

web/jsp/extension/browse/browse_landing.jsp

I want this to override the default browse page. I chose to do this by adding this to a faces-config.xml in the META-INF folder:


<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
                              "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
  
   <navigation-rule>
      <from-view-id>/jsp/login.jsp</from-view-id>
         <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>/jsp/extension/browse/browse_landing.jsp</to-view-id>
         </navigation-case>
   </navigation-rule>

</faces-config>

I packaged it together as in the SDK custom jsp sample, deployed to my Alfresco install and restarted. However, it doesn't seem as though my faces-config.xml has been read. I can navigate manually to my new browse_landing.jsp page but my overriden navigation doesn't seem to work.

Is there a step I've missed or something I've done wrong? Any help would be greatly appreciated.

Thanks,

Lakh
3 REPLIES 3

gavinc
Champ in-the-making
Champ in-the-making
There is another navigation rule you need to override:

<navigation-rule>
      <from-view-id>/jsp/*</from-view-id>
      <navigation-case>
         <from-outcome>browse</from-outcome>
         <to-view-id>/jsp/browse/browse_landing.jsp</to-view-id>
      </navigation-case>
</navigation-rule>

Try adding this and see if that helps.

lnagra
Champ in-the-making
Champ in-the-making
Many thanks Gavin,

This now works. For future undestanding, could you help explain why both of them are needed - I'm a little unclear as to the purpose of each.

Thanks,

Lakh

gavinc
Champ in-the-making
Champ in-the-making
The first rule you overrode covers the scenario of logging in i.e. going from /jsp/login.jsp. We use the "browse" outcome in multiple places throughout the app to re-show the main screen.

The 2nd rule we overrode basically covers the use of "browse" anywhere in the application.