/** * 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; }
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>(); 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; } }
final com.rometools.rome.feed.atom.Content romeContent = new com.rometools.rome.feed.atom.Content(); romeContent.setValue(content.getValue()); romeContent.setType(content.getType()); final List<com.rometools.rome.feed.atom.Content> contents = new ArrayList<com.rometools.rome.feed.atom.Content>(); contents.add(romeContent);
content.setType(type); content.setMode(mode); content.setValue(value);
content.setType(type); content.setMode(mode); content.setValue(value);
content.setType(contentType); List contents = new ArrayList(); contents.add(content);
final String type = sTitle.getType(); if (type != null) { title.setType(type);
final Content c = new Content(); c.setValue(parseTextConstructToString(title)); c.setType(getAttributeValue(title, "type")); entry.setTitleEx(c);
final Content c = new Content(); c.setValue(parseTextConstructToString(title)); c.setType(getAttributeValue(title, "type")); entry.setTitleEx(c);
final Content c = new Content(); c.setValue(parseTextConstructToString(title)); c.setType(getAttributeValue(title, "type")); feed.setTitleEx(c); final Content content = new Content(); content.setValue(parseTextConstructToString(subtitle)); content.setType(getAttributeValue(subtitle, "type")); feed.setSubtitle(content);
final Content c = new Content(); c.setValue(parseTextConstructToString(title)); c.setType(getAttributeValue(title, "type")); feed.setTitleEx(c); final Content content = new Content(); content.setValue(parseTextConstructToString(subtitle)); content.setType(getAttributeValue(subtitle, "type")); feed.setSubtitle(content);