@Test public void testContainerDefaultPermissions() { ContainerBuilder<PageBuilder> containerBuilder = new ContainerBuilderImpl<PageBuilder>(null); Container container = containerBuilder .build(); assertEquals("Should have default access permissions defined in API", BareContainer.DEFAULT_ACCESS_PERMISSION, container.getAccessPermission()); assertEquals("Should have default moveAppsPermissions defined in API", BareContainer.DEFAULT_MOVE_APPS_PERMISSION, container.getMoveAppsPermission()); assertEquals("Should have default moveContainersPermissions defined in API", BareContainer.DEFAULT_MOVE_CONTAINERS_PERMISSION, container.getMoveContainersPermission()); }
@Override public Page build() { if (null == siteName || null == siteType) { throw new IllegalStateException("API usage error: either the SiteKey should be set or both site name and site type should be set."); } if (null == name) { throw new IllegalStateException("API usage error: either the PageKey should be set or both SiteKey and page name should be set."); } SiteKey siteKey = new SiteKey(siteType, siteName); PageKey pageKey = new PageKey(siteKey, name); PageState pageState = new PageState(displayName, description, showMaxWindow, null, Arrays.asList(Util.from(accessPermission)), Util.from(editPermission)[0], Arrays.asList(Util.from(moveAppsPermission)), Arrays.asList(Util.from(moveContainersPermission))); PageContext pageContext = new PageContext(pageKey, pageState); Page page = new PageImpl(pageContext); page.setChildren(this.children); if (log.isTraceEnabled()) { log.trace("Page finished: " + this); } return page; }
PageBuilderImpl extends LayoutBuilderImpl<PageBuilder> implements PageBuilder { @Override public Page build() { if (null == siteName || null == siteType) { throw new IllegalStateException("API usage error: either the SiteKey should be set or both site name and site type should be set."); } if (null == name) { throw new IllegalStateException("API usage error: either the PageKey should be set or both SiteKey and page name should be set."); } SiteKey siteKey = new SiteKey(siteType, siteName); PageKey pageKey = new PageKey(siteKey, name); PageState pageState = new PageState(displayName, description, showMaxWindow, null, Arrays.asList(Util.from(accessPermission)), Util.from(editPermission)[0], Arrays.asList(Util.from(moveAppsPermission)), Arrays.asList(Util.from(moveContainersPermission))); PageContext pageContext = new PageContext(pageKey, pageState); Page page = new PageImpl(pageContext); page.setChildren(this.children); if (log.isTraceEnabled()) { log.trace("Page finished: " + this); } return page; } }
PageBuilderImpl extends LayoutBuilderImpl<PageBuilder> implements PageBuilder { @Override public Page build() { if (null == siteName || null == siteType) { throw new IllegalStateException("API usage error: either the SiteKey should be set or both site name and site type should be set."); } if (null == name) { throw new IllegalStateException("API usage error: either the PageKey should be set or both SiteKey and page name should be set."); } SiteKey siteKey = new SiteKey(siteType, siteName); PageKey pageKey = new PageKey(siteKey, name); PageState pageState = new PageState(displayName, description, showMaxWindow, null, Arrays.asList(Util.from(accessPermission)), Util.from(editPermission)[0], Arrays.asList(Util.from(moveAppsPermission)), Arrays.asList(Util.from(moveContainersPermission))); PageContext pageContext = new PageContext(pageKey, pageState); Page page = new PageImpl(pageContext); page.setChildren(this.children); if (log.isTraceEnabled()) { log.trace("Page finished: " + this); } return page; } PageBuilderImpl(); }
PageBuilderImpl extends LayoutBuilderImpl<PageBuilder> implements PageBuilder { @Override public Page build() { if (null == siteName || null == siteType) { throw new IllegalStateException("API usage error: either the SiteKey should be set or both site name and site type should be set."); } if (null == name) { throw new IllegalStateException("API usage error: either the PageKey should be set or both SiteKey and page name should be set."); } SiteKey siteKey = new SiteKey(siteType, siteName); PageKey pageKey = new PageKey(siteKey, name); PageState pageState = new PageState(displayName, description, showMaxWindow, null, Arrays.asList(Util.from(accessPermission)), Util.from(editPermission)[0], Arrays.asList(Util.from(moveAppsPermission)), Arrays.asList(Util.from(moveContainersPermission))); PageContext pageContext = new PageContext(pageKey, pageState); Page page = new PageImpl(pageContext); page.setChildren(this.children); if (log.isTraceEnabled()) { log.trace("Page finished: " + this); } return page; } PageBuilderImpl(); @Override ContainerBuilder<PageBuilder> newColumnsBuilder(); @Override PageBuilder name(String name); @Override PageBuilder description(String description); @Override PageBuilder siteName(String siteName); @Override PageBuilder displayName(String displayName); @Override PageBuilder showMaxWindow(boolean showMaxWindow); @Override PageBuilder accessPermission(Permission accessPermission); @Override PageBuilder editPermission(Permission editPermission); @Override PageBuilder moveAppsPermission(Permission moveAppsPermission); @Override PageBuilder moveContainersPermission(Permission moveContainersPermission); @Override PageBuilder siteType(String siteType); @Override Page build(); @Override String toString(); }
PageBuilderImpl extends LayoutBuilderImpl<PageBuilder> implements PageBuilder { @Override public Page build() { if (null == siteName || null == siteType) { throw new IllegalStateException("API usage error: either the SiteKey should be set or both site name and site type should be set."); } if (null == name) { throw new IllegalStateException("API usage error: either the PageKey should be set or both SiteKey and page name should be set."); } SiteKey siteKey = new SiteKey(siteType, siteName); PageKey pageKey = new PageKey(siteKey, name); PageState pageState = new PageState(displayName, description, showMaxWindow, null, Arrays.asList(Util.from(accessPermission)), Util.from(editPermission)[0], Arrays.asList(Util.from(moveAppsPermission)), Arrays.asList(Util.from(moveContainersPermission))); PageContext pageContext = new PageContext(pageKey, pageState); Page page = new PageImpl(pageContext); page.setChildren(this.children); if (log.isTraceEnabled()) { log.trace("Page finished: " + this); } return page; } PageBuilderImpl(); @Override ContainerBuilder<PageBuilder> newColumnsBuilder(); @Override PageBuilder name(String name); @Override PageBuilder description(String description); @Override PageBuilder siteName(String siteName); @Override PageBuilder displayName(String displayName); @Override PageBuilder showMaxWindow(boolean showMaxWindow); @Override PageBuilder accessPermission(Permission accessPermission); @Override PageBuilder editPermission(Permission editPermission); @Override PageBuilder moveAppsPermission(Permission moveAppsPermission); @Override PageBuilder moveContainersPermission(Permission moveContainersPermission); @Override PageBuilder siteType(String siteType); @Override Page build(); @Override String toString();  }