@Override protected List<Entry> buildFeedEntries(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) { List<Entry> entries = new ArrayList<>(); for (String name : model.keySet()) { Entry entry = new Entry(); entry.setTitle(name); Content content = new Content(); content.setValue((String) model.get(name)); entry.setSummary(content); entries.add(entry); } return entries; } }
/** * Sets the entry title. * <p> * * @param title the entry title, <b>null</b> if none. * */ public void setTitle(final String title) { if (this.title == null) { this.title = new Content(); } this.title.setValue(title); }
/** * Sets the feed title. * <p> * * @param title the feed title to set, <b>null</b> if none. * */ public void setTitle(final String title) { if (this.title == null) { this.title = new Content(); } this.title.setValue(title); }
/** * Sets the entry title. * <p> * * @param title the entry title, <b>null</b> if none. * */ public void setTitle(final String title) { if (this.title == null) { this.title = new Content(); } this.title.setValue(title); }
/** * Sets the feed title. * <p> * * @param title the feed title to set, <b>null</b> if none. * */ public void setTitle(final String title) { if (this.title == null) { this.title = new Content(); } this.title.setValue(title); }
/** * Set content of entry. * * @param contentString content string. * @param type Must be "text" for plain text, "html" for escaped HTML, "xhtml" for XHTML or a * valid MIME content-type. */ public void setContent(final String contentString, final String type) { final Content newContent = new Content(); newContent.setType(type == null ? Content.HTML : type); newContent.setValue(contentString); final ArrayList<Content> contents = new ArrayList<Content>(); contents.add(newContent); setContents(contents); }
public ClientMediaEntry(final ClientAtomService service, final ClientCollection collection, final String title, final String slug, final String contentType, final InputStream is) { this(service, collection); inputStream = is; setTitle(title); setSlug(slug); final Content content = new Content(); content.setType(contentType); final List<Content> contents = new ArrayList<Content>(); contents.add(content); setContents(contents); }
public ClientMediaEntry(final ClientAtomService service, final ClientCollection collection, final String title, final String slug, final String contentType, final byte[] bytes) { this(service, collection); this.bytes = bytes; setTitle(title); setSlug(slug); final Content content = new Content(); content.setType(contentType); final List<Content> contents = new ArrayList<Content>(); contents.add(content); setContents(contents); }
protected Content createAtomContent(final SyndContent sContent) { final Content content = new Content(); content.setType(sContent.getType()); content.setValue(sContent.getValue()); return content; }
protected Content createAtomContent(final SyndContent sContent) { final Content content = new Content(); content.setType(sContent.getType()); content.setValue(sContent.getValue()); return content; }
@Override protected List<Entry> buildFeedEntries(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { log.info("In buildFeedEntries: " + model); Vets vets = (Vets) model.get("vets"); List<Vet> vetList = vets.getVetList(); List<Entry> entries = new ArrayList<Entry>(vetList.size()); for (Vet vet : vetList) { Entry entry = new Entry(); // see // http://diveintomark.org/archives/2004/05/28/howto-atom-id#other entry.setId(String.format("tag:springsource.org,%s", vet.getId())); entry.setTitle(String.format("Vet: %s %s", vet.getFirstName(), vet.getLastName())); entry.setUpdated(new Date()); Content summary = new Content(); summary.setValue(vet.getSpecialties().toString()); entry.setSummary(summary); entries.add(entry); } response.setContentType("blabla"); return entries; } }
@Override protected List<Entry> buildFeedEntries(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { List<Entry> entries = new ArrayList<Entry>(); List<Customer> customerlist = (List<Customer>) model.get("customers"); for (Customer o : customerlist) { Entry entry = new Entry(); entry.setId("https://github.com/mploed/event-driven-spring-boot/customer/" + Long.toString(o.getId())); entry.setUpdated(o.getUpdated()); entry.setTitle("Customer " + o.getId()); List<Content> contents = new ArrayList<Content>(); Content content = new Content(); content.setSrc(baseUrl(request) + "customer/rest/" + Long.toString(o.getId())); content.setType("application/json"); contents.add(content); entry.setContents(contents); Content summary = new Content(); summary.setValue("This is the customer " + o.getId()); entry.setSummary(summary); entries.add(entry); } return entries; } }
private Content parseContent(final Element e) { final String value = parseTextConstructToString(e); final String src = getAttributeValue(e, "src"); final String type = getAttributeValue(e, "type"); final Content content = new Content(); content.setSrc(src); content.setType(type); content.setValue(value); return content; }
@Override protected List<Entry> buildFeedEntries(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { List<Entry> entries = new ArrayList<Entry>(); ObjectMapper mapper = new ObjectMapper(); for (PersonRating personRating : personRatingRepository.findAll(new Sort(Sort.Direction.DESC, "lastUpdated"))) { Entry entry = new Entry(); entry.setId("https://github.com/mploed/ddd-with-spring/person-rating/" + personRating.getId()); entry.setUpdated(personRating.getLastUpdated()); entry.setTitle("Person Rating " + personRating.getId()); List<Content> contents = new ArrayList<Content>(); Content content = new Content(); content.setSrc(baseUrl(request) + "rating/rest/" + personRating.getId()); content.setType("application/json"); contents.add(content); entry.setContents(contents); Content summary = new Content(); summary.setValue(mapper.writeValueAsString(personRating)); entry.setSummary(summary); entries.add(entry); } return entries; } }
@Override protected List<Entry> buildFeedEntries(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { List<Entry> entries = new ArrayList<Entry>(); List<DecisionMemo> decisionMemos = (List<DecisionMemo>) model.get("approvedDecisions"); for (DecisionMemo o : decisionMemos) { Entry entry = new Entry(); entry.setId("https://github.com/mploed/event-driven-spring-boot/decision-memo/" + o.getId()); entry.setUpdated(o.getLastUpdate()); entry.setTitle("Approved Decision " + o.getId()); List<Content> contents = new ArrayList<Content>(); Content content = new Content(); content.setSrc(baseUrl(request) + "credit-decision/rest/" + o.getId()); content.setType("application/json"); contents.add(content); entry.setContents(contents); Content summary = new Content(); summary.setValue(o.getApplicationNumber()); entry.setSummary(summary); entries.add(entry); } return entries; } }
private Content parseContent(final Element e) { final String value = parseTextConstructToString(e); final String src = getAttributeValue(e, "src"); final String type = getAttributeValue(e, "type"); final Content content = new Content(); content.setSrc(src); content.setType(type); content.setValue(value); return content; }
@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); }
@Override protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) { feed.setId("https://github.com/mploed/ddd-with-spring/credit-agency"); feed.setTitle("Credit Agency Ratings"); 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(personRatingRepository.lastUpdate()); Content subtitle = new Content(); subtitle.setValue("List of all valid person ratings"); feed.setSubtitle(subtitle); }
@Override protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) { feed.setId("https://github.com/mploed/event-driven-spring-boot/credit-decision"); feed.setTitle("Approved Credit Applications"); 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(decisionMemoRepository.lastUpdate()); Content subtitle = new Content(); subtitle.setValue("List of all APPROVED credit applications"); feed.setSubtitle(subtitle); }
final Content content = new Content(); content.setType(type); content.setMode(mode);