com.endeca.infront.assembler.servlet
Class AbstractPreviewLinkServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.endeca.infront.assembler.servlet.AbstractPreviewLinkServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
SpringPreviewLinkServlet

public abstract class AbstractPreviewLinkServlet
extends javax.servlet.http.HttpServlet

Link service for Workbench Preview functionality. This service constructs a link to the page that is being previewed; it is also used for auditing content items.

This is the input to the service, as specified by request parameters:


The expected output from the service is a JSONP callback with data {action: "link"}, where "link" represents the encoded URL action string.

As an example, suppose that the user triggers preview on a content item contained within a page named "browse%" (note that "%25" is the encoded value of the character '%').

See Also:
Serialized Form

Constructor Summary
AbstractPreviewLinkServlet()
           
 
Method Summary
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Creates and returns a link to the page specified using request parameters.
protected abstract  ContentSource getContentSource()
          A method to retrieve a ContentSource to use for creating links.
protected abstract  NavigationStateBuilder getNavigationStateBuilder()
          A method to retrieve a NavigationStateBuilder to use for creating links.
protected  String getUrlForAction(NavigationAction action)
          Constructs and returns a URL representing the given NavigationAction.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, 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

AbstractPreviewLinkServlet

public AbstractPreviewLinkServlet()
Method Detail

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     IOException
Creates and returns a link to the page specified using request parameters. See AbstractPreviewLinkServlet.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - The request the client has made of the servlet
response - The response the servlet sends to the client
Throws:
IOException - If an input or output error is detected when the servlet handles the GET request
javax.servlet.ServletException - If the GET request could not be handled

getNavigationStateBuilder

protected abstract NavigationStateBuilder getNavigationStateBuilder()
A method to retrieve a NavigationStateBuilder to use for creating links. Subclasses must override this method to provide a specific means of acquiring the state builder.

Returns:
the NavigationStateBuilder

getContentSource

protected abstract ContentSource getContentSource()
A method to retrieve a ContentSource to use for creating links. Subclasses must override this method to provide a specific means of acquiring the content source.

Returns:
the ContentSource

getUrlForAction

protected String getUrlForAction(NavigationAction action)
Constructs and returns a URL representing the given NavigationAction. The default implementation simply concatenates Action.getContentPath() and NavigationAction.getNavigationState(). Applications with more complicated ways of constructing URLs can extend this method to provide their own implementation.

Parameters:
action - The input action
Returns:
The output URL


Copyright © 2012, Oracle and/or its affiliates. All rights reserved.