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
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 |
CONTENT_SELECTOR_TYPE
public static final String
CONTENT_SELECTOR_TYPE
- The phtype that identifies a ContentSelector preview.
PlaceholderPreviewServlet
public PlaceholderPreviewServlet()
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