Examples of SyndFeedImpl


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

        {
            log.debug( "No updates found, feed not generated." );
            return null;
        }
       
        SyndFeed feed = new SyndFeedImpl();
        feed.setTitle( title );       
        feed.setDescription( description );
        feed.setLanguage( DEFAULT_LANGUAGE );
        feed.setPublishedDate( dataEntries.get( dataEntries.size() - 1 ).getPublishedDate() );
        feed.setFeedType( DEFAULT_FEEDTYPE );
        feed.setEntries( getEntries( dataEntries ) );

        log.debug( "Finished generating the feed \'" + title + "\'." );
       
        return feed;
    }
View Full Code Here

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

        {
            log.debug( "No updates found, feed not generated." );
            return null;
        }
       
        SyndFeed feed = new SyndFeedImpl();
        feed.setTitle( title );       
        feed.setDescription( description );
        feed.setLanguage( DEFAULT_LANGUAGE );
        feed.setPublishedDate( dataEntries.get( dataEntries.size() - 1 ).getPublishedDate() );
        feed.setFeedType( DEFAULT_FEEDTYPE );
        feed.setEntries( getEntries( dataEntries ) );

        log.debug( "Finished generating the feed \'" + title + "\'." );
       
        return feed;
    }
View Full Code Here

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

                // Convert to an RSS feed
                if (feed != null) {
                    response.setContentType("application/rss+xml; charset=utf-8");
                    feed.setFeedType("atom_1.0");
                    SyndFeed syndFeed = new SyndFeedImpl(feed);
                    syndFeed.setFeedType(requestFeedType);
                    syndFeed.setLink(path);
                    SyndFeedOutput syndOutput = new SyndFeedOutput();
                    try {
                        syndOutput.output(syndFeed, getWriter(response));
                    } catch (FeedException e) {
                        throw new ServletException(e);
View Full Code Here

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

        }
        return description;
    }

    protected SyndFeed createFeed(QueueBrowser browser, HttpServletRequest request) throws JMSException {
        SyndFeed feed = new SyndFeedImpl();
        feed.setFeedType(feedType);

        String title = browser.getQueue().toString();
        String selector = browser.getMessageSelector();
        if (selector != null) {
            title += " with selector: " + selector;
        }
        feed.setTitle(title);
        feed.setLink(request.getRequestURI());
        feed.setDescription(getDescription());
        return feed;
    }
View Full Code Here

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

                    "ContentCannotGenerateBlogRssFeed",
                    UtilMisc.toMap("contentId", contentId), locale));
        }

        // create the feed
        SyndFeed feed = new SyndFeedImpl();
        feed.setFeedType(feedType);
        feed.setLink(mainLink);

        feed.setTitle(content.getString("contentName"));
        feed.setDescription(content.getString("description"));
        feed.setEntries(generateEntryList(dispatcher, delegator, contentId, entryLink, locale, userLogin));

        Map<String, Object> resp = ServiceUtil.returnSuccess();
        resp.put("wireFeed", feed.createWireFeed());
        return resp;
    }
View Full Code Here

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

     * @return the structure containing alerts
     */   
    public Feed getFeed() {
       
        // Create a new Feed
        SyndFeed feed = new SyndFeedImpl();
        feed.setTitle("Apache Tuscant Feed Aggregator");
        feed.setDescription("A sample showing an SCA application to aggregate various types of feeds");
        feed.setAuthor("Apache Tuscany");
        feed.setLink("http://incubator.apache.org/tuscany");
        // Aggregate entries from feed1 and feed2
        List<SyndEntry> entries = new ArrayList<SyndEntry>();
       
        try {       
            AlertsType alerts = this.alerts.getAllNewAlerts("");
           
            for( Object alertObject : alerts.getAlert() ){        
                AlertType alert = ((AlertType)alertObject);
                SyndEntry entry = new SyndEntryImpl();
                entry.setTitle(alert.getTitle());
                //entry.(alert.getSummary());                   
                entry.setLink(alert.getAddress());
                entry.setPublishedDate(dateFormatter.parse(alert.getDate()));
                       
                entries.add(entry);
            }
        } catch(Exception ex) {
            System.err.println("Exception " + ex.toString());
        }
       
        feed.setEntries(entries);
       
        return (Feed)feed.createWireFeed("atom_1.0");
    }
