private void addGroupToProfile() throws SGroupNotFoundException, SProfileMemberCreationException { final SGroup group = identityService.getGroup(groupId); if (group != null) { sProfileMember = profileService.addGroupToProfile(profileId, groupId, group.getName(), group.getParentPath()); } }
private void addGroupToProfile() throws SGroupNotFoundException, SProfileMemberCreationException { final SGroup group = identityService.getGroup(groupId); if (group != null) { sProfileMember = profileService.addGroupToProfile(profileId, groupId, group.getName(), group.getParentPath()); } }
public SGroup update() throws SIdentityException { SGroup sGroup = identityService.getGroup(groupId); final SGroupBuilderFactory sGroupBuilderFactory = BuilderFactory.get(SGroupBuilderFactory.class); // if the parent path changes it's also necessary to change the children's parent path final String parentPathKey = sGroupBuilderFactory.getParentPathKey(); final String nameKey = sGroupBuilderFactory.getNameKey(); final Map<String, Object> fields = changeDescriptor.getFields(); if (fields.containsKey(parentPathKey) || fields.containsKey(nameKey)) { final String parentPath = fields.containsKey(parentPathKey) ? (String) fields.get(parentPathKey) : sGroup.getParentPath(); final String groupName = fields.containsKey(nameKey) ? (String) fields.get(nameKey) : sGroup.getName(); updateChildren(sGroup, parentPath, sGroupBuilderFactory.getIdKey(), parentPathKey, groupName); } identityService.updateGroup(sGroup, changeDescriptor, iconUpdater); return sGroup; }
public SGroup update() throws SIdentityException { SGroup sGroup = identityService.getGroup(groupId); final SGroupBuilderFactory sGroupBuilderFactory = BuilderFactory.get(SGroupBuilderFactory.class); // if the parent path changes it's also necessary to change the children's parent path final String parentPathKey = sGroupBuilderFactory.getParentPathKey(); final String nameKey = sGroupBuilderFactory.getNameKey(); final Map<String, Object> fields = changeDescriptor.getFields(); if (fields.containsKey(parentPathKey) || fields.containsKey(nameKey)) { final String parentPath = fields.containsKey(parentPathKey) ? (String) fields.get(parentPathKey) : sGroup.getParentPath(); final String groupName = fields.containsKey(nameKey) ? (String) fields.get(nameKey) : sGroup.getName(); updateChildren(sGroup, parentPath, sGroupBuilderFactory.getIdKey(), parentPathKey, groupName); } identityService.updateGroup(sGroup, changeDescriptor, iconUpdater); return sGroup; }
private void addRoleAndGroupToProfile() throws SGroupNotFoundException, SRoleNotFoundException, SProfileMemberCreationException { final SGroup group = identityService.getGroup(groupId); final SRole role = identityService.getRole(roleId); if (group != null && role != null) { sProfileMember = profileService .addRoleAndGroupToProfile(profileId, roleId, groupId, role.getName(), group.getName(), group.getParentPath()); } }
private void addRoleAndGroupToProfile() throws SGroupNotFoundException, SRoleNotFoundException, SProfileMemberCreationException { final SGroup group = identityService.getGroup(groupId); final SRole role = identityService.getRole(roleId); if (group != null && role != null) { sProfileMember = profileService .addRoleAndGroupToProfile(profileId, roleId, groupId, role.getName(), group.getName(), group.getParentPath()); } }
protected EntityUpdateDescriptor getGroupDescriptor(final SGroup existingGroup, final ExportedGroup exportedGroup) { final SGroupUpdateBuilder groupUpdateBuilder = BuilderFactory.get(SGroupUpdateBuilderFactory.class).createNewInstance(); final String name = exportedGroup.getName(); if (name != null && !name.equals(existingGroup.getName())) { groupUpdateBuilder.updateName(name); } final String parentPath = exportedGroup.getParentPath(); if (parentPath != null && !parentPath.equals(existingGroup.getParentPath())) { groupUpdateBuilder.updateName(parentPath); } final String description = exportedGroup.getDescription(); if (description != null && !description.equals(existingGroup.getDescription())) { groupUpdateBuilder.updateDescription(description); } final String displayName = exportedGroup.getDisplayName(); if (displayName != null && !displayName.equals(existingGroup.getDisplayName())) { groupUpdateBuilder.updateDisplayName(displayName); } return groupUpdateBuilder.done(); }
protected EntityUpdateDescriptor getGroupDescriptor(final SGroup existingGroup, final ExportedGroup exportedGroup) { final SGroupUpdateBuilder groupUpdateBuilder = BuilderFactory.get(SGroupUpdateBuilderFactory.class).createNewInstance(); final String name = exportedGroup.getName(); if (name != null && !name.equals(existingGroup.getName())) { groupUpdateBuilder.updateName(name); } final String parentPath = exportedGroup.getParentPath(); if (parentPath != null && !parentPath.equals(existingGroup.getParentPath())) { groupUpdateBuilder.updateName(parentPath); } final String description = exportedGroup.getDescription(); if (description != null && !description.equals(existingGroup.getDescription())) { groupUpdateBuilder.updateDescription(description); } final String displayName = exportedGroup.getDisplayName(); if (displayName != null && !displayName.equals(existingGroup.getDisplayName())) { groupUpdateBuilder.updateDisplayName(displayName); } return groupUpdateBuilder.done(); }
@Override public void execute() throws SBonitaException { userNames = new HashMap<>(20); final List<SCustomUserInfoDefinition> customUserInfoDefinitions = getAllCustomUserInfoDefinitions(); final List<ExportedUser> users = getAllUsers(getUserInfoDefinitionNames(customUserInfoDefinitions)); // improvement: user server object to avoid useless conversion; final List<ExportedRole> roles = getAllRoles(); final List<SGroup> groups = getAllGroups(); final Map<Long, String> groupIdParentPath = new HashMap<>(groups.size()); for (final SGroup group : groups) { groupIdParentPath.put(group.getId(), group.getParentPath()); } final List<SUserMembership> userMemberships = getAllUserMemberships(); // improvement: user server object to avoid useless conversion; final List<ExportedGroup> clientGroups = ModelConvertor.toExportedGroups(groups); // improvement: user server object to avoid useless conversion; final List<ExportedUserMembership> clientUserMemberships = ModelConvertor.toExportedUserMembership(userMemberships, userNames, groupIdParentPath); List<ExportedCustomUserInfoDefinition> customUserInfoDefinitionCreators = ModelConvertor.toExportedCustomUserInfoDefinition(customUserInfoDefinitions); final Organization organization = new Organization(users, roles, clientGroups, clientUserMemberships, customUserInfoDefinitionCreators); try { xmlOrganization = new OrganizationParser().convert(organization); } catch (JAXBException e) { throw new SBonitaReadException(e); } }
@Override public void execute() throws SBonitaException { userNames = new HashMap<>(20); final List<SCustomUserInfoDefinition> customUserInfoDefinitions = getAllCustomUserInfoDefinitions(); final List<ExportedUser> users = getAllUsers(getUserInfoDefinitionNames(customUserInfoDefinitions)); // improvement: user server object to avoid useless conversion; final List<ExportedRole> roles = getAllRoles(); final List<SGroup> groups = getAllGroups(); final Map<Long, String> groupIdParentPath = new HashMap<>(groups.size()); for (final SGroup group : groups) { groupIdParentPath.put(group.getId(), group.getParentPath()); } final List<SUserMembership> userMemberships = getAllUserMemberships(); // improvement: user server object to avoid useless conversion; final List<ExportedGroup> clientGroups = ModelConvertor.toExportedGroups(groups); // improvement: user server object to avoid useless conversion; final List<ExportedUserMembership> clientUserMemberships = ModelConvertor.toExportedUserMembership(userMemberships, userNames, groupIdParentPath); List<ExportedCustomUserInfoDefinition> customUserInfoDefinitionCreators = ModelConvertor.toExportedCustomUserInfoDefinition(customUserInfoDefinitions); final Organization organization = new Organization(users, roles, clientGroups, clientUserMemberships, customUserInfoDefinitionCreators); try { xmlOrganization = new OrganizationParser().convert(organization); } catch (JAXBException e) { throw new SBonitaReadException(e); } }
private static ExportedGroup toExportedGroup(final SGroup sGroup) { final ExportedGroup group = new ExportedGroup(); group.setName(sGroup.getName()); group.setParentPath(sGroup.getParentPath()); group.setDescription(sGroup.getDescription()); group.setDisplayName(sGroup.getDisplayName()); return group; }
private static ExportedGroup toExportedGroup(final SGroup sGroup) { final ExportedGroup group = new ExportedGroup(); group.setName(sGroup.getName()); group.setParentPath(sGroup.getParentPath()); group.setDescription(sGroup.getDescription()); group.setDisplayName(sGroup.getDisplayName()); return group; }
public static Group toGroup(final SGroup sGroup) { final GroupImpl group = new GroupImpl(sGroup.getId(), sGroup.getName()); group.setParentPath(sGroup.getParentPath()); group.setCreatedBy(sGroup.getCreatedBy()); group.setCreationDate(new Date(sGroup.getCreationDate())); group.setDescription(sGroup.getDescription()); group.setDisplayName(sGroup.getDisplayName()); group.setIconId(sGroup.getIconId()); group.setLastUpdate(new Date(sGroup.getLastUpdate())); return group; }
public static Group toGroup(final SGroup sGroup) { final GroupImpl group = new GroupImpl(sGroup.getId(), sGroup.getName()); group.setParentPath(sGroup.getParentPath()); group.setCreatedBy(sGroup.getCreatedBy()); group.setCreationDate(new Date(sGroup.getCreationDate())); group.setDescription(sGroup.getDescription()); group.setDisplayName(sGroup.getDisplayName()); group.setIconId(sGroup.getIconId()); group.setLastUpdate(new Date(sGroup.getLastUpdate())); return group; }
continue; profileService.addGroupToProfile(profileId, group.getId(), group.getName(), group.getParentPath()); continue; profileService.addRoleAndGroupToProfile(profileId, role.getId(), group.getId(), role.getName(), group.getName(), group.getParentPath());
continue; profileService.addGroupToProfile(profileId, group.getId(), group.getName(), group.getParentPath()); continue; profileService.addRoleAndGroupToProfile(profileId, role.getId(), group.getId(), role.getName(), group.getName(), group.getParentPath());
builder.setGroupId(groupId); builder.setDisplayNamePart1(group.getName()); builder.setDisplayNamePart2(group.getParentPath()); break; builder.setDisplayNamePart1(role.getName()); builder.setDisplayNamePart2(group.getName()); builder.setDisplayNamePart3(group.getParentPath()); break; default:
builder.setGroupId(groupId); builder.setDisplayNamePart1(group.getName()); builder.setDisplayNamePart2(group.getParentPath()); break; builder.setDisplayNamePart1(role.getName()); builder.setDisplayNamePart2(group.getName()); builder.setDisplayNamePart3(group.getParentPath()); break; default: