Package com.sun.syndication.feed.atom

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


        atomEntry.setId(        entry.getPermalink());
        atomEntry.setTitle(     entry.getTitle());
        atomEntry.setPublished( entry.getPubTime());
        atomEntry.setUpdated(   entry.getUpdateTime());
       
        Content content = new Content();
        content.setType(Content.HTML);
        content.setValue(entry.getText());
        List contents = new ArrayList();
        contents.add(content);
       
        atomEntry.setContents(contents);
       
        if (StringUtils.isNotEmpty(entry.getSummary())) {
            Content summary = new Content();
            summary.setType(Content.HTML);
            summary.setValue(entry.getSummary());
            atomEntry.setSummary(summary);
        }
       
        User creator = entry.getCreator();
        Person author = new Person();
View Full Code Here


        if (entry.getUpdated() != null) {
            updateTime = new Timestamp( entry.getUpdated().getTime() );
        }
        rollerEntry.setTitle(entry.getTitle());
        if (entry.getContents() != null && entry.getContents().size() > 0) {
            Content content = (Content)entry.getContents().get(0);
            rollerEntry.setText(content.getValue());
        }
        if (entry.getSummary() != null) {
            rollerEntry.setSummary(entry.getSummary().getValue());
        }
        rollerEntry.setPubTime(pubTime);
View Full Code Here

    private static Map<String, Entry> cart = new HashMap<String, Entry>();

    public Feed getFeed() {
        Feed feed = new Feed();
        feed.setTitle("shopping cart");
        Content subtitle = new Content();
        subtitle.setValue("Total : " + getTotal());
        feed.setSubtitle(subtitle);
        feed.getEntries().addAll(cart.values());
        return feed;
    }
View Full Code Here

        syndFeed.setUri(aFeed.getId());

        syndFeed.setTitle(aFeed.getTitle());

        Content aSubtitle = aFeed.getSubtitle();
        if (aSubtitle!=null) {
            syndFeed.setDescription(aSubtitle.getValue());
        }

        // if there is exactly one alternate link, use that as THE link
        if (aFeed.getAlternateLinks() != null
                && aFeed.getAlternateLinks().size() == 1) {
View Full Code Here

        List contents = entry.getContents();
        if (contents != null && contents.size() > 0) {
            List sContents = new ArrayList();
            for (Iterator iter=contents.iterator(); iter.hasNext();) {
                Content content = (Content)iter.next();
                sContents.add(createSyndContent(content));
            }
            syndEntry.setContents(sContents);
        }

        Content summary = entry.getSummary();
        if (summary!=null) {
            syndEntry.setDescription(createSyndContent(entry.getSummary()));
        }

        List authors = entry.getAuthors();
View Full Code Here

        }
        if (aCats.size() > 0) aFeed.setCategories(aCats);

        String sDesc = syndFeed.getDescription();
        if (sDesc != null) {
            Content subtitle = new Content();
            subtitle.setType(Content.TEXT); // TODO: need content type in SyndFeed
            subtitle.setValue(sDesc);
            aFeed.setSubtitle(subtitle);
        }

        List authors = syndFeed.getAuthors();
        if (authors!=null && authors.size() > 0) {
View Full Code Here

        }
        if (aCats.size() > 0) aEntry.setCategories(aCats);
       
        SyndContent sDescription = sEntry.getDescription();
        if (sDescription!=null) {
            Content summary = new Content();
            summary.setType(sDescription.getType());
            summary.setValue(sDescription.getValue());
            aEntry.setSummary(summary);
        }

        // take first item in contents collection as the content
        List syndContents = sEntry.getContents();
        if (syndContents != null && syndContents.size() > 0) {
            SyndContent syndContent = (SyndContent)syndContents.get(0);
            Content content = new Content();
            content.setType(syndContent.getType());
            content.setValue(syndContent.getValue());
            aEntry.setSummary(content);
        }

        List authors = sEntry.getAuthors();
        if (authors!=null && authors.size() > 0) {
View Full Code Here

        if (aFeed.getAlternateLinks().size() > 0) {
            linkHref = ((Link) aFeed.getAlternateLinks().get(0)).getHref();
        }
        syndFeed.setLink(linkHref);

        Content tagline = aFeed.getTagline();
        if (tagline!=null) {
            syndFeed.setDescription(tagline.getValue());
        }


        List aEntries = aFeed.getEntries();
        if (aEntries!=null) {
View Full Code Here

        }
        else {
            syndEntry.setUri(syndEntry.getLink());
        }

        Content content = entry.getSummary();
        if (content==null) {
            List contents = entry.getContents();
            if (contents!=null && contents.size()>0) {
                content = (Content) contents.get(0);
            }
        }
        if (content!=null) {
            SyndContent sContent = new SyndContentImpl();
            sContent.setType(content.getType());
            sContent.setValue(content.getValue());
            syndEntry.setDescription(sContent);
        }

        List contents = entry.getContents();
        if (contents.size()>0) {
            List sContents = new ArrayList();
            for (int i=0;i<contents.size();i++) {
                content = (Content) contents.get(i);
                SyndContent sContent = new SyndContentImpl();
                sContent.setType(content.getType());
                sContent.setValue(content.getValue());
                sContents.add(sContent);
            }
            syndEntry.setContents(sContents);
        }
View Full Code Here

            aFeed.setAlternateLinks(list);
        }

        String sDesc = syndFeed.getDescription();
        if (sDesc!=null) {
            Content tagline = new Content();
            tagline.setValue(sDesc);
            aFeed.setTagline(tagline);
        }

        aFeed.setLanguage(syndFeed.getLanguage());
View Full Code Here

TOP

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

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.