info.magnolia.module.rssaggregator.servlet
Class FeedSyndicationServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by info.magnolia.module.rssaggregator.servlet.AbstractServlet
              extended by info.magnolia.module.rssaggregator.servlet.FeedSyndicationServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class FeedSyndicationServlet
extends AbstractServlet

Writes an XML feed to the response. Based on the given request parameters, a FeedGenerator will be resolved and is used for generating an XML feed. The content of the feed will be written to the response with the appropriate character encoding.

Author:
Rob van der Linden Vooren
See Also:
FeedGeneratorResolver, FeedGenerator, Serialized Form

Constructor Summary
FeedSyndicationServlet()
          Construct a new AggregateFeedSyndicationController initialized with a FeedGeneratorResolver.
 
Method Summary
 void handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Subclass need implement this method in order to handle the request.
 void setFeedGeneratorResolver(FeedGeneratorResolver feedGeneratorResolver)
          Set the FeedGeneratorResolver used for resolving the FeedGenerators.
protected  void writeToResponse(String content, String characterEncoding, javax.servlet.http.HttpServletResponse response)
          Write the given content to the response using the default content type text/xml.
protected  void writeToResponse(String content, String contentType, String characterEncoding, javax.servlet.http.HttpServletResponse response)
          Write the given content to the response.
 
Methods inherited from class info.magnolia.module.rssaggregator.servlet.AbstractServlet
doGet, doPost, processRequest
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeedSyndicationServlet

public FeedSyndicationServlet()
Construct a new AggregateFeedSyndicationController initialized with a FeedGeneratorResolver.

Method Detail

handleRequest

public void handleRequest(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)
                   throws Exception
Description copied from class: AbstractServlet
Subclass need implement this method in order to handle the request.

Specified by:
handleRequest in class AbstractServlet
Parameters:
request - the request to handle
response - the associated response
Throws:
Exception - if an exception occurs during request handling

writeToResponse

protected void writeToResponse(String content,
                               String contentType,
                               String characterEncoding,
                               javax.servlet.http.HttpServletResponse response)
                        throws IOException
Write the given content to the response.

Parameters:
content - the content to write
characterEncoding - the character encoding to use
response - the response to write to
Throws:
IOException - if an IOException occurs

writeToResponse

protected void writeToResponse(String content,
                               String characterEncoding,
                               javax.servlet.http.HttpServletResponse response)
                        throws IOException
Write the given content to the response using the default content type text/xml.

Parameters:
content - the content to write
characterEncoding - the character encoding to use
response - the response to write to
Throws:
IOException - if an IOException occurs

setFeedGeneratorResolver

public void setFeedGeneratorResolver(FeedGeneratorResolver feedGeneratorResolver)
Set the FeedGeneratorResolver used for resolving the FeedGenerators.

Parameters:
feedGeneratorResolver - the generator resolver to be used (must not be null)
Throws:
IllegalArgumentException - if the given generatorResolver is null


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.