Ubuntu QA:
BlogBrainstorm
Log in
Ubuntu QA
The Ubuntu community has contributed 12232 ideas, 57574 comments, 1174524 votes

Idea #1101: MS Exchange Calandering support



up
-30
down
Written by linuxworks the 29 Feb 08 at 08:15. Category: Installation.
Related to: Nothing/Others. Status: New
Description
This is more of a Mozilla Thunderbird issue but I think Ubuntu should push more for better calendering integration using the SDK provide by MS .

http://msdn2.microsoft.com/en-us/library/ms988691%28EXCHG.65%29.aspx


Calendaring

Microsoft® Exchange Server 2003 includes rich calendaring features that you can use to build calendaring applications. Collaboration Data Objects (CDO) provides the logic necessary to create applications that incorporate appointments, meetings, messages, and other calendaring items. The topics in this section describe how to use CDO to develop custom calendaring solutions.

//Creating an Appointment with CDOEx

#import rename_namespace("CDO") raw_interfaces_only

#include
#include

enum ConnectModeEnum

adModeUnknown = 0,
adModeRead = 1,
adModeWrite = 2,
adModeReadWrite = 3,
adModeShareDenyRead = 4,
adModeShareDenyWrite = 8,
adModeShareExclusive = 12,
adModeShareDenyNone = 16,
adModeRecursive = 4194304
;

enum RecordCreateOptionsEnum

adCreateCollection = 8192,
adCreateStructDoc = -2147483648,
adCreateNonCollection = 0,
adOpenIfExists = 33554432,
adCreateOverwrite = 67108864,
adFailIfNotExists = -1
;

enum RecordOpenOptionsEnum

adOpenRecordUnspecified = -1,
adOpenSource = 8388608,
adOpenAsync = 4096,
adDelayFetchStream = 16384,
adDelayFetchFields = 32768
;

void dump_com_error(_com_error &e)

_tprintf(_T("Oops - hit an error!\n"));
_tprintf(_T("\a\tCode = %08lx\n"), e.Error());
_tprintf(_T("\a\tCode meaning = \n"), e.ErrorMessage());
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
_tprintf(_T("\a\tSource = \n"), (LPCTSTR) bstrSource);
_tprintf(_T("\a\tDescription = \n"), (LPCTSTR) bstrDescription);


struct StartOle
StartOle() CoInitialize(NULL);
~StartOle() CoUninitialize();
_inst_StartOle;

void main(int argc, char** argv)

HRESULT hr = S_OK;

if(argc != 2)

printf("Usage: CreateAppt\r\n");
printf("Example: CreateAppt \"file://./backofficestorage/mydomain.contoso.com/MBX/User1/calendar\"\n");
exit(0);


wchar_t* folderURL = NULL;
size_t size;
size = mbstowcs(NULL,argv[1],0);
folderURL = (wchar_t*)malloc(size * sizeof(wchar_t*) + 1);
mbstowcs(folderURL,argv[1],size+1);

BSTR bstrFolderURL = SysAllocString(folderURL);

try


CDO::IAppointmentPtr pAppt(_uuidof(CDO::Appointment));
CDO::IDataSourcePtr pDsrc;

SYSTEMTIME st = 0;
SYSTEMTIME et = 0;
DATE dst, det;

st.wYear = 1999;
st.wMonth = 12;
st.wDay = 21;
st.wHour = 15;
st.wMinute = 30;

et.wYear = 1999;
et.wMonth = 12;
et.wDay = 21;
et.wHour = 16;
et.wMinute = 30;

// Convert the system value to double date.
SystemTimeToVariantTime(&st, &dst);
SystemTimeToVariantTime(&et, &det);

// Set the properties of the appointment.
pAppt->put_Subject(L"CDO_VC:Important Appointment");
pAppt->put_Location(L"Conference Room");
pAppt->put_TextBody(L"Be there on time");
pAppt->put_StartTime(dst);
pAppt->put_EndTime(det);
pAppt->get_DataSource(&pDsrc);

// Save the appointment.
// Note: using adCreateOverwrite may cause an existing
// appointment to be overwritten.
hr = pDsrc->SaveToContainer(bstrFolderURL,
0,
(enum CDO::ConnectModeEnum) adModeReadWrite,
(enum CDO::RecordCreateOptionsEnum)adCreateOverwrite,
(enum CDO::RecordOpenOptionsEnum)adOpenSource,
L"",
L"");
if (SUCCEEDED(hr))
_tprintf(_T("Appointment created\n"));


catch(_com_error &e)

dump_com_error(e);


SysFreeString(bstrFolderURL);



Above is a sample code in C++ .
Tags: (none)

Attachments
No attachments.


Duplicates


Comments
Remmy wrote on the 29 Feb 08 at 08:18
The Microsoft SDK isn't free software. You have to agree to their licensing terms to use it. Mozilla has their own Calender application. Sunbird.

linuxworks wrote on the 29 Feb 08 at 08:29
Sunbird does not support MS Calendering as of yet, if it has changed recently then that's great . But since I have it installed it still does not support Calendering functions. In order for Ubuntu to make in roads to the enterprise desktop space, a viable solution is needed other than Evolution. And I don't see it on the horizon just yet from the new Mozilla Thunderbird Messaging foundation.

The SDK is not free ware but the api is available for porting.

I think from what I understand, you can make query against MS Exchange and changes based on the sample API provided on MS web site in the link above.

Here is an example from uportal

http://www.ja-sig.org/wiki/display/UPC/MS+Exchange+Calendar+Integration



changlinn wrote on the 29 Feb 08 at 08:58
Uhhh Evolution...
I was using it up until we upgraded to exchange 2007. It works fine.

jelmer wrote on the 29 Feb 08 at 15:40
The OpenChange project is working on this, www.openchange.org. With a bit of luck it will be included in hardy+1.


Post your comment