Package com.sun.syndication.feed.atom

Examples of com.sun.syndication.feed.atom.Link


        Entry entry = new Entry();
        entry.setTitle(file.getName());
        entry.setUpdated(new Date(file.lastModified()));

        Link editlink = new Link();
        editlink.setRel("edit");
        editlink.setHref(editURI);
        List otherlinks = new ArrayList();
        otherlinks.add(editlink);
        entry.setOtherLinks(otherlinks);

        Content content = new Content();
View Full Code Here


        subtitle.setValue(feedDescription);
        feed.setSubtitle(subtitle);
        Person author = new Person();
        author.setName(feedAuthor);
        feed.setAuthors(Collections.singletonList(author));
        Link link = new Link();
        link.setHref("http://incubator.apache.org/tuscany");
        feed.getAlternateLinks().add(link);

        // Aggregate entries from feed1 and feed2
        List<Entry> entries = new ArrayList<Entry>();
        entries.addAll(feed1.getFeed().getEntries());
View Full Code Here

        feed.setId("accounts");
        feed.setTitle("Account Report Feed");
        Content subtitle = new Content();
        subtitle.setValue("This is a sample feed");
        feed.setSubtitle(subtitle);
        Link link = new Link();
        link.setHref("http://incubator.apache.org/tuscany");
        feed.getAlternateLinks().add(link);

        // Add the Account report entry
        Entry entry = get("1234");
        feed.getEntries().add(entry);
View Full Code Here

            // A new entry was created successfully
            if (createdEntry != null) {

                // Set location of the created entry in the Location header
                for (Object l : createdEntry.getOtherLinks()) {
                    Link link = (Link)l;
                    if (link.getRel() == null || "edit".equals(link.getRel())) {
                        response.addHeader("Location", link.getHref());
                        break;
                    }
                }

                // Write the created Atom entry
View Full Code Here

   
            String href = item.getLink();
            if (href == null) {
                href = key.toString();
            }
            Link link = new Link();
            link.setRel("edit");
            link.setHref(href);
            feedEntry.getOtherLinks().add(link);
            link = new Link();
            link.setRel("alternate");
            link.setHref(href);
            feedEntry.getAlternateLinks().add(link);
   
            Date date = item.getDate();
            if (date == null) {
                date = new Date();
            }
            feedEntry.setCreated(date);
            return feedEntry;
           
        } else if (data != null) {
            Entry feedEntry = new Entry();
            feedEntry.setId(key.toString());
            feedEntry.setTitle("item");
   
            // Convert the item to XML
            String value = mediator.mediate(data, itemClassType, itemXMLType, null).toString();
           
            Content content = new Content();
            content.setType("text/xml");
            content.setValue(value);
            List<Content> contents = new ArrayList<Content>();
            contents.add(content);
            feedEntry.setContents(contents);
   
            Link link = new Link();
            link.setRel("edit");
            link.setHref(key.toString());
            feedEntry.getOtherLinks().add(link);
            link = new Link();
            link.setRel("alternate");
            link.setHref(key.toString());
            feedEntry.getAlternateLinks().add(link);
   
            feedEntry.setCreated(new Date());
            return feedEntry;
        } else {
View Full Code Here

                    String value = content.getValue();
                    item.setContents(value);
                }
               
                for (Object l : feedEntry.getOtherLinks()) {
                    Link link = (Link)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

            // A new entry was created successfully
            if (createdFeedEntry != null) {

                // Set location of the created entry in the Location header
                for (Object l : createdFeedEntry.getOtherLinks()) {
                    Link link = (Link)l;
                    if (link.getRel() == null || "edit".equals(link.getRel())) {
                        response.addHeader("Location", link.getHref());
                        break;
                    }
                }

                // Write the created Atom entry
View Full Code Here

        feed.setId("accounts");
        feed.setTitle("Account Report Feed");
        Content subtitle = new Content();
        subtitle.setValue("This is a sample feed");
        feed.setSubtitle(subtitle);
        Link link = new Link();
        link.setHref("http://incubator.apache.org/tuscany");
        feed.getAlternateLinks().add(link);

        // Add the Account report entry
        Entry entry = get("1234");
        feed.getEntries().add(entry);
View Full Code Here

        feed.setId("accounts");
        feed.setTitle("Account Report Feed");
        Content subtitle = new Content();
        subtitle.setValue("This is a sample feed");
        feed.setSubtitle(subtitle);
        Link link = new Link();
        link.setHref("http://incubator.apache.org/tuscany");
        feed.getAlternateLinks().add(link);

        // Add the Account report entry
        Entry entry = get("1234");
        feed.getEntries().add(entry);
View Full Code Here

            content.setValue(value);
            List<Content> contents = new ArrayList<Content>();
            contents.add(content);
            entry.setContents(contents);
   
            Link link = new Link();
            link.setRel("edit");
            link.setHref(key.toString());
            entry.getOtherLinks().add(link);
            link = new Link();
            link.setRel("alternate");
            link.setHref(key.toString());
            entry.getAlternateLinks().add(link);
   
            entry.setCreated(new Date());
            return entry;
        } else {
View Full Code Here

TOP

Related Classes of com.sun.syndication.feed.atom.Link

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.