The property element identifies which properties of repository items or beans should be included in the response. By default, only properties that are explicitly listed are included.

The property element contains the following attributes:

Attribute

Description

name

The name that the property will use when sending the response.

target

The name of the property that is being read from the Java servlet bean or repository. If no target is supplied, the value of the name attribute will be used instead.

property-customizer

The Nucleus path of a component that implements the atg.service.filter.bean.PropertyCustomizer interface. Use these attributes to transform properties if needed.

hidden

If this property is set to true, the property will be excluded from the response. This property is set to false by default.

filter-id

Applies a filter by ID that matches the class of the repository item type of the property value. Note that the filter-id of a bean filter property will override the filter-id attribute of an actor output element. Objects that are properties of this element use this filter-id. For example, if a filter-id is applied to the user repository-item, the same filter-id will be applied to the contact repository-item when filtering the homeAddress property of the user.

Working with Property Customizers

You can transform properties using the property-customizer attribute. For example you could mask a credit card number by creating a maskedCreditCardNumber property:

<property name="maskedCreditCardNumber" property-customizer="/atg/rest
    /filtering/customizers/CreditCardNumberPropertyCustomizer"/>

You can also retrieve other properties using this syntax.

If the target attribute does not start with a $, it will be evaluated as a DynamicBean.getPropertyValue() if the object is a DynamicBean. Both item-descriptor and bean elements can use this syntax. Note that the properties that are returned by default can be added to using xml-combine.

You can use the RepositoryItemPropertyCustomzier to retrieve repository items or properties of a repository item in a bean filter by looking up the item by ID. The following example retrieves a specific property by specifying the property attribute:

<property name="total" property-customizer="atg/dynamo/service/filter/bean/
    RepositoryPropertyCustomizer" target="properties.orderId">
  <attribute name="repository" value="/atg/commerce/order/OrderRepository" />
  <attribute name="item-descriptor" value="order" />
  <attribute name="property" value="priceInfo.amount" />
</property>

To retrieve the entire repository item, do not specify a property attribute:

<property name="order" property-customizer="atg/dynamo/service/filter/bean/
    RepositoryPropertyCustomizer" target="properties.orderId">
  <attribute name="repository" value="/atg/commerce/order/OrderRepository" />
  <attribute name="item-descriptor" value="order" />
</property>

The DottedPropertyNamePropertyCustomizer can be used when you are working with properties that have a dot in their name, such as profile.firstName. For example:

<property name="firstName" property-customizer="/atg/dynamo/service/filter/bean/
    DotterPropertyNamePropertyCustomizer"
    target="properties.'profile.firstname'" />

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices