Examples of SyndLink


Examples of org.apache.wink.common.model.synd.SyndLink

    private List<SyndLink> getLinksAsSynd() {
        List<SyndLink> authors = new ArrayList<SyndLink>();
        for (AtomLink value : getLinks()) {
            if (value != null) {
                authors.add(value.toSynd(new SyndLink()));
            }
        }
        return authors;
    }
View Full Code Here

Examples of org.apache.wink.common.model.synd.SyndLink

     */
    public RssItem(SyndEntry syndEntry) {
        if (syndEntry.getTitle() != null && syndEntry.getTitle().getValue() != null) {
            setTitle(syndEntry.getTitle().getValue());
        }
        SyndLink link = syndEntry.getLink("alternate");
        if (link != null && link.getHref() != null) {
            setLink(link.getHref());
        }
        if (syndEntry.getSummary() != null && syndEntry.getSummary().getValue() != null) {
            setDescription(syndEntry.getSummary().getValue());
        }
        if (syndEntry.getAuthors().size() > 0) {
View Full Code Here

Examples of org.apache.wink.common.model.synd.SyndLink

        }
        if (getTitle() != null) {
            syndEntry.setTitle(new SyndText(getTitle(), SyndTextType.text));
        }
        if (getLink() != null) {
            SyndLink syndLink = new SyndLink();
            syndLink.setHref(getLink());
            syndLink.setRel("alternate");
            syndEntry.getLinks().add(syndLink);
        }
        if (getDescription() != null) {
            syndEntry.setSummary(new SyndText(getDescription()));
        }
        if (getAuthor() != null) {
            SyndPerson syndAuthor = new SyndPerson();
            String authorEmail = getAuthor();
            syndAuthor.setEmail(authorEmail);
            syndAuthor.setName(authorEmail.substring(0, authorEmail.indexOf("@")));
            syndEntry.getAuthors().add(syndAuthor);
        }
        syndEntry.getCategories().clear();
        for (RssCategory rssCategory : getCategories()) {
            SyndCategory syndCategory = new SyndCategory();
            syndCategory = rssCategory.toSynd(syndCategory);
            syndEntry.getCategories().add(syndCategory);
        }
        if (getEnclosure() != null) {
            SyndLink syndEnclosureLink = new SyndLink();
            syndEnclosureLink = getEnclosure().toSynd(syndEnclosureLink);
            syndEntry.getLinks().add(syndEnclosureLink);
        }
        if (getGuid() != null) {
            syndEntry.setId(getGuid().getContent());
View Full Code Here

Examples of org.apache.wink.common.model.synd.SyndLink

    }

    // -- helpers

    public static void assertLink(List<SyndLink> links, String rel, String type, String href) {
        SyndLink link = new SyndLink(rel, type, href);
        assertTrue(links.contains(link));
    }
View Full Code Here

Examples of org.apache.wink.common.model.synd.SyndLink

    private List<SyndLink> getLinksAsSynd() {
        List<SyndLink> authors = new ArrayList<SyndLink>();
        for (AtomLink value : getLinks()) {
            if (value != null) {
                authors.add(value.toSynd(new SyndLink()));
            }
        }
        return authors;
    }
View Full Code Here

Examples of org.apache.wink.common.model.synd.SyndLink

     */
    public RssItem(SyndEntry syndEntry) {
        if (syndEntry.getTitle() != null && syndEntry.getTitle().getValue() != null) {
            setTitle(syndEntry.getTitle().getValue());
        }
        SyndLink link = syndEntry.getLink("alternate"); //$NON-NLS-1$
        if (link != null && link.getHref() != null) {
            setLink(link.getHref());
        }
        if (syndEntry.getSummary() != null && syndEntry.getSummary().getValue() != null) {
            setDescription(syndEntry.getSummary().getValue());
        }
        if (syndEntry.getAuthors().size() > 0) {
View Full Code Here

Examples of org.apache.wink.common.model.synd.SyndLink

        }
        if (getTitle() != null) {
            syndEntry.setTitle(new SyndText(getTitle(), SyndTextType.text));
        }
        if (getLink() != null) {
            SyndLink syndLink = new SyndLink();
            syndLink.setHref(getLink());
            syndLink.setRel("alternate"); //$NON-NLS-1$
            syndEntry.getLinks().add(syndLink);
        }
        if (getDescription() != null) {
            syndEntry.setSummary(new SyndText(getDescription()));
        }
        if (getAuthor() != null) {
            SyndPerson syndAuthor = new SyndPerson();
            String authorEmail = getAuthor();
            syndAuthor.setEmail(authorEmail);
            syndAuthor.setName(authorEmail.substring(0, authorEmail.indexOf("@"))); //$NON-NLS-1$
            syndEntry.getAuthors().add(syndAuthor);
        }
        syndEntry.getCategories().clear();
        for (RssCategory rssCategory : getCategories()) {
            SyndCategory syndCategory = new SyndCategory();
            syndCategory = rssCategory.toSynd(syndCategory);
            syndEntry.getCategories().add(syndCategory);
        }
        if (getEnclosure() != null) {
            SyndLink syndEnclosureLink = new SyndLink();
            syndEnclosureLink = getEnclosure().toSynd(syndEnclosureLink);
            syndEntry.getLinks().add(syndEnclosureLink);
        }
        if (getGuid() != null) {
            syndEntry.setId(getGuid().getContent());
View Full Code Here

Examples of org.apache.wink.common.model.synd.SyndLink

    private List<SyndLink> getLinksAsSynd() {
        List<SyndLink> authors = new ArrayList<SyndLink>();
        for (AtomLink value : getLinks()) {
            if (value != null) {
                authors.add(value.toSynd(new SyndLink()));
            }
        }
        return authors;
    }
View Full Code Here

Examples of org.apache.wink.common.model.synd.SyndLink

            return;
        }
        if (syndFeed.getTitle() != null && syndFeed.getTitle().getValue() != null) {
            setTitle(syndFeed.getTitle().getValue());
        }
        SyndLink link = syndFeed.getLink("alternate"); //$NON-NLS-1$
        if (link != null && link.getHref() != null) {
            setLink(link.getHref());
        }
        if (syndFeed.getSubtitle() != null && syndFeed.getSubtitle().getValue() != null) {
            setDescription(syndFeed.getSubtitle().getValue());
        }
        if (syndFeed.getLang() != null) {
View Full Code Here

Examples of org.apache.wink.common.model.synd.SyndLink

        }
        if (getTitle() != null) {
            syndFeed.setTitle(new SyndText(getTitle(), SyndTextType.text));
        }
        if (getLink() != null) {
            SyndLink syndLink = new SyndLink();
            syndLink.setHref(getLink());
            syndLink.setRel("alternate"); //$NON-NLS-1$
            syndFeed.getLinks().add(syndLink);
        }
        if (getDescription() != null) {
            syndFeed.setSubtitle(new SyndText(getDescription(), SyndTextType.text));
        }
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.