Package com.sun.syndication.feed.synd

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


  public FeedEntry() {
  super(DB.k_syndentries, "FeedEntry");
  }
 
  public SyndEntryImpl getEntry() throws IOException,ClassNotFoundException {
    SyndEntryImpl oRetVal;
    if (!containsKey(DB.bin_entry))
      put(DB.bin_entry, new SyndEntryImpl());
    return (SyndEntryImpl) new ObjectInputStream(new ByteArrayInputStream((byte[])get(DB.bin_entry))).readObject();
  }
View Full Code Here


 
  protected void setUp() throws Exception {
    super.setUp();
    factory = new BookmarkEntryFactory();
   
    entry = new SyndEntryImpl();
    entry.setTitle("this is a title");
    SyndCategory c = new SyndCategoryImpl();
    c.setName("abc,123,0990");
    categories.add(c);
    c = new SyndCategoryImpl();
View Full Code Here

    syndFeed.setUri(feedUri);
    syndFeed.setLink(link);
    syndFeed.setPublishedDate(pubDate);
    List<SyndEntry> entries = new ArrayList<SyndEntry>();
    for(BookmarkDoc bmark : bookmarks){
      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);
    syndFeed.setEncoding("UTF-8");
View Full Code Here

    syndFeed.setUri(feedUri);
    syndFeed.setLink(link);
    syndFeed.setPublishedDate(pubDate);
    List<SyndEntry> entries = new ArrayList<SyndEntry>();
    for(Bookmark bmark : bookmarks){
      SyndEntry entry = new SyndEntryImpl();
      entry.setTitle(bmark.getTitle());
      entry.setAuthor(bmark.getUser().getUsername());
      entry.setLink(bmark.getLink().getUrl());
      entry.setUri("urn:bookmark:"+bmark.getId());
      entry.setUpdatedDate(bmark.getLastUpdated());
      List<String> tags = bmark.getTagList();
      List<SyndCategory> cats = new ArrayList<SyndCategory>();
      for(String aTag : tags){
        SyndCategory aCat = new SyndCategoryImpl();
        aCat.setName(aTag);
        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");
    logger.debug("done initializing syndFeed object");
View Full Code Here

      setImage(image);
    }

    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
      // has an enclosure.
      entry.setLink(helper.getJumpInLink() + "#" + item.getGuid());
      entry.setPublishedDate(item.getPublishDate());
      entry.setUpdatedDate(item.getLastModified());

      // The enclosure is the media (audio or video) file of the episode
      Enclosure media = item.getEnclosure();
      if (media != null) {
        SyndEnclosure enclosure = new SyndEnclosureImpl();
        enclosure.setUrl(helper.getMediaUrl(item));
        enclosure.setType(media.getType());
        enclosure.setLength(media.getLength());
        // Also set the item link to point to the enclosure
        entry.setLink(helper.getMediaUrl(item));
        List<SyndEnclosure> enclosures = new ArrayList<SyndEnclosure>();
        enclosures.add(enclosure);
        entry.setEnclosures(enclosures);
      }

      episodes.add(entry);
    }
    setEntries(episodes);
View Full Code Here

    image.setTitle("OLAT - Online Learning And Training");
    image.setLink(getLink());
    setImage(image);

    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

            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());

            entry.setAuthor(event.getOwner().getTwitterScreenName());
            entry.setDescription(content);

            entries.add(entry);
        }

        feed.setEntries(entries);
View Full Code Here

        for (EventActivity activity : activities) {
            SyndContent content = new SyndContentImpl();
            content.setType("text/html");
            content.setValue(Helper.cleanupHTML(activity.getContent()));

            SyndEntry entry = new SyndEntryImpl();
            entry.setTitle(Helper.h(activity.getTitle()));
            entry.setDescription(content);

            entries.add(entry);
        }

        feed.setEntries(entries);
