Java Code Examples for com.rometools.rome.feed.atom.Feed#setId()

The following examples show how to use com.rometools.rome.feed.atom.Feed#setId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomerAtomFeedView.java    From event-driven-spring-boot with Apache License 2.0 6 votes vote down vote up
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
	feed.setId("https://github.com/mploed/event-driven-spring-boot/customer");
	feed.setTitle("Customer");
	List<Link> alternateLinks = new ArrayList<>();
	Link link = new Link();
	link.setRel("self");
	link.setHref(baseUrl(request) + "feed");
	alternateLinks.add(link);
	List<SyndPerson> authors = new ArrayList<SyndPerson>();
	Person person = new Person();
	person.setName("Big Pug Bank");
	authors.add(person);
	feed.setAuthors(authors);

	feed.setAlternateLinks(alternateLinks);
	feed.setUpdated(customerRepository.lastUpdate());
	Content subtitle = new Content();
	subtitle.setValue("List of all customers");
	feed.setSubtitle(subtitle);
}
 
Example 2
Source File: OrderAtomFeedView.java    From microservice-atom with Apache License 2.0 6 votes vote down vote up
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
	feed.setId("tag:ewolff.com/microservice-atom/order");
	feed.setTitle("Order");
	List<Link> alternateLinks = new ArrayList<>();
	Link link = new Link();
	link.setRel("self");
	link.setHref(baseUrl(request) + "feed");
	alternateLinks.add(link);
	List<SyndPerson> authors = new ArrayList<SyndPerson>();
	Person person = new Person();
	person.setName("Big Money Online Commerce Inc.");
	authors.add(person);
	feed.setAuthors(authors);

	feed.setAlternateLinks(alternateLinks);
	feed.setUpdated(orderRepository.lastUpdate());
	Content subtitle = new Content();
	subtitle.setValue("List of all orders");
	feed.setSubtitle(subtitle);
}
 
Example 3
Source File: HrmsAtomViewBuilder.java    From Spring-MVC-Blueprints with MIT License 5 votes vote down vote up
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed,
		HttpServletRequest request) {
	feed.setTitle("User Feeds News");
	feed.setId("tag:hrmsUserTypes");
	feed.setUpdated(new Date());

}
 
Example 4
Source File: GenericAtomFeedView.java    From podcastpedia-web with MIT License 5 votes vote down vote up
protected void buildFeedMetadata(Map model, Feed feed, HttpServletRequest request) {
    feed.setId("" + model.get("feed_id"));
    feed.setTitle("" + model.get("feed_title"));
    Content subTitle = new Content();
    subTitle.setValue("" + model.get("feed_description"));
    feed.setSubtitle(subTitle);
}
 
Example 5
Source File: FoundPodcastsAtomFeedView.java    From podcastpedia-web with MIT License 5 votes vote down vote up
protected void buildFeedMetadata(Map model, Feed feed, HttpServletRequest request) {
    feed.setId("" + model.get("feed_id"));
    feed.setTitle("" + model.get("feed_title"));
    Content subTitle = new Content();
    subTitle.setValue("" + model.get("feed_description"));
    feed.setSubtitle(subTitle);
}
 
Example 6
Source File: FoundEpisodesAtomFeedView.java    From podcastpedia-web with MIT License 5 votes vote down vote up
protected void buildFeedMetadata(Map model, Feed feed, HttpServletRequest request) {
    feed.setId("" + model.get("feed_id"));
    feed.setTitle("" + model.get("feed_title"));
    Content subTitle = new Content();
    subTitle.setValue("" + model.get("feed_description"));
    feed.setSubtitle(subTitle);
}
 
Example 7
Source File: TestEqualsBean.java    From rome with Apache License 2.0 5 votes vote down vote up
public void testEquals() {
    final Feed feed1 = new Feed();
    final Feed feed2 = new Feed();
    final Feed feed3 = new Feed();
    final Feed feed4 = new Feed();
    feed4.setId("a");

    // reflexive
    assertTrue(feed1.equals(feed1));

    // symmetric
    assertTrue(feed1.equals(feed2));
    assertTrue(feed2.equals(feed1));

    assertFalse(feed1.equals(feed4));
    assertFalse(feed4.equals(feed1));

    // transitive
    assertTrue(feed1.equals(feed2));
    assertTrue(feed2.equals(feed3));
    assertTrue(feed1.equals(feed3));

    assertTrue(feed1.equals(feed2));
    assertFalse(feed2.equals(feed4));
    assertFalse(feed1.equals(feed4));

    // consistent
    assertTrue(feed1.equals(feed2));
    assertTrue(feed1.equals(feed2));

    assertFalse(feed1.equals(feed4));
    assertFalse(feed1.equals(feed4));

    // not-null to null is FALSE
    assertFalse(feed1.equals(null));
}
 
