1
votes

I need to run some cron job for all groups that are organisations depending on the portlet group scope preferences.

If I add portlet to the organisation page, set some preferences to portlet and then remove the portlet, preferences are not removed and cron job continues to perform task.

Is there any way to figure out that a portlet was removed or that there is no portlet with concrete id connected to particular groupId?

Environment: Liferay 6.1

1
Do you remove portlet's instance from layout or undeploy portlet's WAR file? It seems like a bug if preferences are not being deleted along with the portlet instance.Artem Shafranov

1 Answers

0
votes

You can use PortalUtil.getPlidFromPortletId(long groupId, String portletId) it will return the plid that the portlet is on, or 0 if it is not on any page.