|
|
|
date: 23 Jan 2006 13:58:57 -0800,
group: microsoft.public.exchange2000.development
back
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:office:office#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>";
date: 23 Jan 2006 13:58:57 -0800
author: unknown
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
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:office:office#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>";
>
date: Tue, 24 Jan 2006 11:00:54 +1100
author: Glen Scales [MVP]
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:office:office#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>";
date: 24 Jan 2006 07:28:02 -0800
author: Heidi
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:office:office#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>";
date: 24 Jan 2006 09:13:01 -0800
author: Heidi
|
|