Friday, September 18, 2009

Changing the Landing page after Login in Lotus Connections 2.5

As I described in an earlier post, how to modify the Homepage link of the navigation bar in order to display the "My page" instead of the update page, I describe in this post how to modify the Homepage redirection after logging in to Connections. We make use of the WASReqURL cookie that is set to remember the URL to a protected resource when there is no User session active. WAS redirects to the Login page and remembers the previously called URL in the WASReqURL. Via a small JavaScript on the login page, we modify this cookie to point to the My Page url. The login page is defined in dboard.war/auth/login.jsp. Add the following snippet to the head scripts of the file.


function setRedirectCookie(){
var cookieName = "WASReqURL";
var requestURL = getCookie(cookieName);
if(requestURL.substr(requestURL.length - 9) == "homepage/") {
  requestURL += "web/widgets";
}
setCookie(cookieName, requestURL, null, "/");
}


The getCookie() and setCookie() methods are copied from the example on w3schools. Note, that the setCookie() method uses a fourth parameter, which is the path that is simply appended after the expires parameter. The setRedirectCookie() method retrieves the WASReqURL and checks if it ends with "homepage/" - which is the Updates page. If thats the case, the "web/widgets" is appended, pointing to the My Page.
Post a Comment