2.2.2.3.2 AllOrNone (BodyPreference)

The AllOrNone element is an optional child element of the BodyPreference element (section 2.2.2.12). A command request MUST have a maximum of 1 AllOrNone element per BodyPreference element. If the AllOrNone element is not included in the request, then the truncated or non-truncated content is searched, synchronized, or retrieved as if the value was set to 0 (FALSE). The AllOrNone element MUST NOT be used in command responses.

This element MUST be ignored if the TruncationSize element is not included.

A client can include multiple BodyPreference elements in a command request with different values for the Type element (section 2.2.2.41.4). By default, the server returns the data truncated to the size requested by TruncationSize for the Type element that matches the native storage format of the item's Body element (section 2.2.2.9). But, if the client also includes the AllOrNone element with a value of 1 (TRUE) along with the TruncationSize element, it is instructing the server not to return a truncated response for that type when the size (in bytes) of the available data exceeds the value of the TruncationSize element. For example, a client can use these two elements to signify that it cannot process partial Rich Text Format (RTF) data (a Type element value of 3). In this case, if the client has specified multiple BodyPreference elements, the server selects the next BodyPreference element that will return the maximum amount of body text to the client. Assume that the client specifies two BodyPreference elements.

 <airsyncbase:BodyPreference>
      <airsyncbase:Type>2</airsyncbase:Type>
      <airsyncbase:AllOrNone>1</airsyncbase:AllOrNone>
      <airsyncbase:TruncationSize>50</airsyncbase:TruncationSize>
 </airsyncbase:BodyPreference>
  
 <airsyncbase:BodyPreference>
      <airsyncbase:Type>1</airsyncbase:Type>
      <airsyncbase:TruncationSize>50</airsyncbase:TruncationSize>
 </airsyncbase:BodyPreference>

The first BodyPreference element requests an HTML body, but only if the body size is less than 50 bytes. The second requests an element in plain text format. If the client requests a text body whose native format is HTML, and the size of the data exceeds 50 bytes, the server converts the body to plain text and returns the first 50 bytes of plain text data.

Protocol Versions

The following table specifies the protocol versions that support this element. The client indicates the protocol version being used by setting either the MS-ASProtocolVersion header, as specified in [MS-ASHTTP] section 2.2.1.1.2.6, or the Protocol version field, as specified in [MS-ASHTTP] section 2.2.1.1.1.1, in the request.

Protocol version

Element support

2.5

12.0

Yes

12.1

Yes

14.0

Yes

14.1

Yes

16.0

Yes

16.1

Yes