掲示板

portlet link different in production than in development

8年前 に Randy Leonard によって更新されました。

portlet link different in production than in development

New Member 投稿: 15 参加年月日: 15/11/27 最新の投稿
I have a portal app which works well in an Eclipse-managed development environment, but does not work well in a production environment. That is, same code behaves differently within different environments.

The issue is with hyperlinks to portlets in other pages. Specifically, my development environment provides links similar to that as follows:

http://localhost:8080/group/backoffice/partners/involved-parties/detail?p_p_id=involvedpartydetail_WAR_xyzportalinvolvedpartyportlet&p_p_lifecycle=0&p_p_col_id=column-1&p_p_col_count=1&_involvedpartydetail_WAR_xyzportalinvolvedpartyportlet_involvedPartyId=8a94e3855403d261015404a089300142


But the same code generates a link as follows in the production environment:

http://npp-bo-001.xyz.com:8080/c/portal/layout?p_l_id=0&p_p_id=involvedpartydetail_WAR_xyzportalinvolvedpartyportlet&p_p_lifecycle=0&p_p_col_id=column-1&p_p_col_count=1&_involvedpartydetail_WAR_xyzportalinvolvedpartyportlet_involvedPartyId=ff808181540490cd0154049df3250090


The code which generates this link is as follows:


String involvedPartyDetailPortletId = "involvedpartydetail_WAR_xyzportalinvolvedpartyportlet";
long involvedPartyDetailPlid = PortalUtil.getPlidFromPortletId(myThemeId, involvedPartyDetailPortletId);

<aui:script use="datatable,datatable-sort,datatable-scroll,liferay-portlet-url">
var columns = [
{
label : 'Name',
key : 'name',
sortable : true,
allowHTML : true,
formatter : function(o) {
var renderURL = Liferay.PortletURL
.createURL('<%= PortletURLFactoryUtil.create(request, involvedPartyDetailPortletId, involvedPartyDetailPlid, javax.portlet.PortletRequest.RENDER_PHASE) %>');
renderURL.setParameter('involvedPartyId', o.data.involvedPartyId);
return '<a href="' + renderURL.toString() + '">' + o.data.name + '</a>';
}
...........


The impact is my production environment subsequently redirects my browser to the following URL:


http://npp-bo-001.looppay.com:8080/web/guest/home


But I get the correct page when running within my production environment. A possibly relevant comment is I've added the following portal-ext.properties to my deployment, but not development environment:


virtual.hosts.valid.hosts=localhost,127.0.0.1,npp-bo-001.looppay.com


This is due to the following documented bug: https://issues.liferay.com/browse/LPS-62784

Anyhow, has anyone seen this behavior before? Suggestions?
8年前 に Randy Leonard によって更新されました。

RE: portlet link different in production than in development (回答)

New Member 投稿: 15 参加年月日: 15/11/27 最新の投稿
I have found the issue in a post from 2009:
  • https://www.liferay.com/web/raymond.auge/blog/-/blogs/deploying-plugins-to-liferay


That is, my plugin projects do not follow what seems to be a required naming convention, as Liferay derives some metadata from filenames instead of .properties files.

For the projects I've refactored to the naming convention thus far, the portlets work as expected in both development and production.
thumbnail
8年前 に Olaf Kock によって更新されました。

RE: portlet link different in production than in development

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Randy Leonard:
I have found the issue in a post from 2009:



Thanks for reporting this back (and reminding us of these default assumptions) and congratulations for finding the issue. Good job.

The good news is that Liferay 7 will drop those requirements if I understand correctly - at least (definitely) once you deploy your portlets as components instead of WARs.