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; }
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 void updateMediaEntryAppLinks(final Entry entry, final String fileName, final boolean singleEntry) { // TODO: figure out why PNG is missing from Java MIME types final FileTypeMap map = FileTypeMap.getDefaultFileTypeMap(); if (map instanceof MimetypesFileTypeMap) { try { ((MimetypesFileTypeMap) map).addMimeTypes("image/png png PNG"); } catch (final Exception ignored) { } } entry.setId(getEntryMediaViewURI(fileName)); entry.setTitle(fileName); entry.setUpdated(new Date()); final List<Link> otherlinks = new ArrayList<Link>(); entry.setOtherLinks(otherlinks); final Link editlink = new Link(); editlink.setRel("edit"); editlink.setHref(getEntryEditURI(fileName, relativeURIs, singleEntry)); otherlinks.add(editlink); final Link editMedialink = new Link(); editMedialink.setRel("edit-media"); editMedialink.setHref(getEntryMediaEditURI(fileName, relativeURIs, singleEntry)); otherlinks.add(editMedialink); final Content content = entry.getContents().get(0); content.setSrc(getEntryMediaViewURI(fileName)); final List<Content> contents = new ArrayList<Content>(); contents.add(content); entry.setContents(contents); }
@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; } }
content.setSrc(file.getPermalink()); content.setType(contentType); List contents = new ArrayList();