protected static List createAtomPersons(List sPersons) { List persons = new ArrayList(); for (Iterator iter = sPersons.iterator(); iter.hasNext(); ) { SyndPerson sPerson = (SyndPerson)iter.next(); Person person = new Person(); person.setName(sPerson.getName()); person.setUri(sPerson.getUri()); person.setEmail(sPerson.getEmail()); person.setModules(sPerson.getModules()); persons.add(person); } return persons; }
protected static List createSyndPersons(List aPersons) { List persons = new ArrayList(); for (Iterator iter = aPersons.iterator(); iter.hasNext(); ) { Person aPerson = (Person)iter.next(); SyndPerson person = new SyndPersonImpl(); person.setName(aPerson.getName()); person.setUri(aPerson.getUri()); person.setEmail(aPerson.getEmail()); person.setModules(aPerson.getModules()); persons.add(person); } return persons; }
/** * Another ROME-instigated hack due to the fact that we cannot parse/extract custom elements from {@code SyndPerson} instances * * @param author the entry author * @return the entry author's username */ private String getUsername(SyndPerson author) { //unfortunately the author uri is not always provided. String authorUri = author.getUri(); if (authorUri != null) { int usernameIndex = max(authorUri.lastIndexOf("/"), max(authorUri.lastIndexOf("~"), authorUri.lastIndexOf("="))); return authorUri.substring(usernameIndex + 1); } else { //return full name as a last resort return author.getName(); } } }
/** * Returns the entry author. * <p> * This method is a convenience method, it maps to the Dublin Core module creator. * <p> * @return the entry author, <b>null</b> if none. * */ public String getAuthor() { String author; // Start out looking for one or more authors in _authors. For non-Atom // feeds, _authors may actually be null. if ((_authors != null) && (_authors.size() > 0)) { author = ((SyndPerson)_authors.get(0)).getName(); } else { author = getDCModule().getCreator(); } if (author == null) { author = ""; } return author; }
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; }
for (MetadataValue author : authors) { SyndPerson sp = new SyndPersonImpl(); sp.setName(author.getValue()); creators.add(sp);
/** * Returns the entry author. * <p> * This method is a convenience method, it maps to the Dublin Core module creator. * <p> * @return the entry author, <b>null</b> if none. * */ public String getAuthor() { String author; // Start out looking for one or more authors in _authors. For non-Atom // feeds, _authors may actually be null. if ((_authors != null) && (_authors.size() > 0)) { author = ((SyndPerson)_authors.get(0)).getName(); } else { author = getDCModule().getCreator(); } if (author == null) { author = ""; } return author; }
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 static List createAtomPersons(List sPersons) { List persons = new ArrayList(); for (Iterator iter = sPersons.iterator(); iter.hasNext(); ) { SyndPerson sPerson = (SyndPerson)iter.next(); Person person = new Person(); person.setName(sPerson.getName()); person.setUri(sPerson.getUri()); person.setEmail(sPerson.getEmail()); person.setModules(sPerson.getModules()); persons.add(person); } return persons; }
protected static List createSyndPersons(List aPersons) { List persons = new ArrayList(); for (Iterator iter = aPersons.iterator(); iter.hasNext(); ) { Person aPerson = (Person)iter.next(); SyndPerson person = new SyndPersonImpl(); person.setName(aPerson.getName()); person.setUri(aPerson.getUri()); person.setEmail(aPerson.getEmail()); person.setModules(aPerson.getModules()); persons.add(person); } return persons; }
/** * Returns the entry author. * <p> * This method is a convenience method, it maps to the Dublin Core module creator. * <p> * @return the entry author, <b>null</b> if none. * */ public String getAuthor() { String author; // Start out looking for one or more authors in _authors. For non-Atom // feeds, _authors may actually be null. if ((_authors != null) && (_authors.size() > 0)) { author = ((SyndPerson)_authors.get(0)).getName(); } else { author = getDCModule().getCreator(); } if (author == null) { author = ""; } return author; }
@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 static List createAtomPersons(List sPersons) { List persons = new ArrayList(); for (Object sPerson1 : sPersons) { SyndPerson sPerson = (SyndPerson) sPerson1; Person person = new Person(); person.setName(sPerson.getName()); person.setUri(sPerson.getUri()); person.setEmail(sPerson.getEmail()); person.setModules(sPerson.getModules()); persons.add(person); } return persons; }
protected static List createSyndPersons(List aPersons) { List persons = new ArrayList(); for (Iterator iter = aPersons.iterator(); iter.hasNext(); ) { Person aPerson = (Person)iter.next(); SyndPerson person = new SyndPersonImpl(); person.setName(aPerson.getName()); person.setUri(aPerson.getUri()); person.setEmail(aPerson.getEmail()); person.setModules(aPerson.getModules()); persons.add(person); } return persons; }
/** * Returns the entry author. * <p> * This method is a convenience method, it maps to the Dublin Core module creator. * <p> * @return the entry author, <b>null</b> if none. * */ public String getAuthor() { String author; // Start out looking for one or more authors in _authors. For non-Atom // feeds, _authors may actually be null. if ((_authors != null) && (_authors.size() > 0)) { author = ((SyndPerson)_authors.get(0)).getName(); } else { author = getDCModule().getCreator(); } if (author == null) { author = ""; } return author; }