cancel
Showing results for 
Search instead for 
Did you mean: 

Portal Logoff redirection URL

Former Member
0 Kudos

Hi,

I want to redirect the URL to another page from the default log on page when the user logs off. I know we can change it in ume.logoff.redirect.url and give the desired URL. But the problem is we have two different sites and each sites should return to different screens once the logoff is clicked. So the URL cannot be maintained in this property. We have two mastheads for both this sites.

I tried to figure it out in the code. The URL to be mentioned is present in logOutComponent which is part of the jar file which comes with masthead. I cant change the desired URL in that component. Where can i change the URL to get the desired result?

Regards,

p188071

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can do this by a simple modification in the LogOutComponent.java file.Search for the below code on the java file

String externalUrl = UMFactory.getProperties().get("ume.logoff.redirect.url");

Replace the above code with String externalUrl = "you own url";

Hope this will help you out.

Regards,

Harish.

benjamin_houttuin
Active Contributor
0 Kudos

Hi <name>,

I decompiled the "logOutComponent" .class and it containts the following code:

-


// Decompiled by DJ v3.6.6.79 Copyright 2004 Atanas Neshkov Date: 19-1-2008 18:04:06

// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!

// Decompiler options: packimports(3)

// Source File Name: LogOutComponent.java

package com.sapportals.portal.navigation;

import com.sap.security.api.UMFactory;

import com.sap.security.api.util.IUMParameters;

import com.sapportals.portal.prt.component.*;

import com.sapportals.portal.prt.pom.IEvent;

import com.sapportals.portal.prt.runtime.IPortalRuntimeResources;

import com.sapportals.portal.prt.runtime.PortalRuntime;

// Referenced classes of package com.sapportals.portal.navigation:

// INavigationGenerator

public class LogOutComponent extends AbstractPortalComponent

{

public LogOutComponent()

{

}

public void doOnNodeReady(IPortalComponentRequest request, IEvent event)

{

String externalUrl = UMFactory.getProperties().get("ume.logoff.redirect.url");

boolean silent = UMFactory.getProperties().getBoolean("ume.logoff.redirect.silent", false);

if(externalUrl != null && !externalUrl.equals("") && !silent)

{

request.redirect(externalUrl);

} else

{

INavigationGenerator navigationService = (INavigationGenerator)PortalRuntime.getRuntimeResources().getService("com.sap.portal.navigation.service.navigation");

String URL = navigationService.getPortalURL(request, null);

request.redirect(URL);

}

}

public void doContent(IPortalComponentRequest iportalcomponentrequest, IPortalComponentResponse iportalcomponentresponse)

{

}

}

-


As you can see this module just gets the property "ume.logoff.redirect.url", does an adittional check and then gives back this url..

Not that fancy..

My suggestion to you would be to edit the portalapp.xml, look for the component "default" and extend it with an additional component property called "MyCustomLogOffURL" for example. To do this just copy the allready excisting "Help URL" property and rename.

Example:

-


<property name="MyCustomLogOffURL" value="http://yourloggofurlforthismasthead.com">

<property name="plainDescription" value="My Custom Logoff URL" />

<property name="category" value="Navigation" />

</property>

-


Adding this property here makes you set it seperately for both the masterheads you use, because you can just set it in the Property editor of the PCD

In addition you now need to modify the "HeaderiView.jsp" a bit to use your custom parameter instead of the "logOutComponent".

To do that add the following initialisation at the beging of the jsp file:

-


final String MY_CUSTOM_LOG_OFF_URL = "MyCustomLogOffURL";

-


....and change the function GetLogoffURL so that it will look like this:

-


private String GetLogoffURL(IPortalComponentRequest request)

{

String value = (String)request.getNode().getValue(MY_CUSTOM_LOG_OFF_URL);

return value;

}

-


<h3>PLEASE TAKE NOTICE OF THE FOLLOWING</h3>

<h5>Never change the SAP component always create a copy and rename it to your own namespace!!!</h5>

Good Luck,

Benjamin Houttuin

Former Member
0 Kudos

Hi

Thanks for the reply. Thanks for your effort.....

I understand the concept which you told me in detail....

i started implementing......

At the end i could see it is redirecting to URL

http://localhost:50000/irj/servlet/prt/portal/prtroot/null

portal runtime error

An exception occurred while processing a request for:

iView : N/A

Component Name : N/A

iView not found: null.default.

Kindly Help me out...

Thanks

Regards,

Bob