/* * (non-Javadoc) * * @see * cc.kune.core.server.manager.GroupManager#createGroup(cc.kune.domain.Group, * cc.kune.domain.User, java.lang.String) */ @Override public Group createGroup(final Group group, final User user, final String publicDescrip) throws GroupShortNameInUseException, GroupLongNameInUseException, UserMustBeLoggedException { checkIfShortNameAreInUse(group.getShortName()); checkIfLongNameAreInUse(group.getLongName()); final String defaultSiteWorkspaceTheme = kuneProperties.get(KuneProperties.WS_THEMES_DEF); if (User.isKnownUser(user)) { setAdmissionType(group); final String licName = group.getDefaultLicense().getShortName(); final License license = licenseFinder.findByShortName(licName); group.setDefaultLicense(license); group.setWorkspaceTheme(defaultSiteWorkspaceTheme); final boolean isClosed = group.getGroupType().equals(GroupType.CLOSED); initSocialNetwork( group, user.getUserGroup(), getDefGroupMode(isClosed), getDefSNVisibility(isClosed)); final String title = i18n.t("About [%s]", group.getLongName()); initGroup( user, group, serverToolRegistry.getToolsRegisEnabledForGroups(), title, publicDescrip); snCache.expire(user.getUserGroup()); return group; } else { throw new UserMustBeLoggedException(); } }
/** Test default content and licenses. */ @Test public void testDefaultContentAndLicenses() { assertNotNull(defaultGroup.getDefaultContent()); assertTrue(licenseManager.getAll().size() > 0); assertNotNull(defaultGroup.getDefaultLicense()); }