The goal of this task is to implement clear and efficient mechanism so that when a content is deleted in staging this operation can be propagated to live as part of the publication to live.
It should also be possible to export delete-asset operations so that on import they are deleted in the target site. This is very useful for complex environments where publication to live is done manually through LAR files.
(1) Update all portlet data handlers to not delete social activity when entity is deleted
(2) When entity is deleted, add SocialActivity entry for event
(3) When deleting entire site, delete social activity.
For (3), look in GroupLocalServiceImpl: we are using PortletDataHandlers for deletions now.
Need to make sure any changes to Activities do not break activities portlet.
STEPS TO TEST:
- Create two sites: SiteA and SiteB
- In SiteA go to Site Administration > Content > Bookmarks and add two bookmarks: Liferay (http://www.liferay.com) and AlloyUI (http://alloyui.com)
- Click the wrench icon and select Export/Import > Leave options unchanged > Click Export > Download the LAR
- In SiteB go to Site Administration > Content > Bookmarks > Click the wrench icon and select Export/Import > Select the import tab > drop the LAR from previous and complete the process. Check that the two bookmarks have been imported in Site B
- Go back to Bookmarks in Site A and send the Liferay bookmark to the Recycle Bin. Go to Recycle Bin and empty it.
- Go back to Bookmarks, click the wrench icon and select Export/Import. In the Content section, click the change link under "Comments, Ratings and Deletions". Check the Deletions option and Save. Notice that a badge with "1 Deletion" message is display next to the Content checkbox. Click Export and download the LAR file.
- Now go to Site B > Bookmarks > Export/Import > Import. Drop the file from previous step and click Continue. Under "Comments, Ratings and Deletions" check the Deletions option and click save. Notice that a badge with "1 Deletion" message is display next to the Content checkbox, meaning that the LAR to import contains one deletion operation. Continue with the import process.
- Finally, check that the Liferay bookmark has been removed from Site B.
The integration test testExportImportDeletions at BaseExportImportPortletTestCase.java has been added to test this feature.