The thing, that portlet ID equals to portlet's name, if the portlet is within Liferay portal, i.e. ROOT
.
But if you trying to get name for the portlet within other war file (e.g. plugin environment), in this case portlet name is generated according this rule:
[portlet ID] + _WAR_ + [webapp name, where portlet is placed]
Please note, that both portlet ID
and webapp name
exclude -
from their names.
So, if you have portlet with id some-portlet-id
within WAR-file some-portlet
, so the portlet name is something like the following:
someportletid_WAR_someportlet
This also reffers to Liferay's themes names.
Also please keep in mind, that also Liferay portlet's name has optional instance ID:
[portlet ID] + _WAR_ + [webapp name, where portlet is placed] + _INSTANCE_ + [portlet instance ID]
They are necessary for those portlets, where instansable
is true. This is basically 4 arbitrary letters.
someportletid_WAR_someportlet_INSTANCE_abcd
But please be carefull with them, just because you can ignore that instance IDs and put everything you want. But if you need to get a particular instance with some pre-filled data (e.g. portlet preferences), you definitelly need to know that somehow.