Profile userProfile = userIdentity.getProfile(); json.put("id", userProfile.getId()); json.put("profileUrl", LinkProvider.getUserProfileUri(userIdentity.getRemoteId())); json.put("avatar", userProfile.getAvatarImageSource() != null ? userProfile.getAvatarImageSource() : LinkProvider.PROFILE_DEFAULT_AVATAR_URL); jsonArray.put(json);
if (size > 0) { suggestions = relationshipManager.getSuggestions(identity, 20, 50, 10); if (suggestions.size() == 1 && suggestions.keySet().iterator().next().getRemoteId().equals(userACL.getSuperUser())) { Identity id = suggestion.getKey(); if (id.getRemoteId().equals(userACL.getSuperUser())) continue; JSONObject json = new JSONObject(); Profile socialProfile = id.getProfile(); position = ""; json.put("username", id.getRemoteId()); json.put("suggestionName", socialProfile.getFullName()); json.put("suggestionId", id.getId());
if(spaceService.isMember(space, identity.getRemoteId())) { continue; if (Space.CLOSE.equals(space.getRegistration())) continue; if (!spaceService.isMember(space, connector.getRemoteId())) continue; if (!spaceService.isIgnored(space, connector.getRemoteId())) continue; Integer value = spacesWithMemberNum.get(space); if (Space.CLOSE.equals(space.getRegistration())) continue; if (spaceService.isMember(space, identity.getRemoteId())) continue; if (spaceService.isPendingUser(space, identity.getRemoteId())) continue; if (spaceService.isInvitedUser(space, identity.getRemoteId())) continue; if (spaceService.isIgnored(space, identity.getRemoteId())) continue; JSONObject json = buildJSONObject(space, 0);
@GET @Path("contacts/{identityId}/pending") public Response contactsPendingRequests(@PathParam("identityId") String identityId) { IdentityManager identityManager = (IdentityManager) ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(IdentityManager.class); Identity identity = identityManager.getOrCreateIdentity(OrganizationIdentityProvider.NAME, identityId); if (identity == null){ return Response.ok("identity null for "+identityId, MediaType.APPLICATION_JSON).cacheControl(cacheControl).build(); } RelationshipManager relationshipManager = (RelationshipManager) ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(RelationshipManager.class); List<Relationship> relations = relationshipManager.getIncoming(identity); ArrayList<Object> liste = new ArrayList<Object>(); for (Relationship relation : relations) { Relation rel = new Relation(); Identity contactIdentity = relation.getSender(); Profile profile = contactIdentity.getProfile(); rel.setRelationshipId(contactIdentity.getRemoteId()); rel.setRequesterName(profile.getFullName()); rel.setPosition(profile.getPosition()); rel.setAvatarUrl(profile.getAvatarUrl()); liste.add(rel); } return renderJSON(liste); }
contactBean.setId(contact.getRemoteId()); contactBean.setFullName(profile.getFullName()); contactBean.setAvatarUrl(profile.getAvatarUrl()); ExoSocialActivity[] latestAct = activities.load(0, 1); contactBean.setLatestActivity((latestAct.length == 0) ? null : latestAct[0].getTitle()); String profileLink = LinkProvider.getProfileLink(contact.getRemoteId()); contactBean.setProfileLink(profileLink);