com.rometools.rome.feed.atom.Person Java Examples

The following examples show how to use com.rometools.rome.feed.atom.Person. 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: Atom10Parser.java    From rome with Apache License 2.0 6 votes vote down vote up
private Person parsePerson(final String baseURI, final Element ePerson, final Locale locale) {

        final Person person = new Person();

        final Element name = ePerson.getChild("name", getAtomNamespace());
        if (name != null) {
            person.setName(name.getText());
        }

        final Element uri = ePerson.getChild("uri", getAtomNamespace());
        if (uri != null) {
            person.setUri(uri.getText());
            if (isRelativeURI(uri.getText())) {
                person.setUriResolved(resolveURI(baseURI, ePerson, uri.getText()));
            }
        }

        final Element email = ePerson.getChild("email", getAtomNamespace());
        if (email != null) {
            person.setEmail(email.getText());
        }

        person.setModules(parsePersonModules(ePerson, locale));

        return person;
    }
 
Example #4
Source File: Atom03Parser.java    From rome with Apache License 2.0 6 votes vote down vote up
private Person parsePerson(final Element ePerson) {

        final Person person = new Person();

        final Element name = ePerson.getChild("name", getAtomNamespace());

        if (name != null) {
            person.setName(name.getText());
        }

        final Element url = ePerson.getChild("url", getAtomNamespace());
        if (url != null) {
            person.setUrl(url.getText());
        }

        final Element email = ePerson.getChild("email", getAtomNamespace());
        if (email != null) {
            person.setEmail(email.getText());
        }

        return person;

    }
 
Example #5
Source File: ConverterForAtom03.java    From rome with Apache License 2.0 5 votes vote down vote up
protected static List<SyndPerson> createAtomPersons(final List<SyndPerson> sPersons) {
    final List<SyndPerson> persons = new ArrayList<SyndPerson>();
    for (final SyndPerson syndPerson : sPersons) {
        final SyndPerson sPerson = syndPerson;
        final Person person = new Person();
        person.setName(sPerson.getName());
        person.setUri(sPerson.getUri());
        person.setEmail(sPerson.getEmail());
        person.setModules(sPerson.getModules());
        persons.add(person);
    }
    return persons;
}