From f671f41f7c6b6996693af0692d1ede09a19ce06b Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 6 Dec 2018 17:25:24 +1100 Subject: [PATCH] removes commented out Relation type editor and the unused/disabled xml health check --- .../XmlDataIntegrityHealthCheck.cs | 97 ------ src/Umbraco.Web/Umbraco.Web.csproj | 10 - .../RelationTypes/EditRelationType.aspx | 148 --------- .../RelationTypes/EditRelationType.aspx.cs | 287 ------------------ .../EditRelationType.aspx.designer.cs | 249 --------------- 5 files changed, 791 deletions(-) delete mode 100644 src/Umbraco.Web/HealthCheck/Checks/DataIntegrity/XmlDataIntegrityHealthCheck.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.cs delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.designer.cs diff --git a/src/Umbraco.Web/HealthCheck/Checks/DataIntegrity/XmlDataIntegrityHealthCheck.cs b/src/Umbraco.Web/HealthCheck/Checks/DataIntegrity/XmlDataIntegrityHealthCheck.cs deleted file mode 100644 index c53793274f..0000000000 --- a/src/Umbraco.Web/HealthCheck/Checks/DataIntegrity/XmlDataIntegrityHealthCheck.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using System.Collections.Generic; -using Umbraco.Core.Composing; -using Umbraco.Core.Services; -using Umbraco.Web.PublishedCache; - -namespace Umbraco.Web.HealthCheck.Checks.DataIntegrity -{ - /// - /// This moves the functionality from the XmlIntegrity check dashboard into a health check - /// - [HealthCheck( - "D999EB2B-64C2-400F-B50C-334D41F8589A", - "XML Data Integrity", - Description = "This checks the data integrity for the xml structures for content, media and members that are stored in the cmsContentXml table. This does not check the data integrity of the xml cache file, only the xml structures stored in the database used to create the xml cache file.", - Group = "Data Integrity")] - [HideFromTypeFinder] // only if running the Xml cache! added by XmlCacheComponent! - public class XmlDataIntegrityHealthCheck : HealthCheck - { - private readonly ILocalizedTextService _textService; - private readonly PublishedCache.XmlPublishedCache.PublishedSnapshotService _publishedSnapshotService; - - private const string CheckContentXmlTableAction = "checkContentXmlTable"; - private const string CheckMediaXmlTableAction = "checkMediaXmlTable"; - private const string CheckMembersXmlTableAction = "checkMembersXmlTable"; - - public XmlDataIntegrityHealthCheck(ILocalizedTextService textService, IPublishedSnapshotService publishedSnapshotService) - { - _textService = textService; - - _publishedSnapshotService = publishedSnapshotService as PublishedCache.XmlPublishedCache.PublishedSnapshotService; - if (_publishedSnapshotService == null) - throw new NotSupportedException("Unsupported IPublishedSnapshotService, only the Xml one is supported."); - } - - /// - /// Get the status for this health check - /// - /// - public override IEnumerable GetStatus() - { - //return the statuses - return new[] { CheckContent(), CheckMedia(), CheckMembers() }; - } - - /// - /// Executes the action and returns it's status - /// - /// - /// - public override HealthCheckStatus ExecuteAction(HealthCheckAction action) - { - switch (action.Alias) - { - case CheckContentXmlTableAction: - _publishedSnapshotService.RebuildContentAndPreviewXml(); - return CheckContent(); - case CheckMediaXmlTableAction: - _publishedSnapshotService.RebuildMediaXml(); - return CheckMedia(); - case CheckMembersXmlTableAction: - _publishedSnapshotService.RebuildMemberXml(); - return CheckMembers(); - default: - throw new ArgumentOutOfRangeException(); - } - } - - private HealthCheckStatus CheckMembers() - { - return Check(_publishedSnapshotService.VerifyMemberXml(), CheckMembersXmlTableAction, "healthcheck/xmlDataIntegrityCheckMembers"); - } - - private HealthCheckStatus CheckMedia() - { - return Check(_publishedSnapshotService.VerifyMediaXml(), CheckMediaXmlTableAction, "healthcheck/xmlDataIntegrityCheckMedia"); - } - - private HealthCheckStatus CheckContent() - { - return Check(_publishedSnapshotService.VerifyContentAndPreviewXml(), CheckContentXmlTableAction, "healthcheck/xmlDataIntegrityCheckContent"); - } - - private HealthCheckStatus Check(bool ok, string action, string text) - { - var actions = new List(); - if (ok == false) - actions.Add(new HealthCheckAction(action, Id)); - - return new HealthCheckStatus(_textService.Localize(text, new[] { ok ? "ok" : "not ok" })) - { - ResultType = ok ? StatusResultType.Success : StatusResultType.Error, - Actions = actions - }; - } - } -} diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index c17536ab4d..814a6c5a64 100755 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -272,7 +272,6 @@ - @@ -1237,12 +1236,6 @@ FeedProxy.aspx - - EditRelationType.aspx - - - EditRelationType.aspx - NewRelationType.aspx ASPXCodeBehind @@ -1321,9 +1314,6 @@ - - ASPXCodeBehind - ASPXCodeBehind diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx deleted file mode 100644 index aa7e92d598..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx +++ /dev/null @@ -1,148 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditRelationType.aspx.cs" Inherits="umbraco.cms.presentation.developer.RelationTypes.EditRelationType" MasterPageFile="../../masterpages/umbracoPage.Master" %> -<%@ Register TagPrefix="umb" Namespace="Umbraco.Web._Legacy.Controls" %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Parent  ChildCreatedComment
 " target="_blank"><%# DataBinder.Eval(Container.DataItem, "ParentText") %>  " target="_blank"><%# DataBinder.Eval(Container.DataItem, "ChildText") %><%# DataBinder.Eval(Container.DataItem, "DateTime") %><%# DataBinder.Eval(Container.DataItem, "Comment") %>
- -
- - -
- -
- - -
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.cs deleted file mode 100644 index 74c639b4a7..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.cs +++ /dev/null @@ -1,287 +0,0 @@ -//TODO: Rebuild with new tree format and apis and then remove -//using umbraco.uicontrols; - -//using System; -//using System.Collections.Generic; -//using System.Web.UI; -//using System.Web.UI.WebControls; -// -//using umbraco.BusinessLogic; -//using Umbraco.Core; -//using Umbraco.Core.Models; -//using RelationType = umbraco.cms.businesslogic.relation.RelationType; - -//namespace umbraco.cms.presentation.developer.RelationTypes -//{ -// /// -// /// Edit an existing RelationType -// /// -// [WebformsPageTreeAuthorize(Constants.Trees.RelationTypes)] -// public partial class EditRelationType : UmbracoEnsuredPage -// { - -// /// -// /// Class scope reference to the current RelationType being edited -// /// -// private IRelationType _relationType; - -// /// -// /// Class scope reference to the relations associated with the current RelationType -// /// -// private List _relations; - -// /// -// /// Umbraco ObjectType used to represent all parent items in this relation type -// /// -// /// -// private UmbracoObjectTypes _parentObjectType; - -// /// -// /// Umbraco ObjectType used to represent all child items in this relation type -// /// -// private UmbracoObjectTypes _childObjectType; - -// /// -// /// Gets the name of the parent object type for all relations in this relation type -// /// -// protected string ParentObjectType -// { -// get -// { -// return this._parentObjectType.GetName(); //UmbracoHelper.GetName(this.parentObjectType); -// } -// } - -// /// -// /// Gets the name of the child object type for all relations in this relation type -// /// -// protected string ChildObjectType -// { -// get -// { -// return this._childObjectType.GetName(); //UmbracoHelper.GetName(this.childObjectType); -// } -// } - -// /// -// /// Gets a string representing the current relation type direction -// /// -// protected string RelationTypeDirection -// { -// get -// { -// return this._relationType.IsBidirectional ? "bidirectional" : "parentToChild"; -// } -// } - -// /// -// /// Gets the Relations for this RelationType, via lazy load -// /// -// private List Relations -// { -// get -// { -// if (this._relations == null) -// { -// this._relations = new List(); - -// using (var reader = uQuery.SqlHelper.ExecuteReader(@" -// SELECT A.id, -// A.parentId, -// B.[text] AS parentText, -// A.childId, -// C.[text] AS childText, -// A.relType, -// A.[datetime], -// A.comment -// FROM umbracoRelation A -// LEFT OUTER JOIN umbracoNode B ON A.parentId = B.id -// LEFT OUTER JOIN umbracoNode C ON A.childId = C.id -// WHERE A.relType = " + this._relationType.Id.ToString())) -// { -// while (reader.Read()) -// { -// var readOnlyRelation = new ReadOnlyRelation(); - -// readOnlyRelation.Id = reader.GetInt("id"); -// readOnlyRelation.ParentId = reader.GetInt("parentId"); -// readOnlyRelation.ParentText = reader.GetString("parentText"); -// readOnlyRelation.ChildId = reader.GetInt("childId"); -// readOnlyRelation.ChildText = reader.GetString("childText"); -// readOnlyRelation.RelType = reader.GetInt("relType"); -// readOnlyRelation.DateTime = reader.GetDateTime("datetime"); -// readOnlyRelation.Comment = reader.GetString("comment"); - -// this._relations.Add(readOnlyRelation); -// } -// } -// } - -// return this._relations; -// } -// } - -// /// -// /// On Load event -// /// -// /// this aspx page -// /// EventArgs (expect empty) -// protected void Page_Load(object sender, EventArgs e) -// { -// int id; -// if (int.TryParse(Request.QueryString["id"], out id)) -// { -// var relationService = Services.RelationService; - -// this._relationType = relationService.GetRelationTypeById(id); -// if (this._relationType != null) -// { -// this._parentObjectType = UmbracoObjectTypesExtensions.GetUmbracoObjectType(this._relationType.ParentObjectType); -// this._childObjectType = UmbracoObjectTypesExtensions.GetUmbracoObjectType(this._relationType.ChildObjectType); - -// // ----------- - -// if (!this.IsPostBack) -// { -// this.EnsureChildControls(); - -// this.idLiteral.Text = this._relationType.Id.ToString(); -// this.nameTextBox.Text = this._relationType.Name; -// this.aliasTextBox.Text = this._relationType.Alias; - -// if (this._relationType.IsBidirectional) -// { -// this.dualRadioButtonList.Items.FindByValue("1").Selected = true; -// } -// else -// { -// this.dualRadioButtonList.Items.FindByValue("0").Selected = true; -// } - -// this.parentLiteral.Text = this._parentObjectType.GetFriendlyName(); -// // UmbracoHelper.GetFriendlyName(this.parentObjectType); -// this.childLiteral.Text = this._childObjectType.GetFriendlyName(); -// // UmbracoHelper.GetFriendlyName(this.childObjectType); - -// this.relationsCountLiteral.Text = this.Relations.Count.ToString(); - -// this.relationsRepeater.DataSource = this.Relations; -// this.relationsRepeater.DataBind(); -// } -// } -// else -// { -// throw new Exception("Unable to get RelationType where ID = " + id); -// } -// } -// else -// { -// throw new Exception("Invalid RelationType ID"); -// } -// } - -// /// -// /// Creates the child controls used in this page -// /// -// protected override void CreateChildControls() -// { -// base.CreateChildControls(); -/* - var save = tabControl.Menu.NewButton(); - save.Click +=saveMenuImageButton_Click; - save.CausesValidation = true; - save.Text = ui.Text("save"); - save.ButtonType = MenuButtonType.Primary; - save.ID = "save"; - save.ValidationGroup = "RelationType";*/ - -// var relationsTabPage = this.tabControl.NewTabPage("Relations"); -// saveMenuImageButton.ToolTip = "save relation type"; -// saveMenuImageButton.Click +=saveMenuImageButton_Click; -// saveMenuImageButton.CausesValidation = true; -// saveMenuImageButton.Text = Services.TextService.Localize("save"); -// saveMenuImageButton.ValidationGroup = "RelationType"; - -// var relationsTabPage = this.tabControl.NewTabPage("Relations"); -// relationsTabPage.Controls.Add(this.relationsCountPane); -// relationsTabPage.Controls.Add(this.relationsPane); - -// /* -// var refreshMenuImageButton = relationsTabPage.Menu.NewImageButton(); -// refreshMenuImageButton.AlternateText = "refresh relations"; -// refreshMenuImageButton.Click += this.RefreshMenuImageButton_Click; -// refreshMenuImageButton.ImageUrl = "/umbraco/developer/RelationTypes/Images/Refresh.gif"; -// refreshMenuImageButton.CausesValidation = false;*/ -// } - -// /// -// /// check that alias hasn't been changed to clash with another (except itself) -// /// -// /// the aliasCustomValidator control -// /// to set validation respose -// protected void AliasCustomValidator_ServerValidate(object source, ServerValidateEventArgs args) -// { -// args.IsValid = (RelationType.GetByAlias(this.aliasTextBox.Text.Trim()) == null) || -// (this.aliasTextBox.Text.Trim() == this._relationType.Alias); -// } - -// /// -// /// Reload the relations, in case they have changed -// /// -// /// expects refreshMenuImageButton -// /// expects ImageClickEventArgs -// private void RefreshMenuImageButton_Click(object sender, ImageClickEventArgs e) -// { -// } - -// /// -// /// Save button in Umbraco menu -// /// -// /// expects saveMenuImageButton object -// /// expects ImageClickEventArgs -// void saveMenuImageButton_Click(object sender, EventArgs e) -// { -// if (this.Page.IsValid) -// { -// var nameChanged = this._relationType.Name != this.nameTextBox.Text.Trim(); -// var aliasChanged = this._relationType.Alias != this.aliasTextBox.Text.Trim(); -// var directionChanged = this._relationType.IsBidirectional != (this.dualRadioButtonList.SelectedValue == "1"); - -// if (nameChanged || aliasChanged || directionChanged) -// { -// string bubbleBody = string.Empty; - -// if (nameChanged) -// { -// bubbleBody += "Name, "; - -// this._relationType.Name = this.nameTextBox.Text.Trim(); - -// // Refresh tree, as the name as changed -// ClientTools.SyncTree(this._relationType.Id.ToString(), true); -// } - -// if (directionChanged) -// { -// bubbleBody += "Direction, "; -// this._relationType.IsBidirectional = this.dualRadioButtonList.SelectedValue == "1"; -// } - -// if (aliasChanged) -// { -// bubbleBody += "Alias, "; -// this._relationType.Alias = this.aliasTextBox.Text.Trim(); -// } - -// bubbleBody = bubbleBody.Remove(bubbleBody.LastIndexOf(','), 1); -// bubbleBody = bubbleBody + "Changed"; - -// var relationService = Services.RelationService; -// relationService.Save(this._relationType); - -// ClientTools.ShowSpeechBubble(SpeechBubbleIcon.Save, "Relation Type Updated", bubbleBody); -// } -// } -// } -// } -//} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.designer.cs deleted file mode 100644 index 7e8475fdfb..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/RelationTypes/EditRelationType.aspx.designer.cs +++ /dev/null @@ -1,249 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.cms.presentation.developer.RelationTypes { - - - public partial class EditRelationType { - - /// - /// tabControl control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.TabView tabControl; - - /// - /// idPane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane idPane; - - /// - /// idPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel idPropertyPanel; - - /// - /// idLiteral control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal idLiteral; - - /// - /// nameAliasPane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane nameAliasPane; - - /// - /// nameProperyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel nameProperyPanel; - - /// - /// nameTextBox control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox nameTextBox; - - /// - /// nameRequiredFieldValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator nameRequiredFieldValidator; - - /// - /// aliasPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel aliasPropertyPanel; - - /// - /// aliasTextBox control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox aliasTextBox; - - /// - /// aliasRequiredFieldValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator aliasRequiredFieldValidator; - - /// - /// aliasCustomValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CustomValidator aliasCustomValidator; - - /// - /// directionPane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane directionPane; - - /// - /// dualPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel dualPropertyPanel; - - /// - /// dualRadioButtonList control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RadioButtonList dualRadioButtonList; - - /// - /// objectTypePane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane objectTypePane; - - /// - /// parentPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel parentPropertyPanel; - - /// - /// parentLiteral control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal parentLiteral; - - /// - /// childPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel childPropertyPanel; - - /// - /// childLiteral control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal childLiteral; - - /// - /// relationsCountPane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane relationsCountPane; - - /// - /// relationsCountPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel relationsCountPropertyPanel; - - /// - /// relationsCountLiteral control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal relationsCountLiteral; - - /// - /// relationsPane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane relationsPane; - - /// - /// relationsPropertyPanel control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.PropertyPanel relationsPropertyPanel; - - /// - /// relationsRepeater control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Repeater relationsRepeater; - } -}