简体   繁体   English

如何编程可用性检查并创建到Outlook的新会议?

[英]How to program availability check and to create new meeting to Outlook?

I am creating a Java web app to manage meetings between a set of students and teachers. 我正在创建一个Java Web应用程序来管理一组学生和教师之间的会议。 All of them already use Outlook to manage their email and personal calendar. 所有这些人都已经使用Outlook来管理他们的电子邮件和个人日历。

I would like to know if it's even possible to build the schedule feature of my web app using Exchange, Office365 or Sharepoint Team Calendar via REST service in order to check the availability and create a meeting for a student and one of the teachers available: 我想知道是否可以通过REST服务使用Exchange,Office365或Sharepoint Team Calendar构建我的Web应用程序的计划功能,以便检查可用性并为学生和其中一位教师创建会议:

SharePoint 2013 REST service SharePoint 2013 REST服务

So far, the most promising mechanism I have found is Microsoft Sharepoint Server's calendar, which collaborative features makes possible to create a meeting and check availability for a list of users. 到目前为止,我发现的最有希望的机制是Microsoft Sharepoint Server的日历,这些协作功能可以创建会议并检查用户列表的可用性。 The downside is that it does not support one to one meetings but for the entire team (as far I have found). 缺点是它不支持一对一会议,而是支持整个团队(据我所知)。

My second option would be to require everyone in the group (students and teachers of the department) to make public their personal calendar so the web app be able to check the availability of both student and teacher and send a meeting request. 我的第二个选择是要求小组中的每个人(该部门的学生和教师)公开他们的个人日历,以便网络应用程序能够检查学生和教师的可用性并发送会议请求。 The obvious problem is the privacy/security concern derived from this approach. 显而易见的问题是从这种方法中获得的隐私/安全问题。

My last option (and by far the less favourite because it feels like re-inventing the wheel) is to build a proprietary calendar within the web app and send iCal requests to each person. 我的最后一个选择(到目前为止,不太喜欢,因为它感觉就像重新发明轮子)是在Web应用程序中构建一个专有日历,并向每个人发送iCal请求。 The obvious problem with this approach is synchronisation between the two separated calendars. 这种方法的明显问题是两个分开的日历之间的同步。

In addition, this feature must be a pretty common need so there should be tons of blogs explaining how to take advantage of Exchange/Sharepoint/Office365 to implement it (other platforms are not considered since my employer's infrastructure is based on Microsoft). 此外,此功能必须是一个非常常见的需求,因此应该有大量的博客解释如何利用Exchange / Sharepoint / Office365来实现它(由于我的雇主的基础架构基于Microsoft,因此不考虑其他平台)。 However, whether it is so obvious that nobody talks about it or I have not searched in the right place. 然而,是否有人明白没有人谈论它或者我没有在正确的地方搜索过。 Any advice to point me in the right direction? 有什么建议让我指出正确的方向吗?

Exchange natively shows user calendar availability exposed in EWS (Exchange Web Services), your network administrator must configure Exchange server enabling EWS. Exchange本机显示在EWS(Exchange Web服务)中公开的用户日历可用性,您的网络管理员必须配置启用EWS的Exchange服务器。 But guess what... Office 365 (as I know) have EWS services enabled, due exchange is part of office 365 offer. 但是猜猜是什么... Office 365(据我所知)启用了EWS服务,到期交换是Office 365优惠的一部分。

As EWS are normal Web services you should create a "service stub" or proxy in whatever you use in java to create services references mapping wsdl files. 由于EWS是普通的Web服务,因此您应该在java中使用的任何内容中创建“服务存根”或代理,以创建映射wsdl文件的服务引用。

Exchanged EWS is my preferred solution. 交换的EWS是我的首选解决方案。

Hope this helps. 希望这可以帮助。

This is the reference page, this link show how to use the service references from C# to make the right API calls. 这是参考页面,此链接显示如何使用C#中的服务引用来进行正确的API调用。

http://msdn.microsoft.com/en-us/library/exchange/aa494212(v=exchg.140).aspx http://msdn.microsoft.com/en-us/library/exchange/aa494212(v=exchg.140).aspx

static void GetUserAvailability(ExchangeServiceBinding esb)
{
    // Identify the time to compare free/busy information.
    Duration duration = new Duration();
    duration.StartTime = DateTime.Now;
    duration.EndTime = DateTime.Now.AddHours(4);

    // Identify the options for comparing free/busy information.
    FreeBusyViewOptionsType fbViewOptions = new FreeBusyViewOptionsType();
    fbViewOptions.TimeWindow = duration;
    fbViewOptions.RequestedView = FreeBusyViewType.MergedOnly;
    fbViewOptions.RequestedViewSpecified = true;
    fbViewOptions.MergedFreeBusyIntervalInMinutes = 35;
    fbViewOptions.MergedFreeBusyIntervalInMinutesSpecified = true;

    MailboxData[] mailboxes = new MailboxData[1];
    mailboxes[0] = new MailboxData();

    // Identify the user mailbox to review for free/busy data.
    EmailAddress emailAddress = new EmailAddress();

    emailAddress.Address = "tplate@contoso.com";
    emailAddress.Name = String.Empty;

    mailboxes[0].Email = emailAddress;
    mailboxes[0].ExcludeConflicts = false;

    // Make the request.
    GetUserAvailabilityRequestType request = new GetUserAvailabilityRequestType();

    // Set the time zone of the request.
    request.TimeZone = new SerializableTimeZone();
    request.TimeZone.Bias = 480;
    request.TimeZone.StandardTime = new SerializableTimeZoneTime();
    request.TimeZone.StandardTime.Bias = 0;
    request.TimeZone.StandardTime.DayOfWeek = DayOfWeekType.Sunday.ToString();
    request.TimeZone.StandardTime.DayOrder = 1;
    request.TimeZone.StandardTime.Month = 11;
    request.TimeZone.StandardTime.Time = "02:00:00";
    request.TimeZone.DaylightTime = new SerializableTimeZoneTime();
    request.TimeZone.DaylightTime.Bias = -60;
    request.TimeZone.DaylightTime.DayOfWeek = DayOfWeekType.Sunday.ToString();
    request.TimeZone.DaylightTime.DayOrder = 2;
    request.TimeZone.DaylightTime.Month = 3;
    request.TimeZone.DaylightTime.Time = "02:00:00";

    // Add the mailboxes to the request.
    request.MailboxDataArray = mailboxes;

    // Add the view options to the request.
    request.FreeBusyViewOptions = fbViewOptions;

    try
    {
        // Send the request and get the response.
        GetUserAvailabilityResponseType response = esb.GetUserAvailability(request);

        // Access free/busy information.
        if (response.FreeBusyResponseArray.Length < 1)
        {
            throw new Exception("No free/busy response data available.");
        }
        else
        {
            foreach (FreeBusyResponseType fbrt in response.FreeBusyResponseArray)
            {
                if (fbrt.ResponseMessage.ResponseClass == ResponseClassType.Error)
                {
                    Console.WriteLine(string.Format("Error: {0}", fbrt.ResponseMessage.MessageText));
                }
                else
                {
                    // Show the free/busy stream.
                    FreeBusyView fbv = fbrt.FreeBusyView;
                    Console.WriteLine(string.Format("Merged free/busy data: {0}", fbv.MergedFreeBusy));
                }
            }
        }
    }
    catch (Exception e)
    {
        // Perform error processing.
        Console.WriteLine(e.Message);
        Console.ReadLine();
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM