Installing the Contextual Image Delivery Java Web filter

The Web filter enables you to make use of the Contextual Image Delivery proxy, which forwards requests to the Contextual Image Delivery microservice.

Procedure

  1. Access your CID installation media and navigate to Content Delivery\roles\cid\proxy\.
  2. Access the config\ subfolder and merge the contents of the XML files with the corresponding XML files in the WEB-INF/classes/ folder of your Web application.
  3. Copy all files from the lib\ subfolder to your Web application library location, WEB-INF\lib\.
  4. If you want to run the image transformer against a customized URL, access the WEB-INF/classes/ folder of your Web application.
  5. Open cd_ambient_conf.xml for editing.
  6. In the <ExcludedPaths> section, add a subelement <Path>/CUSTOM/PATH</Path>, where /CUSTOM/PATH refers to the customized URL that you want the image transformer to run against.
  7. Save and close cd_ambient_conf.xml.
  8. In the WEB-INF/ folder of your Web application, open web.xml for editing.
  9. Create a new filter section with the following contents (you can also copy-paste this section from the file Content Delivery\roles\cid\proxy\deployment-descriptor\web.xml on the installation media):
    <filter>
      <filter-name>CID filter</filter-name>
      <filter-class>com.sdl.delivery.image.filter.ContextualImageFilter</filter-class>
    </filter>
  10. Create a new filter-mapping section with the following contents (you can also copy-paste this section from the file Content Delivery\roles\cid\proxy\deployment-descriptor\web.xml on the installation media):
    <filter-mapping>
      <filter-name>CID filter</filter-name>
      <url-pattern>/CUSTOM/PATH/*</url-pattern>
    </filter-mapping>

    where /CUSTOM/PATH refers to the customized URL that you want the image transformer proxy filter to run against. If you do not want to create a customized URL, set <url-pattern> to /cid/*.

  11. Save and close web.xml.
  12. If your Web application server is WebSphere, use the WebSphere administrative console to instruct your Web module classloaders to search for classes in the application first. To do so, set the Web module classloader mode to the value PARENT_LAST. For more information, refer to the following WebSphere documentation resource: Administer classloaders using the WebSphere administrative console.
  13. Start or restart the Web application.