Package com.sun.syndication.feed.synd

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


      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


        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

    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

    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

        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

    }

    protected byte[] createEventFeed(SyndFeed feed, List<EventActivity> activities) throws IOException, FeedException {
        List<SyndEntry> entries = new ArrayList<SyndEntry>();
        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);
View Full Code Here

                } catch (IOException e) {
                    Debug.logError(e, module);
                }
                if (sub != null) {
                    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);
View Full Code Here

                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"));
            }
View Full Code Here

            feedEntry.setUri(key.toString());
            feedEntry.setTitle(item.getTitle());
   
            String value = item.getContents();
            if (value != null) {
                SyndContent content = new SyndContentImpl();
                content.setType("text/xml");
                content.setValue(value);
                List<SyndContent> contents = new ArrayList<SyndContent>();
                contents.add(content);
                feedEntry.setContents(contents);
            }
   
            String href = item.getLink();
            if (href == null) {
                href = key.toString();
            }
            SyndLink link = new SyndLinkImpl();
            link.setRel("edit");
            link.setHref(href);
            feedEntry.getLinks().add(link);
            link = new SyndLinkImpl();
            link.setRel("alternate");
            link.setHref(href);
            feedEntry.getLinks().add(link);
   
            Date date = item.getDate();
            if (date == null) {
                date = new Date();
            }
            feedEntry.setPublishedDate(date);
            return feedEntry;
           
        } else if (data != null) {
            SyndEntry feedEntry = new SyndEntryImpl();
            feedEntry.setUri(key.toString());
            feedEntry.setTitle("item");
   
            // Convert the item to XML
            String value = mediator.mediate(data, itemClassType, itemXMLType, null).toString();
           
            SyndContent content = new SyndContentImpl();
            content.setType("text/xml");
            content.setValue(value);
            List<SyndContent> contents = new ArrayList<SyndContent>();
            contents.add(content);
            feedEntry.setContents(contents);
   
            SyndLink link = new SyndLinkImpl();
View Full Code Here

            SyndEntry entry = new SyndEntryImpl();
            entry.setTitle("customer " + "Jane Doe_" + String.valueOf(i));
            entry.setUri(id);

            SyndContent content = new SyndContentImpl();
            content.setValue("Jane Doe_" + String.valueOf(i));
            content.setType(Content.TEXT);
            entry.setContents(Collections.singletonList(content));

            List<SyndLink> links = new ArrayList<SyndLink>();
            SyndLink link = new SyndLinkImpl();
            link.setRel("edit");
View Full Code Here

TOP

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

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.