Use the atg-rest-property-filters control parameter to apply property filtering to individual REST Web Services requests. The value of the control parameter uses the same format as the rest-filtering element in the /atg/rest/filtering/filteringConfiguration.xml configuration file. See Default Filtering.

If you include the atg-rest-property-filters control parameter in a REST request, the configurations that you have made in the filteringConfiguration.xml file will not apply at all. The REST interface considers only the per-request filter.

If you include the atg-rest-property-filters control parameter in a REST request, all properties are hidden by default. You must explicitly set the hidden attribute to false for each property that you wish to return.

Use JSON markup for the atg-rest-property-filters value. The components of the JSON value are shown below.

{ 
  "<componentName>": 
  [
    {
      "item-descriptor": "<itemDescriptorName>",
      "depth": <depthInt>,
      "properties": 
      { 
        "<propertyName>": 
        {
          "hidden": <boolean>,
          "writable": <boolean>,
          "target": "<target-dot-notation>",
          "component": "<component-path>",
          "property-customizer": "<customizer-class-name>" 
        }, ...
      }, ...
    }, ...
  ], ...
}

For example, the following atg-rest-property-filters control parameter value specifies that only the wishlist property will be returned for user repository items. It also specifies that only the eventType and published values will be returned for the wishlist property.

{
  "/atg/userprofiling/ProfileAdapterRepository": [
    {
      "item-descriptor": "user",
      "depth": 0,
      "properties": {
        "wishlist": {
          
        }
      }
    }
  ],
  "/atg/commerce/gifts/Giftlists": [
    {
      "item-descriptor": "gift-list",
      "depth": 1,
      "properties": {
        "eventType": {
          
        },
        "published": {
          
        }
      }
    }
  ]
}

The REST Web Service server will check several configuration parameters before accepting filters supplied with the atg-rest-property-filters control parameter. These configuration properties control whether certain types of per-request filtering will be accepted. There are individual configuration properties for requests that will return JSON and XML output. See information about the following properties in /atg/rest/output/JSONOutputCustomizer and /atg/rest/output/XMLOutputCustomizer.

  • enablePerRequestFilters

  • enablePerRequestComponentFilters

  • enablePerRequestRepositoryFilters

  • enablePerRequestClassFilters