Examples of StreamScope


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

        Long ssIdToInsert = (Long) inActionContext.getParams();

        Person person = personMapper.execute(new FindByIdRequest("Person", inActionContext.getPrincipal().getId()));
        List<StreamScope> bookmarks = person.getBookmarks();

        StreamScope scope = null;

        // if already bookmarked, just assign return scope here.
        for (StreamScope ss : bookmarks)
        {
            if (ss.getId() == ssIdToInsert)
View Full Code Here

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

        {
            throw new ValidationException("Description must be present and less than " + maxLength + " characters");
        }

        // verify streamscope not null and is correct type.
        StreamScope streamScope = streamScopeMapper.execute(new FindByIdRequest("StreamScope", dto.getStreamId()));
        if (streamScope == null)
        {
            throw new ValidationException("Stream not found");
        }

        // put in state so action doesn't need to look it up again or use placeholder object.
        inActionContext.getState().put("streamScope", streamScope);

        // verify that featured stream belongs to person or group.
        if (streamScope.getScopeType() != ScopeType.PERSON && streamScope.getScopeType() != ScopeType.GROUP)
        {
            throw new ValidationException("Only person and group streams supported.");
        }

    }
View Full Code Here

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

        {
            throw new RuntimeException("getDomainGroupsByShortNames was not set in the MessageRecipientIdClassBridge.");
        }

        Activity activity = (Activity) msgObject;
        StreamScope scope = activity.getRecipientStreamScope();
        switch (scope.getScopeType())
        {
        case GROUP:
            return "g" + getDomainGroupsByShortNames.fetchId(scope.getUniqueKey());
        case PERSON:
            return "p" + getPersonIdByAccountIdMapper.execute(scope.getUniqueKey());
        case RESOURCE:
            return "r" + getSharedResourceByUniqueKeyMapper.execute(//
                    new SharedResourceRequest(scope.getUniqueKey(), null)).getId();
        default:
            throw new RuntimeException("Unknown/unhandled recipient type: " + scope.getScopeType());
        }
    }
