com.ibm.commerce.content.commands

Class ResolveContentURLCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, ResolveContentURLCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    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.
    See Also:
    Serialized Form
    • Constructor Detail

      • ResolveContentURLCmdImpl

        public ResolveContentURLCmdImpl()
    • Method Detail

      • setStoreStaticAssets

        public void setStoreStaticAssets(boolean storeStaticAssets)
        Indicates that the content URL is to be resolved for getting store static assets from Content Management System. If true, the URL will be constructed by using CMS_STATIC_CONTENT_HOST_KEY and CMS_PREVIEW_PATH_KEY. Set to false if the URL is intended for other usage. The default is false
        Specified by:
        setStoreStaticAssets in interface ResolveContentURLCmd
        Parameters:
        internal - internal URL option
      • setUseCustomerTenantWCH

        public 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.
        Specified by:
        setUseCustomerTenantWCH in interface ResolveContentURLCmd
      • setInternal

        public void setInternal(boolean internal)
        Indicates that the content URL is to be resolved for an internal call from the WebSphere Commerce application server. Set to false if the URL is intended for use within the browser. The default is false
        Specified by:
        setInternal in interface ResolveContentURLCmd
        Parameters:
        internal - internal URL option
      • setPreview

        public void setPreview(boolean preview)
        Indicates that the content URL is to be resolved to the preview location. Set to false for production URLs. The default is false.
        Specified by:
        setPreview in interface ResolveContentURLCmd
        Parameters:
        preview - preview option
      • setIncludeHostName

        public void setIncludeHostName(boolean includeHostName)
        Indicates that the content URL must be a fully qualified URL that includes the scheme, host name and port. The command will prepare relative URLs if 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.
        Specified by:
        setIncludeHostName in interface ResolveContentURLCmd
        Parameters:
        includeHostName - includeHostName option
      • getResolvedURL

        public java.lang.String getResolvedURL()
        Get the resolved content URL. This value is available after the command is executed.
        Specified by:
        getResolvedURL in interface ResolveContentURLCmd
        Returns:
        the resolved content URL
      • getResolvedMimeType

        public java.lang.String getResolvedMimeType()
        Get the resolved MIME content type. This value is available after the command is executed.
        Specified by:
        getResolvedMimeType in interface ResolveContentURLCmd
        Returns:
        the resolved MIME content type
      • getResolvedMimeSubtype

        public java.lang.String getResolvedMimeSubtype()
        Get the resolved MIME content sub-type. This value is available after the command is executed.
        Specified by:
        getResolvedMimeSubtype in interface ResolveContentURLCmd
        Returns:
        the resolved MIME content sub-type
      • getResolvedRenderType

        public java.lang.String getResolvedRenderType()
        Get the resolved render type. This value is available after the command is executed. The value can be CONTENT, LINK or RESOURCE. A value of CONTENT indicates that the content is an HTML fragment that is to be embedded in an HTML page. A value of LINK indicates that the content is a stand alone HTML page and that the content URL is to be rendered as a link to that page using the HTML anchor (A) tag. A value of RESOURCE indicates that the content is an image or other type of file and that the content URL is to be rendered according to the MIME type.
        Specified by:
        getResolvedRenderType in interface ResolveContentURLCmd
        Returns:
        the resolved render type