Examples of SyndLink


Examples of com.rometools.rome.feed.synd.SyndLink

    if (foreignMarkup == null) {
      return;
    }
    for (Element element : foreignMarkup) {
      if ("link".equals(element.getName()) && ATOM_10_NS.equals(element.getNamespace())) {
        SyndLink link = new SyndLinkImpl();
        link.setRel(element.getAttributeValue("rel"));
        link.setHref(element.getAttributeValue("href"));
        feed.getLinks().add(link);
      }
    }
  }
View Full Code Here

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

            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

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

               
                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

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

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

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

        NativeArray nativeArray = new NativeArray(0);
        if (entry.getLinks().size() > 0) {
            List list = entry.getLinks();
            int size = list.size();
            for (int i = 0; i < size; i++) {
                SyndLink element = (SyndLink) list.get(i);
                nativeArray.put(i, nativeArray, element.getHref());
            }
            return nativeArray;
        } else if (entry.getLink() != null) {
            nativeArray.put(0, nativeArray, entry.getLink());
            return nativeArray;
View Full Code Here

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

            NativeArray nativeArray = new NativeArray(0);
            if (feed.getLinks() != null) {
                List list = feed.getLinks();
                int size = list.size();
                for (int i = 0; i < size; i++) {
                    SyndLink element = (SyndLink) list.get(i);
                    nativeArray.put(i, nativeArray, element.getHref());
                }
                return nativeArray;
            } else if (feed.getLink().compareTo("") != 0) {
                nativeArray.put(0, nativeArray, feed.getLink());
                return nativeArray;
View Full Code Here

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