Examples of StreamScope


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

        orgShortNames.add(orgShortName1);
        orgShortNames.add(orgShortName2);
        orgShortNames.add(orgShortName3);

        final Activity act = context.mock(Activity.class);
        final StreamScope recipStreamScope = context.mock(StreamScope.class, "recipStreamScope");

        final SharedResource sharedResource = context.mock(SharedResource.class);
        final StreamScope sharedResourceStreamScope = context.mock(StreamScope.class, "sharedResourceStreamScope");

        context.checking(new Expectations()
        {
            {
                // everyone list gets the activity id
View Full Code Here

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

    {
        PostCachedActivity sut = new PostCachedActivity(personFollowersMapper, getPersonModelViewByAccountIdMapper);
        sut.setCache(cache);

        final Activity act = context.mock(Activity.class);
        final StreamScope recipStreamScope = context.mock(StreamScope.class);

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

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

        person.setStartTabGroup(startTabGroup);
        person.setTheme(properties.getTheme());

        // Make the default view for a person
        StreamScope personScope = new StreamScope(ScopeType.PERSON, (String) inFields.get("accountId"));

        person.setStreamScope(personScope);

        Set<StreamScope> defaultScopeList = new HashSet<StreamScope>();
        defaultScopeList.add(personScope);
View Full Code Here

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

        dto.setKey(inRequest.getUniqueKey());

        log.info("Looking for the stream scope for shared resource with uniqueKey " + inRequest.getUniqueKey());

        // either null or a stream scope id
        StreamScope sharedResourceStreamScope = getResourceStreamScopeByKeyMapper.execute(inRequest.getUniqueKey());

        // if the stream scope doesn't exist, then this resource doesn't either
        if (sharedResourceStreamScope == null)
        {
            // not found - if the shared resource existed, it would have a stream scope, so we can stop looking through
            // the other tables now
            log.info("Couldn't find the stream scope for shared resource with unique key " + inRequest.getUniqueKey()
                    + " - must not exist.  Cache as such.");

            dto.setStreamScopeId(null);
            dto.setIsLiked(false);
            return dto;
        }
        dto.setStreamScopeId(sharedResourceStreamScope.getId());

        // since we know the destination SharedResource id, we can get the likers and sharers much quicker
        inRequest.setSharedResourceId(sharedResourceStreamScope.getDestinationEntityId());

        log.info("Found the shared resource for unique key " + inRequest.getUniqueKey()
                + " - looking for lists of people ids that liked and shared it.");

        List<Long> sharedPersonIds = getPeopleThatSharedResourceMapper.execute(inRequest);
View Full Code Here

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

            final Map<String, Serializable> inFields)
    {
        // create the group
        DomainGroup group = new DomainGroup();

        StreamScope groupScope = new StreamScope(ScopeType.GROUP, (String) inFields.get("shortName"));
        group.setStreamScope(groupScope);

        // set the capabilities as a new list to avoid search indexing problems
        group.setCapabilities(new ArrayList<BackgroundItem>());
View Full Code Here

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

    public void testWithStreamIdSharedInActivity()
    {
        final long activityId = 6789L;
        final long activityId2 = 6790L;

        final StreamScope scope = new StreamScope(ScopeType.RESOURCE, "http://foo.foo.foo.com");
        getEntityManager().persist(scope);
        getEntityManager().flush();

        // an activity that shares the shared resource
        SharedResource sr = new SharedResource("http://foo.foo.foo.com");
        sr.setStreamScope(scope);
        getEntityManager().persist(sr);
        getEntityManager().flush();

        scope.setDestinationEntityId(sr.getId());
        getEntityManager().flush();

        Activity act = getEntityManager().find(Activity.class, activityId);
        act.setSharedLink(sr);

        getEntityManager().flush();

        // an activity that came from the shared resource
        act = getEntityManager().find(Activity.class, activityId2);
        act.setRecipientStreamScope(scope);

        getEntityManager().flush();

        final List<Long> request = new ArrayList<Long>();
        request.add(scope.getId());
        List<List<Long>> activityIds = sut.execute(request);

        assertEquals(1, activityIds.size());
        // assertEquals(2, activityIds.get(0).size());
        assertTrue(activityIds.get(0).contains(activityId));
View Full Code Here

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

    @Test
    public void testWhenExists()
    {
        final Long expectedId = 3L;
        final Long destinationEntityId = 4507L;
        StreamScope result = sutThatThrowsExceptionWhenNotFound.execute("csagan");
        org.junit.Assert.assertEquals(new Long(expectedId), new Long(result.getId()));
        org.junit.Assert.assertEquals(destinationEntityId, result.getDestinationEntityId());
    }
View Full Code Here

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

    public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext)
    {
        FeaturedStreamDTO dto = (FeaturedStreamDTO) inActionContext.getActionContext().getParams();

        // get streamScope from context state, or create proxy verison if not there.
        StreamScope streamScope = (inActionContext.getActionContext().getState().get("streamScope") == null) ? //
        streamScopeProxyMapper.execute(dto.getStreamId())
                : (StreamScope) inActionContext.getActionContext().getState().get("streamScope");

        FeaturedStream entity = new FeaturedStream(dto.getDescription(), streamScope);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.