public String getNYTLaius() { StringBuilder sb = new StringBuilder(); sb.append("<div style=\"font-size:120%;\">"); sb.append("<b>"); sb.append("Media presence</b><br>"); sb.append("</div>"); if (!controllerBean.isNYTfound()) { sb.append("No media presence was detected for "); sb.append(controllerBean.getSearch().getFullname()); sb.append(" (experimental feature)."); } else { sb.append(controllerBean.getSearch().getFullname()); sb.append(" is mentioned in the following article(s) fron the New York Times:<br>"); for (Document element : controllerBean.getSetMediaDocs()) { if (!element.getPublication_outlet().equals("New York Times")) { continue; } sb.append(element.getYear()); sb.append(". \"<a href=\""); sb.append(element.getNyt_url()); sb.append("\">"); sb.append(element.getTitle()); sb.append("</a>.\""); sb.append("<br>"); } } sb.append("<p></p>"); return sb.toString(); }
public String getListDocs() { StringBuilder sb = new StringBuilder(); sb.append("<b>List of "); sb.append(controllerBean.getSearch().getFullname()); sb.append("'s publications</b>:<br>"); ArrayList<Document> listDocs = new ArrayList(); listDocs.addAll(controllerBean.getSetDocs()); Collections.sort(listDocs, new DocSortByYear()); for (Document doc : listDocs) { sb.append(doc.getAuthorsToString()); sb.append(" "); sb.append("(<b>").append(doc.getYear()).append("</b>)."); sb.append(" \"").append(doc.getTitle()).append("\". "); sb.append("<i>").append(doc.getPublication_outlet()).append("</i>."); sb.append("<p></p>"); } return sb.toString(); }