Examples of LinkInformation


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

     * Parse information test.
     */
    @Test
    public final void parseInformationTest()
    {
        final LinkInformation link = new LinkInformation();
        final String html = "<html></html>";

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

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

                    {
                        // Assume that the user meant to attach the link,
                        // so attach the link to the message.

                        // Grab the link text from the unattached link textbox
                        LinkInformation linkInformation = new LinkInformation();
                        String linkText = addLinkComposite.getLinkText();
                        linkInformation.setUrl(linkText);
                        linkInformation.setTitle(linkText);

                        Bookmark bookmark = new Bookmark(linkInformation);
                        attachment = bookmark;
                    }
View Full Code Here

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

        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();
View Full Code Here

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

     * @param link
     *            the link that was added.
     */
    public void onLinkAdded(final LinkInformation link)
    {
        LinkInformation addedLink = link;

        if (null == addedLink)
        {
            addedLink = new LinkInformation();
        }

        selector.setLink(addedLink);

        if (!addedLink.getImageUrls().isEmpty())
        {
            displayPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().hasThumbnail());
        }

        linkUrlDisplay.setText("source: " + addedLink.getSource());

        title.setVisibleLength(MAX_LENGTH);
        title.setValue(addedLink.getTitle());
        title.addBlurHandler(new BlurHandler()
        {
            public void onBlur(final BlurEvent event)
            {
                // This check is a workaround for the real problem, which is that the blur handler is getting wired up
                // multiple times (once on the first time the user clicks 'add link' and once when the activity is
                // posted and everything is being cleared out). Maybe this control will get redesigned when
                // PostToStreamComposite gets refactored from MVC to the current design.
                if (link != null)
                {
                    link.setTitle(title.getValue());
                }
            }
        });

        linkDesc.setText(addedLink.getDescription());
    }
View Full Code Here

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

     */
    @Test
    public final void noVideoIdTest()
    {
        final String html = "<html></html>";
        final LinkInformation link = new LinkInformation();
        // No video ID.
        link.setUrl("http://www.youtube.com?something=something");

        sut.parseInformation(html, link, TEST_ACCOUNT);

        Assert.assertEquals(0, link.getImageUrls().size());
    }
View Full Code Here

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

     */
    @Test
    public final void parseTitleTest()
    {
        final String html = "<html></html>";
        final LinkInformation link = new LinkInformation();
        link.setUrl("http://www.youtube.com?v=0123456789A");

        sut.parseInformation(html, link, TEST_ACCOUNT);

        // TODO check content of image url.
        Assert.assertEquals(1, link.getImageUrls().size());
    }
View Full Code Here

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

     */
    @Test
    public final void noDescriptionTest()
    {
        final String html = "<html></html>";
        final LinkInformation link = new LinkInformation();

        sut.parseInformation(html, link, TEST_ACCOUNT);

        Assert.assertEquals("", link.getDescription());
    }
View Full Code Here

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

     */
    @Test
    public final void parseTitleTest()
    {
        final String html = "<html><meta name=\"description\" content=\"some description\">Some webpage</title></html>";
        final LinkInformation link = new LinkInformation();

        sut.parseInformation(html, link, TEST_ACCOUNT);

        Assert.assertEquals("some description", link.getDescription());
    }
View Full Code Here

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

     * Test for the bookmark populate.
     */
    @Test
    public final void populate()
    {
        LinkInformation info = new LinkInformation();
        info.setDescription("description");
        info.setUrl("url");
        info.setTitle("title");
        info.setSelectedThumbnail("thumbnail");

        BookmarkPopulator sut = new BookmarkPopulator();
        sut.setLinkInformation(info);

        ActivityDTO activity = new ActivityDTO();
View Full Code Here

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

     * Just test the basic properties and that the populator is of the right type.
     */
    @Test
    public final void test()
    {
        LinkInformation info = new LinkInformation();
        Bookmark sut = new Bookmark(info);

        Assert.assertEquals(info, sut.getLinkInformation());
        Assert.assertTrue(sut.getPopulator() instanceof BookmarkPopulator);
    }
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.