friendlyURLMap.put(LocaleUtil.getDefault(), friendlyURL);
String typeSettings = layoutJSONObject.getString("typeSettings");
Layout layout = LayoutLocalServiceUtil.addLayout(
userId, groupId, privateLayout, parentLayoutId, nameMap, titleMap,
null, null, null, LayoutConstants.TYPE_PORTLET, typeSettings,
hidden, friendlyURLMap, serviceContext);
LayoutTypePortlet layoutTypePortlet =
(LayoutTypePortlet)layout.getLayoutType();
String layoutTemplateId = layoutJSONObject.getString(
"layoutTemplateId", _defaultLayoutTemplateId);
if (Validator.isNotNull(layoutTemplateId)) {
layoutTypePortlet.setLayoutTemplateId(
userId, layoutTemplateId, false);
}
JSONArray columnsJSONArray = layoutJSONObject.getJSONArray("columns");
addLayoutColumns(
layout, LayoutTypePortletConstants.COLUMN_PREFIX, columnsJSONArray);
LayoutLocalServiceUtil.updateLayout(
groupId, layout.isPrivateLayout(), layout.getLayoutId(),
layout.getTypeSettings());
JSONArray layoutsJSONArray = layoutJSONObject.getJSONArray("layouts");
addLayouts(privateLayout, layout.getLayoutId(), layoutsJSONArray);
}