© 2005 BEA Systems, Inc.

com.bea.p13n.placeholder.servlets
Class PlaceholderPreviewServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.bea.p13n.placeholder.servlets.PlaceholderPreviewServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

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()).

See Also:
Serialized Form

Field Summary
static String CONTENT_SELECTOR_TYPE
          The phtype that identifies a ContentSelector preview.
 
Constructor Summary
PlaceholderPreviewServlet()
           
 
Method Summary
 void doGet(HttpServletRequest req, HttpServletResponse resp)
          Do the GET request.
 void doPost(HttpServletRequest req, HttpServletResponse resp)
          Do the POST request.
 void init()
          Initialize this servlet.
 
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, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_SELECTOR_TYPE

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

See Also:
Constant Field Values
Constructor Detail

PlaceholderPreviewServlet

public PlaceholderPreviewServlet()
Method Detail

doGet

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.

Parameters:
req - the HTTP request
resp - the HTTP response
Throws:
ServletException
IOException

doPost

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

Parameters:
req - the HTTP request
resp - the HTTP response
Throws:
ServletException
IOException

init

public void init()
          throws ServletException
Initialize this servlet.

Throws:
ServletException

© 2005 BEA Systems, Inc.

Copyright © 2005 BEA Systems, Inc. All Rights Reserved