com.endeca.infront.content.source
Class WorkbenchContentSource

java.lang.Object
  extended by com.endeca.infront.content.source.AbstractContentSource
      extended by com.endeca.infront.content.source.WorkbenchContentSource
All Implemented Interfaces:
ContentSource
Direct Known Subclasses:
AuthoringContentSource, LiveContentSource

public class WorkbenchContentSource
extends AbstractContentSource

The WorkbenchContentSource allows the retrieval of content from a Workbench Server. It contains uniform configuration parameters that allow content to run in 'Live' or 'Authoring' mode.


Field Summary
protected  com.endeca.infront.publish.ContentClient client
           
protected static int DEFAULT_CLIENT_PORT
           
protected static long DEFAULT_MESSAGE_TIMEOUT
           
protected static int DEFAULT_SERVER_PORT
           
protected  com.endeca.infront.content.source.WorkbenchContentSource.ContentSourceParameterValidator validator
           
 
Constructor Summary
WorkbenchContentSource()
          Constructs a new content source.
WorkbenchContentSource(boolean isAuthoring, String appName, String defaultSiteRootPath, String host, int workbenchPort, String user, String password, boolean useSSL, int publishingPort, int clientPort, String contextPath, String realPath)
          Deprecated. 
 
Method Summary
 void destroy()
          Calls the destroy method of the content source
 String getAppName()
           
 int getClientPort()
           
 String getHost()
           
 long getMessageTimeout()
           
 int getServerPort()
           
 void init()
          Validates all configuration parameters are set on the WorkbenchContentSource and establishes a connection to the Workbench Server to receive content.
 boolean isAuthoring()
           
 ContentLocator resolveContent(javax.servlet.http.HttpServletRequest pRequest)
          Calls the resolveContent method of the content source
 ContentLocator resolveContent(String pContentUri)
          Calls the resolveContent method of the content source
 void setAppName(String appName)
           
 void setClientPort(int clientPort)
           
 void setHost(String host)
           
 void setIsAuthoring(boolean authoring)
           
 void setMessageTimeout(long messageTimeout)
           
 void setServerPort(int serverPort)
           
 
Methods inherited from class com.endeca.infront.content.source.AbstractContentSource
getDefaultSiteRootPath, setDefaultSiteRootPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MESSAGE_TIMEOUT

protected static final long DEFAULT_MESSAGE_TIMEOUT
See Also:
Constant Field Values

DEFAULT_SERVER_PORT

protected static final int DEFAULT_SERVER_PORT
See Also:
Constant Field Values

DEFAULT_CLIENT_PORT

protected static final int DEFAULT_CLIENT_PORT
See Also:
Constant Field Values

client

protected com.endeca.infront.publish.ContentClient client

validator

protected com.endeca.infront.content.source.WorkbenchContentSource.ContentSourceParameterValidator validator
Constructor Detail

WorkbenchContentSource

@Deprecated
public WorkbenchContentSource(boolean isAuthoring,
                                         String appName,
                                         String defaultSiteRootPath,
                                         String host,
                                         int workbenchPort,
                                         String user,
                                         String password,
                                         boolean useSSL,
                                         int publishingPort,
                                         int clientPort,
                                         String contextPath,
                                         String realPath)
Deprecated. 

Constructs a new content source. If isAuthoring is set to FALSE, the content source will be a LiveContentSource, otherwise it will be an AuthoringContentSource.

See the descriptions below for information about which parameters are required for each content source.

Parameters:
isAuthoring - When set to FALSE, the Content Source will be an instance of the LiveContentSource, when TRUE, the underlying implementation is a AuthoringContentSource.
appName - The name of the application we want to retrieve content for. Used in both modes.
defaultSiteRootPath - The default site root path. When an attempt is made to resolve content from an HttpServletRequest, the source first tries to resolve the result of calling HttpServletRequest.getPathInfo(). If that doesn't resolve, it then tries to resolve the path info prepended with the defaultSiteRootPath. Used in both modes.
host - The host name for the Workbench instance. Used in both modes.
workbenchPort - The port to the workbench server. Used in Authoring mode.
user - The username for connecting to the content repository. Used in Authoring mode.
password - The password for connected to the content repository. Used in Authoring mode.
useSSL - Whether to use SSL to connect to the content repository. Used in Authoring mode.
publishingPort - The port to connect to for content. This port is used by the LiveContentSource to establish a connection to Workbench for content promotion. Used in Live mode.
clientPort - The port used by the tcp client. if this port is set to -1, system will assign port automatically. Used in Live mode.
contextPath - Additional debug property for identifying this Assembler Client in the PromotionStatus Page. Specifying the context path for the client allows developers to more quickly identify where it is located in relation to the application server. Used in Live mode.
realPath - Additional debug property for identifying this Assembler Client in the PromotionStatus page. The real path is where the client is located on the file system, and is useful for locating the client from the PromotionStatus page. Used in Live mode.

WorkbenchContentSource

public WorkbenchContentSource()
Constructs a new content source.

Method Detail

init

public void init()
Validates all configuration parameters are set on the WorkbenchContentSource and establishes a connection to the Workbench Server to receive content.


isAuthoring

public boolean isAuthoring()

setIsAuthoring

public void setIsAuthoring(boolean authoring)

setAppName

public void setAppName(String appName)

getAppName

public String getAppName()

setHost

public void setHost(String host)

getHost

public String getHost()

setServerPort

public void setServerPort(int serverPort)

getServerPort

public int getServerPort()

setClientPort

public void setClientPort(int clientPort)

getClientPort

public int getClientPort()

getMessageTimeout

public long getMessageTimeout()

setMessageTimeout

public void setMessageTimeout(long messageTimeout)

resolveContent

public ContentLocator resolveContent(String pContentUri)
                              throws ContentException
Calls the resolveContent method of the content source

Parameters:
pContentUri - The URI to access for content. The string should be properly URL-encoded.
Returns:
a ContentLocator with the location of the content.
Throws:
ContentException - Thrown when there is an error accessing or forming content.
See Also:
ContentSource.resolveContent(String)

resolveContent

public ContentLocator resolveContent(javax.servlet.http.HttpServletRequest pRequest)
                              throws ContentException
Calls the resolveContent method of the content source

Specified by:
resolveContent in interface ContentSource
Overrides:
resolveContent in class AbstractContentSource
Parameters:
pRequest - The HttpServletRequest containing the content URI.
Returns:
a ContentLocator with the information that was inferred from the HttpServletRequest.
Throws:
ContentException - Thrown when there is an error accessing or forming content.
See Also:
ContentSource.resolveContent(HttpServletRequest)

destroy

public void destroy()
Calls the destroy method of the content source

Specified by:
destroy in interface ContentSource
Overrides:
destroy in class AbstractContentSource
See Also:
ContentSource.destroy()


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