RAD Scheduler and Exchange 2007

10 posts, 0 answers
  1. Timothy Kruszewski
    Timothy Kruszewski avatar
    76 posts
    Member since:
    Feb 2010

    Posted 10 Feb 2010 Link to this post

    I am evaluating the RAD Scheduler for possible purchase and I’m trying to implement a solution where an Exchange 2007 server would be the primary data source for the scheduler.  I have been able to pull in my own mailbox and add, update and delete items just fine but I also need to be able to do this for other users in the organization.  Back in April 2009 another user posted the following thread

    “How do I get it to work with public folders or to load another user's calendar (to which the logged in user has access rights in Exchange)?  The provider only takes a username, password, and domain along with the server URL.  I don't see how to specify a particular folder or path.  Looking at Telerik's source code for the Exchange provider, I do see that the DistinguishedFolderIdNameType enumerated date type includes an option for publicfoldersroot, but it doesn't appear to be used anywhere.

    Similarly, I'd also like User A, who has access rights to User B's calendar, to be able to do so, but, again, I don't see where I can specify the alternate calendar location.”

    Teleriks response was as follows:

    “The FindCalendarItems method currently queries only the authenticated users calendar:

    DistinguishedFolderIdType[] folderIDArray = new DistinguishedFolderIdType[1];
    folderIDArray[0] = new DistinguishedFolderIdType();
    folderIDArray[0].Id = DistinguishedFolderIdNameType.calendar;
    findItemRequest.ParentFolderIds = folderIDArray;

    We can other calendars here as well:

    // Identify which folders to search.
    List<DistinguishedFolderIdType> folderIDs = new List<DistinguishedFolderIdType>();

    DistinguishedFolderIdType ownCalendar = new DistinguishedFolderIdType();
    ownCalendar.Id = DistinguishedFolderIdNameType.calendar;
    folderIDs.Add(ownCalendar);

    DistinguishedFolderIdType otherCalendar = new DistinguishedFolderIdType();
    otherCalendar.Id = DistinguishedFolderIdNameType.calendar;

    EmailAddressType otherMailbox = new EmailAddressType();
    otherMailbox.EmailAddress = "other.user@contoso.com";


    otherCalendar.Mailbox = otherMailbox;
    folderIDs.Add(otherCalendar);

    findItemRequest.ParentFolderIds = folderIDs.ToArray();”

    I’ve tried implementing this code but still cannot see any other users on the scheduler.  Is there any other examples or documentation that could help me out here?

  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2809 posts

    Posted 16 Feb 2010 Link to this post

    Hello Timothy,

    Thank you for your interest in our products. The scenario you describe should be possible. We've opted to release he provider as source code to allow for such customizations.

    I've just tested the sample code with our Exchange Server and it seems to work here:

    protected internal CalendarItemType[] FindCalendarItems()
    {
        // ...
     
        // Identify which folders to search.
    DistinguishedFolderIdType[] folderIDArray = new DistinguishedFolderIdType[2];
    folderIDArray[0] = new DistinguishedFolderIdType();
    folderIDArray[0].Id = DistinguishedFolderIdNameType.calendar;
    findItemRequest.ParentFolderIds = folderIDArray;
     
    folderIDArray[1] = new DistinguishedFolderIdType();
    folderIDArray[1].Id = DistinguishedFolderIdNameType.calendar;
     
    EmailAddressType additionalMailbox = new EmailAddressType();
    additionalMailbox.EmailAddress = "xxxx@telerik.com";
     
    folderIDArray[1].Mailbox = additionalMailbox;
     
    // ...

    Maybe the authenticated user does not have enough permissions?

    Sincerely yours,
    Tsvetomir Tsonev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Timothy Kruszewski
    Timothy Kruszewski avatar
    76 posts
    Member since:
    Feb 2010

    Posted 16 Feb 2010 Link to this post

    The code works fine for 1 users but I need to display many users at one time.  Please see the code example below of what I'm trying to do.  So in this case only email1 is being displayed in the scheduler.

    protected internal CalendarItemType[] FindCalendarItems()  
            {  
                // Form the FindItem request.  
                FindItemType findItemRequest = new FindItemType();  
     
                // Define the item properties that are returned in the response.  
                ItemResponseShapeType itemProperties = new ItemResponseShapeType();  
                itemProperties.BaseShape = DefaultShapeNamesType.IdOnly;  
     
                PathToUnindexedFieldType calendarIsRecurringFieldPath = new PathToUnindexedFieldType();  
                calendarIsRecurringFieldPath.FieldURI = UnindexedFieldURIType.calendarIsRecurring;  
     
                PathToUnindexedFieldType calendarItemTypeFieldPath = new PathToUnindexedFieldType();  
                calendarIsRecurringFieldPath.FieldURI = UnindexedFieldURIType.calendarCalendarItemType;  
     
                PathToUnindexedFieldType calendarStartFieldPath = new PathToUnindexedFieldType();  
                calendarStartFieldPath.FieldURI = UnindexedFieldURIType.calendarStart;  
     
                PathToUnindexedFieldType calendarEndFieldPath = new PathToUnindexedFieldType();  
                calendarEndFieldPath.FieldURI = UnindexedFieldURIType.calendarEnd;  
     
                itemProperties.AdditionalProperties = new PathToUnindexedFieldType[]  
                                                        {  
                                                            calendarIsRecurringFieldPath,   
                                                            calendarItemTypeFieldPath,  
                                                            calendarStartFieldPath,  
                                                            calendarEndFieldPath  
                                                        };  
                findItemRequest.ItemShape = itemProperties;  
     
                // Identify which folders to search.  
                //DistinguishedFolderIdType[] folderIDArray = new DistinguishedFolderIdType[1];  
                //folderIDArray[0] = new DistinguishedFolderIdType();  
                //folderIDArray[0].Id = DistinguishedFolderIdNameType.calendar;  
                //findItemRequest.ParentFolderIds = folderIDArray;  
     
                ////Identify which folders to search.  
                List<DistinguishedFolderIdType> folderIDs = new List<DistinguishedFolderIdType>();  
     
                DistinguishedFolderIdType otherCalendar1 = new DistinguishedFolderIdType();  
                otherCalendar1.Id = DistinguishedFolderIdNameType.calendar;  
     
                EmailAddressType otherMailbox1 = new EmailAddressType();  
                otherMailbox1.EmailAddress = "email1@test.com";  
     
                otherCalendar1.Mailbox = otherMailbox1;  
                folderIDs.Add(otherCalendar1);  
     
                DistinguishedFolderIdType ownCalendar = new DistinguishedFolderIdType();  
                ownCalendar.Id = DistinguishedFolderIdNameType.calendar;  
                folderIDs.Add(ownCalendar);  
     
                DistinguishedFolderIdType otherCalendar = new DistinguishedFolderIdType();  
                otherCalendar.Id = DistinguishedFolderIdNameType.calendar;  
     
                EmailAddressType otherMailbox = new EmailAddressType();  
                otherMailbox.EmailAddress = "email2@test.com";  
     
                otherCalendar.Mailbox = otherMailbox;  
                folderIDs.Add(otherCalendar);  
     
                findItemRequest.ParentFolderIds = folderIDs.ToArray();  
     
                // Define the sort order of items.  
                FieldOrderType[] fieldsOrder = new FieldOrderType[1];  
                fieldsOrder[0] = new FieldOrderType();  
                PathToUnindexedFieldType subjectOrder = new PathToUnindexedFieldType();  
                subjectOrder.FieldURI = UnindexedFieldURIType.calendarStart;  
                fieldsOrder[0].Item = subjectOrder;  
                fieldsOrder[0].Order = SortDirectionType.Ascending;  
                findItemRequest.SortOrder = fieldsOrder;  
     
                // Define the traversal type.  
                findItemRequest.Traversal = ItemQueryTraversalType.Shallow;  
     
                // Send the FindItem request and get the response.  
                FindItemResponseType findItemResponse = Service.FindItem(findItemRequest);  
     
                // Access the response message.  
                ArrayOfResponseMessagesType responseMessages = findItemResponse.ResponseMessages;  
                ResponseMessageType responseMessage = responseMessages.Items[0];  
     
                if (responseMessage is FindItemResponseMessageType)  
                {  
                    FindItemResponseMessageType firmt = (responseMessage as FindItemResponseMessageType);  
                    FindItemParentType fipt = firmt.RootFolder;  
                    object obj = fipt.Item;  
     
                    if (obj is ArrayOfRealItemsType)  
                    {  
                        ArrayOfRealItemsType items = (obj as ArrayOfRealItemsType);  
     
                        if (items.Items != null)  
                        {  
                            List<CalendarItemType> calendarItems = new List<CalendarItemType>(items.Items.Length);  
                            foreach (ItemType item in items.Items)  
                            {  
                                CalendarItemType calendarItem = item as CalendarItemType;  
     
                                if (calendarItem != null)  
                                {  
                                    calendarItems.Add(calendarItem);  
                                }  
                            }  
     
                            return calendarItems.ToArray();  
                        }  
     
                        return new CalendarItemType[0];  
                    }  
                }  
     
                return null;  
            } 

     
  4. T. Tsonev
    Admin
    T. Tsonev avatar
    2809 posts

    Posted 18 Feb 2010 Link to this post

    Hello Timothy,

    Indeed querying more than one mailbox will simply merge the results as if they're coming from a single mailbox.

    The mailboxes can be mapped to RadScheduler resources in the CreateAppointmentsFromCalendarItem method. You should inspect the mailbox of the calendar item and assign a corresponding resource.

    The resource list is defined by the GetResourcesByType method.

    The reverse process should happen in the CreateCalendarItem method.

    Then you can use resource grouping to display the calendars:

    http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourcegrouping/defaultcs.aspx

    I hope this helps.

    Greetings,
    Tsvetomir Tsonev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Timothy Kruszewski
    Timothy Kruszewski avatar
    76 posts
    Member since:
    Feb 2010

    Posted 18 Feb 2010 Link to this post

    The problem is that it's not merging the two mailboxes together, it's just displaying which ever mailbox gets queiried first.
  6. T. Tsonev
    Admin
    T. Tsonev avatar
    2809 posts

    Posted 24 Feb 2010 Link to this post

    Hi Timothy,

    Apologies for the late response. Indeed the current method took only the calendar items from the first folder. It turns out the additional calendars are returned as separate response messages and must be iterated. We've fixed the code and I'm sending you the fixed version.

    protected internal CalendarItemType[] FindCalendarItems()
    {
        // Form the FindItem request.
        FindItemType findItemRequest = new FindItemType();
     
        // Define the item properties that are returned in the response.
        ItemResponseShapeType itemProperties = new ItemResponseShapeType();
        itemProperties.BaseShape = DefaultShapeNamesType.IdOnly;
     
        PathToUnindexedFieldType calendarIsRecurringFieldPath = new PathToUnindexedFieldType();
        calendarIsRecurringFieldPath.FieldURI = UnindexedFieldURIType.calendarIsRecurring;
     
        PathToUnindexedFieldType calendarItemTypeFieldPath = new PathToUnindexedFieldType();
        calendarIsRecurringFieldPath.FieldURI = UnindexedFieldURIType.calendarCalendarItemType;
     
        PathToUnindexedFieldType calendarStartFieldPath = new PathToUnindexedFieldType();
        calendarStartFieldPath.FieldURI = UnindexedFieldURIType.calendarStart;
     
        PathToUnindexedFieldType calendarEndFieldPath = new PathToUnindexedFieldType();
        calendarEndFieldPath.FieldURI = UnindexedFieldURIType.calendarEnd;
     
        itemProperties.AdditionalProperties = new PathToUnindexedFieldType[]
                                                {
                                                    calendarIsRecurringFieldPath,
                                                    calendarItemTypeFieldPath,
                                                    calendarStartFieldPath,
                                                    calendarEndFieldPath
                                                };
        findItemRequest.ItemShape = itemProperties;
     
        // Identify which folders to search.
        List<DistinguishedFolderIdType> folderIDs = new List<DistinguishedFolderIdType>();
     
        DistinguishedFolderIdType ownCalendar = new DistinguishedFolderIdType();
        ownCalendar.Id = DistinguishedFolderIdNameType.calendar;
        folderIDs.Add(ownCalendar);
     
        //DistinguishedFolderIdType otherCalendar = new DistinguishedFolderIdType();
        //otherCalendar.Id = DistinguishedFolderIdNameType.calendar;
     
        //EmailAddressType otherMailbox = new EmailAddressType();
        //otherMailbox.EmailAddress = "xxxx@test.com";
     
        //otherCalendar.Mailbox = otherMailbox;
     
        folderIDs.Add(otherCalendar);
     
        findItemRequest.ParentFolderIds = folderIDs.ToArray(); 
     
        // Define the sort order of items.
        FieldOrderType[] fieldsOrder = new FieldOrderType[1];
        fieldsOrder[0] = new FieldOrderType();
        PathToUnindexedFieldType subjectOrder = new PathToUnindexedFieldType();
        subjectOrder.FieldURI = UnindexedFieldURIType.calendarStart;
        fieldsOrder[0].Item = subjectOrder;
        fieldsOrder[0].Order = SortDirectionType.Ascending;
        findItemRequest.SortOrder = fieldsOrder;
     
        // Define the traversal type.
        findItemRequest.Traversal = ItemQueryTraversalType.Shallow;
     
        // Send the FindItem request and get the response.
        FindItemResponseType findItemResponse = Service.FindItem(findItemRequest);
     
        // Access the response message.
        ArrayOfResponseMessagesType responseMessages = findItemResponse.ResponseMessages;
     
        List<CalendarItemType> calendarItems = new List<CalendarItemType>();
        foreach (ResponseMessageType responseMessage in responseMessages.Items)
        {
            if (responseMessage is FindItemResponseMessageType)
            {
                FindItemResponseMessageType firmt = (responseMessage as FindItemResponseMessageType);
                FindItemParentType fipt = firmt.RootFolder;
                object obj = fipt.Item;
     
                if (obj is ArrayOfRealItemsType)
                {
                    ArrayOfRealItemsType items = (obj as ArrayOfRealItemsType);
     
                    if (items.Items != null)
                    {
                        foreach (ItemType item in items.Items)
                        {
                            CalendarItemType calendarItem = item as CalendarItemType;
     
                            if (calendarItem != null)
                            {
                                calendarItems.Add(calendarItem);
                            }
                        }
                    }
                }
            }
        }
     
        return calendarItems.ToArray();
    }

    As a token of our gratitude for your involvement, your Telerik points have been updated.

    All the best,
    Tsvetomir Tsonev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  7. John Doe
    John Doe avatar
    2 posts
    Member since:
    Jul 2009

    Posted 25 Aug 2011 Link to this post

    Hey Timothy, I'm trying to do the same thing with pulling in multiple user calendars into one calendar. Unfortunately I'm a systems administrator not an asp.net programmer. I'm having a hard time with the Exchange Web Services. Seems there is hardly any working code out there using either the Exchange Web Services directly or by using the RadSchedular.

    Could any of you please send me your usings and full code behind and aspx code?

    my email is toolnbama@charter if you would rather email me.

    Best Regards to both of you.
  8. Timothy Kruszewski
    Timothy Kruszewski avatar
    76 posts
    Member since:
    Feb 2010

    Posted 26 Aug 2011 Link to this post

    We actually are using a 3rd party provider to handle the syncing of Exchange with our scheduling database.

    http://www.exchangewise.com/Products/MXSync/Overview.htm
  9. John Doe
    John Doe avatar
    2 posts
    Member since:
    Jul 2009

    Posted 26 Aug 2011 Link to this post

    Ok thanks. I was hoping to use RAD Scheduler but it looks like telerik is not interested in providing a working demo connecting to exchange.
  10. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 27 Aug 2011 Link to this post

    Hello John Doe,

    It is true that the scenario of combining the RadScheduler with Exchange is not a common one.

    However please take a look at this help article for RadScheduler with Exchange provider and if you have any further questions - please feel free to ask.

    Best wishes,
    Veronica Milcheva
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top