Writing View Definitions

To write settings in a view definition, as specified in section 2.2.6, the client MUST open the folder that contains the view definition message. The client MUST save the view definition message in the folder that will display that view.

The client MUST call the RopGetContentsTable ROP ([MS-OXCROPS] section with the Associated flag to open the FAI contents table, as specified in [MS-OXCFOLD] section

If a view definition message already exists with the same PidTagViewDescriptorName property ([MS-OXPROPS] section 2.1056) in the same folder, the client MUST open that message and save the view definition there. The client MUST search for a matching row in the FAI contents table by using steps equivalent to the following, as specified in [MS-OXCTABL] section 2.2.2:

  1. Send the RopSetColumns ROP ([MS-OXCROPS] section with the following properties:

    • PidTagFolderId ([MS-OXCFOLD] section

    • PidTagMid ([MS-OXPROPS] section 2.801)

    • PidTagMessageClass ([MS-OXCMSG] section

    • PidTagViewDescriptorVersion ([MS-OXPROPS] section 2.1058)

    • PidTagViewDescriptorName ([MS-OXPROPS] section 2.1056)

  2. Send the RopSortTable ROP ([MS-OXCROPS] section with a sort order that includes the following properties:

    • PidTagMessageClass, followed by

    • PidTagViewDescriptorVersion

    • PidTagViewDescriptorName

  3. Send the RopFindRow ROP ([MS-OXCROPS] section, searching for a match on the PidTagMessageClass, PidTagViewDescriptorVersion, and PidTagViewDescriptorName properties, as specified in section 2.2.6.

  4. Send the RopQueryRows ROP ([MS-OXCROPS] section to retrieve a single row and get the PidTagFolderId and PidTagMid properties of the matching message from the row.

If the message does not exist, the client MUST create the message as specified in [MS-OXCMSG] section by sending the RopCreateMessage ROP ([MS-OXCROPS] section on the folder, and passing the Associated flag.

If the client found a matching row, it MUST send the RopOpenMessage ROP ([MS-OXCROPS] section to open the message, using the PidTagFolderId and PidTagMid properties from the table row and setting the ReadWrite flag in the OpenModeFlags field, as specified in [MS-OXCMSG] section

If the client found a matching message or created a new one, it MUST save the serialized settings streams on the properties specified in section 2.2.6 by using steps equivalent to the following, as specified in [MS-OXCPRPT] section 2.2.16:

  1. Send the RopOpenStream ROP ([MS-OXCROPS] section to open Stream object handles on the PidTagViewDescriptorBinary property (section and the PidTagViewDescriptorStrings property (section

  2. Write the serialized settings by using the RopWriteStream ROP ([MS-OXCROPS] section

  3. Persist the stream back to the property by sending the RopRelease ROP ([MS-OXCROPS] section

  4. Persist changes to the message by sending the RopSaveChangesMessage ROP ([MS-OXCROPS] section