Example 8
Source File: VetsAtomView.java    From docker-workflow-plugin with MIT License 4 votes vote down vote up
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
    feed.setId("tag:springsource.org");
    feed.setTitle("Veterinarians");
    //feed.setUpdated(date);
}
 
Example 9
Source File: VetsAtomView.java    From audit4j-demo with Apache License 2.0 4 votes vote down vote up
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
    feed.setId("tag:springsource.org");
    feed.setTitle("Veterinarians");
    //feed.setUpdated(date);
}
 
Example 10
Source File: VetsAtomView.java    From enhanced-pet-clinic with Apache License 2.0 4 votes vote down vote up
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
	feed.setId("tag:springsource.org");
	feed.setTitle("Veterinarians");
	feed.setUpdated(new Date());
}
 
Example 11
Source File: Atom03Parser.java    From rome with Apache License 2.0 4 votes vote down vote up
protected WireFeed parseFeed(final Element eFeed, final Locale locale) {

        final String type = getType();
        final Document document = eFeed.getDocument();
        final String styleSheet = getStyleSheet(document);

        final Feed feed = new Feed(type);
        feed.setStyleSheet(styleSheet);

        final Element title = eFeed.getChild("title", getAtomNamespace());
        if (title != null) {
            feed.setTitleEx(parseContent(title));
        }

        final List<Element> links = eFeed.getChildren("link", getAtomNamespace());
        feed.setAlternateLinks(parseAlternateLinks(links));
        feed.setOtherLinks(parseOtherLinks(links));

        final Element author = eFeed.getChild("author", getAtomNamespace());
        if (author != null) {
            final List<SyndPerson> authors = new ArrayList<SyndPerson>();
            authors.add(parsePerson(author));
            feed.setAuthors(authors);
        }

        final List<Element> contributors = eFeed.getChildren("contributor", getAtomNamespace());
        if (!contributors.isEmpty()) {
            feed.setContributors(parsePersons(contributors));
        }

        final Element tagline = eFeed.getChild("tagline", getAtomNamespace());
        if (tagline != null) {
            feed.setTagline(parseContent(tagline));
        }

        final Element id = eFeed.getChild("id", getAtomNamespace());
        if (id != null) {
            feed.setId(id.getText());
        }

        final Element generator = eFeed.getChild("generator", getAtomNamespace());
        if (generator != null) {
            final Generator gen = new Generator();
            gen.setValue(generator.getText());
            String att = getAttributeValue(generator, "url");
            if (att != null) {
                gen.setUrl(att);
            }
            att = getAttributeValue(generator, "version");
            if (att != null) {
                gen.setVersion(att);
            }
            feed.setGenerator(gen);
        }

        final Element copyright = eFeed.getChild("copyright", getAtomNamespace());
        if (copyright != null) {
            feed.setCopyright(copyright.getText());
        }

        final Element info = eFeed.getChild("info", getAtomNamespace());
        if (info != null) {
            feed.setInfo(parseContent(info));
        }

        final Element modified = eFeed.getChild("modified", getAtomNamespace());
        if (modified != null) {
            feed.setModified(DateParser.parseDate(modified.getText(), locale));
        }

        feed.setModules(parseFeedModules(eFeed, locale));

        final List<Element> entries = eFeed.getChildren("entry", getAtomNamespace());
        if (!entries.isEmpty()) {
            feed.setEntries(parseEntries(entries, locale));
        }

        final List<Element> foreignMarkup = extractForeignMarkup(eFeed, feed, getAtomNamespace());
        if (!foreignMarkup.isEmpty()) {
            feed.setForeignMarkup(foreignMarkup);
        }

        return feed;

    }
 
Example 12
Source File: VetsAtomView.java    From activejpa with Apache License 2.0 4 votes vote down vote up
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
    feed.setId("tag:springsource.org");
    feed.setTitle("Veterinarians");
    //feed.setUpdated(date);
}