@Override final public SystemAndCustomAvatars getAvatars(final ApplicationUser remoteUser, final String owningObjectId) { final List<Avatar> systemAvatars = avatarManager.getAllSystemAvatars(type); final List<Avatar> avatarsForOwner = avatarManager.getCustomAvatarsForOwner(type, owningObjectId); return new SystemAndCustomAvatars(systemAvatars, avatarsForOwner); }
public RemoteAvatar[] getProjectAvatars(final User user, final String projectKey, final boolean includeSystemAvatars, final String size) throws RemoteException, RemotePermissionException { final boolean large = "large".equalsIgnoreCase(size); final Project project = retrieveProjectByKey(projectKey, user); final ArrayList<Avatar> avatars = new ArrayList<Avatar>(); if (includeSystemAvatars) { avatars.addAll(avatarManager.getAllSystemAvatars(Avatar.Type.PROJECT)); } avatars.addAll(avatarManager.getCustomAvatarsForOwner(PROJECT, project.getId().toString())); RemoteAvatar[] remoteAvatars = new RemoteAvatar[avatars.size()]; for (int i = 0; i < avatars.size(); i++) { remoteAvatars[i] = createRemoteAvatar(avatars.get(i), large, new Base64InputStreamConsumer(true)); } return remoteAvatars; }
avatars.put("system", systemAvatarBeans); final List<Avatar> customAvatarsForOwner = avatarManager.getCustomAvatarsForOwner(type, ownerId); final List<AvatarBean> customAvatarBeans = avatarBeanFactory.createAvatarBeans(customAvatarsForOwner, avatarUser); avatars.put("custom", customAvatarBeans);