Examples of StreamScope


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

        widget.addStyleName(StaticResourceBundle.INSTANCE.coreCss().eurekaConnectShareWidgetContainer());
        initWidget(widget);

        PersonModelView person = Session.getInstance().getCurrentPerson();

        StreamScope defaultStreamScope = new StreamScope(person.getDisplayName(), ScopeType.PERSON,
                person.getAccountId(), person.getStreamId());

        final PostToPanel postToPanel = new PostToPanel(defaultStreamScope);
        widget.add(postToPanel);

        // -- Setup the link display panel (thumbnail selector, field to update title) --

        title.addStyleName(StaticResourceBundle.INSTANCE.coreCss().attachLinkTitleEntry());
        linkUrlDisplay.addStyleName(StaticResourceBundle.INSTANCE.coreCss().url());
        linkDesc.addStyleName(StaticResourceBundle.INSTANCE.coreCss().metaDescription());

        FlowPanel linkInfoPanel = new FlowPanel();
        linkInfoPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().messageLink());
        linkInfoPanel.add(title);
        linkInfoPanel.add(linkUrlDisplay);
        linkInfoPanel.add(linkDesc);

        displayPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().linkPanel());
        displayPanel.add(selector);
        displayPanel.add(linkInfoPanel);
        displayPanel.add(selector.getPagingControls());

        widget.add(displayPanel);

        final LinkInformation link = new LinkInformation();
        link.setDescription(desc);
        link.setTitle(inTitle);
        link.setUrl(resourceUrl);
        try
        {
            link.setSource(resourceUrl.substring(0, resourceUrl.indexOf('/', 7)));
        }
        catch (Exception e)
        {
            link.setSource(resourceUrl);
        }

        if (thumbs != null)
        {
            HashSet<String> thumbsSet = new HashSet<String>();

            for (String thumb : thumbs)
            {
                thumbsSet.add(thumb);
            }

            link.setImageUrls(thumbsSet);

            link.setLargestImageUrl(thumbs[0]);
        }

        onLinkAdded(link);

        final FlowPanel postContainer = new FlowPanel();
        postContainer.getElement().setAttribute("id", "post-to-stream");
        postContainer.addStyleName(StaticResourceBundle.INSTANCE.coreCss().postToStream());
        postContainer.addStyleName(StaticResourceBundle.INSTANCE.coreCss().small());
        postContainer.addStyleName(StaticResourceBundle.INSTANCE.coreCss().postToStreamContainer());

        FlowPanel postInfoContainer = new FlowPanel();
        postInfoContainer.addStyleName(StaticResourceBundle.INSTANCE.coreCss().postInfoContainer());

        postButton.addStyleName(StaticResourceBundle.INSTANCE.coreCss().postButton());
        postInfoContainer.add(postButton);

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

        message.setText(defaultText);

        // user clicked in message text box
        message.addFocusHandler(new FocusHandler()
        {
            public void onFocus(final FocusEvent inEvent)
            {
                if ((" " + postContainer.getStyleName() + " ")
                        .contains(StaticResourceBundle.INSTANCE.coreCss().small()))
                {
                    postContainer.removeStyleName(StaticResourceBundle.INSTANCE.coreCss().small());
                    message.setText("");
                }
            }
        });

        // changes to the message for character countdown
        message.addKeystrokeHandler(new KeyUpHandler()
        {
            public void onKeyUp(final KeyUpEvent inEvent)
            {
                onCommentChanges();

            }
        });
        message.addValueChangedHandler(new ValueChangeHandler<String>()
        {
            public void onValueChange(final ValueChangeEvent<String> inEvent)
            {
                onCommentChanges();
            }
        });

        AvatarWidget avatar = new AvatarWidget(person, EntityType.PERSON, Size.VerySmall);
        avatar.addStyleName(StaticResourceBundle.INSTANCE.coreCss().postEntryAvatar());

        Panel entryPanel = new FlowPanel();
        entryPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().postEntryPanel());
        entryPanel.add(avatar);
        entryPanel.add(postInfoContainer);
        entryPanel.add(message);

        postContainer.add(entryPanel);

        FlowPanel contentWarningContainer = new FlowPanel();
        contentWarningContainer.addStyleName(StaticResourceBundle.INSTANCE.coreCss().contentWarning());
        contentWarningContainer.add(new SimplePanel());
        final FlowPanel contentWarning = new FlowPanel();
        contentWarningContainer.add(contentWarning);
        postContainer.add(contentWarningContainer);
        Session.getInstance().getEventBus()
                .addObserver(GotSystemSettingsResponseEvent.class, new Observer<GotSystemSettingsResponseEvent>()
                {
                    public void update(final GotSystemSettingsResponseEvent event)
                    {
                        contentWarning.getElement().setInnerHTML(event.getResponse().getContentWarningText());
                    }
                });
        SystemSettingsModel.getInstance().fetch(null, true);

        widget.add(postContainer);

        EventBus.getInstance().addObserver(MessageStreamAppendEvent.class, new Observer<MessageStreamAppendEvent>()
        {
            public void update(final MessageStreamAppendEvent arg1)
            {
                closeWindow();
            }
        });

        postButton.addClickHandler(new ClickHandler()
        {
            public void onClick(final ClickEvent event)
            {
                StreamScope scope = postToPanel.getPostScope();
                if (scope == null)
                {
                    ErrorPostingMessageToNullScopeEvent error = new ErrorPostingMessageToNullScopeEvent();
                    error.setErrorMsg("The stream name you entered could not be found");
                    Session.getInstance().getEventBus().notifyObservers(error);
                    return;
                }

                EntityType recipientType = DomainConversionUtility.convertToEntityType(scope.getScopeType());
                if (EntityType.NOTSET.equals(recipientType))
                {
                    recipientType = EntityType.GROUP;
                }

                String messageText = message.getText();

                if (messageText.equals(defaultText))
                {
                    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

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

        singleActivityMode = false;
        activitySpinner.removeClassName(StaticResourceBundle.INSTANCE.coreCss().displayNone());
        moreLink.setVisible(false);
        streamPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().hidden());
        currentRequestObj = StreamJsonRequestFactory.getEmptyRequest();
        currentStream = new StreamScope(ScopeType.PERSON, Session.getInstance().getCurrentPerson().getAccountId());
        ShowRecipient showRecipient = ShowRecipient.YES;

        streamContainerPanel.removeStyleName(StaticResourceBundle.INSTANCE.coreCss().hasOwnerRights());

        stickyActivityHolder.clear();
View Full Code Here

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

        streamPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().embeddedWidget());
        streamPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().eurekaConnectFullStreamWidget());
        initWidget(streamPanel);

        EventBus.getInstance().notifyObservers(new StreamRequestEvent("", jsonRequest));
        StreamScope postingScope = getPostingScope(jsonRequest);
        if (postingScope != null)
        {
            streamPanel.setStreamScope(postingScope, true);
        }
    }
