public Item parseItem(Element rssRoot,Element eItem) { Item item = super.parseItem(rssRoot,eItem); item.setExpirationDate(null); Element e = eItem.getChild("author",getRSSNamespace()); if (e!=null) { item.setAuthor(e.getText()); } e = eItem.getChild("guid",getRSSNamespace()); if (e!=null) { Guid guid = new Guid(); String att = e.getAttributeValue("isPermaLink");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK if (att!=null) { guid.setPermaLink(att.equalsIgnoreCase("true")); } guid.setValue(e.getText()); item.setGuid(guid); } e = eItem.getChild("comments",getRSSNamespace()); if (e!=null) { item.setComments(e.getText()); } return item; }
public Item parseItem(Element rssRoot,Element eItem) { Item item = super.parseItem(rssRoot,eItem); item.setExpirationDate(null); Element e = eItem.getChild("author",getRSSNamespace()); if (e!=null) { item.setAuthor(e.getText()); } e = eItem.getChild("guid",getRSSNamespace()); if (e!=null) { Guid guid = new Guid(); String att = e.getAttributeValue("isPermaLink");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK if (att!=null) { guid.setPermaLink(att.equalsIgnoreCase("true")); } guid.setValue(e.getText()); item.setGuid(guid); } e = eItem.getChild("comments",getRSSNamespace()); if (e!=null) { item.setComments(e.getText()); } return item; }
protected Item createRSSItem(SyndEntry sEntry) { Item item = super.createRSSItem(sEntry); if (sEntry.getAuthors()!=null && sEntry.getAuthors().size() > 0) { SyndPerson author = (SyndPerson)sEntry.getAuthors().get(0); item.setAuthor(author.getEmail()); } Guid guid = null; String uri = sEntry.getUri(); if (uri!=null) { guid = new Guid(); guid.setPermaLink(false); guid.setValue(uri); } else { String link = sEntry.getLink(); if (link!=null) { guid = new Guid(); guid.setPermaLink(true); guid.setValue(link); } } item.setGuid(guid); return item; }
protected Item createRSSItem(SyndEntry sEntry) { Item item = super.createRSSItem(sEntry); if (sEntry.getAuthors()!=null && sEntry.getAuthors().size() > 0) { SyndPerson author = (SyndPerson)sEntry.getAuthors().get(0); item.setAuthor(author.getEmail()); } Guid guid = null; String uri = sEntry.getUri(); if (uri!=null) { guid = new Guid(); guid.setPermaLink(false); guid.setValue(uri); } else { String link = sEntry.getLink(); if (link!=null) { guid = new Guid(); guid.setPermaLink(true); guid.setValue(link); } } item.setGuid(guid); return item; }
/** * Creates feed item with information about the post * * @param post post to add to the feed * @param componentUrl base url of the forum component * @return item for the RSS feed */ private Item createFeedItem(Post post, String componentUrl) { Item item = new Item(); Content content = new Content(); content.setType(Content.TEXT); content.setValue(post.getPostContent()); item.setContent(content); item.setTitle(post.getTopic().getTitle()); item.setAuthor(post.getUserCreated().getUsername()); item.setLink(componentUrl + "/posts/" + post.getId()); item.setPubDate(post.getCreationDate().toDate()); return item; }
@Override protected Item createRSSItem(SyndEntry sEntry) { Item item = super.createRSSItem(sEntry); if (sEntry.getAuthors()!=null && sEntry.getAuthors().size() > 0) { SyndPerson author = (SyndPerson)sEntry.getAuthors().get(0); item.setAuthor(author.getEmail()); } Guid guid = null; String uri = sEntry.getUri(); if (uri!=null) { guid = new Guid(); guid.setPermaLink(false); guid.setValue(uri); } else { String link = sEntry.getLink(); if (link!=null) { guid = new Guid(); guid.setPermaLink(true); guid.setValue(link); } } item.setGuid(guid); SyndLink comments = sEntry.findRelatedLink("comments"); if(comments != null && (comments.getType() == null || comments.getType().endsWith("html"))){ item.setComments(comments.getHref()); } return item; }
@Override protected Item createRSSItem(SyndEntry sEntry) { Item item = super.createRSSItem(sEntry); if (sEntry.getAuthors()!=null && sEntry.getAuthors().size() > 0) { SyndPerson author = (SyndPerson)sEntry.getAuthors().get(0); item.setAuthor(author.getEmail()); } Guid guid = null; String uri = sEntry.getUri(); if (uri!=null) { guid = new Guid(); guid.setPermaLink(false); guid.setValue(uri); } else { String link = sEntry.getLink(); if (link!=null) { guid = new Guid(); guid.setPermaLink(true); guid.setValue(link); } } item.setGuid(guid); SyndLink comments = sEntry.findRelatedLink("comments"); if(comments != null && (comments.getType() == null || comments.getType().endsWith("html"))){ item.setComments(comments.getHref()); } return item; }
public Item parseItem(Element rssRoot,Element eItem) { Item item = super.parseItem(rssRoot,eItem); item.setExpirationDate(null); Element e = eItem.getChild("author",getRSSNamespace()); if (e!=null) { item.setAuthor(e.getText()); } e = eItem.getChild("guid",getRSSNamespace()); if (e!=null) { Guid guid = new Guid(); String att = e.getAttributeValue("isPermaLink");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK if (att!=null) { guid.setPermaLink(att.equalsIgnoreCase("true")); } guid.setValue(e.getText()); item.setGuid(guid); } e = eItem.getChild("comments",getRSSNamespace()); if (e!=null) { item.setComments(e.getText()); } return item; }
public Item parseItem(Element rssRoot,Element eItem) { Item item = super.parseItem(rssRoot,eItem); item.setExpirationDate(null); Element e = eItem.getChild("author",getRSSNamespace()); if (e!=null) { item.setAuthor(e.getText()); } e = eItem.getChild("guid",getRSSNamespace()); if (e!=null) { Guid guid = new Guid(); String att = e.getAttributeValue("isPermaLink");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK if (att!=null) { guid.setPermaLink(att.equalsIgnoreCase("true")); } guid.setValue(e.getText()); item.setGuid(guid); } e = eItem.getChild("comments",getRSSNamespace()); if (e!=null) { item.setComments(e.getText()); } return item; }
/** * Create news item * * @param topic news topic * @param url building URL * @return item for news feed */ private Item createFeedItem(Topic topic, String url) { Item item = new Item(); Description description = new Description(); description.setType("text"); String postContent = topic.getLastPost().getPostContent(); postContent = RssUtils.skipInValidXMLChars(postContent); description.setValue(postContent); Content content = new Content(); item.setContent(content); item.setTitle(topic.getTitle()); item.setAuthor(topic.getLastPost().getUserCreated().getUsername()); item.setLink(url + "/posts/" + topic.getLastPost().getId()); item.setComments(topic.getTopicStarter().getSignature()); item.setDescription(description); item.setPubDate(topic.getModificationDate().toDate()); return item; }