Filtering the content model
By applying filters to the content model, we can exclude parts of the page hierarchy from the content model. Filtering is performed based on request data and metadata assigned to the pages.There are two ways we can filter the content model:
- We can filter on the device classpecified in the HTTP request. This filtering can be used to provide a unified content model for both desktop and mobile users. For pages that are specific to mobile users, you assign only the device class for the mobile client, such as a smartphone or tablet. These pages are then visible only to users who access the portal with one of the specified devices.
- We can filter on the markup languagthat pages support. This approach is useful when building mobile websites for older devices that use markup languages like WML or Compact HTML
When filtering for mobile devices that support HTML, filter only by device class.
- Enable content model filtering in the portal. By default, filtering is not enabled. This step must be done only once.
- Log in to the WAS admin console.
- Click Resources > Resource Environment > Resource Environment Providers.
- Click WP ConfigService.
- Under Additional Properties, click Custom Properties.
- Click New, and enter the appropriate property name, depending on the type of filterinto perform.
- Filter by device class
- Add content.topology.filter.deviceclass, and set the string value to the true.
- Filter by markup language
- Add content.topology.filter.markup, and set the string value to the true.
- Save the changes, and restart the server.
Parent: Model SPI overview
Related:
Sub packages of the Model SPI
Obtaining a model from the portal
Obtaining the object ID for a page or portlet
Model SPI samples
Remote Model SPI REST service
Related:
Set service configuration properties