Show TOC

 Content FiltersLocate this document in the navigation structure


You use content filters to transform the content, layout, or format of documents when they are requested for display. For example, an XML document can be transformed into an HTML file for display in the browser or into a WML file for display on a handheld device. Similarly, the content of a file can be presented in different formats to serve different purposes and audiences. The same information can be distributed as a news column, a business report, or a text file.



In general, content filters that execute formatting and layout transformations use the publishing pipeline . However, you can have other content filters that do not use the pipeline, for example, a content filter that adds a copyright statement to documents.

The content filters that are provided in CM are read filters, that is, they transform the content of resources from a storage format to a presentation format for display in the browser. However, the publishing pipeline can also work in the opposite direction and apply write filters to data input by the user to store that data in a different format.


  • The publishing pipeline is configured appropriately.
  • XSL and CSS stylesheets that are to be applied by the content filters are available. Depending on the layout and formatting requirements, you can use predefined stylesheets that are provided by CM. You can modify these stylesheets or create new ones.

When a resource is requested for display, CM checks if there are any content filters registered for the resource type in question. If so, the resource is passed to a filter manager that is responsible for initiating the transformation process and applying the correct filter.


Filter Managers

CM currently provides three filter managers that manage different types of document transformations:

  • The XSLT filter manager transforms an XML document according to instructions provided in an XSL stylesheet that is specified in a filter definition. The output of this transformation can be fed into a formatter program that renders the document in the desired display format. The formatter program to be used is also specified in the filter definition.This filter manager can use various stylesheets and formatters to render XML documents in the following display formats: HTML, XHTML, WML, PLAIN, VRML, and SVG-XML.
  • The HMTL filter manager transforms the layout and style of an HTML document by applying a cascading stylesheet (CSS) to it. The stylesheet must be specified in a filter definition. The filter manager can also provide a base tag and a URL handler.
  • The HTML stylesheet filter manager is an HTML filter manager without base tag and URL handler properties.

The following table lists the parameters of content filters that can be specified during the configuration. Depending on the filter manager class, some parameters are not relevant.

Content Filter Parameters

Parameter Filter Manager Description



Name of the filter.



Specification of the file name extensions of the resources to which the filter is to be applied.

If you leave this input field empty, the filter is applied to all extensions.

MIME Types


MIME types of the resources to which the filter is to be applied.

If you leave this input field empty, the filter is applied to all MIME types.



Specification of a path or path pattern to whose content the filter is to be applied.

If you leave this input field empty, the filter is applied to all paths.

For more information, see Using Placeholders .

Resource Type


Resources types on which the filter is to be applied.



Selection of repositories whose content is to be filtered.



Specification of filter priority.

If multiple filters are applicable to a resource, the priority determines the order in which they are applied. A value of 1 indicates the highest and a value of 99 indicates the lowest priority.



Specification of the stylesheet to be used by the filter.

Base Tag


Specification of an HTML base tag that is inserted into the HTML output file.

A base tag specifies the base URL from which all relative links in the document are derived.

Base URL


Specification of a base URL that is used in combination with the URL Handler Classparameter.

The URL handler can use the base URL to modify documents in an HTML document.

URL Handler Class


Specification of the Java class implemented by the URL handler used to change the URLs in an HTML document.

For example, such a handler could be written to replace relative URLs with absolute URLs in an HTML file. The URL handler must implement the com.sapportals.wcm.service.pipeline.processor.html.IHtmlUrlHandler interface.

Mime Type


Specification of the MIME type of the output document.



Name of the formatter program to be used for generating the output format rendered in the browser.

For more information on formatter programs, see XSLT Filters .



The Extensions, Mime Types and Path parameters are used together. Resources have to correspond to all three parameters in order for the filter to be applied.

The parameters only support one specification. If you want to apply a filter to more than one MIME type, you have to create more than one filter.