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 ...
-
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-com
ffice
ffice#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\" < '" +
string.Format("{0:yyyy/MM/dd}", dDate.AddDays(1)) + " 00:00:00' " +
"ORDER BY \"urn:schemas:calendar:dtstart\" ASC" +
"</g:sql></g:searchrequest>";
-
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-com
ffice
ffice#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\" < '" +
> string.Format("{0:yyyy/MM/dd}", dDate.AddDays(1)) + " 00:00:00' " +
> "ORDER BY \"urn:schemas:calendar:dtstart\" ASC" +
> "</g:sql></g:searchrequest>";
>
-
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-com
ffice
ffice#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\" < '" +
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>";
-
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-com
ffice
ffice#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\" < '" +
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>";
Similar Threads
-
By Application Development in forum Commerce server
Replies: 1
Last Post: 02-08-2006, 06:03 PM
-
By Application Development in forum Microsoft Exchange
Replies: 6
Last Post: 06-07-2005, 03:26 PM
-
By Application Development in forum Microsoft Exchange
Replies: 4
Last Post: 01-09-2005, 06:45 PM
-
By Application Development in forum Microsoft Exchange
Replies: 0
Last Post: 12-23-2004, 11:12 AM
-
By Application Development in forum Microsoft Exchange
Replies: 4
Last Post: 07-14-2004, 09:42 PM