PlaceholderPreviewServlet Class

com.bea.p13n.placeholder.servlets
PlaceholderPreviewServlet Class

public class PlaceholderPreviewServlet

    extends HttpServlet

A servlet which generates a content query preview info.

If a request parameter called 'query' is set, it is assumed to contain the cq:contentQuery XML structure of a content query. The 'username' request parameter will be used to resolve user property references. The servlet will return XML of the form:

 <preview-info-result>
   <preview-info is-folder="true|false">
      <path>...</path>
      <mimeType>...</mimeType>
      <size>...</size>
   </preview-info>
   ...
 </preview-info-result>
 
with a <preview-info> entry per content object that would be returned from the content query.

If a request parameter of 'path' is set, then, depending upon the 'phtype' request parameter, the corresponding content object will be rendered (Ad) or displayed (ContentSelector).

The phType request parameter is always required

This expects the PlaceholderService to use to be mapped to java:comp/env/ejb/PlaceholderService and the AdServier to be mapped to java:comp/env/ejb/AdService.

It also expects a ShowBinaryServlet to mapped to the partial URI defined by the "ShowDocURI" init parameter (defaulting to ContentProviders.getShowDocURI()).


Hierarchy
Object
  GenericServlet
    HttpServlet
      PlaceholderPreviewServlet
All Implemented Interfaces

Serializable, Servlet, ServletConfig

Field Summary

public static final String
CONTENT_SELECTOR_TYPE
The phtype that identifies a ContentSelector preview.
 

Constructor Summary

PlaceholderPreviewServlet()

 

Method Summary

public void
doGet(HttpServletRequest req, HttpServletResponse resp)
Do the GET request.
public void
doPost(HttpServletRequest req, HttpServletResponse resp)
Do the POST request.
public void
init()
Initialize this servlet.
 
Methods from  javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods from  javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log, service
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface javax.servlet.Servlet
destroy, getServletConfig, getServletInfo, init, service
 
Methods from interface javax.servlet.ServletConfig
getInitParameter, getInitParameterNames, getServletContext, getServletName
 

Field Detail

CONTENT_SELECTOR_TYPE

public static final String CONTENT_SELECTOR_TYPE
The phtype that identifies a ContentSelector preview.

 

Constructor Detail

PlaceholderPreviewServlet

public PlaceholderPreviewServlet()
 

Method Detail

doGet(HttpServletRequest, HttpServletResponse) Method

public void doGet(HttpServletRequest req, 
                  HttpServletResponse resp)
throws ServletException, IOException
Do the GET request. This method will generate each of the frames and the frameset itself.

Overrides
HttpServlet.doGet(HttpServletRequest, HttpServletResponse)

Parameters

req
the HTTP request
resp
the HTTP response

Exceptions

ServletException
IOException

doPost(HttpServletRequest, HttpServletResponse) Method

public void doPost(HttpServletRequest req, 
                   HttpServletResponse resp)
throws ServletException, IOException
Do the POST request. This will call doGet().

Overrides
HttpServlet.doPost(HttpServletRequest, HttpServletResponse)

Parameters

req
the HTTP request
resp
the HTTP response

Exceptions

ServletException
IOException

init() Method

public void init()
throws ServletException
Initialize this servlet.

Overrides
GenericServlet.init()

Exceptions

ServletException