@Test public void saveSite() { Permission access = new Permission("*", new Group("access")); Permission edit = new Permission("*", new Group("edit")); Site site = portal.createSite(new SiteId("newsite"), "basic"); site.setAccessPermission(access); site.setDisplayName("displayName"); site.setDescription("description"); site.setEditPermission(edit); site.setLocale(Locale.ENGLISH); site.setSkin("skin"); site.getAttributes().put(Attributes.key("attributeKey", String.class), "attributeValue"); portal.saveSite(site); site = portal.getSite(new SiteId("newsite")); assertNotNull(site); assertEquals("displayName", site.getDisplayName()); assertEquals("description", site.getDescription()); assertEquals(access, site.getAccessPermission()); assertEquals(edit, site.getEditPermission()); assertEquals(new SiteId("newsite"), site.getId()); assertEquals(Locale.ENGLISH, site.getLocale()); assertEquals("newsite", site.getName()); assertEquals("skin", site.getSkin()); assertEquals(SiteType.SITE, site.getType()); assertEquals(1, site.getAttributes().size()); assertEquals("attributeValue", site.getAttributes().get(Attributes.key("attributeKey", String.class))); assertNull(portal.getSite(new SiteId("xxx"))); }
@Override public void saveSite(Site site) { Parameters.requireNonNull(site, "site"); ((SiteImpl) site).save(dataStorage, userPortalConfigService); }
PortalImpl implements Portal { @Override public void saveSite(Site site) { Parameters.requireNonNull(site, "site"); ((SiteImpl) site).save(dataStorage, userPortalConfigService); } }
PortalImpl implements Portal { @Override public void saveSite(Site site) { Parameters.requireNonNull(site, "site"); ((SiteImpl) site).save(dataStorage, userPortalConfigService); } PortalImpl(DataStorage dataStorage, PageService pageService, NavigationService navigationService,
                      DescriptionService descriptionService, ResourceBundleManager bundleManager, Authenticator authenticator,
                      IdentityRegistry identityRegistry, UserACL acl, UserPortalConfigService userPortalConfigService,
                      OAuthProviderAccessor oauthProviderAccessor); }
PortalImpl implements Portal { @Override public void saveSite(Site site) { Parameters.requireNonNull(site, "site"); ((SiteImpl) site).save(dataStorage, userPortalConfigService); } PortalImpl(DataStorage dataStorage, PageService pageService, NavigationService navigationService,
                      DescriptionService descriptionService, ResourceBundleManager bundleManager, Authenticator authenticator,
                      IdentityRegistry identityRegistry, UserACL acl, UserPortalConfigService userPortalConfigService,
                      OAuthProviderAccessor oauthProviderAccessor); @Override Site getSite(SiteId siteId); @Override Site createSite(SiteId siteId); @Override Site createSite(SiteId siteId, String templateName); @Override List<Site> findSites(SiteQuery query); @Override void saveSite(Site site); @Override boolean removeSite(SiteId siteId); @Override Navigation getNavigation(SiteId siteId); @Override PageBuilder newPageBuilder(); @Override ApplicationRegistry getApplicationRegistry(); @Override Page getPage(PageId pageId); List<ContainerItem> getPageRootContainer(PageContext pageContext); @Override Page createPage(PageId pageId); @Override List<Page> findPages(PageQuery query); @Override void savePage(Page page); @Override boolean removePage(PageId pageId); @Override boolean hasPermission(User user, Permission permission); @Override OAuthProvider getOAuthProvider(String oauthProviderKey); }
PortalImpl implements Portal { @Override public void saveSite(Site site) { Parameters.requireNonNull(site, "site"); ((SiteImpl) site).save(dataStorage, userPortalConfigService); } PortalImpl(DataStorage dataStorage, PageService pageService, NavigationService navigationService,
                      DescriptionService descriptionService, ResourceBundleManager bundleManager, Authenticator authenticator,
                      IdentityRegistry identityRegistry, UserACL acl, UserPortalConfigService userPortalConfigService,
                      OAuthProviderAccessor oauthProviderAccessor); @Override Site getSite(SiteId siteId); @Override Site createSite(SiteId siteId); @Override Site createSite(SiteId siteId, String templateName); @Override List<Site> findSites(SiteQuery query); @Override void saveSite(Site site); @Override boolean removeSite(SiteId siteId); @Override Navigation getNavigation(SiteId siteId); @Override PageBuilder newPageBuilder(); @Override ApplicationRegistry getApplicationRegistry(); @Override Page getPage(PageId pageId); List<ContainerItem> getPageRootContainer(PageContext pageContext); @Override Page createPage(PageId pageId); @Override List<Page> findPages(PageQuery query); @Override void savePage(Page page); @Override boolean removePage(PageId pageId); @Override boolean hasPermission(User user, Permission permission); @Override OAuthProvider getOAuthProvider(String oauthProviderKey);  }