juliocamarero/liferay-portal — pull request #445 by epgarcia (2012-07-17 12:47:50+00:00)
Title: LPS 28118 Site Template Portlet Preferences

Current status:

Create a site from a site template:
- copy portlet preferences from the imported portlet (overwritting existing ones, if any)
- copy data from the imported portlet and map the ids at portlet preferences to the imported data

Merging site template and site (e.g when resetting)
- copy portlet preferences from the imported portlet (overwritting existing ones, if any)

Result: when mergin a site template, ids at portlet preferences point to the data in the site template, instead to the data in the site.

Solution:

Create a site from a site template
- Remains as in current status

Merging site template and site (e.g when resetting)
- copy portlet preferences from the imported portlet (overwritting existing ones, if any)
- overwritte only portlet preferences which do not refer to data

To notify the PortletImporter which portlet preferences refer to data, they must be declared in the getDataPortletPreferences() method of the corresponding *PortletDataHandlerImpl class.

The PortletExportImportTest class has been created to test this behaviour.