protected override void UpdateRequestBody(PublishedCalendar publishedFolder) { ItemResponseShape itemResponseShape = new ItemResponseShape(); itemResponseShape.BaseShape = ShapeEnum.IdOnly; List <PropertyPath> list = new List <PropertyPath> { new PropertyUri(PropertyUriEnum.ItemId), new PropertyUri(PropertyUriEnum.ItemParentId), new PropertyUri(PropertyUriEnum.Sensitivity), new PropertyUri(PropertyUriEnum.IsCancelled), new PropertyUri(PropertyUriEnum.LegacyFreeBusyStatus), new PropertyUri(PropertyUriEnum.CalendarItemType), new PropertyUri(PropertyUriEnum.Start), new PropertyUri(PropertyUriEnum.End), new PropertyUri(PropertyUriEnum.IsAllDayEvent), new PropertyUri(PropertyUriEnum.EnhancedLocation), new PropertyUri(PropertyUriEnum.Subject), new PropertyUri(PropertyUriEnum.Recurrence) }; if (publishedFolder.DetailLevel == DetailLevelEnumType.FullDetails) { list.Add(new PropertyUri(PropertyUriEnum.Body)); } itemResponseShape.AdditionalProperties = list.ToArray(); itemResponseShape.BodyType = base.Request.Body.ItemShape.BodyType; WellKnownShapes.SetDefaultsOnItemResponseShape(itemResponseShape, base.Context.UserAgent.Layout, null); base.Request.Body.ItemShape = itemResponseShape; }
// Token: 0x060018A9 RID: 6313 RVA: 0x00055170 File Offset: 0x00053370 internal TResponse Execute() { this.ValidateRequestBody(); TResponse result; try { this.TraceDebug("Creating the published folder instance", new object[0]); using (PublishedCalendar publishedCalendar = (PublishedCalendar)PublishedFolder.Create(this.Context.PublishingUrl)) { publishedCalendar.TimeZone = EWSSettings.RequestTimeZone; this.UpdateRequestBody(publishedCalendar); this.TraceDebug("Invoking the command", new object[0]); result = this.InternalExecute(publishedCalendar); } } catch (OverBudgetException exception) { result = this.CreateErrorResponse(exception, ResponseCodeType.ErrorServerBusy); } catch (PublishedFolderAccessDeniedException exception2) { result = this.CreateErrorResponse(exception2, ResponseCodeType.ErrorAccessDenied); } catch (FolderNotPublishedException exception3) { result = this.CreateErrorResponse(exception3, ResponseCodeType.ErrorAccessDenied); } return(result); }
protected override void UpdateRequestBody(PublishedCalendar publishedFolder) { ItemResponseShape itemResponseShape = new ItemResponseShape(); itemResponseShape.BaseShape = ShapeEnum.IdOnly; itemResponseShape.AdditionalProperties = new PropertyPath[] { new PropertyUri(PropertyUriEnum.ItemId), new PropertyUri(PropertyUriEnum.ItemParentId), new PropertyUri(PropertyUriEnum.Sensitivity), new PropertyUri(PropertyUriEnum.IsCancelled), new PropertyUri(PropertyUriEnum.IsMeeting), new PropertyUri(PropertyUriEnum.LegacyFreeBusyStatus), new PropertyUri(PropertyUriEnum.CalendarItemType), new PropertyUri(PropertyUriEnum.Start), new PropertyUri(PropertyUriEnum.End), new PropertyUri(PropertyUriEnum.IsAllDayEvent), new PropertyUri(PropertyUriEnum.Location), new PropertyUri(PropertyUriEnum.Subject) }; base.Request.Body.ItemShape = itemResponseShape; CalendarPageView calendarPageView = (CalendarPageView)base.Request.Body.Paging; CalendarPageView calendarPageView2 = new CalendarPageView(); calendarPageView2.StartDate = calendarPageView.StartDate; calendarPageView2.EndDate = calendarPageView.EndDate; base.Request.Body.Paging = calendarPageView2; }
protected override GetItemJsonResponse InternalExecute(PublishedCalendar publishedFolder) { base.TraceDebug("GetItemAnonymous:InternalExecute", new object[0]); if (publishedFolder.DetailLevel == DetailLevelEnumType.AvailabilityOnly) { return(this.CreateErrorResponse(new InvalidOperationException("Item details are not allowed"), ResponseCodeType.ErrorInvalidRequest)); } StoreObjectId itemId = null; bool flag; try { this.GetStoreObjectId(out itemId, out flag); } catch (StoragePermanentException exception) { return(this.CreateErrorResponse(exception, ResponseCodeType.ErrorInvalidRequest)); } GetItemJsonResponse result; try { base.TraceDebug("Get item from published folder", new object[0]); using (DisposeGuard disposeGuard = default(DisposeGuard)) { CalendarItemBase item = publishedFolder.GetItem(itemId, GetItemAnonymous.propertiesToFetch); disposeGuard.Add <CalendarItemBase>(item); if (flag) { base.TraceDebug("Request was for a Recurring Master", new object[0]); if (!(item is CalendarItemOccurrence)) { return(this.CreateErrorResponse(new Exception("Invalid RecurrenceMasterId"), ResponseCodeType.ErrorInvalidRequest)); } itemId = ((CalendarItemOccurrence)item).MasterId.ObjectId; item = publishedFolder.GetItem(itemId, GetItemAnonymous.propertiesToFetch); disposeGuard.Add <CalendarItemBase>(item); } EwsCalendarItemType serviceObject = this.CreateServiceObject(item); if (item.Sensitivity == Sensitivity.Private) { base.TraceDebug("Clear sensitive information", new object[0]); this.ClearSensitiveInformation(serviceObject); } result = this.CreateSuccessResponse(serviceObject); } } catch (ObjectNotFoundException exception2) { result = this.CreateErrorResponse(exception2, ResponseCodeType.ErrorInvalidRequest); } return(result); }
public PublishedCalendarDataSource(AnonymousSessionContext sessionContext, PublishedCalendar folder, DateRange[] dateRanges, PropertyDefinition[] properties) : base(dateRanges, properties) { if (sessionContext == null) { throw new ArgumentNullException("sessionContext"); } if (folder == null) { throw new ArgumentNullException("folder"); } this.sessionContext = sessionContext; this.folder = folder; base.Load((ExDateTime start, ExDateTime end) => folder.GetCalendarView(start, end, properties)); }
// Token: 0x060019E6 RID: 6630 RVA: 0x000963F0 File Offset: 0x000945F0 private static bool BindExchangePrincipal(OwaContext owaContext) { bool result = false; PublishingUrl publishingUrl = (PublishingUrl)owaContext.HttpContext.Items["AnonymousUserContextPublishedUrl"]; try { using (PublishedCalendar publishedCalendar = (PublishedCalendar)PublishedFolder.Create(publishingUrl)) { owaContext.ExchangePrincipal = publishedCalendar.CreateExchangePrincipal(); HttpContext.Current.Items["AnonymousUserContextExchangePrincipalKey"] = owaContext.ExchangePrincipal; HttpContext.Current.Items["AnonymousUserContextTimeZoneKey"] = publishedCalendar.TimeZone; HttpContext.Current.Items["AnonymousUserContextSharingDetailsKey"] = publishedCalendar.DetailLevel; HttpContext.Current.Items["AnonymousUserContextPublishedCalendarNameKey"] = publishedCalendar.DisplayName; HttpContext.Current.Items["AnonymousUserContextPublishedCalendarIdKey"] = publishedCalendar.FolderId; } } catch (WrongServerException ex) { ExTraceGlobals.CoreTracer.TraceDebug <WrongServerException>(0L, "CalendarVDirRequestDispatcher.BindExchangePrincipal: Returns 500 due to wrong BE server. Exception = {0}.", ex); owaContext.HttpContext.Response.AppendHeader("X-BEServerException", CalendarVDirRequestDispatcher.BEServerExceptionHeaderValue); string value = ex.RightServerToString(); if (!string.IsNullOrEmpty(value)) { owaContext.HttpContext.Response.AppendHeader(WellKnownHeader.XDBMountedOnServer, value); } owaContext.HttpContext.Response.TrySkipIisCustomErrors = true; Utilities.EndResponse(owaContext.HttpContext, HttpStatusCode.InternalServerError); result = true; } catch (PublishedFolderAccessDeniedException arg) { ExTraceGlobals.CoreTracer.TraceDebug <PublishedFolderAccessDeniedException>(0L, "CalendarVDirRequestDispatcher.BindExchangePrincipal: Returns 404 due to access is denied. Exception = {0}.", arg); Utilities.EndResponse(owaContext.HttpContext, HttpStatusCode.NotFound); result = true; } catch (FolderNotPublishedException arg2) { ExTraceGlobals.CoreTracer.TraceDebug <FolderNotPublishedException>(0L, "CalendarVDirRequestDispatcher.BindExchangePrincipal: Returns 404 due to Folder not published. Exception = {0}.", arg2); Utilities.EndResponse(owaContext.HttpContext, HttpStatusCode.NotFound); result = true; } catch (OverBudgetException ex2) { ExTraceGlobals.CoreTracer.TraceDebug <OverBudgetException>(0L, "CalendarVDirRequestDispatcher.BindExchangePrincipal: User is throttled. Exception = {0}.", ex2); Utilities.HandleException(owaContext, ex2); result = true; } return(result); }
// Token: 0x06001A0B RID: 6667 RVA: 0x000966F0 File Offset: 0x000948F0 public void ProcessRequest(HttpContext context) { if (Globals.OwaVDirType == OWAVDirType.OWA) { ExTraceGlobals.CoreCallTracer.TraceError((long)this.GetHashCode(), "HttpHandlerICal.ProcessRequest: Returns 400 since OWA vdir doesn't support."); Utilities.EndResponse(context, HttpStatusCode.BadRequest); return; } PublishingUrl publishingUrl = (PublishingUrl)context.Items["AnonymousUserContextPublishedUrl"]; if (publishingUrl == null) { ExTraceGlobals.CoreCallTracer.TraceError((long)this.GetHashCode(), "HttpHandlerICal.ProcessRequest: Missing publishing url,"); Utilities.EndResponse(context, HttpStatusCode.BadRequest); return; } if (publishingUrl.DataType != SharingDataType.Calendar && publishingUrl.DataType != SharingDataType.ReachCalendar) { ExTraceGlobals.CoreCallTracer.TraceError <SharingDataType>((long)this.GetHashCode(), "HttpHandlerICal.ProcessRequest: Returns 400 due to invalid data type '{0}'.", publishingUrl.DataType); Utilities.EndResponse(context, HttpStatusCode.BadRequest); return; } if (!Utilities.IsGetRequest(context.Request)) { ExTraceGlobals.CoreCallTracer.TraceDebug <string>((long)this.GetHashCode(), "HttpHandlerICal.ProcessRequest: Stop process if it is not GET request. HttpMethod = {0}.", context.Request.HttpMethod); return; } try { using (PublishedCalendar publishedCalendar = (PublishedCalendar)PublishedFolder.Create(publishingUrl)) { publishedCalendar.WriteInternetCalendar(context.Response.OutputStream, "utf-8"); } context.Response.ContentType = "text/calendar; charset=utf-8"; } catch (FolderNotPublishedException arg) { ExTraceGlobals.CoreCallTracer.TraceError <FolderNotPublishedException>((long)this.GetHashCode(), "HttpHandlerICal.ProcessRequest: Returns 404 due to folder is not published. Exception = {0}.", arg); Utilities.EndResponse(context, HttpStatusCode.NotFound); } catch (PublishedFolderAccessDeniedException arg2) { ExTraceGlobals.CoreCallTracer.TraceError <PublishedFolderAccessDeniedException>((long)this.GetHashCode(), "HttpHandlerICal.ProcessRequest: Returns 404 due to access is denied. Exception = {0}.", arg2); Utilities.EndResponse(context, HttpStatusCode.NotFound); } }
protected override FindItemJsonResponse InternalExecute(PublishedCalendar publishedFolder) { object[][] data; try { data = this.GetData(publishedFolder); } catch (ArgumentException exception) { return(this.CreateErrorResponse(exception, ResponseCodeType.ErrorInvalidRequest)); } ServiceResult <FindItemParentWrapper> result = this.CreateServiceResponse(new FindItemAnonymous.AnonymousQueryView(data, int.MaxValue), publishedFolder); FindItemResponse findItemResponse = new FindItemResponse(); findItemResponse.ProcessServiceResult(result); return(new FindItemJsonResponse { Body = findItemResponse }); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); string parameter = base.GetParameter("id", true); try { StoreObjectId itemId = Utilities.CreateStoreObjectId(parameter); PublishingUrl publishingUrl = ((AnonymousSessionContext)base.SessionContext).PublishingUrl; using (PublishedCalendar publishedCalendar = (PublishedCalendar)PublishedFolder.Create(publishingUrl)) { this.detailLevel = publishedCalendar.DetailLevel; if (this.detailLevel == DetailLevelEnumType.AvailabilityOnly) { Utilities.EndResponse(OwaContext.Current.HttpContext, HttpStatusCode.Forbidden); } this.item = publishedCalendar.GetItemData(itemId); } } catch (FolderNotPublishedException) { Utilities.EndResponse(OwaContext.Current.HttpContext, HttpStatusCode.NotFound); } catch (OwaInvalidIdFormatException innerException) { throw new OwaInvalidRequestException("Invalid id param", innerException); } catch (PublishedFolderAccessDeniedException innerException2) { throw new OwaInvalidRequestException("Cannot access this published folder", innerException2); } catch (ObjectNotFoundException innerException3) { throw new OwaInvalidRequestException("Cannot open this item", innerException3); } }
// Token: 0x060018AE RID: 6318 protected abstract TResponse InternalExecute(PublishedCalendar publishedFolder);
// Token: 0x060018AD RID: 6317 protected abstract void UpdateRequestBody(PublishedCalendar publishedFolder);
private ServiceResult <FindItemParentWrapper> CreateServiceResponse(FindItemAnonymous.AnonymousQueryView anonymousView, PublishedCalendar publishedFolder) { ServiceResult <FindItemParentWrapper> result; using (Folder calendarFolder = publishedFolder.GetCalendarFolder()) { PropertyListForViewRowDeterminer classDeterminer = PropertyListForViewRowDeterminer.BuildForItems(base.Request.Body.ItemShape, calendarFolder); IdAndSession idAndSession = new IdAndSession(calendarFolder.Id, calendarFolder.Session); ItemType[] items = anonymousView.ConvertToItems(FindItemAnonymous.propertiesToFetch, classDeterminer, idAndSession); BasePageResult paging = new BasePageResult(anonymousView); FindItemParentWrapper value = new FindItemParentWrapper(items, paging); result = new ServiceResult <FindItemParentWrapper>(value); } return(result); }
private object[][] GetData(PublishedCalendar publishedFolder) { CalendarPageView calendarPageView = (CalendarPageView)base.Request.Body.Paging; return(publishedFolder.GetCalendarView(calendarPageView.StartDateEx, calendarPageView.EndDateEx, FindItemAnonymous.propertiesToFetch)); }