Package org.eurekastreams.server.domain.stream

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


     */
    public ActivityDTO getActivityDTO(final String inContent, final EntityType inDestinationType,
            final String inDestinationUniqueId, final ActivityDTOPopulatorStrategy verbPopulator,
            final ActivityDTOPopulatorStrategy objectPopulator)
    {
        ActivityDTO activity = new ActivityDTO();
        HashMap<String, String> props = new HashMap<String, String>();
        activity.setBaseObjectProperties(props);
        activity.getBaseObjectProperties().put("content", inContent);

        StreamEntityDTO destination = new StreamEntityDTO();
        destination.setUniqueIdentifier(inDestinationUniqueId);
        destination.setType(inDestinationType);
        activity.setDestinationStream(destination);

        if (verbPopulator != null)
        {
            verbPopulator.populate(activity);
        }
View Full Code Here


                    }

                    ActivityDTOPopulatorStrategy objectStrat = attachment != null ? attachment.getPopulator()
                            : new NotePopulator();

                    ActivityDTO activity = activityPopulator.getActivityDTO(postBox.getText(),
                            DomainConversionUtility.convertToEntityType(currentStream.getScopeType()),
                            currentStream.getUniqueKey(), new PostPopulator(), objectStrat);

                    PostActivityRequest postRequest = new PostActivityRequest(activity);
View Full Code Here

                    messageText = "";
                }

                BookmarkPopulator objectStrat = new BookmarkPopulator();
                objectStrat.setLinkInformation(link);
                ActivityDTO activity = activityPopulator.getActivityDTO(messageText, recipientType,
                        scope.getUniqueKey(), new PostPopulator(), objectStrat);
                PostActivityRequest postRequest = new PostActivityRequest(activity);

                ActivityModel.getInstance().insert(postRequest);
            }
View Full Code Here

        {
            recipientType = EntityType.GROUP;
        }

        ActivityDTOPopulatorStrategy objectStrat = attachment != null ? attachment.getPopulator() : new NotePopulator();
        ActivityDTO activity = activityPopulator.getActivityDTO(messageText, recipientType, scope.getUniqueKey(),
                new PostPopulator(), objectStrat);
        PostActivityRequest postRequest = new PostActivityRequest(activity);

        ActivityModel.getInstance().insert(postRequest);
    }
View Full Code Here

         * {@inheritDoc}
         */
        @Override
        public void postMessage()
        {
            ActivityDTO activity = activityPopulator.getActivityDTO(getMesssageText(), EntityType.RESOURCE,
                    resourceId, new PostPopulator(), new NotePopulator());

            activity.setShowInStream(postToEurekaCheckBox.getValue());
            HashMap<String, String> props = activity.getBaseObjectProperties();
            props.put("resourceUrl", resourceUrl);
            props.put("resourceTitle", resourceTitle);
            props.put("siteUrl", siteUrl);
            props.put("siteTitle", siteTitle);

View Full Code Here

     * @return void.
     */
    @Override
    public Void execute(final Long inRequest)
    {
        ActivityDTO activity = activityDAO.execute(inRequest);

        // short-circut if activity already deleted, or showInStream has been toggled back to true already or not a
        // resource type activity.
        if (activity == null || activity.getShowInStream()
                || activity.getDestinationStream().getType() != EntityType.RESOURCE)
        {
            return null;
        }

        PersonModelView actor = getPersonModelViewByAccountIdMapper.execute(activity.getActor().getUniqueIdentifier());

        // remove from actor's personal stream.
        getCache().removeFromList(CacheKeys.ENTITY_STREAM_BY_SCOPE_ID + actor.getStreamId(), inRequest);

        // remove activity id user's "following" lists for everyone following destination stream.
View Full Code Here

        // delete a comment via sut.
        assertTrue(sut.execute(1L));

        // grab activity directly from cache and verify state has changed.
        ActivityDTO activity = activityDAO.execute(new ArrayList<Long>()
        {
            {
                add(activityId);
            }
        }).get(0);
        assertEquals(2, activity.getFirstComment().getId());
        assertEquals(3, activity.getLastComment().getId());
        assertEquals(2, activity.getCommentCount());

    }
View Full Code Here

        // delete a comment via sut.
        assertTrue(sut.execute(3L));

        // grab activity directly from cache and verify state has changed.
        ActivityDTO activity = activityDAO.execute(new ArrayList<Long>()
        {
            {
                add(activityId);
            }
        }).get(0);
        assertEquals(1, activity.getFirstComment().getId());
        assertEquals(2, activity.getLastComment().getId());
        assertEquals(2, activity.getCommentCount());
    }
View Full Code Here

        // delete a comment via sut.
        assertTrue(sut.execute(2L));

        // grab activity directly from cache and verify state has changed.
        ActivityDTO activity = activityDAO.execute(new ArrayList<Long>()
        {
            {
                add(activityId);
            }
        }).get(0);
        assertEquals(1, activity.getFirstComment().getId());
        assertEquals(3, activity.getLastComment().getId());
        assertEquals(2, activity.getCommentCount());
    }
View Full Code Here

        assertTrue(sut.execute(1L));
        // delete a comment via sut.
        assertTrue(sut.execute(2L));

        // grab activity directly from cache and verify state has changed.
        ActivityDTO activity = activityDAO.execute(new ArrayList<Long>() { { add(activityId); } }).get(0);
        assertEquals(3, activity.getFirstComment().getId());
        assertNull(activity.getLastComment());
        assertEquals(1, activity.getCommentCount());
    }
View Full Code Here

TOP

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

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.