3.1.4.1.2 Creating the To-Do Folder
To complete creation of the To-Do folder, a client SHOULD<5> set the search criteria for the To-Do folder. The search criteria are composed of restriction structures, as specified in [MS-OXCDATA] section 2.12. The search criteria are set by using the Folder Object Protocol, as specified in [MS-OXCFOLD], such that the Top of Personal Folders folder is the only container included in the search and the search applies a RES_AND restriction with the following two subclauses.
First, a RES_AND restriction with the following three subclauses:
A RES_NOT restriction with a RES_CONTENT subclause that compares the PidTagMessageClass property ([MS-OXCMSG] section 2.2.1.3) to the string value "IPM.appointment". The RES_CONTENT subclause has the FuzzyLevelLow field set to FL_PREFIX and the FuzzyLevelHigh field set to FL_IGNORECASE.
A RES_NOT restriction with a RES_CONTENT subclause that compares the PidTagMessageClass property to the string value "IPM.Activity". The RES_CONTENT subclause has the FuzzyLevelLow field set to FL_PREFIX and the FuzzyLevelHigh field set to FL_IGNORECASE.
A RES_NOT restriction with a RES_CONTENT subclause that compares the PidTagMessageClass property to the string value "IPM.StickyNote". The RES_CONTENT subclause has the FuzzyLevelLow field set to FL_PREFIX and the FuzzyLevelHigh field set to FL_IGNORECASE.
Second, a RES_AND restriction with the following two subclauses:
A RES_AND restriction with any of the following subclauses. Each of these subclauses is included in the RES_AND restriction only if the special folder exists within the message store. For example, if only the Drafts folder exists, then only the RES_PROPERTY subclause for the Drafts folder is included in the RES_AND restriction:
A RES_PROPERTY restriction with a relational operator value of RELOP_NE, comparing the value of the PidTagParentEntryId property ([MS-OXCFOLD] section 2.2.2.2.1.7) with the FID ([MS-OXCDATA] section 2.2.1.1)/MID ([MS-OXCDATA] section 2.2.1.2) pair of the Deleted Items folder.
A RES_PROPERTY restriction with a relational operator value of RELOP_NE, comparing the value of the PidTagParentEntryId property with the FID/MID pair of the Junk E-mail folder.
A RES_PROPERTY restriction with a relational operator value of RELOP_NE, comparing the value of the PidTagParentEntryId property with the FID/MID pair of the Drafts folder.
A RES_PROPERTY restriction with a relational operator value of RELOP_NE, comparing the value of the PidTagParentEntryId property with the FID/MID pair of the Outbox folder.
A RES_PROPERTY restriction with a relational operator value of RELOP_NE, comparing the value of the PidTagParentEntryId property with the FID/MID pair of the Conflicts folder.
A RES_PROPERTY restriction with a relational operator value of RELOP_NE, comparing the value of the PidTagParentEntryId property with the FID/MID pair of the Local Failures folder.
A RES_PROPERTY restriction with a relational operator value of RELOP_NE, comparing the value of the PidTagParentEntryId property with the FID/MID pair of the Server Failures folder.
A RES_PROPERTY restriction with a relational operator value of RELOP_NE, comparing the value of the PidTagParentEntryId property with the FID/MID pair of the Sync Issues folder.
A RES_OR restriction with the following four subclauses:
A RES_AND restriction with the following two subclauses:
A RES_OR restriction with the following two subclauses:
A RES_CONTENT restriction with the FuzzyLevelLow field set to FL_FULLSTRING and the FuzzyLevelHigh field set to FL_IGNORECASE comparing the value of the PidTagMessageClass property to the string value "IPM.Task".
A RES_CONTENT restriction with the FuzzyLevelLow field set to FL_PREFIX and the FuzzyLevelHigh field set to FL_IGNORECASE comparing the value of the PidTagMessageClass property to the string value "IPM.Task".
A RES_NOT restriction with a RES_AND subclause. The RES_AND subclause has the following two subclauses:
A RES_PROPERTY restriction with a relational operator value of RELOP_EQ, comparing the value of the PidLidTaskState ([MS-OXPROPS] section 2.334) property to the LONG ([MS-DTYP]) value 2.
A RES_PROPERTY restriction with a relational operator value of RELOP_NE, comparing the value of the PidLidTaskAccepted property ([MS-OXOTASK] section 2.2.2.2.7) to the binary value 1.
A RES_AND restriction with the following two subclauses:
A RES_EXIST restriction that specifies the PidTagFollowupIcon property ([MS-OXOFLAG] section 2.2.1.2).
A RES_PROPERTY restriction with a relational operator value of RELOP_GT, comparing the value of the PidTagFollowupIcon property to the LONG value 0 (zero).
A RES_AND restriction with the following two subclauses:
A RES_EXIST restriction that specifies the PidTagToDoItemFlags property ([MS-OXOFLAG] section 2.2.1.6).
A RES_BITMASK restriction with the BitMapRelOp field set to BMR_NEZ to compare the value of the PidTagToDoItemFlags property to the ULONG ([MS-DTYP]) value 0x00000001.
A RES_OR restriction with the following two subclauses:
A RES_AND restriction with the following three subclauses:
A RES_OR restriction with the following two subclauses:
A RES_NOT restriction with a RES_EXIST subclause that specifies the PidTagFollowupIcon property.
A RES_PROPERTY restriction with a relational operator value of RELOP_EQ, comparing the value of the PidTagFollowupIcon property to the LONG value 0 (zero).
A RES_EXIST restriction that specifies the PidTagFlagStatus property ([MS-OXOFLAG] section 2.2.1.1).
A RES_PROPERTY restriction, with a relational operator value of RELOP_EQ, comparing the value of the PidTagFlagStatus property to the LONG value 1.
A RES_AND restriction with the following two subclauses:
A RES_EXIST restriction that specifies the PidLidTaskStatus property ([MS-OXOTASK] section 2.2.2.2.2).
A RES_PROPERTY restriction with a relational operator value of RELOP_EQ, comparing the value of the PidLidTaskStatus property to the ULONG value 2.
The search SHOULD provide the client with the information when requested, include child folders, and run without content indexing.