Examples of SyndFeedOutput


Examples of com.rometools.rome.io.SyndFeedOutput

    for (Entry entry : entries.getEntries()) {
      children.add(entry.asRss());
    }
    feed.setEntries(children);

    SyndFeedOutput output = new SyndFeedOutput();
    StringWriter writer = new StringWriter();
    try {
      output.output(feed, writer);
    } catch (Exception e) {
      writer.write("Could not get feed information");
      log.error(e.getMessage(), e);
    }
    return Response.ok(writer.toString()).build();
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

    assertNotNull(syndFeed);
    assertEquals(1,syndFeed.getEntries().size());
 
    syndFeed.setFeedType("atom_1.0");
   
    SyndFeedOutput output = new SyndFeedOutput();
    String feedData = output.outputString(syndFeed);   
   
    StringReader sreader = new StringReader(feedData);
    SyndFeedInput input = new SyndFeedInput(true);
    SyndFeed copyFeed = input.build(sreader);
    assertNotNull(copyFeed);
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

                logger.debug("Found object on stack with expression '" + feedName + "': " + feed);

            if (feedType != null) // if the feedType is specified, we'll override the one set in the feed object
                feed.setFeedType(feedType);

            SyndFeedOutput output = new SyndFeedOutput();
            // we'll need the writer since Rome doesn't support writing to an outputStream yet
            Writer out = null;
            try {
                out = ServletActionContext.getResponse().getWriter();
                preprocess(feed);
                output.output(feed, out);
                postprocess(feed);
            } catch (Exception e) {
                // Woops, couldn't write the feed ?
                logger.error("Could not write the feed: " + e.getMessage(), e);
            } finally {
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

        }

        // Write feed to output
        response.setContentType(syndFeedType.contentType);
        response.setCharacterEncoding("UTF-8");
        SyndFeedOutput output = new SyndFeedOutput();
        try {
            output.output(syndFeed, response.getWriter());
        } catch (FeedException ex) {
            throw new ServletException(ex);
        }
        response.getWriter().flush();
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

      }
      // TODO:GW Do we need this?
      // response.setContentLength(feed.get);

      writer = response.getWriter();
      SyndFeedOutput output = new SyndFeedOutput();
      output.output(feed, writer);

    } catch (FeedException e) {
      // throw olat exception for nice logging
      log.warn("Error when generating RSS stream for path::" + request.getPathInfo(), e);
      DispatcherAction.sendNotFound("none", response);
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

  public SyndFeedMediaResource(SyndFeed feed) {
    this.feed = feed;

    feedString = null;
    try {
      SyndFeedOutput output = new SyndFeedOutput();
      feedString = output.outputString(feed);
    } catch (FeedException e) {
      // cannot convert feed to string or something
    }
  }
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

        feed.setEntries(entries);
        return outputSyndFeed(feed);
    }

    protected byte[] outputSyndFeed(SyndFeed feed) throws IOException, FeedException, UnsupportedEncodingException {
        SyndFeedOutput output = new SyndFeedOutput();
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        output.output(feed, new OutputStreamWriter(baos, "utf-8"));
        baos.flush();
        baos.close();

        return baos.toByteArray();
    }
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

        String feedType = RequestUtils.getStringParameter(request,FEED_TYPE);
        feedType = (feedType!=null) ? feedType : getDefaultFeedType();
        feed.setFeedType(feedType);
       
        response.setContentType(getContentType());
        SyndFeedOutput output = new SyndFeedOutput();
        output.output(feed,response.getWriter());
    }
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

     */
    public Document outputW3CDom() throws FeedException
    {
        try
        {
            SyndFeedOutput feedWriter = new SyndFeedOutput();
            return feedWriter.outputW3CDom(feed);
        }
        catch (FeedException e)
        {
            log.error(e);
            throw e;
View Full Code Here

Examples of com.sun.syndication.io.SyndFeedOutput

    /**
     * @return the feed we built as serialized XML string
     */
    public String outputString() throws FeedException
    {
        SyndFeedOutput feedWriter = new SyndFeedOutput();
        return feedWriter.outputString(feed);
    }
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.