public Link createAtomLink(SyndLink syndLink) { Link link = new Link(); link.setRel( syndLink.getRel()); link.setType( syndLink.getType()); link.setHref( syndLink.getHref()); link.setHreflang(syndLink.getHreflang()); link.setLength( syndLink.getLength()); link.setTitle( syndLink.getTitle()); return link; }
public SyndLink createSyndLink(Link link) { SyndLink syndLink = new SyndLinkImpl(); syndLink.setRel( link.getRel()); syndLink.setType( link.getType()); syndLink.setHref( link.getHrefResolved()); syndLink.setHreflang(link.getHreflang()); syndLink.setLength( link.getLength()); syndLink.setTitle( link.getTitle()); return syndLink; }
private SyndEntry toSyndEntry(TgwEntry tgwEntry) { SyndEntry entry = new SyndEntryImpl(); // basic info //entry.setUri("http://aaa.com/" + entry.hashCode()); //entry.setLink("http://aaa.com/" + entry.hashCode()); entry.setTitle(tgwEntry.getTitle()); entry.setPublishedDate(tgwEntry.getPublished()); entry.setUpdatedDate(tgwEntry.getUpdated()); entry.setAuthor(tgwEntry.getAuthor()); // entry.setLink("abcd"); SyndLink link = new SyndLinkImpl(); link.setRel("self"); link.setType("application/atom+xml"); link.setHref("xxxx"); // SyndLink link = new SyndLinkImpl(); // link.set // content SyndContent content = new SyndContentImpl(); content.setType("text/plain"); content.setValue(tgwEntry.getContent()); entry.setDescription(content); List<SyndContent> list = new ArrayList<SyndContent>(); list.add(content); entry.setContents(list); return entry; }
@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; }
List<SyndLink> links = e.getLinks(); if (links != null && !links.isEmpty()) { link = links.get(0).getHref();
public SyndLink findRelatedLink(String relation) { for(SyndLink l : this.getLinks()){ if(relation.equals(l.getRel())){ return l; } } return null; } }
@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; }
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) { Channel channel = new Channel(type); channel.setModules(ModuleUtils.cloneModules(syndFeed.getModules())); channel.setEncoding(syndFeed.getEncoding()); channel.setTitle(syndFeed.getTitle()); if (syndFeed.getLink() != null) { channel.setLink(syndFeed.getLink()); } else if (syndFeed.getLinks().size() > 0) { channel.setLink(((SyndLink)syndFeed.getLinks().get(0)).getHref()); } channel.setDescription(syndFeed.getDescription()); SyndImage sImage = syndFeed.getImage(); if (sImage!=null) { channel.setImage(createRSSImage(sImage)); } List sEntries = syndFeed.getEntries(); if (sEntries!=null) { channel.setItems(createRSSItems(sEntries)); } if (((List)syndFeed.getForeignMarkup()).size() > 0) { channel.setForeignMarkup(syndFeed.getForeignMarkup()); } return channel; }
public SyndLink findRelatedLink(String relation) { for(SyndLink l : this.getLinks()){ if(relation.equals(l.getRel())){ return l; } } return null; } }
public SyndLink createSyndLink(Link link) { SyndLink syndLink = new SyndLinkImpl(); syndLink.setRel( link.getRel()); syndLink.setType( link.getType()); syndLink.setHref( link.getHrefResolved()); syndLink.setHreflang(link.getHreflang()); syndLink.setLength( link.getLength()); syndLink.setTitle( link.getTitle()); return syndLink; }
public Link createAtomLink(SyndLink syndLink) { Link link = new Link(); link.setRel( syndLink.getRel()); link.setType( syndLink.getType()); link.setHref( syndLink.getHref()); link.setHreflang(syndLink.getHreflang()); link.setLength( syndLink.getLength()); link.setTitle( syndLink.getTitle()); return link; }
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) { Channel channel = new Channel(type); channel.setModules(ModuleUtils.cloneModules(syndFeed.getModules())); channel.setEncoding(syndFeed.getEncoding()); channel.setTitle(syndFeed.getTitle()); if (syndFeed.getLink() != null) { channel.setLink(syndFeed.getLink()); } else if (syndFeed.getLinks().size() > 0) { channel.setLink(((SyndLink)syndFeed.getLinks().get(0)).getHref()); } channel.setDescription(syndFeed.getDescription()); SyndImage sImage = syndFeed.getImage(); if (sImage!=null) { channel.setImage(createRSSImage(sImage)); } List sEntries = syndFeed.getEntries(); if (sEntries!=null) { channel.setItems(createRSSItems(sEntries)); } if (((List)syndFeed.getForeignMarkup()).size() > 0) { channel.setForeignMarkup(syndFeed.getForeignMarkup()); } return channel; }
public SyndLink createSyndLink(Link link) { SyndLink syndLink = new SyndLinkImpl(); syndLink.setRel( link.getRel()); syndLink.setType( link.getType()); syndLink.setHref( link.getHrefResolved()); syndLink.setHreflang(link.getHreflang()); syndLink.setLength( link.getLength()); syndLink.setTitle( link.getTitle()); return syndLink; }