View Full Code Here

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

     */
    @Test
    public void testExecuteWhenSharedResourceDNE()
    {
        final String uniqueKey = "http://foo.com";
        final StreamScope sharedResourceStreamScope = null;
        final SharedResourceRequest request = new SharedResourceRequest(uniqueKey, null);

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

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

     */
    @Test
    public void testExecuteWhenSharedExists()
    {
        final String uniqueKey = "http://foo.com";
        final StreamScope sharedResourceStreamScope = context.mock(StreamScope.class);
        final SharedResourceRequest request = new SharedResourceRequest(uniqueKey, null);
        final List<Long> sharerIds = new ArrayList<Long>();
        final List<Long> likerIds = new ArrayList<Long>();
        final List<PersonModelView> people = new ArrayList<PersonModelView>();

View Full Code Here

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

            PersonModelView person = getPersonModelViewByAccountIdMapper.execute(uniqueKey);

            getCache().addToTopOfList(CacheKeys.ENTITY_STREAM_BY_SCOPE_ID + person.getStreamId(), activityId);
            break;
        case RESOURCE:
            StreamScope scope = getResourceStreamScopeIdByKeyMapper.execute(uniqueKey);
            if (scope != null)
            {
                getCache().addToTopOfList(CacheKeys.ENTITY_STREAM_BY_SCOPE_ID + scope.getId(), activityId);
            }

            // if showInStream is true and author is person, add to actors (author)'s stream also.
            if (activity.getShowInStream() && activity.getActor().getType() == EntityType.PERSON)
            {
View Full Code Here

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

        final ArrayList<Long> streamScopeIds = new ArrayList<Long>();

        if (resourceKey != null && !resourceKey.equals(""))
        {
            StreamScope streamScope = resourceStreamScopeMapper.execute(resourceKey);
            if (streamScope != null && streamScope.getId() > 0)
            {
                streamScopeIds.add(streamScope.getId());
            }
        }

        for (PersonModelView person : people)
        {
View Full Code Here

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

            public void itemSelected(final JavaScriptObject obj)
            {
                if (!getEntityType(obj.toString()).equals("NOTSET"))
                {
                    EventBus.getInstance().notifyObservers(
                            new StreamScopeAddedEvent(new StreamScope(getDisplayName(obj.toString()), ScopeType
                                    .valueOf(getEntityType(obj.toString())), getUniqueId(obj.toString()), Long
                                    .parseLong(getStreamScopeId(obj.toString())))));
                }
            }
        });
View Full Code Here

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

     * @param sharedMessage
     *            the shared message.
     */
    public ShareMessageDialogContent(final ActivityDTO sharedMessage)
    {
        StreamScope postScope = new StreamScope(ScopeType.PERSON, Session.getInstance().getCurrentPerson()
                .getAccountId());
        processor = Session.getInstance().getActionProcessor();

        actionKeys.put(EntityType.GROUP, "postGroupActivityServiceActionTaskHandler");
        actionKeys.put(EntityType.PERSON, "postPersonActivityServiceActionTaskHandler");

        body.addStyleName(StaticResourceBundle.INSTANCE.coreCss().shareMessageDialogBody());

        Label loading = new Label("Share this activity to your stream or another stream");
        loading.setStyleName(StaticResourceBundle.INSTANCE.coreCss().formTitle());
        body.add(loading);

        errorMsg.addStyleName(StaticResourceBundle.INSTANCE.coreCss().formErrorBox());
        errorMsg.setVisible(false);
        body.add(errorMsg);

        postToPanel = new PostToPanel(postScope, true);
        body.add(postToPanel);

        StreamMessageItemRenderer messageRenderer = new StreamMessageItemRenderer(ShowRecipient.NO, State.READONLY);

        body.add(messageRenderer.render(sharedMessage));

        Label messageLabel = new Label("Comment:");
        messageLabel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().formLabel());
        body.add(messageLabel);
        commentBox.addStyleName(StaticResourceBundle.INSTANCE.coreCss().messageBox());
        body.add(commentBox);

        countDown.setText(Integer.toString(MAXLENGTH));
        countDown.addStyleName(StaticResourceBundle.INSTANCE.coreCss().charactersRemaining());
        body.add(countDown);

        final FlowPanel warning = new FlowPanel();
        warning.addStyleName(StaticResourceBundle.INSTANCE.coreCss().warning());
        body.add(warning);
        Session.getInstance().getEventBus()
                .addObserver(GotSystemSettingsResponseEvent.class, new Observer<GotSystemSettingsResponseEvent>()
                {
                    public void update(final GotSystemSettingsResponseEvent event)
                    {
                        warning.getElement().setInnerHTML(event.getResponse().getContentWarningText());
                    }

                });
        SystemSettingsModel.getInstance().fetch(null, true);

        share = new Hyperlink("share", History.getToken());
        share.addStyleName(StaticResourceBundle.INSTANCE.coreCss().formButton());
        share.addStyleName(StaticResourceBundle.INSTANCE.coreCss().formShareButton());

        Hyperlink cancel = new Hyperlink("Cancel", History.getToken());
        cancel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().formButton());
        cancel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().formCancelButton());
        cancel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().shareMessageCancel());

        body.add(share);
        body.add(cancel);

        cancel.addClickHandler(new ClickHandler()
        {
            public void onClick(final ClickEvent event)
            {
                close();
            }

        });

        commentBox.addKeyUpHandler(new KeyUpHandler()
        {
            public void onKeyUp(final KeyUpEvent event)
            {
                onCommentChanges();
            }
        });

        commentBox.addChangeHandler(new ChangeHandler()
        {
            public void onChange(final ChangeEvent event)
            {
                onCommentChanges();
            }
        });

        share.addClickHandler(new ClickHandler()
        {
            public void onClick(final ClickEvent event)
            {
                if (!inactive)
                {
                    StreamScope scope = postToPanel.getPostScope();

                    if (scope != null)
                    {
                        hideError();
                        EntityType recipientType;
                        if (scope.getScopeType().equals(ScopeType.PERSON))
                        {
                            recipientType = EntityType.PERSON;
                        }
                        else
                        {
                            recipientType = EntityType.GROUP;
                        }

                        PostActivityRequest postRequest = new PostActivityRequest(new ActivityDTOPopulator()
                                .getActivityDTO("", recipientType, scope.getUniqueKey(), new SharePopulator(
                                        sharedMessage, commentBox.getText()), null));

                        processor.makeRequest(actionKeys.get(recipientType), postRequest,
                                new AsyncCallback<ActivityDTO>()
                                {
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.