Package org.eurekastreams.server.domain.stream

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


     */
    @Test
    public void testExecuteWithSameDisplayName()
    {
        final String newDisplayName = "sldkfjsdlkfj";
        final StreamEntityDTO entity = context.mock(StreamEntityDTO.class);
        final Person person = context.mock(Person.class);

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


     * @return true
     */
    @Override
    protected Boolean updateCachedEntity(final ActivityDTO inCachedItem, final String inUpdatedDestinationStreamName)
    {
        StreamEntityDTO destinationStream = inCachedItem.getDestinationStream();
        if (destinationStream.getDisplayName().equals(inUpdatedDestinationStreamName))
        {
            return false;
        }
        destinationStream.setDisplayName(inUpdatedDestinationStreamName);
        return true;
    }
View Full Code Here

    public void testGetFollowersWithPersonDestinationStream()
    {
        ActivityDTO testActivity = new ActivityDTO();
        testActivity.setId(1L);

        StreamEntityDTO testDestinationStream = new StreamEntityDTO();
        testDestinationStream.setId(1L);
        testDestinationStream.setUniqueIdentifier("fordp");
        testDestinationStream.setType(EntityType.PERSON);
        testActivity.setDestinationStream(testDestinationStream);

        PersonModelView testPersonModelView = new PersonModelView();
        testPersonModelView.setEntityId(TEST_PERSON_ID);
View Full Code Here

    public void testGetFollowersWithGroupDestinationStream()
    {
        ActivityDTO testActivity = new ActivityDTO();
        testActivity.setId(1L);

        StreamEntityDTO testDestinationStream = new StreamEntityDTO();
        testDestinationStream.setId(1L);
        testDestinationStream.setUniqueIdentifier("group1");
        testDestinationStream.setType(EntityType.GROUP);
        testActivity.setDestinationStream(testDestinationStream);

        DomainGroupModelView testGroupModelView = new DomainGroupModelView();
        testGroupModelView.setEntityId(5L);
View Full Code Here

        try
        {
            Principal currentUserPrincipal = openSocialPrincipalDao.execute(userId.getUserId(token));

            // Create the actor.
            StreamEntityDTO actorEntity = new StreamEntityDTO();
            actorEntity.setUniqueIdentifier(currentUserPrincipal.getOpenSocialId());
            actorEntity.setType(EntityType.PERSON);

            // Create the destination stream.
            StreamEntityDTO destStream = new StreamEntityDTO();
            destStream.setUniqueIdentifier(currentUserPrincipal.getAccountId());
            destStream.setType(EntityType.PERSON);

            // Create the activitydto object.
            ActivityDTO currentActivity = new ActivityDTO();
            currentActivity.setActor(actorEntity);
            currentActivity.setBaseObjectProperties(new HashMap<String, String>(
View Full Code Here

     * @return A list of IDs of following composite streams.
     */
    public List<Long> execute(final ActivityDTO activity)
    {
        // Gets the followers and add to their followed stream
        StreamEntityDTO destinationStream = activity.getDestinationStream();
        List<Long> followers = null;
        if (destinationStream.getType() == EntityType.PERSON)
        {
            long personId = getPersonIdFromAccountIdMapper.execute(destinationStream.getUniqueIdentifier());
            followers = personFollowersMapper.execute(personId);
        }
        else if (destinationStream.getType() == EntityType.GROUP)
        {
            // Empty for groups, group activity doesn't show up in following streams.
            followers = new ArrayList<Long>();
        }
        else
View Full Code Here

     *            The activity being deleted.
     * @return List of user Ids for users that are following the activity's destination stream.
     */
    private List<Long> getIdsForUsersFollowingDestinationStream(final ActivityDTO inActivityDTO)
    {
        StreamEntityDTO destinationStream = inActivityDTO.getDestinationStream();
        List<Long> followingUserIds = null;
        switch (destinationStream.getType())
        {
        case PERSON:
            long personId = getPersonIdByAccountIdMapper.execute(destinationStream.getUniqueIdentifier());
            followingUserIds = userIdsFollowingPersonDAO.execute(personId);
            break;
        case GROUP:
            long groupId = groupByShortNameDAO.fetchId(destinationStream.getUniqueIdentifier());
            followingUserIds = userIdsFollowingGroupDAO.execute(groupId);
            break;
        case RESOURCE:
            if (inActivityDTO.getActor().getType() == EntityType.PERSON)
            {
                inActivityDTO.getActor().getUniqueIdentifier();
                long actorPersonId = getPersonIdByAccountIdMapper.execute(inActivityDTO.getActor()
                        .getUniqueIdentifier());
                followingUserIds = userIdsFollowingPersonDAO.execute(actorPersonId);
            }
            else
            {
                throw new RuntimeException("Unexpected Actor type for resource activity: "
                        + inActivityDTO.getActor().getType());
            }
            break;
        default:
            throw new RuntimeException("Unexpected Activity destination stream type: " + destinationStream.getType());
        }

        return followingUserIds;
    }
View Full Code Here

        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

     *            Renderer for the message's verb.
     * @return The actions panel.
     */
    private Widget buildActionsLine(final ActivityDTO msg, final VerbRenderer verbRenderer)
    {
        StreamEntityDTO destinationStream = msg.getDestinationStream();

        // timestamp and actions
        Panel timestampActions = new FlowPanel();
        timestampActions.addStyleName(StaticResourceBundle.INSTANCE.coreCss().messageTimestampActionsArea());

        // Hijack this property and use to show lock icon for private activity.
        if (!msg.isShareable())
        {
            Label lockIcon = new Label("");
            lockIcon.addStyleName(StaticResourceBundle.INSTANCE.coreCss().privateIcon());
            timestampActions.add(lockIcon);
        }

        // create timestamp as permalink
        String date = new DateFormatter(new Date()).timeAgo(msg.getPostedTime());
        Widget dateLink;
        String permalinkUrl = activityLinkBuilder.buildActivityPermalink(msg.getId(), destinationStream.getType(),
                destinationStream.getUniqueIdentifier());
        dateLink = new InlineHyperlink(date, permalinkUrl);
        dateLink.addStyleName(StaticResourceBundle.INSTANCE.coreCss().messageTimestampLink());
        timestampActions.add(dateLink);

        if (msg.getAppName() != null)
View Full Code Here

            RenderUtilities.addActorNameRenderers(renderers, activity);

            if (activity.getBaseObjectType() == BaseObjectType.BOOKMARK
                    && activity.getDestinationStream().getType() != EntityType.RESOURCE)
            {
                StreamEntityDTO stream = activity.getDestinationStream();
                renderers.add(new MetadataLinkRenderer("shared this link to", stream.getType(), stream
                        .getUniqueIdentifier(), stream.getDisplayName()));
            }

            return renderers;
        }
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.