String portalName = uiForm.getUIStringInput(FIELD_NAME).getValue();
DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
PortalConfig config = dataService.getPortalConfig(portalName);
if (config != null) {
UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
uiApp.addMessage(new ApplicationMessage("UIPortalForm.msg.sameName", null));
return;
}
UserPortalConfigService service = uiForm.getApplicationComponent(UserPortalConfigService.class);
service.createUserPortalConfig(SiteType.PORTAL.getName(), portalName, template);