View Full Code Here

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

                    {
                        JSONObject obj = recipients.get(0).isObject();
                        String type = obj.get("type").isString().stringValue();
                        String name = obj.get("name").isString().stringValue();
                        ScopeType scopeType = ScopeType.valueOf(type);
                        return new StreamScope(scopeType, name);
                    }
                }
            }
        }
        catch (Exception ex)
View Full Code Here

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

    /**
     * Posts the message.
     */
    public void postMessage()
    {
        StreamScope scope = postToPanel.getPostScope();
        if (scope == null)
        {
            ErrorPostingMessageToNullScopeEvent error = new ErrorPostingMessageToNullScopeEvent();
            error.setErrorMsg("The stream name you entered could not be found");
            Session.getInstance().getEventBus().notifyObservers(error);
            return;
        }

        EntityType recipientType = DomainConversionUtility.convertToEntityType(scope.getScopeType());
        if (EntityType.NOTSET.equals(recipientType))
        {
            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

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

        resourceUrl = inResourceUrl;
        resourceTitle = inResourceTitle;
        siteUrl = inSiteUrl;
        siteTitle = inSiteTitle;

        StreamScope streamScope = new StreamScope(ScopeType.RESOURCE, resourceId);

        final StreamPanel streamPanel = new StreamPanel(ShowRecipient.NO,
                new CommentWidgetStreamMessageItemRenderer(),
                new CommentWidgetPostToStreamComposite(streamScope));
        streamPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().embeddedWidget());
View Full Code Here

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

            {
                sr.setStreamScope(scopes.get(0));
            }
            else
            {
                sr.setStreamScope(new StreamScope(ScopeType.RESOURCE, uniqueKey));
            }

            getEntityManager().persist(sr);

            if (sr.getStreamScope().getDestinationEntityId() == null)
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()
        {
            {
                oneOf(getPersonModelViewByAccountIdMapper).execute("someAccountId");
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()
        {
            {
                oneOf(getPersonModelViewByAccountIdMapper).execute(personAccountId);
View Full Code Here

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);

        context.checking(new Expectations()
        {
            {
                // everyone list gets the activity id
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.