Package org.eurekastreams.server.domain

Examples of org.eurekastreams.server.domain.AvatarUrlGenerator


                mainContents.insert(banner, 1);

                // Banner exists and should override the banner the theme is supplying. (i.e. profile page.)
                if (event.getBannerableEntity() != null)
                {
                    AvatarUrlGenerator urlGen = new AvatarUrlGenerator(null);
                    new WidgetJSNIFacadeImpl()
                    .setBanner(urlGen.getBannerUrl(event.getBannerableEntity().getBannerId()));
                }
                // Start page, the bannerable entity is null, just clear out the banner value
                // to let the theme take over again.
                else
                {
View Full Code Here


        return new Command()
        {
            public void execute()
            {
                PersonModelView result = dialogContent.getPerson();
                AvatarUrlGenerator urlGen = new AvatarUrlGenerator(EntityType.PERSON);
                String imageUrl = urlGen.getSmallAvatarUrl(result.getAvatarId());

                callEmployeeSelectedHandler(result.getAccountId(), result.getDisplayName(), imageUrl);
            }
        };
    }
View Full Code Here

                            for (Serializable person : arg1.getResponse())
                            {
                                PersonModelView personMV = (PersonModelView) person;
                                if (ntidList.contains(personMV.getAccountId()))
                                {
                                    AvatarUrlGenerator urlGen = new AvatarUrlGenerator(EntityType.PERSON);
                                    String imageUrl = urlGen.getSmallAvatarUrl(personMV.getAvatarId());

                                    JsArrayString personJSON = (JsArrayString) JavaScriptObject.createObject();
                                    personJSON.set(0, personMV.getAccountId());
                                    personJSON.set(1, personMV.getDisplayName());
                                    personJSON.set(2, imageUrl);
View Full Code Here

     * @param title
     *            the title.
     */
    public void setAvatar(final String avatarId, final EntityType type, final String title)
    {
        AvatarUrlGenerator urlGen = new AvatarUrlGenerator(type);
        String imageUrl = imageSize.equals(Size.Normal) ? urlGen.getNormalAvatarUrl(avatarId) : urlGen
                .getSmallAvatarUrl(avatarId);
        image.setUrl(imageUrl);
        if (title.length() > 0)
        {
            image.setTitle(title);
View Full Code Here

        content.addStyleName(StaticResourceBundle.INSTANCE.coreCss().yuiSkinSam());
        content.addStyleName(StaticResourceBundle.INSTANCE.coreCss().avatarCropModal());
        strategy = inStrategy;

        AvatarUrlGenerator urlGenerator = new AvatarUrlGenerator(EntityType.PERSON);
        content.add(new Label(
                "Drag or resize the box to change your avatar. When you are finished click the save button."));
        baseImage = new Image();
        baseImage.setSize(inImageWidth, inImageHeight);
        baseImage.setUrl(urlGenerator.getOriginalAvatarUrl(inAvatarId));
        baseImage.getElement().setAttribute("id", "avatarBase");

        FlowPanel imageContainer = new FlowPanel();
        imageContainer.addStyleName(StaticResourceBundle.INSTANCE.coreCss().imageContainer());
        imageContainer.add(baseImage);
View Full Code Here

            {
                mainLinkUi.setHref(url);
            }
        }

        AvatarUrlGenerator urlGen = new AvatarUrlGenerator(item.getAvatarOwnerType());
        avatarUi.setSrc(urlGen.getSmallAvatarUrl(item.getAvatarId()));

        if (item.getFilterCategory() == null)
        {
            disableToplevelUi.removeFromParent();
        }
View Full Code Here

     *            the image id.
     * @return the image.
     */
    public FlowPanel getImage(final String imageId)
    {
        AvatarUrlGenerator urlGenerator = new AvatarUrlGenerator(entityType);
        FlowPanel imageContainer = new FlowPanel();
        imageContainer.addStyleName(StaticResourceBundle.INSTANCE.coreCss().banner());
        imageContainer.add(new Image(urlGenerator.getBannerUrl(imageId)));

        return imageContainer;
    }
View Full Code Here

    {
        JSONObject person = new JSONObject();
       
        person.put(AUTHOR_NAME_KEY, inPerson.getDisplayName());
       
        AvatarUrlGenerator generator = new AvatarUrlGenerator(EntityType.PERSON);
        person.put(PERSON_IMAGE_KEY, generator.getSmallAvatarUrl(inPerson.getAvatarId()));
       
        person.put(ID_KEY, inPerson.getOpenSocialId());
       
        return person;
    }
View Full Code Here

            DateFormatter dateFormatter = new DateFormatter(new Date());
            JSONArray jsonActivities = new JSONArray();
            for (ActivityDTO activity : activities.getPagedSet())
            {
                AvatarUrlGenerator actorUrlGen = new AvatarUrlGenerator(EntityType.PERSON);

                JSONObject jsonActivity = new JSONObject();
                jsonActivity.put("commentCount", activity.getCommentCount());
                jsonActivity.put("likeCount", activity.getLikeCount());
                jsonActivity.put("destinationDisplayName", activity.getDestinationStream().getDisplayName());
                jsonActivity.put("destinationUniqueIdentifier", activity.getDestinationStream().getUniqueIdentifier());
                jsonActivity.put("destinationType", activity.getDestinationStream().getType());
                jsonActivity.put("actorAvatarPath", actorUrlGen.getSmallAvatarUrl(activity.getActor().getAvatarId()));
                jsonActivity.put("actorDisplayName", activity.getActor().getDisplayName());
                jsonActivity.put("actorUniqueIdentifier", activity.getActor().getUniqueIdentifier());
                jsonActivity.put("actorType", activity.getActor().getType());
                jsonActivity.put("verb", activity.getVerb());
                jsonActivity.put("postedTimeAgo", dateFormatter.timeAgo(activity.getPostedTime()));
                jsonActivity.put("baseObjectType", activity.getBaseObjectType().toString());
                jsonActivity.put("activityId", activity.getId());
                jsonActivity.put("originalActorAvatarPath",
                        actorUrlGen.getSmallAvatarUrl(activity.getOriginalActor().getAvatarId()));
                jsonActivity.put("originalActorActivityId", activity.getOriginalActor().getAvatarId());
                jsonActivity.put("originalActorDisplayName", activity.getOriginalActor().getDisplayName());
                jsonActivity.put("originalActorUniqueIdentifier", activity.getOriginalActor().getUniqueIdentifier());
                jsonActivity.put("originalActorType", activity.getOriginalActor().getType());
View Full Code Here

    {
        final EventBus eventBus = EventBus.getInstance();

        eventBus.addObserver(GotCurrentUserStreamBookmarks.class, new Observer<GotCurrentUserStreamBookmarks>()
        {
            private final AvatarUrlGenerator groupUrlGen = new AvatarUrlGenerator(EntityType.GROUP);
            private final AvatarUrlGenerator personUrlGen = new AvatarUrlGenerator(EntityType.PERSON);

            public void update(final GotCurrentUserStreamBookmarks event)
            {
                bookmarkList.clear();
                bookmarksWidgetMap.clear();

                List<StreamFilter> sortedStreamFilters = event.getResponse();
                Collections.sort(sortedStreamFilters, new StreamFilterNameComparator());

                for (final StreamFilter filter : sortedStreamFilters)
                {
                    JSONObject req = StreamJsonRequestFactory.getJSONRequest(filter.getRequest());
                    String uniqueId = null;
                    String entityType = null;

                    String imgUrl = "";

                    if (req.containsKey("query"))
                    {
                        JSONObject query = req.get("query").isObject();
                        if (query.containsKey(StreamJsonRequestFactory.RECIPIENT_KEY))
                        {
                            JSONArray recipient = query.get(StreamJsonRequestFactory.RECIPIENT_KEY).isArray();
                            if (recipient.size() > 0)
                            {
                                JSONObject recipientObj = recipient.get(0).isObject();
                                uniqueId = recipientObj.get("name").isString().stringValue();
                                entityType = recipientObj.get("type").isString().stringValue().toLowerCase();

                                AvatarUrlGenerator urlGen = groupUrlGen;

                                if ("person".equals(entityType))
                                {
                                    urlGen = personUrlGen;
                                }

                                imgUrl = urlGen.getSmallAvatarUrl(filter.getOwnerAvatarId());

                            }
                        }

                    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.domain.AvatarUrlGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.