/// <summary> /// Page_Load event handler /// </summary> /// <param name="sender">Sender object</param> /// <param name="e">Event data for Page_Load event</param> protected void Page_Load(object sender, EventArgs e) { try { string encodedcollectionUri = Request.QueryString[QueryStringKeys.CollectionUri]; string collectionUri = Request.RequestContext.HttpContext.Server.UrlDecode(encodedcollectionUri); string resourceId = Request.QueryString[QueryStringKeys.ResourceId]; string[] collectionUriParts = collectionUri.Split(new string[] { @"/" }, StringSplitOptions.RemoveEmptyEntries); var dataset = PivotCollectionHelper.GetAllPivotCollectionItems(Request); var dataModel = dataset.SingleOrDefault(tuple => tuple.Name == collectionUriParts[4]); if (dataModel == null || dataModel.IsNameNull()) { throw new ArgumentException(Properties.Messages.CollectionNotFound); } } catch (ThreadAbortException) { } catch (Exception exception) { this.MainBody.Visible = false; this.MainBody.Disabled = true; this.errorSummaryContainer.Visible = true; Globals.TraceMessage(TraceEventType.Error, exception.ToString(), exception.Message); } }
/// <summary> /// Get all published Pivot collection /// </summary> /// <returns>returns list of PublishingCollectionItem</returns> public IEnumerable <PublishingCollectionItem> GetAllPivotCollectionItems() { try { PublishingCollectionItems pivotCollectionItems = PivotCollectionHelper.GetAllPivotCollectionItemsForPivot(this.Context.Request); Session[Properties.Messages.PivotCollectionItemsForSorting] = pivotCollectionItems; ViewState.Add(Properties.Messages.SortingDirection, Properties.Messages.Ascending); ViewState.Add(Properties.Messages.SortingColumn, "ResourceType"); return(pivotCollectionItems.OrderBy(p => p.ResourceType)); } catch (System.ServiceModel.EndpointNotFoundException) { this.errorSummaryContainer.Visible = true; this.collectionsGrid.Visible = false; return(null); } catch (System.TimeoutException) { this.errorMessageSpan.InnerText = Properties.Messages.ConnectionTimedOut; this.errorSummaryContainer.Visible = true; this.collectionsGrid.Visible = false; return(null); } catch (System.ServiceModel.FaultException exception) { Zentity.Services.Web.Globals.TraceMessage(System.Diagnostics.TraceEventType.Error, exception.ToString(), exception.Message); this.errorMessageSpan.InnerText = Properties.Messages.ZentityServerAccessError; this.errorSummaryContainer.Visible = true; this.collectionsGrid.Visible = false; return(null); } catch (System.Exception exception) { Zentity.Services.Web.Globals.TraceMessage(System.Diagnostics.TraceEventType.Error, exception.ToString(), exception.Message); this.errorMessageSpan.InnerText = Properties.Messages.ZentityServerAccessError; this.errorSummaryContainer.Visible = true; this.collectionsGrid.Visible = false; return(null); } }