Examples of SyndContent


Examples of com.rometools.rome.feed.synd.SyndContent

        final SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem);

        final Description desc = item.getDescription();
        if (desc != null) {
            final SyndContent descContent = new SyndContentImpl();
            descContent.setType(desc.getType());
            descContent.setValue(desc.getValue());
            syndEntry.setDescription(descContent);
        }

        final Content cont = item.getContent();
        if (cont != null) {

            final SyndContent contContent = new SyndContentImpl();
            contContent.setType(cont.getType());
            contContent.setValue(cont.getValue());

            final List<SyndContent> contents = new ArrayList<SyndContent>();
            contents.add(contContent);
            syndEntry.setContents(contents);
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndContent

    }
    return null;
  }
 
  protected String createNotes(SyndEntry entry, SyndFeed fromFeed, FeedSubscription fromSubscription){
    SyndContent content = entry.getDescription();
    if(content != null){
      return FormatUtil.tidyAndExtractTextFromHtml(content.getValue()).trim();
    }
    return "";
  }
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndContent

   
    SyndEntry entry = entries.get(0);
    assertEquals("http://zirr.us/",entry.getLink());
    assertEquals("zirrus",entry.getTitle());
    assertEquals("gnizr",entry.getAuthor());
    SyndContent cont = entry.getDescription();
    assertNotNull(cont);
    assertEquals("website",cont.getValue());
    assertEquals("text/html",cont.getType());
   
    List<SyndCategory> cats = entry.getCategories();
    assertFalse(cats.isEmpty());
    SyndCategory cat = cats.get(0);
    assertEquals("cnn",cat.getName());
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndContent

      SyndEntry entry = new SyndEntryImpl();
      entry.setTitle(bmark.getTitle());
      entry.setAuthor(bmark.getUsername());
      entry.setLink(bmark.getUrl());
      entry.setUri("urn-x:gnizr:bookmark:"+bmark.getBookmarkId());   
      SyndContent cnt = new SyndContentImpl();
      cnt.setType("text/html");
      if(bmark.getNotes() != null){
        cnt.setValue(bmark.getNotes());
        entry.setDescription(cnt);
      }   
      entries.add(entry);     
    }
    syndFeed.setEntries(entries);
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndContent

        cats.add(aCat);
      }
      if(cats.isEmpty() == false){
        entry.setCategories(cats);
      }
      SyndContent cnt = new SyndContentImpl();
      cnt.setType("text/html");
      cnt.setValue(bmark.getNotes());
      entry.setDescription(cnt);
      entries.add(entry);     
    }
    syndFeed.setEntries(entries);
    syndFeed.setEncoding("UTF-8");
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndContent

      Map<String, Object> entryMap = new HashMap<String, Object>();
      entryMap.put(KEY_ID,e.getUri());
      entryMap.put(KEY_TITLE,getTidyText(e.getTitle()));
      entryMap.put(KEY_LINK,e.getLink());
      entryMap.put(KEY_AUTHOR,e.getAuthor());
      SyndContent content = e.getDescription();
      if(content != null && content.getValue() != null){
        String tt = getTidyText(e.getDescription().getValue());
        tt = FormatUtil.highlightStarEnclosedText(tt,"<span class=\"matched_text\">","</span>");
        entryMap.put(KEY_SUMMARY,tt);
      }else{
        entryMap.put(KEY_SUMMARY,"");
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndContent

        feedEntry.setPublishedDate(syndEntry.getPublishedDate());
        feedEntry.setUpdatedDate(syndEntry.getUpdatedDate());
        feedEntry.setAuthor(syndEntry.getAuthor());

        if (syndEntry.getDescription() != null) {
            SyndContent description = syndEntry.getDescription();

            // TODO: Hardcode 'html', otherwise the ROME stuff craps out and kills Firefox feed renderer...
            feedEntry.setDescriptionType("html");
            feedEntry.setDescriptionValue(description.getValue());
        }

        return feedEntry;
    }
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndContent

    List<SyndEntry> episodes = new ArrayList<SyndEntry>();
    for (Item item : feed.getPublishedItems()) {
      SyndEntry entry = new SyndEntryImpl();
      entry.setTitle(item.getTitle());

      SyndContent itemDescription = new SyndContentImpl();
      itemDescription.setType("text/plain");
      itemDescription.setValue(helper.getItemDescriptionForBrowser(item));
      entry.setDescription(itemDescription);
     
      // Link will also be converted to the rss guid tag. Except if there's an
      // enclosure, then the enclosure url is used.
      // Use jump-in link far all entries. This will be overriden if the item
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndContent

    List<SyndEntry> entries = new ArrayList<SyndEntry>();
    SyndEntry entry = new SyndEntryImpl();
    entry.setTitle(translator.translate("rss.olat.title", new String[] { NotificationHelper.getFormatedName(identity) }));
    entry.setLink(getLink());
    SyndContent description = new SyndContentImpl();
    description.setType("text/plain");
    description.setValue(translator.translate("rss.olat.description"));
    entry.setDescription(description);
    entries.add(entry);

    // bookmark news
    for (Bookmark bookmark : bookmarks) {
      SyndEntry item = new SyndEntryImpl();
      item.setTitle(translator.translate("rss.bookmark.title", new String[] { bookmark.getTitle() }));
      // create jump in link with factory method from manager
      String itemLink = BookmarkManager.getInstance().createJumpInURL(bookmark);
      item.setLink(itemLink);
      SyndContent itemDescription = new SyndContentImpl();
      itemDescription.setType("text/plain");
      itemDescription.setValue(bookmark.getDescription());
      item.setDescription(itemDescription);
      entries.add(item);
    }

    // notification news
    // we are only interested in subscribers which listen to a valid publisher
    List<Subscriber> subs = man.getValidSubscribers(identity);
    for (Subscriber subscriber : subs) {
      SubscriptionItem si = man.createSubscriptionItem(subscriber, locale, SubscriptionInfo.MIME_PLAIN, SubscriptionInfo.MIME_HTML);
      if (si != null) {
        SyndEntry item = new SyndEntryImpl();
        item.setTitle(si.getTitle());
        item.setLink(si.getLink());
        SyndContent itemDescription = new SyndContentImpl();
        itemDescription.setType(SubscriptionInfo.MIME_HTML);
        itemDescription.setValue(si.getDescription());
        item.setDescription(itemDescription);
        entries.add(item);
      }
    }
    setEntries(entries);
View Full Code Here

Examples of com.sun.syndication.feed.synd.SyndContent

        for (EventEx event : events) {
            if (event == null) { continue; }
            if (!event.isSearchable()) continue;

            SyndContent content = new SyndContentImpl();
            content.setType("text/html");
            content.setValue(Helper.cleanupHTML(event.getDescription()));

            SyndEntry entry = new SyndEntryImpl();
            entry.setTitle(event.getTitle());
            entry.setLink(event.getEventURL());
            entry.setPublishedDate(event.getCreatedAt().toDate());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.