Examples of SyndLinkImpl


Examples of com.sun.syndication.feed.synd.SyndLinkImpl

            content.setValue("Jane Doe_" + String.valueOf(i));
            content.setType("text");
            entry.setContents(Collections.singletonList(content));

            List<SyndLink> links = new ArrayList<SyndLink>();
            SyndLink link = new SyndLinkImpl();
            link.setRel("edit");
            link.setHref("" + id);
            links.add(link);
            entry.setLinks(links);

            links = new ArrayList<SyndLink>();
            link = new SyndLinkImpl();
            link.setRel("alternate");
            link.setHref("" + id);
            links.add(link);
            entry.setLinks(links);

            entry.setPublishedDate(new Date());
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndLinkImpl

   
            String href = item.getLink();
            if (href == null) {
                href = key.toString();
            }
            SyndLink link = new SyndLinkImpl();
            link.setRel("edit");
            link.setHref(href);
            feedEntry.getLinks().add(link);
            link = new SyndLinkImpl();
            link.setRel("alternate");
            link.setHref(href);
            feedEntry.getLinks().add(link);
            feedEntry.setLink(href);
   
            Date date = item.getDate();
            if (date == null) {
                date = new Date();
            }
            feedEntry.setPublishedDate(date);
            return feedEntry;
           
        } else if (data != null) {
            SyndEntry feedEntry = new SyndEntryImpl();
            feedEntry.setUri(key.toString());
            feedEntry.setTitle("item");
   
            // Convert the item to XML
            String value = mediator.mediate(data, itemClassType, itemXMLType, null).toString();
           
            SyndContent content = new SyndContentImpl();
            content.setType("text/xml");
            content.setValue(value);
            List<SyndContent> contents = new ArrayList<SyndContent>();
            contents.add(content);
            feedEntry.setContents(contents);
   
            SyndLink link = new SyndLinkImpl();
            link.setRel("edit");
            link.setHref(key.toString());
            feedEntry.getLinks().add(link);
            link = new SyndLinkImpl();
            link.setRel("alternate");
            link.setHref(key.toString());
            feedEntry.getLinks().add(link);
   
            feedEntry.setPublishedDate(new Date());
            return feedEntry;
        } else {
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndLinkImpl

    public void getBaseObjectWithEnclosure()
    {

        final SyndContent description = context.mock(SyndContent.class);
        final SyndEntryImpl entry = context.mock(SyndEntryImpl.class);
        final SyndLinkImpl link1 = context.mock(SyndLinkImpl.class, "link1");
        final SyndLinkImpl link2 = context.mock(SyndLinkImpl.class, "link2");

        final List<SyndLinkImpl> myLinks = new LinkedList<SyndLinkImpl>();
        myLinks.add(link1);
        myLinks.add(link2);
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndLinkImpl

    @Test
    public void getBaseObjectWithoutImageUrls()
    {
        final SyndContent description = context.mock(SyndContent.class);
        final SyndEntryImpl entry = context.mock(SyndEntryImpl.class);
        final SyndLinkImpl link1 = context.mock(SyndLinkImpl.class);

        final List<SyndLinkImpl> myLinks = new LinkedList<SyndLinkImpl>();
        myLinks.add(link1);

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

Examples of com.sun.syndication.feed.synd.SyndLinkImpl

        myContents = new LinkedList<SyndContentImpl>();
        myContents.add(content);

        final SyndContent description = context.mock(SyndContent.class);
        final SyndEntryImpl entry = context.mock(SyndEntryImpl.class);
        final SyndLinkImpl link1 = context.mock(SyndLinkImpl.class, "link1");
        final SyndLinkImpl link2 = context.mock(SyndLinkImpl.class, "link2");

        final List<SyndLinkImpl> myLinks = new LinkedList<SyndLinkImpl>();
        myLinks.add(link1);
        myLinks.add(link2);
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndLinkImpl

        myContents = new LinkedList<SyndContentImpl>();
        myContents.add(content);

        final SyndContent description = context.mock(SyndContent.class);
        final SyndEntryImpl entry = context.mock(SyndEntryImpl.class);
        final SyndLinkImpl link1 = context.mock(SyndLinkImpl.class);

        final List<SyndLinkImpl> myLinks = new LinkedList<SyndLinkImpl>();
        myLinks.add(link1);

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

Examples of com.sun.syndication.feed.synd.SyndLinkImpl

        HashMap<String, String> object = new HashMap<String, String>();
        object.put("title", entry.getTitle());

        for (Object linkObj : entry.getLinks())
        {
            SyndLinkImpl link = (SyndLinkImpl) linkObj;
            if (link.getRel().equals("enclosure"))
            {
                object.put("largerImage", link.getHref());
            }
            if (link.getRel().equals("alternate"))
            {
                object.put("imagePageURL", link.getHref());
            }
        }

        MediaModule media = (MediaModuleImpl) entry.getModule(MediaModule.URI);
        if (media != null && media.getMetadata().getThumbnail().length > 0)
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndLinkImpl

        HashMap<String, String> object = new HashMap<String, String>();
        object.put("title", InputCleaner.stripHtml(entry.getTitle(), MAXLENGTH));

        for (Object linkObj : entry.getLinks())
        {
            SyndLinkImpl link = (SyndLinkImpl) linkObj;
            if (link.getRel().equals("enclosure"))
            {
                object.put("videoStream", InputCleaner.stripHtml(link.getHref(), MAXLENGTH));
            }
            else if (link.getRel().equals("alternate"))
            {
                object.put("videoPageUrl", InputCleaner.stripHtml(link.getHref(), MAXLENGTH));
            }
        }

        if (entry.getDescription() != null)
        {
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndLinkImpl

    protected List createSyndLinks(List aLinks) {
        ArrayList sLinks = new ArrayList();
        for (Iterator iter = aLinks.iterator(); iter.hasNext();) {
            Link link = (Link)iter.next();
            SyndLink sLink = new SyndLinkImpl();
            sLink.setHref(     link.getHref());
            sLink.setType(     link.getType());
            sLink.setLength(   link.getLength());
            sLink.setHreflang( link.getHref());
            sLinks.add(sLink);
        }
        return sLinks;
    }
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndLinkImpl

        return syndEntry;
    }
   
    public SyndLink createSyndLink(Feed feed, Entry entry, Link link) {
        SyndLink syndLink = new SyndLinkImpl();
        syndLink.setRel(link.getRel());
        syndLink.setType(link.getType());
        syndLink.setHref(link.getHref());
        syndLink.setHreflang(link.getHreflang());
        syndLink.setLength(link.getLength());
        return syndLink;
    }
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.