Foren

Integrating LMS portlets into Liferay

Alex Berezin, geändert vor 13 Jahren.

Integrating LMS portlets into Liferay

Junior Member Beiträge: 30 Beitrittsdatum: 20.08.10 Neueste Beiträge
Hello,

I am new to Liferay and I want to bring in some JSR168 portlets from my LMS. The vendor provides a .WAR file that needs to be installed in Liferay but they do not support Liferay and therefore require a custom portlet handler file to be built. They include an example for WebSphere which looks like this:

package com.saba.jsrportlet;

import java.io.IOException;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

// Referenced classes of package com.saba.jsrportlet:
// SabaPortletHandler

public class SabaWebspherePortletHandler extends SabaPortletHandler
{

public SabaWebspherePortletHandler()
{
}

protected Cookie[] getCookies(RenderRequest request)
throws PortletException, IOException
{
HttpServletRequest httpRequest = (HttpServletRequest)request;
return httpRequest.getCookies();
}
}

What needs to be included in the Liferay Portlet handler file?

Thanks!
Alex B, geändert vor 13 Jahren.

RE: Integrating LMS portlets into Liferay

Junior Member Beiträge: 30 Beitrittsdatum: 20.08.10 Neueste Beiträge
Has anyone done this before?
thumbnail
Sandeep Nair, geändert vor 13 Jahren.

RE: Integrating LMS portlets into Liferay

Liferay Legend Beiträge: 1744 Beitrittsdatum: 06.11.08 Neueste Beiträge
Any success on this?
thumbnail
Mika Koivisto, geändert vor 13 Jahren.

RE: Integrating LMS portlets into Liferay

Liferay Legend Beiträge: 1519 Beitrittsdatum: 07.08.06 Neueste Beiträge
I have no idea if this works but try something like this. The key here is that instead of casting RenderRequest you can use PortalUtil.getHttpServletRequest() to get access to the HttpServletRequest.

package com.saba.jsrportlet;

import com.liferay.portal.util.PortalUtil;

import java.io.IOException;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

// Referenced classes of package com.saba.jsrportlet:
// SabaPortletHandler

public class SabaLiferayPortletHandler extends SabaPortletHandler
{

public SabaWebspherePortletHandler()
{
}

protected Cookie[] getCookies(RenderRequest request)
throws PortletException, IOException
{
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(request);
return httpRequest.getCookies();
}
}