@Override protected void doImportStagedModel(PortletDataContext portletDataContext, Website website) throws Exception { long userId = portletDataContext.getUserId(website.getUserUuid()); ServiceContext serviceContext = portletDataContext.createServiceContext(website); Website existingWebsite = _websiteLocalService.fetchWebsiteByUuidAndCompanyId( website.getUuid(), portletDataContext.getCompanyGroupId()); Website importedWebsite = null; if (existingWebsite == null) { serviceContext.setUuid(website.getUuid()); importedWebsite = _websiteLocalService.addWebsite( userId, website.getClassName(), website.getClassPK(), website.getUrl(), website.getTypeId(), website.isPrimary(), serviceContext); } else { importedWebsite = _websiteLocalService.updateWebsite( existingWebsite.getWebsiteId(), website.getUrl(), website.getTypeId(), website.isPrimary()); } portletDataContext.importClassedModel(website, importedWebsite); }