View Full Code Here

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

                // Convert to an RSS feed
                if (feed != null) {
                    response.setContentType("application/rss+xml; charset=utf-8");
                    feed.setFeedType("atom_1.0");
                    SyndFeed syndFeed = new SyndFeedImpl(feed);
                    syndFeed.setFeedType(requestFeedType);
                    SyndFeedOutput syndOutput = new SyndFeedOutput();
                    try {
                        syndOutput.output(syndFeed, getWriter(response));
                    } catch (FeedException e) {
                        throw new ServletException(e);
View Full Code Here

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

                if (feed != null) {

                    // Convert to an RSS feed
                    response.setContentType("application/rss+xml; charset=utf-8");
                    feed.setFeedType("atom_1.0");
                    SyndFeed syndFeed = new SyndFeedImpl(feed);
                    syndFeed.setFeedType(requestFeedType);
                    SyndFeedOutput syndOutput = new SyndFeedOutput();
                    try {
                        syndOutput.output(syndFeed, getWriter(response));
                    } catch (FeedException e) {
                        throw new ServletException(e);
View Full Code Here

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

     * @return the structure containing alerts
     */   
    public Feed getFeed() {
       
        // Create a new Feed
        SyndFeed feed = new SyndFeedImpl();
        feed.setTitle("Apache Tuscant Feed Aggregator");
        feed.setDescription("A sample showing an SCA application to aggregate various types of feeds");
        feed.setAuthor("Apache Tuscany");
        feed.setLink("http://incubator.apache.org/tuscany");
        // Aggregate entries from feed1 and feed2
        List<SyndEntry> entries = new ArrayList<SyndEntry>();
       
        try {       
            AlertsType alerts = this.alerts.getAllNewAlerts("");
           
            for( Object alertObject : alerts.getAlert() ){        
                AlertType alert = ((AlertType)alertObject);
                SyndEntry entry = new SyndEntryImpl();
                entry.setTitle(alert.getTitle());
                //entry.(alert.getSummary());                   
                entry.setLink(alert.getAddress());
                entry.setPublishedDate(dateFormatter.parse(alert.getDate()));
                       
                entries.add(entry);
            }
        } catch(Exception ex) {
            System.err.println("Exception " + ex.toString());
        }
       
        feed.setEntries(entries);
       
        return (Feed)feed.createWireFeed("atom_1.0");
    }
View Full Code Here

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

   */
  public static void toRSS(String hostUrl, String feedLink, String title, String description,
      List<FeedEntryModel> entryModels, OutputStream os)
      throws IOException, FeedException {

    SyndFeed feed = new SyndFeedImpl();
    feed.setFeedType("rss_2.0");
    feed.setEncoding("UTF-8");
    feed.setTitle(title);
    feed.setLink(feedLink);
    feed.setDescription(description);
    SyndImageImpl image = new SyndImageImpl();
    image.setTitle(Constants.NAME);
    image.setUrl(hostUrl + "/gitblt_25.png");
    image.setLink(hostUrl);
    feed.setImage(image);

    List<SyndEntry> entries = new ArrayList<SyndEntry>();
    for (FeedEntryModel entryModel : entryModels) {
      SyndEntry entry = new SyndEntryImpl();
      entry.setTitle(entryModel.title);
      entry.setAuthor(entryModel.author);
      entry.setLink(entryModel.link);
      entry.setPublishedDate(entryModel.published);

      if (entryModel.tags != null && entryModel.tags.size() > 0) {
        List<SyndCategory> tags = new ArrayList<SyndCategory>();
        for (String tag : entryModel.tags) {
          SyndCategoryImpl cat = new SyndCategoryImpl();
          cat.setName(tag);
          tags.add(cat);
        }
        entry.setCategories(tags);
      }

      SyndContent content = new SyndContentImpl();
      if (StringUtils.isEmpty(entryModel.contentType)
          || entryModel.contentType.equalsIgnoreCase("text/plain")) {
        content.setType("text/html");
        content.setValue(StringUtils.breakLinesForHtml(entryModel.content));
      } else {
        content.setType(entryModel.contentType);
        content.setValue(entryModel.content);
      }
      entry.setDescription(content);

      entries.add(entry);
    }
    feed.setEntries(entries);

    OutputStreamWriter writer = new OutputStreamWriter(os, "UTF-8");
    SyndFeedOutput output = new SyndFeedOutput();
    output.output(feed, writer);
    writer.close();
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.