Examples of SyndLink


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

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

                    String value = content.getValue();
                    item.setContents(value);
                }
               
                for (Object l : feedEntry.getLinks()) {
                    SyndLink link = (SyndLink)l;
                    if (link.getRel() == null || "edit".equals(link.getRel())) {
                        String href = link.getHref();
                        if (href.startsWith("null/")) {
                            href = href.substring(5);
                        }
                        item.setLink(href);
                        break;
View Full Code Here

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

    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.SyndLink

        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

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

        List otherLinks = new ArrayList();
        String sLink = syndFeed.getLink();
        List slinks = syndFeed.getLinks();
        if (slinks != null) {
            for (Iterator iter=slinks.iterator(); iter.hasNext();) {      
                SyndLink syndLink = (SyndLink)iter.next();               
                Link link = new Link();
                link.setRel(syndLink.getRel());
                link.setHref(syndLink.getHref());
                link.setHreflang(syndLink.getHreflang());
                link.setLength(syndLink.getLength());               
                if ("alternate".equals(syndLink.getRel())) {
                    alternateLinks.add(link);
                } else {
                    otherLinks.add(link);
                }
            }
View Full Code Here

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

        List alternateLinks = new ArrayList();
        List otherLinks = new ArrayList();
        List slinks = sEntry.getLinks();
        if (slinks != null) {
            for (Iterator iter=slinks.iterator(); iter.hasNext();) {      
                SyndLink syndLink = (SyndLink)iter.next();               
                Link link = new Link();
                link.setRel(syndLink.getRel());
                link.setHref(syndLink.getHref());
                link.setHreflang(syndLink.getHreflang());
                link.setLength(syndLink.getLength());               
                if ("alternate".equals(syndLink.getRel())) {
                    alternateLinks.add(link);
                } else {
                    otherLinks.add(link);
                }
            }
View Full Code Here

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

  public void decorate(SyndFeed feed, Blog blog) {
    if (checkListenerEnabled(blog)) {
      List<SyndLink> links = new ArrayList<SyndLink>(feed.getLinks());
      for (String hub : getHubs(blog)) {
        SyndLink link = new SyndLinkImpl();
        link.setRel("hub");
        link.setHref(hub.trim());
        links.add(link);
      }
      feed.setLinks(links);
    } else {
      log.warn("PubSubHubBub Feed Decorator plugin is enabled, however the PubSubHubBub " +
View Full Code Here

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

        List alternateLinks = new ArrayList();
        List otherLinks = new ArrayList();
        List slinks = syndFeed.getLinks();
        if (slinks != null) {
            for (Iterator iter=slinks.iterator(); iter.hasNext();) {
                SyndLink syndLink = (SyndLink)iter.next();
                Link link = createAtomLink(syndLink);
                if (link.getRel() == null ||
                        "".equals(link.getRel().trim()) ||
                        "alternate".equals(link.getRel())) {
                    alternateLinks.add(link);
View Full Code Here

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

        List alternateLinks = new ArrayList();
        List otherLinks = new ArrayList();
        List slinks = sEntry.getLinks();
        if (slinks != null) {
            for (Iterator iter=slinks.iterator(); iter.hasNext();) {
                SyndLink syndLink = (SyndLink)iter.next();
                Link link = createAtomLink(syndLink);
                if (link.getRel() == null ||
                        "".equals(link.getRel().trim()) ||
                        "alternate".equals(link.getRel())) {
                    alternateLinks.add(link);
View Full Code Here

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

    protected List createSyndLinks(List aLinks) {
        ArrayList sLinks = new ArrayList();
        for (Iterator iter = aLinks.iterator(); iter.hasNext();) {
            Link link = (Link)iter.next();
            SyndLink sLink = createSyndLink(link);
            sLinks.add(sLink);
        }
        return sLinks;
    }
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.