cancel
Showing results for 
Search instead for 
Did you mean: 

Portal log-off Landing page based on condition

piyush_kumar6
Active Contributor
0 Kudos

Hi All,

I have one requirement in which after log-off i have to redirect the landing page

to different url based on condition.

In My portal we have 2 log on screen ( Implemented using anonymous Login)

suppose one for supplier and one for buyer and we have 2 different desktop also in portal for

each group, My requirement is if Supplier log out from his log-in then it should go to Supplier log-in page,

same way if buyer log out it should go to buyer log-in page.


Supplier url : http://hostname:50000/irj/portal
Buyer url :   http://hostname:50000/irj/portal/anonymous

Regards,

Piyush

Accepted Solutions (0)

Answers (1)

Answers (1)

p330068
Active Contributor
0 Kudos

Hi Piyush,

For your requirement, you need to modify LogoffConfirmMsg.jsp in masthead.par

Please search for modifying par file

Hope it will helps

Regards

Arun

hofmann
Active Contributor
0 Kudos

Hi,

the LogoffConfirmMsg.jsp is responsible for showing the message: "Do you really want to logoff", called in the mastehead:

var val = window.showModalDialog('/irj/servlet/prt/portal/prtroot/com.sap.portal.navigation.masthead.logoffConfirmMsg?UnsavedData=true', '', 'dialogHeight: 170px; dialogWidth: 350px; edge: Raised; center: Yes; help: No; resizable: No; status: No');

To modify the redirect, the portal only offers 1 parameter (Visual Administrator), so by default you cannot define it per user basis. This is done by modifying the masthead application:

- Create 2 versions (1 for every redirect)

- Assign the masthead to the corresponding desktop:

Suppliers will use mastheadA and Buyers mastheadB

- In the masthead, the part responsible for doing the post-logoff part (the actual redirect) is:


<form name="logoffForm" style="display:none;position:absolute;top:-5000;left:-5000" action="/irj/servlet/prt/portal/prtroot/com.sap.portal.navigation.masthead.LogOutComponent" method="POST">
	<input type="hidden" name="logout_submit" value="true"></input>
</form>

So you'll have to modify com.sap.portal.navigation.masthead.LogOutComponent.

Look at:


public void doOnNodeReady(IPortalComponentRequest request, IEvent event)
    {
        String externalUrl = UMFactory.getProperties().get("ume.logoff.redirect.url");

The component is reading the UME parameter: ume.logoff.redirect.url

This is the part you'll have to replace. You can make this hardcoded (ugly) or create an iView parameter. With an iView parameter you can define this property in the portal administration.

br,

Tobias

piyush_kumar6
Active Contributor
0 Kudos

HI Tobias,

Thanks for your reply.

But i am not getting below doOnNodeReady() function code in masmasthead

 public void doOnNodeReady(IPortalComponentRequest request, IEvent event)
    {
        String externalUrl = UMFactory.getProperties().get("ume.logoff.redirect.url");

In HeaderiView.jsp i got getExternalLogOffUrl () function ,

which i have changed like below but its not redirecting to that page.


private String getExternalLogOffUrl()
{
    String custUrl="/irj/portal/anonymous?guest_user=etender";
  //return UMFactory.getProperties().get("ume.logoff.redirect.url"); 
  return custUrl;   
} 

I am using EP 7.01.

Regards,

Piyush

Former Member
0 Kudos

Hi Piyush ,

I think what Tobias means to say is that you will have to create a Custom Logout Component and place that piece of code over there .

Then in the form statement you can redirect the control to this component .

Regards

Mayank

hofmann
Active Contributor
0 Kudos

Hi,

So you'll have to modify com.sap.portal.navigation.masthead.LogOutComponent.

You'll have to modify the Java code of LogOutComponent and not the masthead JSP. You'll have to decompile the .class file and compile it again.

If you don't want to do this, you can modify the masthead JSP. Add some code that will read the iView parameter there.

br,

Tobias