public class GetContentCmdImpl extends TaskCommandImpl implements GetContentCmd, com.ibm.websphere.cache.Sizeable
The GetContentCmdImpl class provides an implementation of the GetContentCmd task command that retrieves content from the specified content URL. The URL must be accessible from the WebSphere Commerce application server and the content must be text or HTML that can be included in the page that is returned to the browser.
If the content includes embedded URLs, then the URLs must be:
This command can be configured by setting the following values in the STORECONF table:
If the content cannot be retrieved, a warning is logged and the content property is set to null.
This command is a cacheable command. The following cachespec entry will enable this command.
<cache-entry> <class>command</class> <sharing-policy>not-shared</sharing-policy> <name>com.ibm.commerce.content.commands.GetContentCmdImpl</name> <cache-id> <component type="method" id="getCacheId"> <required>true</required> </component> <priority>1</priority> <timeout>3600</timeout> <inactivity>600</inactivity> </cache-id> <dependency-id>getContent</dependency-id> </cache-entry>
Constructor and Description |
---|
GetContentCmdImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.String | getCacheId()
Generate a cache ID for use with dynacache.
|
protected java.lang.String | getCharacterEncoding()
Get the character encoding used to read the content.
|
protected java.lang.String | getCMSHost()
Get the content host that will be used to replace the configurable token found in content URLs embedded in the retrieved content.
|
protected java.lang.String | getCMSPath()
Get the URL prefix path that will be used to replace the configurable token found in content URLs embedded in the retrieved content.
|
protected java.lang.String | getCMSToken()
Get the URL prefix token that will be replaced in the retrieved content by the configurable content URL prefix.
|
protected int | getConnectTimeout()
Get the connection timeout.
|
java.lang.String | getContent()
Get the content.
|
boolean | getIncludeHostName()
Get the includeHostName option.
|
protected java.lang.String | getLTPAToken(java.net.URL url)
Get the LTPA token that will be passed to the content URL.
|
long | getObjectSize()
Returns the estimated footprint size in bytes of this object and the objects it contains.
|
boolean | getPreview()
Get the preview option.
|
protected int | getReadTimeout()
Get the read timeout.
|
java.lang.String | getURL()
Get the content URL.
|
void | performExecute()
This method performs the business logic for this command.
|
protected void | setContent(java.lang.String content)
Set the content.
|
void | setIncludeHostName(boolean includeHostName)
Indicates that the URLs embedded in the content must be a fully qualified URLs that includes the scheme, host name and port.
|
void | setOutputProperties(com.ibm.websphere.command.TargetableCommand cachedCommand)
Copy the content from a cached version of this command.
|
void | setPreview(boolean preview)
Indicates that the content is preview content.
|
void | setURL(java.lang.String url)
Set the content URL.
|
public void setURL(java.lang.String url)
public java.lang.String getURL()
public java.lang.String getContent()
protected void setContent(java.lang.String content)
public void setPreview(boolean preview)
public boolean getPreview()
public void setIncludeHostName(boolean includeHostName)
public boolean getIncludeHostName()
protected int getConnectTimeout()
protected int getReadTimeout()
protected java.lang.String getCharacterEncoding()
protected java.lang.String getCMSToken()
protected java.lang.String getCMSPath()
protected java.lang.String getCMSHost()
protected java.lang.String getLTPAToken(java.net.URL url)
public void performExecute() throws ECException
public long getObjectSize()
public void setOutputProperties(com.ibm.websphere.command.TargetableCommand cachedCommand)
public java.lang.String getCacheId()