dataService.save(page);
UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
userPortal.saveNode(selectedNode, null);
DescriptionService descriptionService = getApplicationComponent(DescriptionService.class);
Map<Locale, Described.State> descriptions = new HashMap<Locale, Described.State>();
Map<String, String> cachedLabels = uiPageInfo.getCachedLabels();
for (String strLocale : cachedLabels.keySet()) {
Locale locale;
if (strLocale.contains("_")) {
String[] arr = strLocale.split("_");
if (arr.length > 2) {
locale = new Locale(arr[0], arr[1], arr[2]);
} else {
locale = new Locale(arr[0], arr[1]);
}
} else {
locale = new Locale(strLocale);
}
descriptions.put(locale, new Described.State(cachedLabels.get(strLocale), null));
}
descriptionService.setDescriptions(createdNode.getId(), descriptions);
return createdNode;
}