Examples of StreamScope


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

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

        final List<StreamScope> bookmarks = new ArrayList<StreamScope>();

        final StreamScope scopeToAdd = new StreamScope();

        context.checking(new Expectations()
        {
            {
                oneOf(actionContext).getPrincipal();
View Full Code Here

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

                        String displayName = results[3];
                        ScopeType entityType = ScopeType.valueOf(results[0]);
                        String uniqueId = results[1];
                        long streamScopeId = Long.parseLong(results[2]);

                        typedInScope = new StreamScope(displayName, entityType, uniqueId, streamScopeId);

                        other.setChecked(true);

                        autoComplete.setVisible(false);
                        autoComplete.setDefaultText(OTHER_TEXT);
                        scopePanel = new StreamScopePanel(typedInScope);
                        thisBuffered.add(scopePanel);
                    }
                    else
                    {
                        typedInScope = null;
                    }
                }
            });
            autoComplete.setDefaultText(OTHER_TEXT);
            this.add(autoComplete);

            EventBus.getInstance().addObserver(StreamScopeDeletedEvent.getEvent(),
                    new Observer<StreamScopeDeletedEvent>()
                    {
                        public void update(final StreamScopeDeletedEvent event)
                        {
                            try
                            {
                                if (typedInScope.equals(event.getScope()))
                                {
                                    autoComplete.setVisible(true);
                                    autoComplete.setDefaultText(OTHER_TEXT);
                                    thisBuffered.remove(scopePanel);
                                    typedInScope = null;
                                }
                            }
                            catch (final Exception ex)
                            {
                                int x = 0;
                                // no logging Im client side. This means a scope
                                // closed that doesnt have an ID
                                // Usually by a user who just entered it into
                                // the create list modal.
                                // This is necessary because we use a little
                                // long vs a big Long.
                            }
                        }
                    });

            EventBus.getInstance().addObserver(SwitchedToCustomStreamEvent.class,
                    new Observer<SwitchedToCustomStreamEvent>()
                    {
                        public void update(final SwitchedToCustomStreamEvent arg1)
                        {
                            if (other.isChecked())
                            {
                                selectMyActivityStream();
                            }
                        }
                    });

            EventBus.getInstance().addObserver(SwitchedToGroupStreamEvent.getEvent(),
                    new Observer<SwitchedToGroupStreamEvent>()
                    {
                        public void update(final SwitchedToGroupStreamEvent arg1)
                        {
                            GroupStreamDTO group = arg1.getView();

                            // If the group has disabled posting, make "my activity stream" the default destination. The
                            // one case where this would be the incorrect thing to do is if the user is a group or org
                            // coordinator. But it is better for coordinators to have to explicitly choose the group
                            // than the alternative: a non-postable group pre-selected for regular users and their posts
                            // just going nowhere.
                            if (!group.isPostable())
                            {
                                selectMyActivityStream();
                            }
                            else
                            {
                                other.setChecked(true);
                                autoComplete.setVisible(false);
                                autoComplete.setDefaultText(OTHER_TEXT);
                                removeScopePanel(thisBuffered);

                                typedInScope = new StreamScope(ScopeType.GROUP, group.getShortName());
                                typedInScope.setDisplayName(group.getName());

                                scopePanel = new StreamScopePanel(typedInScope);
                                thisBuffered.add(scopePanel);
                            }
View Full Code Here

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

                will(returnValue(testDomainGroupId));
            }
        });

        Activity activity = new Activity();
        activity.setRecipientStreamScope(new StreamScope(ScopeType.GROUP, testDomainGroupShortName));
        assertEquals("g" + testDomainGroupId, sut.objectToString(activity));
        context.assertIsSatisfied();
    }
View Full Code Here

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

     */
    @Test
    public void testObjectToStringForPersonFromActivityObject()
    {
        Activity activity = new Activity();
        activity.setRecipientStreamScope(new StreamScope(ScopeType.PERSON, testPersonAccountId));
        assertEquals("p" + testPersonId, sut.objectToString(activity));
        context.assertIsSatisfied();
    }
View Full Code Here

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

     */
    @Test(expected = RuntimeException.class)
    public void testObjectToStringForUnsupportedFromActivityObject()
    {
        Activity activity = new Activity();
        activity.setRecipientStreamScope(new StreamScope(ScopeType.ALL, "bleh"));
        sut.objectToString(activity);
        context.assertIsSatisfied();
    }
View Full Code Here

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

                                            uniqueId, event.getResponse());

                                    ScopeType scopeType = ScopeType.valueOf(recipient.get(
                                            StreamJsonRequestFactory.ENTITY_TYPE_KEY).isString().stringValue());

                                    StreamScope scope = new StreamScope(scopeType, uniqueId);
                                    scope.setDisplayName(displayName);

                                    Session.getInstance().getEventBus().notifyObservers(
                                            new StreamScopeAddedEvent(scope));
                                }
View Full Code Here

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

     */
    @Test
    public final void testPersist() throws Exception
    {
        final Person testPerson = context.mock(Person.class);
        final StreamScope streamScope = context.mock(StreamScope.class);

        context.checking(new Expectations()
        {
            {
                oneOf(personMapperMock).insert(testPerson);
View Full Code Here

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

    @Test
    public void testValidatePassList()
    {
        final HashMap<String, Serializable> map = new HashMap<String, Serializable>();
        ArrayList<StreamScope> scopes = new ArrayList<StreamScope>();
        scopes.add(new StreamScope(ScopeType.PERSON, "key"));
        map.put("key", scopes);

        sut = new MapParameterValidator("key", List.class, "message here");
        sut.validate(map, new HashMap<String, String>());
    }
View Full Code Here

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

        final List<Person> coordinators = new ArrayList<Person>();
        coordinators.add(new Person("id2", "Homer", "Jay", "Simpson", "Homey"));
        coordinators.add(new Person("id3", "Max", "X", "Power", "Homer"));

        personMock = context.mock(Person.class);
        final StreamScope streamScope = context.mock(StreamScope.class);

        final long id = 1L;
        final String newName = "NEW org name here";

        final HashMap<String, Serializable> formData = new HashMap<String, Serializable>();
View Full Code Here

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

        final List<Person> coordinators = new ArrayList<Person>();
        coordinators.add(new Person("id2", "Homer", "Jay", "Simpson", "Homey"));
        coordinators.add(new Person("id3", "Max", "X", "Power", "Homer"));

        personMock = context.mock(Person.class);
        final StreamScope streamScope = context.mock(StreamScope.class);

        final long id = 1L;
        final String newName = "NEW org name here";

        final HashMap<String, Serializable> formData = new HashMap<String, Serializable>();
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.