hhuijser/liferay-portal — pull request #1809 by ericmin (2014-03-27 02:09:57+00:00)
Title: LPS-45490 Make import LAR from properties to use import ALL option

When import LAR from properties like what we set as the following:

default.user.public.layouts.lar=${liferay.home}/deploy/default_user_public.lar

We do not have an option to choose if import all or import sepecific portlet and related preferences, so we should use import ALL to make sure the lar's stuff are fully imported. As the code in where we import portlet data or portlet preferences will checked if it is ALL so we should pass the PortletDataHandlerKeys with ALL to put into the parameterMap. Otherwise, it will be failed to import portlet data or portlet preferences.

More details please refer ExportImportHelperImpl.getImportPortletControlsMap():

As I mentioned in the preivous comment that we don't have an options to import specific portlet data or portlet preference in this case so if we don't put those ALL to the paramerMap then later in the check statement to check if import portlet data or portlet preferences it will be failed.

LayoutImporter.doImportLayouts:

// Portlet preferences

_portletImporter.importPortletPreferences(
portletDataContext, layoutSet.getCompanyId(),
portletPreferencesGroupId, layout, null, portletElement,
false,
importPortletControlsMap.get(
PortletDataHandlerKeys.PORTLET_ARCHIVED_SETUPS),
importPortletControlsMap.get(
PortletDataHandlerKeys.PORTLET_DATA),
importPortletControlsMap.get(
PortletDataHandlerKeys.PORTLET_SETUP),
importPortletControlsMap.get(
PortletDataHandlerKeys.PORTLET_USER_PREFERENCES));

If any of the PortletDataHandlerKeys without PortletDataHandlerKeys.*_ALL was not put into the parameterMap it will fail to import portlet preferences.

// Portlet data

if (importPortletControlsMap.get(
PortletDataHandlerKeys.PORTLET_DATA)) {

_portletImporter.importPortletData(
portletDataContext, portletId, plid,
portletDataElement);
}

If we do not set PORTLET_DATA_ALL to the parameterMap it will be false which will casue it won't import portlet data.