@RequestProcessing(value = {"/sitemap.xml"}, method = HTTPRequestMethod.GET)
public void sitemap(final HTTPRequestContext context) {
final TextXMLRenderer renderer = new TextXMLRenderer();
context.setRenderer(renderer);
final Sitemap sitemap = new Sitemap();
try {
final JSONObject preference = preferenceQueryService.getPreference();
addArticles(sitemap, preference);
addPages(sitemap, preference);
addTags(sitemap, preference);
addArchives(sitemap, preference);
LOGGER.log(Level.INFO, "Generating sitemap....");
final String content = sitemap.toString();
LOGGER.log(Level.INFO, "Generated sitemap");
renderer.setContent(content);
} catch (final Exception e) {
LOGGER.log(Level.SEVERE, "Get blog article feed error", e);