掲示板

How do you generate short portelt id

9年前 に giri reddy によって更新されました。

How do you generate short portelt id

Junior Member 投稿: 61 参加年月日: 15/02/27 最新の投稿
I see my portlet id as the following.

p_p_id=EmployeeLoginPortlet_WAR_employeelogin55


How do I shorten or specify my own ID so that it will shorten other parameters. Appreciate your help.
thumbnail
9年前 に David H Nebinger によって更新されました。

RE: How do you generate short portelt id

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Yeah, I don't think you can shorten the name outside of renaming your war file and the portlet name in portlet.xml.
thumbnail
9年前 に Ravi Kumar Gupta によって更新されました。

RE: How do you generate short portelt id

Liferay Legend 投稿: 1302 参加年月日: 09/06/24 最新の投稿
Echo that.

But, you can give portlet a name like 1,2,3,... like liferay did for their own portlet or keep a short name.. Something like this..
<portlet-name>2</portlet-name>
9年前 に giri reddy によって更新されました。

RE: How do you generate short portelt id

Junior Member 投稿: 61 参加年月日: 15/02/27 最新の投稿
Ravi Kumar Gupta:
Echo that.

But, you can give portlet a name like 1,2,3,... like liferay did for their own portlet or keep a short name.. Something like this..
<portlet-name>2</portlet-name>


I can shorten name in portlet.xml. I don't have idea why it is adding war file name also. Somehow out of the box portlets from Liferay does not have problem with added string for war name.
thumbnail
9年前 に David H Nebinger によって更新されました。

RE: How do you generate short portelt id

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
giri reddy:
I don't have idea why it is adding war file name also. Somehow out of the box portlets from Liferay does not have problem with added string for war name.


What liferay does isn't the point. If you did create a portlet, say 53, without any prefix that portlet name would conflict with Liferay's. So Liferay prepends the war filename (stripped of invalid chars) to ensure there is no name conflict.

So if you changed your portlet project to build emplogin.war and portlet name of 1, you would get something like emplogin_WAR_1. You could get even shorter if you used a stupid name like a.war, but that won't be very maintenance friendly.
9年前 に giri reddy によって更新されました。

RE: How do you generate short portelt id

Junior Member 投稿: 61 参加年月日: 15/02/27 最新の投稿
David H Nebinger:
giri reddy:
I don't have idea why it is adding war file name also. Somehow out of the box portlets from Liferay does not have problem with added string for war name.


What liferay does isn't the point. If you did create a portlet, say 53, without any prefix that portlet name would conflict with Liferay's. So Liferay prepends the war filename (stripped of invalid chars) to ensure there is no name conflict.

So if you changed your portlet project to build emplogin.war and portlet name of 1, you would get something like emplogin_WAR_1. You could get even shorter if you used a stupid name like a.war, but that won't be very maintenance friendly.


Thanks David. That perfectly makes sense. I will try to have short war name and portlet name