Package org.openntf.news.monster.meta

Examples of org.openntf.news.monster.meta.Story


    return entryToStory(entry);
   
  }

  private Story entryToStory(SyndEntry entry) {
    Story story=new Story();
   
    story.addFields(storyFields);
   
    story.setLink(entry.getLink());
    story.setRedirectEnabled(isRedirectEnabled());
   
    Calendar date = Calendar.getInstance();
   
    if (entry.getPublishedDate()!=null) {
      date.setTime(entry.getPublishedDate());
    }
    else if (entry.getUpdatedDate()!=null) {
      date.setTime(entry.getUpdatedDate());
    }
   
    story.setDate(date);

    String title=entry.getTitle();
    story.setTitle(title.trim());
   
    String content=getFeedContent(entry);
    String abstractContent=cleanHTML(content);
   
    if(abstractContent.length() >= Constants.STORY_ABSTRACT_MAXLENGTH) {
      abstractContent = abstractContent.substring(0, Constants.STORY_ABSTRACT_MAXLENGTH - 1) + "[...]";
    }
 
    story.setAbstractContent(abstractContent.trim());
//    story.setFullContent(content.trim()); // Currently we won't have full content due to possible legal implications.
   
    return story;   
  }
View Full Code Here

TOP

Related Classes of org.openntf.news.monster.meta.Story

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.