SyndEntry entry = new SyndEntryImpl(); entry.setTitle("entry title 1"); entry.setUri("http://localhost/feed/item1GUID"); entry.setLink("http://localhost/feed/item1");
protected SyndEntry createSyndEntry(Item item, boolean preserveWireItem) { SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem); // adding native feed author to DC creators list String author = item.getAuthor(); if (author!=null) { List creators = ((DCModule)syndEntry.getModule(DCModule.URI)).getCreators(); if (!creators.contains(author)) { Set s = new HashSet(); // using a set to remove duplicates s.addAll(creators); // DC creators s.add(author); // feed native author creators.clear(); creators.addAll(s); } } Guid guid = item.getGuid(); if (guid!=null) { syndEntry.setUri(guid.getValue()); if (item.getLink()==null && guid.isPermaLink()) { syndEntry.setLink(guid.getValue()); } } else { syndEntry.setUri(item.getLink()); } return syndEntry; }
protected SyndEntry createSyndEntry(Item item, boolean preserveWireItem) { SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem); // adding native feed author to DC creators list String author = item.getAuthor(); if (author!=null) { List creators = ((DCModule)syndEntry.getModule(DCModule.URI)).getCreators(); if (!creators.contains(author)) { Set s = new HashSet(); // using a set to remove duplicates s.addAll(creators); // DC creators s.add(author); // feed native author creators.clear(); creators.addAll(s); } } Guid guid = item.getGuid(); if (guid!=null) { syndEntry.setUri(guid.getValue()); if (item.getLink()==null && guid.isPermaLink()) { syndEntry.setLink(guid.getValue()); } } else { syndEntry.setUri(item.getLink()); } return syndEntry; }
entry.setPublishedDate(new Date(post.getTimestamp())); entry.setAuthor(baseurl.concat("profile/").concat(post.getCreatorid())); entry.setUri(baselink.concat("/").concat(Utils.stripAndTrim(post.getTitle()). replaceAll("\\p{Z}+", "-").toLowerCase()));
entry.setUri(entryURL);
entry.setUri(uri);
/** * Overwrites the current values of the given feed entry with new ones computed from the specified source document. * * @param entry the feed entry whose fields are going to be overwritten * @param doc the source for the new values to be set on the fields of the feed entry * @param params parameters to adjust the computation. Each concrete strategy may define its own (key, value) pairs * @param context the XWiki context * @throws XWikiException */ public void sourceDocument(SyndEntry entry, Document doc, Map<String, Object> params, XWikiContext context) throws XWikiException { entry.setUri(getURI(doc, params, context)); entry.setLink(getLink(doc, params, context)); entry.setTitle(getTitle(doc, params, context)); entry.setDescription(getDescription(doc, params, context)); entry.setCategories(getCategories(doc, params, context)); entry.setPublishedDate(getPublishedDate(doc, params, context)); entry.setUpdatedDate(getUpdateDate(doc, params, context)); entry.setAuthor(getAuthor(doc, params, context)); entry.setContributors(getContributors(doc, params, context)); }