如何将Liferay PortletPreferences转换为JSR-168 PortletPreferences?

时间:2014-08-14 13:55:09

标签: liferay portlet preferences

我正在寻找转换

的简单方法
com.liferay.portal.model.PortletPreferences

javax.portlet.PortletPreferences

1 个答案:

答案 0 :(得分:0)

public javax.portlet.PortletPreferences convert(long companyId, com.liferay.portal.model.PortletPreferences obj) throws Exception {
    long ownerId = obj.getOwnerId();
    int ownerType = obj.getOwnerType();
    long plid = obj.getPlid();
    String portletId = obj.getPortletId();
    return PortletPreferencesLocalServiceUtil.getPreferences(companyId, ownerId, ownerType, plid, portletId);