留言板

What happens to portlet data when a portlet/page is deleted?

thumbnail
Cameron McBride,修改在12 年前。

What happens to portlet data when a portlet/page is deleted?

Expert 帖子: 269 加入日期: 11-2-8 最近的帖子
Since there is no easy way to hook into when a portlet is deleted this concerns me as to what Liferay actually cleans up.

If a portlet has 20 portlet preferences and the portlet is deleted does Liferay clean up those items from the database?
Same scenario but a page full of portlets is deleted, is there any cleanup?
Same scenario but an entire site is deleted, is there any cleanup?

In our environment we are wanting to replace 300+ sites that continually change and over 1000 Sharepoint sites (team rooms). The Sharepoint sites come up for projects and then are deleted. Over the course of 3-5 years that will be a whole lot of portlets leaving data around if it is not cleaned up.
thumbnail
Cameron McBride,修改在12 年前。

RE: What happens to portlet data when a portlet/page is deleted?

Expert 帖子: 269 加入日期: 11-2-8 最近的帖子
Just as a quick follow up I have been working on a hook that listens for changes to com.liferay.portal.model.Layout. I can catch when a portlet is delete or a page. I can check at that point to see if it is a particular portlet that was deleted or if that portlet was on the deleted page. That may allow for some cleanup to occur. I am not sure how to listen for a site to be deleted.
thumbnail
Sandeep Nair,修改在12 年前。

RE: What happens to portlet data when a portlet/page is deleted?

Liferay Legend 帖子: 1744 加入日期: 08-11-6 最近的帖子
Hi,

Try creating model Listener for com.liferay.portal.model.Group, the same way you did for Layout to check for site.

Regards,
Sandeep
thumbnail
Cameron McBride,修改在12 年前。

RE: What happens to portlet data when a portlet/page is deleted?

Expert 帖子: 269 加入日期: 11-2-8 最近的帖子
I have created a model listener for group, similar to my Layout listener:
value.object.listener.com.liferay.portal.model.Layout=com.hca.LayoutListener
value.object.listener.com.liferay.portal.model.Group=com.hca.GroupListener


I also created my GroupListener class:
public class GroupListener implements ModelListener<group> {
... several methods here ...
}</group>


Creating or removing a community does not seem to trigger any of the methods. Could group be the wrong thing to listen on?
thumbnail
Sandeep Nair,修改在12 年前。

RE: What happens to portlet data when a portlet/page is deleted?

Liferay Legend 帖子: 1744 加入日期: 08-11-6 最近的帖子
I definitely believe its the Group that gets added or deleted when a community or organization is created. Can you just debug Grouplocalservic(Util and Impl) to see if addGroup, updateGroup and deleteGroup are getting called when you create, update and delete community respectively