Search for keywords on Exchange Event through WebDav - Microsoft Exchange

This is a discussion on Search for keywords on Exchange Event through WebDav - Microsoft Exchange ; I need to add the ability of the following webdav query to be filtered by a keyword that is passed in from a webpage. Below is my code....what do I need to add to the WHERE clause to allow it ...

+ Reply to Thread
Results 1 to 4 of 4

Search for keywords on Exchange Event through WebDav

  1. Default Search for keywords on Exchange Event through WebDav

    I need to add the ability of the following webdav query to be filtered
    by a keyword that is passed in from a webpage. Below is my
    code....what do I need to add to the WHERE clause to allow it to filter
    the keywords using the incoming variable strCategory?

    string strRequest = "<?xml version=\"1.0\"?>" + "<g:searchrequest
    xmlns:g=\"DAV:\">" + "<g:sql>SELECT
    \"urn:schemas:calendar:location\",\"urn:schemas-microsoft-comfficeffice#Keywords\",\"urn:schemas:httpmail:subject\",\"urn:schemas:httpmail:textdescription\",\"urn:schemas:httpmail:hasattachment\",
    " + "\"urn:schemas:calendar:dtstart\", \"urn:schemas:calendar:dtend\",
    " + "\"urn:schemas:calendar:busystatus\",
    \"urn:schemas:calendar:instancetype\" " + "FROM Scope('SHALLOW
    TRAVERSAL OF \"" + strURL + "\"') " + "WHERE NOT
    \"urn:schemas:calendar:instancetype\" = 1 " + "AND \"DAV:contentclass\"
    = 'urn:content-classes:appointment' " + "AND
    \"urn:schemas:calendar:dtstart\" > '" + string.Format("{0:yyyy/MM/dd}",
    dDate) + " 00:00:00' " + "AND \"urn:schemas:calendar:dtend\" &lt; '" +
    string.Format("{0:yyyy/MM/dd}", dDate.AddDays(1)) + " 00:00:00' " +
    "ORDER BY \"urn:schemas:calendar:dtstart\" ASC" +
    "</g:sql></g:searchrequest>";


  2. Default Re: Search for keywords on Exchange Event through WebDav

    add a condition for the categories property and make sure you cast whatever
    you feed into the query as mv.string eg

    "AND ""http://schemas.microsoft.com/exchange/keywords-utf8"" = cast(""Cap1""
    as 'mv.string')"

    Cheers
    Glen

    <struveh@yahoo.com> wrote in message
    news:1138053537.625595.129060@g47g2000cwa.googlegroups.com...
    >I need to add the ability of the following webdav query to be filtered
    > by a keyword that is passed in from a webpage. Below is my
    > code....what do I need to add to the WHERE clause to allow it to filter
    > the keywords using the incoming variable strCategory?
    >
    > string strRequest = "<?xml version=\"1.0\"?>" + "<g:searchrequest
    > xmlns:g=\"DAV:\">" + "<g:sql>SELECT
    > \"urn:schemas:calendar:location\",\"urn:schemas-microsoft-comfficeffice#Keywords\",\"urn:schemas:httpmail:subject\",\"urn:schemas:httpmail:textdescription\",\"urn:schemas:httpmail:hasattachment\",
    > " + "\"urn:schemas:calendar:dtstart\", \"urn:schemas:calendar:dtend\",
    > " + "\"urn:schemas:calendar:busystatus\",
    > \"urn:schemas:calendar:instancetype\" " + "FROM Scope('SHALLOW
    > TRAVERSAL OF \"" + strURL + "\"') " + "WHERE NOT
    > \"urn:schemas:calendar:instancetype\" = 1 " + "AND \"DAV:contentclass\"
    > = 'urn:content-classes:appointment' " + "AND
    > \"urn:schemas:calendar:dtstart\" > '" + string.Format("{0:yyyy/MM/dd}",
    > dDate) + " 00:00:00' " + "AND \"urn:schemas:calendar:dtend\" &lt; '" +
    > string.Format("{0:yyyy/MM/dd}", dDate.AddDays(1)) + " 00:00:00' " +
    > "ORDER BY \"urn:schemas:calendar:dtstart\" ASC" +
    > "</g:sql></g:searchrequest>";
    >




  3. Default Re: Search for keywords on Exchange Event through WebDav

    I added the condition and my result set is now coming back empty. Is
    there something else that needs to be done to it? My query now looks
    like this:

    strRequest = "<?xml version=\"1.0\"?>" + "<g:searchrequest
    xmlns:g=\"DAV:\">" + "<g:sql>SELECT
    \"urn:schemas:calendar:location\",\"urn:schemas-microsoft-comfficeffice#Keywords\",\"urn:schemas:httpmail:subject\",\"urn:schemas:httpmail:textdescription\",\"urn:schemas:httpmail:hasattachment\",
    " + "\"urn:schemas:calendar:dtstart\", \"urn:schemas:calendar:dtend\",
    " + "\"urn:schemas:calendar:busystatus\",
    \"urn:schemas:calendar:instancetype\" " + "FROM Scope('SHALLOW
    TRAVERSAL OF \"" + strURL + "\"') " + "WHERE NOT
    \"urn:schemas:calendar:instancetype\" = 1 " + "AND \"DAV:contentclass\"
    = 'urn:content-classes:appointment' " + "AND
    \"urn:schemas:calendar:dtstart\" > '" + string.Format("{0:yyyy/MM/dd}",
    dDate) + " 00:00:00' " + "AND \"urn:schemas:calendar:dtend\" &lt; '" +
    string.Format("{0:yyyy/MM/dd}", dDate.AddDays(1)) + " 00:00:00' " +
    "AND \"http://schemas.microsoft.com/exchange/keywords-utf8\" =
    cast(\"Category\" as 'mv.string')" + "ORDER BY
    \"urn:schemas:calendar:dtstart\" ASC" + "</g:sql></g:searchrequest>";


  4. Default Re: Search for keywords on Exchange Event through WebDav

    I figured it out. For future reference of others the query string
    should look like this:

    strRequest = "<?xml version=\"1.0\"?>" + "<g:searchrequest
    xmlns:g=\"DAV:\">" + "<g:sql>SELECT
    \"urn:schemas:calendar:location\",\"urn:schemas-microsoft-comfficeffice#Keywords\",\"urn:schemas:httpmail:subject\",\"urn:schemas:httpmail:textdescription\",\"urn:schemas:httpmail:hasattachment\",
    " + "\"urn:schemas:calendar:dtstart\", \"urn:schemas:calendar:dtend\",
    " + "\"urn:schemas:calendar:busystatus\",
    \"urn:schemas:calendar:instancetype\" " + "FROM Scope('SHALLOW
    TRAVERSAL OF \"" + strURL + "\"') " + "WHERE NOT
    \"urn:schemas:calendar:instancetype\" = 1 " + "AND \"DAV:contentclass\"
    = 'urn:content-classes:appointment' " + "AND
    \"urn:schemas:calendar:dtstart\" > '" + string.Format("{0:yyyy/MM/dd}",
    dDate) + " 00:00:00' " + "AND \"urn:schemas:calendar:dtend\" &lt; '" +
    string.Format("{0:yyyy/MM/dd}", dDate.AddDays(1)) + " 00:00:00' " +
    "AND \"http://schemas.microsoft.com/exchange/keywords-utf8\" = cast("
    + Category + " as 'mv.string')" + "ORDER BY
    \"urn:schemas:calendar:dtstart\" ASC" + "</g:sql></g:searchrequest>";


+ Reply to Thread

Similar Threads

  1. Search with keywords
    By Application Development in forum Commerce server
    Replies: 1
    Last Post: 02-08-2006, 06:03 PM
  2. Exchange 2000/2003 Event Sink Registration via WebDAV
    By Application Development in forum Microsoft Exchange
    Replies: 6
    Last Post: 06-07-2005, 03:26 PM
  3. Help, PLEASE: Getting appointment keywords via WebDAV SEARCH
    By Application Development in forum Microsoft Exchange
    Replies: 4
    Last Post: 01-09-2005, 06:45 PM
  4. Querying appointment category (keywords) via webdav
    By Application Development in forum Microsoft Exchange
    Replies: 0
    Last Post: 12-23-2004, 11:12 AM
  5. Exchange WebDav Full-text search doesn't calculate Rank correctly
    By Application Development in forum Microsoft Exchange
    Replies: 4
    Last Post: 07-14-2004, 09:42 PM