com.bea.p13n.placeholder.servlets
Class PlaceholderPreviewServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.bea.p13n.placeholder.servlets.PlaceholderPreviewServlet
All Implemented Interfaces
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class PlaceholderPreviewServlet
extends javax.servlet.http.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(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Do the GET request.
 void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.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
Constants Summary
Constructor Detail

PlaceholderPreviewServlet

public PlaceholderPreviewServlet()
Method Detail

init

public void init()
          throws javax.servlet.ServletException
Initialize this servlet.

Overrides:
init in class javax.servlet.GenericServlet
Throws
javax.servlet.ServletException

doGet

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

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters
req - the HTTP request
resp - the HTTP response
Throws
javax.servlet.ServletException
IOException

doPost

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

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters
req - the HTTP request
resp - the HTTP response
Throws
javax.servlet.ServletException
IOException


Copyright © 2011, Oracle. All rights reserved.