public class ResolveContentURLCmdImpl extends TaskCommandImpl implements ResolveContentURLCmd
The ResolveContentURLCmdImpl
class provides an implementation of the
ResolveContentURLCmd
task command that resolves content URLs that are prefixed
with the token "http://[cmsHost]". The token is replaced by a URL prefix value that
is calculated by appending a configured path value to a configured host value. The configuration
values are set in the STORECONF
table. If the command does not detect the "e;http://[cmsHost]" prefix
then the unresolved URL is returned without modification.
In addition to resolving the URL, this command will resolve the MIME type of the content. The command will scan the URL for a configured parameter name and use the parameter value as the MIME type. If the parameter is not found, the command will attempt to determine the MIME type from the file extension.
This command uses the following values in the STORECONF table.
wc.resolveContentURL.cmsHost
- The host name (including the scheme, host name, and port) of the location of production content.wc.resolveContentURL.cmsInternalHost
- The host name (including the scheme, host name, and port) of the location of production content that is accessed from the
WebSphere Commerce application server rather than the browser. If this value is not specified, then the value of wc.resolveContentURL.cmsHost
is used.wc.resolveContentURL.cmsPreviewHost
- The host name (including the scheme, host name, and port) of the location of preview content. If this value is
not specified, then the value of wc.resolveContentURL.cmsHost
is used.wc.resolveContentURL.cmsInternalPreviewHost
- The host name (including the scheme, host name, and port) of the location of preview content that is accessed from the
WebSphere Commerce application server rather than the browser. If this value is not specified, then the command will look for a value by first checking wc.resolveContentURL.cmsPreviewHost
, then
wc.resolveContentURL.cmsInternalHost
and then wc.resolveContentURL.cmsHost
.wc.resolveContentURL.cmsPath
- The path to the production location of content. This value is optional and can be omitted if the content URLs are relative to the content host.wc.resolveContentURL.cmsPreviewPath
- The path to the preview location of content. If this value is not specified, then the value of wc.resolveContentURL.cmsPath
is used.wc.resolveContentURL.useRelativeURLs
- Indicates that this the command will use relative URLs when resolving production URLs. Set this value to true
if
content URLs are relative to the same host name as the pages that include them. This option can be overridden by setting the includeHostName
property to true
.wc.resolveContentURL.mimeTypeParameter
- The name of a parameter in the URL that indicates the MIME type. If this value is not specified, then the default value of
mimeType is used.
wc.resolveContentURL.renderTypeParameter
- The name of a parameter in the URL that indicates how the content is to be rendered.
If this value is not specified, then the default value of renderType is used.
wc.resolveContentURL.contentRenderType
- The value of the renderType
parameter that indicates that the content is an HTML fragment that is to be embedded in a page. If not specified,
the default value is CONTENT
.wc.resolveContentURL.linkRenderType
- The value of the renderType
parameter that indicates that the content URL is to be rendered as link using the HTML anchor (A) tag. If not specified,
the default value is LINK
.wc.resolveContentURL.resourceRenderType
- The value of the renderType
parameter that indicates that the content URL is an image or other resource and
is to be rendered in HTML according to the mimeType
value. If not specified,
the default value is RESOURCE
.wc.resolveContentURL.encode
- Indicates that the content URL value is to be URL encoded before being appended to the configured path. Set this value to true
if
content URLs should be URL encoded and false
if the URLs should not be encoded. If this value is not specified, then the content URL is not encoded.wc.resolveContentURL.encodeForPreview
- Indicates that preview URLs are to be resolved by URL encoding the content URL before being appending it to the configured path.
Set this value to true
if preview content URLs should be URL encoded and false
if the URLs should not be encoded.
If this value is not specified, then the value of wc.resolveContentURL.encode
is used.wc.resolveContentURL.getResourceURL
- Indicates that URLs that have a render type of RESOURCE are to be retrieved from the resolved content URL.
Set this value to true
to indicate that resource URLs are to be retrieved from the content URL.
If this value is not specified, then the resolved URL is treated as the resource URL.wc.resolveContentURL.getPreviewResourceURL
- Indicates that preview URLs that have a render type of RESOURCE are to be retrieved from the resolved content URL.
Set this value to true
to indicate that preview resource URLs are to be retrieved from the content URL.
If this value is not specified, then the value of wc.resolveContentURL.getResourceURL
is used.wc.resolveContentURL.getLinkURL
- Indicates that URLs that have a render type of LINK are to be retrieved from the resolved content URL.
Set this value to true
to indicate that link URLs are to be retrieved from the content URL.
If this value is not specified, then the resolved URL is treated as the link URL.wc.resolveContentURL.getPreviewLinkURL
- Indicates that preview URLs that have a render type of LINK are to be retrieved from the resolved content URL.
Set this value to true
to indicate that preview link URLs are to be retrieved from the content URL.
If this value is not specified, then the value of wc.resolveContentURL.getLinkURL
is used.defaultCommandClassName, NAME
Constructor and Description |
---|
ResolveContentURLCmdImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getResolvedMimeSubtype()
Get the resolved MIME content sub-type.
|
java.lang.String |
getResolvedMimeType()
Get the resolved MIME content type.
|
java.lang.String |
getResolvedRenderType()
Get the resolved render type.
|
java.lang.String |
getResolvedURL()
Get the resolved content URL.
|
void |
performExecute()
This method performs the business logic for this command.
|
void |
setIncludeHostName(boolean includeHostName)
Indicates that the content URL must be a fully qualified URL that includes the scheme,
host name and port.
|
void |
setInternal(boolean internal)
Indicates that the content URL is to be resolved for an internal
call from the WebSphere Commerce application server.
|
void |
setPreview(boolean preview)
Indicates that the content URL is to be resolved to the preview location.
|
void |
setStoreStaticAssets(boolean storeStaticAssets)
Indicates that the content URL is to be resolved for getting store static
assets from Content Management System.
|
void |
setUnresolvedURL(java.lang.String unresolvedURL)
Set the unresolved content URL.
|
void |
setUseCustomerTenantWCH(boolean useCustomerTenantWCH)
Indicates that the content URL is to be resolved will point to customer
tenant in WCH instead of default IBM tenant.
|
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
public void setUnresolvedURL(java.lang.String unresolvedURL)
setUnresolvedURL
in interface ResolveContentURLCmd
unresolvedUrl
- unresolved content URLResolveContentURLCmd.setUnresolvedURL(java.lang.String)
public void setStoreStaticAssets(boolean storeStaticAssets)
false
setStoreStaticAssets
in interface ResolveContentURLCmd
internal
- internal URL optionpublic void setUseCustomerTenantWCH(boolean useCustomerTenantWCH)
setUseCustomerTenantWCH
in interface ResolveContentURLCmd
public void setInternal(boolean internal)
false
setInternal
in interface ResolveContentURLCmd
internal
- internal URL optionpublic void setPreview(boolean preview)
false
.setPreview
in interface ResolveContentURLCmd
preview
- preview optionpublic void setIncludeHostName(boolean includeHostName)
internal
and preview
are set to false and the
wc.resolveContentURL.useRelativeURLs
configuration value is set to true
.
Set this property to true
to force the URLs to be
fully qualified with the configured host name. For example, if the URL is intended for inclusion in an e-mail, then
it must be fully qualified. The default is false
.setIncludeHostName
in interface ResolveContentURLCmd
includeHostName
- includeHostName optionpublic java.lang.String getResolvedURL()
getResolvedURL
in interface ResolveContentURLCmd
public java.lang.String getResolvedMimeType()
getResolvedMimeType
in interface ResolveContentURLCmd
public java.lang.String getResolvedMimeSubtype()
getResolvedMimeSubtype
in interface ResolveContentURLCmd
public java.lang.String getResolvedRenderType()
getResolvedRenderType
in interface ResolveContentURLCmd
public void performExecute() throws ECException
performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class AbstractECTargetableCommand
ECException
- An exception is thrown if there are errors while resolving the content URL