SyndFeedOutput output = new SyndFeedOutput(); output.output( data.feed, writer ); writer.close();
/** * @return the feed we built as serialized XML string * @throws FeedException if feed error */ public String outputString() throws FeedException { SyndFeedOutput feedWriter = new SyndFeedOutput(); return feedWriter.outputString(feed); }
/** * send the output to designated Writer * * @param writer Writer * @throws FeedException if feed error * @throws IOException if IO error */ public void output(java.io.Writer writer) throws FeedException, IOException { SyndFeedOutput feedWriter = new SyndFeedOutput(); feedWriter.output(feed, writer); }
public void write(OutputStream outputStream) throws IOException { try { Writer w = new OutputStreamWriter(outputStream); SyndFeedOutput output = new SyndFeedOutput(); output.output(feed, w); } catch (FeedException e) { throw new RuntimeException("Got exception while generating feed!", e); } } }
/** * @return the feed we built as DOM Document * @throws FeedException if feed error */ public Document outputW3CDom() throws FeedException { try { SyndFeedOutput feedWriter = new SyndFeedOutput(); return feedWriter.outputW3CDom(feed); } catch (FeedException e) { log.error(e); throw e; } }
private void doWrite(SyndFeed feed) throws IOException, FeedException { feed.setFeedType(feedType.value); SyndFeedOutput output = new SyndFeedOutput(); output.output(feed, response.getWriter()); response.getWriter().close(); } }
/** * @see FeedPluginApi#getFeedOutput(SyndFeed, String) */ public String getFeedOutput(SyndFeed feed, String type, XWikiContext context) { feed.setFeedType(type); StringWriter writer = new StringWriter(); SyndFeedOutput output = new SyndFeedOutput(); try { output.output(feed, writer); writer.close(); return writer.toString(); } catch (Exception e) { e.printStackTrace(); return ""; } }
/** * {@inheritDoc} */ public String getFeedOutput(SyndFeed feed, String type) { feed.setFeedType(type); StringWriter writer = new StringWriter(); SyndFeedOutput output = new SyndFeedOutput(); try { output.output(feed, writer); writer.close(); return writer.toString(); } catch (Exception e) { return ""; } }
@Override public void write(Writer writer) throws IOException { try { SyndFeedOutput output = new SyndFeedOutput(); if (this.feed.getFeedType() == null) { this.feed.setFeedType("atom_1.0"); } output.output(this.feed, writer); } catch (FeedException e) { IOException ioe = new IOException("Feed exception"); ioe.initCause(e); throw ioe; } } }
@ResponseBody @GetMapping("/feed.xml") public ResponseEntity<String> feed() { String feed = ""; try { feed = new SyndFeedOutput().outputString(getFeed()); } catch (Exception ex) { logger.error("Could not generate feed", ex); } return ResponseEntity.ok(). contentType(MediaType.APPLICATION_ATOM_XML). cacheControl(CacheControl.maxAge(1, TimeUnit.HOURS)). eTag(Utils.md5(feed)). body(feed); }
public static void writeFeed(SyndFeed feed, FeedType feedType, Writer outputWriter) throws FeedException, IOException { try { feed.setFeedType(feedType.getType()); SyndFeedOutput output = new SyndFeedOutput(); output.output(feed, outputWriter); } catch (FeedException ex) { ex.printStackTrace(); } }
public static String export(SyndFeed feed) throws FeedException { feed.setEncoding(StringPool.UTF8); SyndFeedOutput output = new SyndFeedOutput(); try { return output.outputString(feed); } catch (IllegalDataException ide) { // LEP-4450 _regexpStrip(feed); return output.outputString(feed); } }
SyndFeedOutput output = new SyndFeedOutput(); output.output(feed, new PrintWriter(System.out));
SyndFeedOutput output = new SyndFeedOutput(); output.output(feed, new PrintWriter(System.out));
feed.setFeedType(getFeedType(request)); response.setContentType(MIME_TYPE); SyndFeedOutput output = new SyndFeedOutput(); output.output(feed, response.getWriter());
final SyndFeedOutput output = new SyndFeedOutput(); final Writer writer = new StringWriter(); output.output(feed, writer);
/** This method will take a SyndFeed object with a SimpleListExtension on it and populate the entries * with current SleEntry values for sorting and grouping. * <b>NB</b>: This basically does this by re-generating the XML for all the entries then re-parsing them * into the SLE data structures. It is a very heavy operation and should not be called frequently! */ public static void initializeForSorting( SyndFeed feed )throws FeedException { List syndEntries = feed.getEntries(); // TODO: the null parameter below will break delegating parsers and generators ModuleGenerators g = new ModuleGenerators( feed.getFeedType() + ITEM_MODULE_GENERATORS_POSFIX_KEY, null); SyndFeedOutput o = new SyndFeedOutput(); Document d = o.outputJDom( feed ); SyndFeed feed2 = new SyndFeedInput().build( d ); feed.copyFrom( feed2 ); }
/** This method will take a SyndFeed object with a SimpleListExtension on it and populate the entries * with current SleEntry values for sorting and grouping. * <b>NB</b>: This basically does this by re-generating the XML for all the entries then re-parsing them * into the SLE data structures. It is a very heavy operation and should not be called frequently! */ public static void initializeForSorting( SyndFeed feed )throws FeedException { List syndEntries = feed.getEntries(); // TODO: the null parameter below will break delegating parsers and generators ModuleGenerators g = new ModuleGenerators( feed.getFeedType() + ITEM_MODULE_GENERATORS_POSFIX_KEY, null); SyndFeedOutput o = new SyndFeedOutput(); Document d = o.outputJDom( feed ); SyndFeed feed2 = new SyndFeedInput().build( d ); feed.copyFrom( feed2 ); }
/** This method will take a SyndFeed object with a SimpleListExtension on it and populate the entries * with current SleEntry values for sorting and grouping. * <b>NB</b>: This basically does this by re-generating the XML for all the entries then re-parsing them * into the SLE data structures. It is a very heavy operation and should not be called frequently! */ public static void initializeForSorting( SyndFeed feed )throws FeedException { List syndEntries = feed.getEntries(); // TODO: the null parameter below will break delegating parsers and generators ModuleGenerators g = new ModuleGenerators( feed.getFeedType() + ITEM_MODULE_GENERATORS_POSFIX_KEY, null); SyndFeedOutput o = new SyndFeedOutput(); Document d = o.outputJDom( feed ); SyndFeed feed2 = new SyndFeedInput().build( d ); feed.copyFrom( feed2 ); }
/** This method will take a SyndFeed object with a SimpleListExtension on it and populate the entries * with current SleEntry values for sorting and grouping. * <b>NB</b>: This basically does this by re-generating the XML for all the entries then re-parsing them * into the SLE data structures. It is a very heavy operation and should not be called frequently! */ public static void initializeForSorting( SyndFeed feed )throws FeedException { List syndEntries = feed.getEntries(); // TODO: the null parameter below will break delegating parsers and generators ModuleGenerators g = new ModuleGenerators( feed.getFeedType() + ITEM_MODULE_GENERATORS_POSFIX_KEY, null); SyndFeedOutput o = new SyndFeedOutput(); Document d = o.outputJDom( feed ); SyndFeed feed2 = new SyndFeedInput().build( d ); feed.copyFrom( feed2 ); }