|
|
|
date: Thu, 15 Sep 2005 17:55:57 +0200,
group: microsoft.public.exchange2000.development
back
Re: urn:schemas:calendar:uid
I think two different algorithms are use and none of these are documented in
anyway. I noticed a third format that seems to get used with a CD0 prefix it
doesn't appear that this property is a very reliable way of identifying a
calendar item. There are a couple of named mapi properties that you should
be able to use that do the same job and appear to be more consistant this
property also seems to get used as the urn:schemas:calendar:uid sometimes.
http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x23
and
http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x3
is what MAPI uses to unique identify an appoinment i believe 0x3 is used for
exceptions so you should be able to use the first to query a calendar to
indentify and appoinment by an ID you retrieved from a copy. These are
binary properties so you first need to convert the property to a hex string
then you can cast this in you query eg
set orgrec = createobject("ADODB.Record")
orgrec.open
"file://./backofficestorage/domain.com/MBX/user1/Calendar/item.EML"
apptid =
Octenttohex(orgrec.fields("http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x23").value)
set rec = createobject("ADODB.Record")
set rs = createobject("ADODB.Recordset")
CalendarURL = "file://./backofficestorage/domain.com/MBX/user2/calendar/"
Rec.Open CalendarURL
Set Rs.ActiveConnection = Rec.ActiveConnection
Rs.Source = "SELECT ""DAV:href"", " & _
" ""urn:schemas:calendar:busystatus"", " & _
" ""urn:schemas:calendar:instancetype"", " & _
" ""urn:schemas:calendar:dtstart"", " & _
" ""urn:schemas:calendar:dtend"", " & _
" ""http://schemas.microsoft.com/mapi/proptag/0x0FFF0102"", " & _
"
""http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x23""
" & _
"FROM scope('shallow traversal of """ & CalendarURL & """') " & _
"WHERE (""urn:schemas:calendar:dtstart"" >= CAST(""2004-12-25T08:00:00Z"" as
'dateTime')) " & _
"AND (""urn:schemas:calendar:dtend"" <= CAST(""2005-12-29T08:00:00Z"" as
'dateTime'))" & _
"AND
(""http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x23""
= CAST(""" & apptid & """ as 'bin.hex'))" & _
"AND (""urn:schemas:calendar:instancetype"" = 0)"
Rs.Open
If Not Rs.EOF Then
Do Until Rs.EOF
ItemURL = Rs.Fields("DAV:HREF").Value
wscript.echo ItemURL
wscript.echo
Octenttohex(rs.fields("http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x23").value)
rs.movenext
loop
end if
Function Octenttohex(OctenArry)
ReDim aOut(UBound(OctenArry))
For i = 1 to UBound(OctenArry) + 1
if len(hex(ascb(midb(OctenArry,i,1)))) = 1 then
aOut(i-1) = "0" & hex(ascb(midb(OctenArry,i,1)))
else
aOut(i-1) = hex(ascb(midb(OctenArry,i,1)))
end if
Next
Octenttohex = join(aOUt,"")
End Function
Cheers
Glen
"John" wrote in message
news:9B44782D-5CFC-43B2-97C0-A2CADB264514@microsoft.com...
> Glen,
> Thanks for the answer.
> Are the two formats convertable in any way? Can I generate the vcal type
> uid
> from the bin-hex or is it a different property depending on the creator.
>
> ps
> your blog is dynamite!
>
> John
>
>
>
>
>
>
> "Glen Scales [MVP]" wrote:
>
>> The two different formats come from how you have created the appointment,
>> if
>> you create an appointment though Outlook via MAPI then you get that large
>> Binary-Hex String. If you create the appointment though OWA you get a
>> GUID
>> eg {9318FD5D-B1FB-4424-A948-4EAB256B796E}. These ID's makeup the vcal-UID
>> and should not change after the appointment is created even if it is
>> updated via either Interface.
>>
>> Cheers
>> Glen
>>
>> "Sorry" wrote in message
>> news:%23K2TuDluFHA.1560@TK2MSFTNGP09.phx.gbl...
>> > Hello Michael,
>> >
>> > I am so happy that you have an answer maybe!
>> >
>> > My question was not correct, it is in fact a select query on a
>> > ExOLEDB.DataSource (file url) which gives me
>> > {9318FD5D-B1FB-4424-A948-4EAB256B796E}
>> >
>> > thanks
>> > John
>> >
>> >
>> > "Michael" schreef in bericht
>> > news:ehxtrPhuFHA.3608@TK2MSFTNGP10.phx.gbl...
>> >> How you retrieve this value for WebDAV? With SEARCH method or PROPFIND
>> >> method?
>> >>
>> >> Michael
>> >> -------------------------------
>> >> If you need WebDAV API for Exchange server,
>> >> use our component WebDAV .NET for Exchange.
>> >> Check out http://www.independentsoft.com
>> >>
>> >>
>> >>
>> >> "Sorry" wrote in message
>> >> news:OK0G33guFHA.4032@TK2MSFTNGP15.phx.gbl...
>> >>>
>> >>> from CDO the urn:schemas:calendar:uid property reads as
>> >>> 040000008200E00074C5B7101A82E00800000000A0094A171FB9C50100000000000000001000000082A0DA3955849E49BA871CAE74CAE50D
>> >>>
>> >>> from a webdav query, urn:schemas:calendar:uid reads as
>> >>> {9318FD5D-B1FB-4424-A948-4EAB256B796E}
>> >>>
>> >>> Is there a way to convert one value format to the other or does
>> >>> anybody
>> >>> know
>> >>> what the formats are?
>> >>>
>> >>> thanks!
>> >>>
>> >>>
>> >
>> >
>>
>>
>>
date: Mon, 19 Sep 2005 14:46:18 +1000
author: Glen Scales [MVP]
Re: urn:schemas:calendar:uid
Cool! Thanks.
"Glen Scales [MVP]" schreef in bericht
news:%23hwBYUNvFHA.2948@TK2MSFTNGP15.phx.gbl...
>I think two different algorithms are use and none of these are documented
>in anyway. I noticed a third format that seems to get used with a CD0
>prefix it doesn't appear that this property is a very reliable way of
>identifying a calendar item. There are a couple of named mapi properties
>that you should be able to use that do the same job and appear to be more
>consistant this property also seems to get used as the
>urn:schemas:calendar:uid sometimes.
>
> http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x23
> and
> http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x3
> is what MAPI uses to unique identify an appoinment i believe 0x3 is used
> for exceptions so you should be able to use the first to query a calendar
> to indentify and appoinment by an ID you retrieved from a copy. These are
> binary properties so you first need to convert the property to a hex
> string then you can cast this in you query eg
>
> set orgrec = createobject("ADODB.Record")
> orgrec.open
> "file://./backofficestorage/domain.com/MBX/user1/Calendar/item.EML"
> apptid =
> Octenttohex(orgrec.fields("http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x23").value)
>
> set rec = createobject("ADODB.Record")
> set rs = createobject("ADODB.Recordset")
> CalendarURL = "file://./backofficestorage/domain.com/MBX/user2/calendar/"
> Rec.Open CalendarURL
> Set Rs.ActiveConnection = Rec.ActiveConnection
> Rs.Source = "SELECT ""DAV:href"", " & _
> " ""urn:schemas:calendar:busystatus"", " & _
> " ""urn:schemas:calendar:instancetype"", " & _
> " ""urn:schemas:calendar:dtstart"", " & _
> " ""urn:schemas:calendar:dtend"", " & _
> " ""http://schemas.microsoft.com/mapi/proptag/0x0FFF0102"", " & _
> "
> ""http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x23""
> " & _
> "FROM scope('shallow traversal of """ & CalendarURL & """') " & _
> "WHERE (""urn:schemas:calendar:dtstart"" >= CAST(""2004-12-25T08:00:00Z""
> as 'dateTime')) " & _
> "AND (""urn:schemas:calendar:dtend"" <= CAST(""2005-12-29T08:00:00Z"" as
> 'dateTime'))" & _
> "AND
> (""http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x23""
> = CAST(""" & apptid & """ as 'bin.hex'))" & _
> "AND (""urn:schemas:calendar:instancetype"" = 0)"
> Rs.Open
> If Not Rs.EOF Then
> Do Until Rs.EOF
> ItemURL = Rs.Fields("DAV:HREF").Value
> wscript.echo ItemURL
> wscript.echo
> Octenttohex(rs.fields("http://schemas.microsoft.com/mapi/id/{6ED8DA90-450B-101B-98DA-00AA003F1305}/0x23").value)
> rs.movenext
> loop
> end if
>
>
> Function Octenttohex(OctenArry)
> ReDim aOut(UBound(OctenArry))
> For i = 1 to UBound(OctenArry) + 1
> if len(hex(ascb(midb(OctenArry,i,1)))) = 1 then
> aOut(i-1) = "0" & hex(ascb(midb(OctenArry,i,1)))
> else
> aOut(i-1) = hex(ascb(midb(OctenArry,i,1)))
> end if
> Next
> Octenttohex = join(aOUt,"")
> End Function
>
> Cheers
> Glen
>
> "John" wrote in message
> news:9B44782D-5CFC-43B2-97C0-A2CADB264514@microsoft.com...
>> Glen,
>> Thanks for the answer.
>> Are the two formats convertable in any way? Can I generate the vcal type
>> uid
>> from the bin-hex or is it a different property depending on the creator.
>>
>> ps
>> your blog is dynamite!
>>
>> John
>>
>>
>>
>>
>>
>>
>> "Glen Scales [MVP]" wrote:
>>
>>> The two different formats come from how you have created the
>>> appointment, if
>>> you create an appointment though Outlook via MAPI then you get that
>>> large
>>> Binary-Hex String. If you create the appointment though OWA you get a
>>> GUID
>>> eg {9318FD5D-B1FB-4424-A948-4EAB256B796E}. These ID's makeup the
>>> vcal-UID
>>> and should not change after the appointment is created even if it is
>>> updated via either Interface.
>>>
>>> Cheers
>>> Glen
>>>
>>> "Sorry" wrote in message
>>> news:%23K2TuDluFHA.1560@TK2MSFTNGP09.phx.gbl...
>>> > Hello Michael,
>>> >
>>> > I am so happy that you have an answer maybe!
>>> >
>>> > My question was not correct, it is in fact a select query on a
>>> > ExOLEDB.DataSource (file url) which gives me
>>> > {9318FD5D-B1FB-4424-A948-4EAB256B796E}
>>> >
>>> > thanks
>>> > John
>>> >
>>> >
>>> > "Michael" schreef in bericht
>>> > news:ehxtrPhuFHA.3608@TK2MSFTNGP10.phx.gbl...
>>> >> How you retrieve this value for WebDAV? With SEARCH method or
>>> >> PROPFIND
>>> >> method?
>>> >>
>>> >> Michael
>>> >> -------------------------------
>>> >> If you need WebDAV API for Exchange server,
>>> >> use our component WebDAV .NET for Exchange.
>>> >> Check out http://www.independentsoft.com
>>> >>
>>> >>
>>> >>
>>> >> "Sorry" wrote in message
>>> >> news:OK0G33guFHA.4032@TK2MSFTNGP15.phx.gbl...
>>> >>>
>>> >>> from CDO the urn:schemas:calendar:uid property reads as
>>> >>> 040000008200E00074C5B7101A82E00800000000A0094A171FB9C50100000000000000001000000082A0DA3955849E49BA871CAE74CAE50D
>>> >>>
>>> >>> from a webdav query, urn:schemas:calendar:uid reads as
>>> >>> {9318FD5D-B1FB-4424-A948-4EAB256B796E}
>>> >>>
>>> >>> Is there a way to convert one value format to the other or does
>>> >>> anybody
>>> >>> know
>>> >>> what the formats are?
>>> >>>
>>> >>> thanks!
>>> >>>
>>> >>>
>>> >
>>> >
>>>
>>>
>>>
>
>
date: Mon, 19 Sep 2005 14:41:23 +0200
author: Sorry
|
|