Package com.sun.syndication.feed.synd

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


            content.setValue("Jane Doe_" + String.valueOf(i));
            content.setType(Content.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

               
                if ( kvp.isEmpty() ) {
                     //send back a feed with a link to the opensearch template
                    feed = new SyndFeedImpl();
                    feed.setFeedType("atom_1.0");
                    SyndLink link = new SyndLinkImpl();
                    link.setRel( "search" );
                    link.setHref( ResponseUtils.appendPath(baseUrl, "opensearch.xml"));
                    link.setType( "application/opensearchdescription+xml");
                    feed.getLinks().add( link );
                }
                else {
                    //send back the actual feed
                    feed = myListener.filterFeed(layer,kvp,baseUrl,req);
View Full Code Here

                i--;
            }
        }
       
        //set the link element
        SyndLink link = new SyndLinkImpl();
        link.setHref(req.getRequestURL().toString());
        feed.setLink(link);
       
        return feed;
    }
View Full Code Here

   
            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

   
            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

    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

        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

  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

        }
        return sLinks;
    }

    public SyndLink createSyndLink(Link link) {
        SyndLink syndLink = new SyndLinkImpl();
        syndLink.setRel(     link.getRel());
        syndLink.setType(    link.getType());
        syndLink.setHref(    link.getHrefResolved());
        syndLink.setTitle(   link.getTitle());
        return syndLink;
    }
View Full Code Here

TOP

Related Classes of com.sun.syndication.feed.synd.SyndLinkImpl

Copyright © 2018 www.massapicom. 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.