Resolving content URLs to an external system
When is integrated with an external content management system,
URLs for content in the external system can be resolved by using the
wcst:resolveContentURL
tag.
URL references or links to content in an external content management system might not be fully qualified, or resolved, URLs. These URLs can contain one or more tokens, such as the host name for the external system. These tokens can be resolved differently in an authoring environment than in a production environment.
The wcst:resolveContentURL
JSTL tag is used to
convert the URL to an external system. The tag converts the URL to a URL that is valid for the
current environment and for the context where the retrieved content is being used. If the specified
unresolved URL cannot be resolved as a content URL, then the specified URL path is returned
unchanged. This tag is used by the store pages where the retrieved content is being rendered. This
tag can also be used when a punch-out integration with an external content management system is not
enabled.
wcst:resolveContentURL
tag.url
- the URL of the content that is being resolved. The unresolved URL can be specified with this attribute or in the body of thewcst:resolveContentURL
tag.var
- the variable to which the resolved content URL is assigned. If this variable attribute is not specified, the resolved content URL is written to the currentJSPWriter
.mimeTypeVar
- the variable to which the resolved MIME content type is assigned.mimeSubtypeVar
- the variable to which the resolved MIME content subtype is assigned.renderTypeVar
- the variable to which the resolved render type is assigned.includeHostName
- indicates that the host name is to be included within the resolved URL. Specifytrue
to include the host name. The default value isfalse
.scope
- the scope for the variables that are specified with thevar
,mimeTypeVar
,mimeSubtypeVar
, andrenderTypeVar
attributes. The values for thescope
attribute can bepage
,request
,session
, andapplication
. The default value ispage
.
Any unresolved content URLs must have the http://[cmsHost]
prefix
token. These unresolved URLs are then resolved with the
com.ibm.commerce.content.commands.ResolveContentURLCmd
task command. The default
implementation of the task command replaces the token with a URL prefix value. This value is
determined by appending a configured path value to a configured host name. For more information
about configuring the default implementation of this task command, see com.ibm.commerce.content.commands.ResolveContentURLCmdImpl.
<wcst:resolveContentURL var="contentURL" url="${attachment.attachmentAsset[assetIndex].attachmentAssetPath}"/>
The
URLs are store with the following format, http://[cmsHost]/contentPath
. The
resolveContentURL
tag replaces the http:/[cmsHost]
prefix with the
host name and path for the external system that is configured in the STORECONF database table.