Package org.eurekastreams.server.domain.stream

Examples of org.eurekastreams.server.domain.stream.StreamEntityDTO


        // Construct the activity we're sharing.
        ActivityDTO original = new ActivityDTO();

        original.setId(1L);
        original.setBaseObjectType(BaseObjectType.NOTE);
        StreamEntityDTO originalActor = new StreamEntityDTO();
        originalActor.setUniqueIdentifier("testacct");

        original.setActor(originalActor);

        HashMap<String, String> props = new HashMap<String, String>();
        props.put("test", "value");
View Full Code Here


        // Construct the activity we're sharing.
        ActivityDTO original = new ActivityDTO();

        original.setId(1L);
        original.setBaseObjectType(BaseObjectType.NOTE);
        StreamEntityDTO originalActor = new StreamEntityDTO();
        originalActor.setUniqueIdentifier("testacct");

        original.setOriginalActor(originalActor);

        HashMap<String, String> props = new HashMap<String, String>();
        props.put("test", "value");
View Full Code Here

        // Construct the activity we're sharing.
        ActivityDTO original = new ActivityDTO();

        original.setId(1L);
        original.setBaseObjectType(BaseObjectType.NOTE);
        StreamEntityDTO originalActor = new StreamEntityDTO();
        originalActor.setUniqueIdentifier("testacct");

        original.setActor(originalActor);

        HashMap<String, String> props = new HashMap<String, String>();
        props.put("test", "value");
View Full Code Here

                            .getUniqueIdentifier());
                    activity.getDestinationStream().setDisplayName(group.getName());
                }
            }

            final StreamEntityDTO actor = activity.getActor();
            if (actor.getType() == EntityType.PERSON)
            {
                List<PersonModelView> people = getPersonModelViewsByAccountIdsMapper.execute(Collections
                        .singletonList(actor.getUniqueIdentifier()));
                if (!people.isEmpty())
                {
                    final PersonModelView person = people.get(0);
                    actor.setId(person.getEntityId());
                    actor.setDestinationEntityId(person.getEntityId());
                    actor.setDisplayName(person.getDisplayName());
                    actor.setAvatarId(person.getAvatarId());
                }
            }
            else if (actor.getType() == EntityType.GROUP)
            {
                List<DomainGroupModelView> groups = groupMapper.execute(Collections.singletonList(actor
                        .getUniqueIdentifier()));
                if (!groups.isEmpty())
                {
                    final DomainGroupModelView group = groups.get(0);
                    actor.setId(group.getEntityId());
                    actor.setDestinationEntityId(group.getEntityId());
                    actor.setDisplayName(group.getName());
                    actor.setAvatarId(group.getAvatarId());
                }
            }
            // fills in data from cached view of original actor
            final StreamEntityDTO originalActor = activity.getOriginalActor();
            if (originalActor != null)
            {
                StreamDTO originalActorStreamDTO = null;

                if (originalActor.getType() == EntityType.PERSON)
                {
                    List<PersonModelView> people = getPersonModelViewsByAccountIdsMapper.execute(Collections
                            .singletonList(originalActor.getUniqueIdentifier()));
                    if (!people.isEmpty())
                    {
                        originalActorStreamDTO = people.get(0);
                    }
                }
                if (originalActor.getType() == EntityType.GROUP)
                {
                    List<DomainGroupModelView> oagroups = groupMapper.execute(Collections.singletonList(originalActor
                            .getUniqueIdentifier()));
                    if (!oagroups.isEmpty())
                    {
                        originalActorStreamDTO = oagroups.get(0);
                    }
                }

                if (originalActorStreamDTO != null)
                {
                    originalActor.setId(originalActorStreamDTO.getEntityId());
                    originalActor.setDestinationEntityId(originalActorStreamDTO.getEntityId());
                    originalActor.setDisplayName(originalActorStreamDTO.getDisplayName());
                    originalActor.setAvatarId(originalActorStreamDTO.getAvatarId());
                }
                else
                {
                    // this is to prevent JSON serializer from dying on a nulled out StreamEntityDTO.
                    activity.setOriginalActor(null);

                    // log this out so we don't just swallow problem.
                    logger.warn("Nulled out originalActor value for activity " + activity.getId()
                            + ". Could not find values for uniqueId: " + originalActor.getUniqueIdentifier()
                            + " type: " + originalActor.getType());
                }
            }

            loadCommentInfo(activity); // set the first/last comment and comment count.
        }
View Full Code Here

        RenderUtilities.addActorNameRenderers(renderers, activity);

        if (showRecipient)
        {
            StreamEntityDTO stream = activity.getDestinationStream();
            if (stream.getType() == EntityType.RESOURCE)
            {
                renderers.add(new ResourceDestinationRenderer(activity));
            }
            else
            {
                renderers.add(new MetadataLinkRenderer("to", stream.getType(), stream.getUniqueIdentifier(), stream
                        .getDisplayName()));
            }
        }

        return renderers;
View Full Code Here

            RenderUtilities.addEntityNameRenderers(renderers, activity.getActor(), null);
        }

        if (showRecipient)
        {
            StreamEntityDTO stream = activity.getDestinationStream();
            if (stream.getType() == EntityType.RESOURCE)
            {
                renderers.add(new ResourceDestinationRenderer(activity));
            }
            else
            {
View Full Code Here

    public void testExecuteWithNewAvatarId()
    {
        final String oldAvatarId = "sdlfkjsdlkjf";
        final String newAvatarId = "slslsllslll";

        final StreamEntityDTO entity = context.mock(StreamEntityDTO.class);
        final Person person = context.mock(Person.class);

        context.checking(new Expectations()
        {
            {
View Full Code Here

    public void testExecuteWithSameAvatarId()
    {
        final String oldAvatarId = "sdlfkjsdlkjf";
        final String newAvatarId = oldAvatarId;

        final StreamEntityDTO entity = context.mock(StreamEntityDTO.class);
        final Person person = context.mock(Person.class);

        context.checking(new Expectations()
        {
            {
View Full Code Here

    {
        // need to get activity info to decide about notifying
        ActivityDTO activityDTO = activityDAO.execute(activityId);

        // Sends notifications for new personal stream comments.
        StreamEntityDTO destination = activityDTO.getDestinationStream();
        long destinationId = destination.getDestinationEntityId();
        EntityType destinationType = destination.getType();

        RequestType requestType = null;
        switch (destinationType)
        {
        case PERSON:
View Full Code Here

        HashMap<String, String> props = new HashMap<String, String>();
        activity.setBaseObjectProperties(props);
        String content = "%EUREKA:ACTORNAME% configured the " + values.get("EUREKA:PLUGINTITLE") + " stream plugin";
        activity.getBaseObjectProperties().put("content", content);

        StreamEntityDTO destination = new StreamEntityDTO();
        if (type.equals(EntityType.PERSON))
        {
            destination.setUniqueIdentifier(principal.getAccountId());
        }
        else
        {
            destination.setUniqueIdentifier(group);
        }
        destination.setType(type);
        activity.setDestinationStream(destination);
        activity.setBaseObjectType(BaseObjectType.NOTE);
        activity.setVerb(ActivityVerb.POST);

        new InlineExecutionStrategyExecutor()
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.domain.stream.StreamEntityDTO

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.