Beispiel #1
0
 private static boolean contentNewsIsInRow(LabsNews news) {
   return news.getRows() != null
       && news.getRows().size() > 0
       && news.getRows().get(0) != null
       && news.getRows().get(0).content(0) != null
       && !StringUtils.isEmpty(news.getRows().get(0).content(0).getHtml());
 }
Beispiel #2
0
 public static SyndContent createRssNewsDescription(LabsNews news) throws ClientException {
   SyndContent description;
   description = new SyndContentImpl();
   description.setType("text/html");
   if (!StringUtils.isEmpty(news.getAccroche())) {
     description.setValue(news.getAccroche());
   } else if (contentNewsIsInRow(news)) {
     description.setValue(news.getRows().get(0).content(0).getHtml());
   } else {
     description.setValue(news.getContent());
   }
   return description;
 }