View Full Code Here

                    String thisLink = entryLink + "?articleContentId=" + v.getString("contentId") + "&blogContentId=" + contentId;
                    SyndContent desc = new SyndContentImpl();
                    desc.setType("text/plain");
                    desc.setValue(sub);

                    SyndEntry entry = new SyndEntryImpl();
                    entry.setTitle(v.getString("contentName"));
                    entry.setPublishedDate(v.getTimestamp("createdDate"));
                    entry.setDescription(desc);
                    entry.setLink(thisLink);
                    entry.setAuthor((v.getString("createdByUserLogin")));
                    entries.add(entry);
                }
            }
        }
View Full Code Here

            List<SyndEntry> entries = new ArrayList<SyndEntry>();
            for (SummaryStatBean.StatDataBean dataBean : bean.getData())
            {
                Date date = dataBean.getDate();

                SyndEntry entry = new SyndEntryImpl();
                entries.add(entry);

                // all the feed has the same url... details on the statistics
                // page
                entry.setLink(bean.getStatURL() + "&freq=" + bean.getFreq()
                        + "&date=" + date.getTime());
                // entry.setUri();

                entry.setTitle(MessageFormat
                        .format(localize(msgs, MSG_ENTRY_TITLE, freq, type,
                                null, null), bean.getObjectName(), dataBean
                                .getDate()));

                Calendar c1 = Calendar.getInstance();
                c1.setTime(date);
                if (bean.getFreq() != StatSubscription.FREQUENCY_MONTHLY)
                {
                    c1.add(Calendar.DAY_OF_MONTH, 1);
                }
                else
                {
                    c1.add(Calendar.MONTH, 1);
                }
                date = c1.getTime();
                entry.setPublishedDate(date);
                // date of last change to Item
                entry.setUpdatedDate(dataBean.getDate());

                SyndContent desc = new SyndContentImpl();
                desc.setType("text/html");

                String tmpMessage = "";

                tmpMessage += MessageFormat
                        .format(localize(msgs, MSG_ENTRY_DESCRIPTION, freq,
                                type, AStatComponentService._SELECTED_OBJECT,
                                "view"), dataBean.getPeriodSelectedView(),
                                dataBean.getTotalSelectedView());

                if (dataBean.isShowSelectedObjectDownload())
                {
                    tmpMessage += MessageFormat.format(
                            localize(msgs, MSG_ENTRY_DESCRIPTION, freq, type,
                                    AStatComponentService._SELECTED_OBJECT,
                                    "download"), dataBean
                                    .getPeriodSelectedDownload(), dataBean
                                    .getTotalSelectedDownload());
                }

                for (String key : dataBean.getPeriodAndTotalTopView().keySet())
                {
                    if (dataBean.getPeriodAndTotalTopView().get(key) != null)
                    {
                        if (dataBean.getPeriodAndTotalTopView().get(key).size() > 0)
                        {
                            tmpMessage += MessageFormat.format(
                                    localize(msgs, MSG_ENTRY_DESCRIPTION, freq,
                                            type, key, "view"), dataBean
                                            .getPeriodAndTotalTopView()
                                            .get(key).get(0), dataBean
                                            .getPeriodAndTotalTopView()
                                            .get(key).get(1));
                        }
                        if (dataBean.getPeriodAndTotalTopDownload().get(key) != null)
                        {
                            if (dataBean.getPeriodAndTotalTopDownload()
                                    .get(key).size() > 0)
                            {
                                tmpMessage += MessageFormat.format(
                                        localize(msgs, MSG_ENTRY_DESCRIPTION,
                                                freq, type, key, "download"),
                                        dataBean.getPeriodAndTotalTopDownload()
                                                .get(key).get(0), dataBean
                                                .getPeriodAndTotalTopDownload()
                                                .get(key).get(1));
                            }
                        }

                    }

                }

                String message = MessageFormat.format(
                        localize(msgs, MSG_ENTRY_DESCRIPTION, freq, type, null,
                                null), bean.getObjectName(),
                        dataBean.getDate(), tmpMessage);

                desc.setValue(message);
                entry.setDescription(desc);

                entry.setAuthor(ConfigurationManager
                        .getProperty("webui.feed.stats.authors"));
            }
            feed.setEntries(entries);
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.syndication.feed.synd.SyndEntryImpl

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.