diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/xmldataintegrityreport.controller.js b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/xmldataintegrityreport.controller.js
new file mode 100644
index 0000000000..09b638b05f
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/xmldataintegrityreport.controller.js
@@ -0,0 +1,62 @@
+function xmlDataIntegrityReportController($scope, umbRequestHelper, $log, $http, $q, $timeout) {
+
+ function check(item) {
+ var action = item.check;
+ umbRequestHelper.resourcePromise(
+ $http.get(umbRequestHelper.getApiUrl("xmlDataIntegrityBaseUrl", action)),
+ 'Failed to retrieve data integrity status')
+ .then(function(result) {
+ item.checking = false;
+ item.invalid = result === "false";
+ });
+ }
+
+ $scope.fix = function(item) {
+ var action = item.fix;
+ if (item.fix) {
+ if (confirm("This will cause all xml structures for this type to be rebuilt. " +
+ "Depending on how much content there is in your site this could take a while. " +
+ "It is not recommended to rebuild xml structures if they are not out of sync, during times of high website traffic " +
+ "or when editors are editing content.")) {
+ item.fixing = true;
+ umbRequestHelper.resourcePromise(
+ $http.post(umbRequestHelper.getApiUrl("xmlDataIntegrityBaseUrl", action)),
+ 'Failed to retrieve data integrity status')
+ .then(function (result) {
+ item.fixing = false;
+ item.invalid = result === "false";
+ });
+ }
+ }
+ }
+
+ $scope.items = {
+ "contentXml": {
+ label: "Content in the cmsContentXml table",
+ checking: true,
+ fixing: false,
+ fix: "FixContentXmlTable",
+ check: "CheckContentXmlTable"
+ },
+ "mediaXml": {
+ label: "Media in the cmsContentXml table",
+ checking: true,
+ fixing: false,
+ fix: "FixMediaXmlTable",
+ check: "CheckMediaXmlTable"
+ },
+ "memberXml": {
+ label: "Members in the cmsContentXml table",
+ checking: true,
+ fixing: false,
+ fix: "FixMembersXmlTable",
+ check: "CheckMembersXmlTable"
+ }
+ };
+
+ for (var i in $scope.items) {
+ check($scope.items[i]);
+ }
+
+}
+angular.module("umbraco").controller("Umbraco.Dashboard.XmlDataIntegrityReportController", xmlDataIntegrityReportController);
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/xmldataintegrityreport.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/xmldataintegrityreport.html
new file mode 100644
index 0000000000..edfac077c0
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/xmldataintegrityreport.html
@@ -0,0 +1,31 @@
+
+
+
Xml Cache Data integrity
+
+
+ Loading...
+
+
+
+ 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.
+
+
+ {{value.label}} ...
+ Checking...
+ Ok
+ Error
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI/config/Dashboard.config b/src/Umbraco.Web.UI/config/Dashboard.config
index f5389cdbf9..95c59431ec 100644
--- a/src/Umbraco.Web.UI/config/Dashboard.config
+++ b/src/Umbraco.Web.UI/config/Dashboard.config
@@ -36,6 +36,11 @@
views/dashboard/developer/examinemanagement.html
+
+
+ views/dashboard/developer/xmldataintegrityreport.html
+
+
diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs
index 10b6989328..0e7d48d3d9 100644
--- a/src/Umbraco.Web/Editors/BackOfficeController.cs
+++ b/src/Umbraco.Web/Editors/BackOfficeController.cs
@@ -232,6 +232,10 @@ namespace Umbraco.Web.Editors
{
"examineMgmtBaseUrl", Url.GetUmbracoApiServiceBaseUrl(
controller => controller.GetIndexerDetails())
+ },
+ {
+ "xmlDataIntegrityBaseUrl", Url.GetUmbracoApiServiceBaseUrl(
+ controller => controller.CheckContentXmlTable())
}
}
},
diff --git a/src/Umbraco.Web/Editors/DashboardController.cs b/src/Umbraco.Web/Editors/DashboardController.cs
index 518761172a..701cca0bb2 100644
--- a/src/Umbraco.Web/Editors/DashboardController.cs
+++ b/src/Umbraco.Web/Editors/DashboardController.cs
@@ -9,9 +9,7 @@ using Umbraco.Core.IO;
namespace Umbraco.Web.Editors
{
- ///
- /// The API controller used for getting entity objects, basic name, icon, id representation of any umbraco object
- ///
+
[PluginController("UmbracoApi")]
public class DashboardController : UmbracoAuthorizedJsonController
{
diff --git a/src/Umbraco.Web/Editors/DashboardSecurity.cs b/src/Umbraco.Web/Editors/DashboardSecurity.cs
index 28725d6b40..a8f5e44ef2 100644
--- a/src/Umbraco.Web/Editors/DashboardSecurity.cs
+++ b/src/Umbraco.Web/Editors/DashboardSecurity.cs
@@ -1,4 +1,5 @@
using System;
+using System.Globalization;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Configuration.Dashboard;
@@ -16,7 +17,7 @@ namespace Umbraco.Web.Editors
public static bool AuthorizeAccess(ISection dashboardSection, IUser user, ISectionService sectionService)
{
- if (user.Id.ToString() == 0.ToInvariantString())
+ if (user.Id.ToString(CultureInfo.InvariantCulture) == 0.ToInvariantString())
{
return true;
}
@@ -30,7 +31,7 @@ namespace Umbraco.Web.Editors
public static bool AuthorizeAccess(IDashboardTab dashboardTab, IUser user, ISectionService sectionService)
{
- if (user.Id.ToString() == Constants.System.Root.ToInvariantString())
+ if (user.Id.ToString(CultureInfo.InvariantCulture) == Constants.System.Root.ToInvariantString())
{
return true;
}
@@ -44,7 +45,7 @@ namespace Umbraco.Web.Editors
public static bool AuthorizeAccess(IDashboardControl dashboardTab, IUser user, ISectionService sectionService)
{
- if (user.Id.ToString() == Constants.System.Root.ToInvariantString())
+ if (user.Id.ToString(CultureInfo.InvariantCulture) == Constants.System.Root.ToInvariantString())
{
return true;
}
diff --git a/src/Umbraco.Web/Editors/TemplateQueryController.cs b/src/Umbraco.Web/Editors/TemplateQueryController.cs
index da4b90607d..2c38287d9a 100644
--- a/src/Umbraco.Web/Editors/TemplateQueryController.cs
+++ b/src/Umbraco.Web/Editors/TemplateQueryController.cs
@@ -5,23 +5,14 @@ using Umbraco.Core.Models;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi.Filters;
using Umbraco.Web.WebApi;
+using System;
+using System.Diagnostics;
+using Umbraco.Web.Dynamics;
+using Umbraco.Web.Models.TemplateQuery;
namespace Umbraco.Web.Editors
{
- using System;
- using System.Diagnostics;
- using System.Diagnostics.Eventing.Reader;
- using System.Drawing;
-
- using global::umbraco;
- using global::umbraco.cms.presentation;
-
- using Umbraco.Core.Persistence.DatabaseModelDefinitions;
- using Umbraco.Web.Dynamics;
- using Umbraco.Web.Models.TemplateQuery;
- using System.Linq.Expressions;
-
- using Umbraco.Web.Models;
+
///
/// The API controller used for building content queries within the template
@@ -39,7 +30,7 @@ namespace Umbraco.Web.Editors
{ }
- private static readonly IEnumerable _terms = new List()
+ private static readonly IEnumerable Terms = new List()
{
new OperathorTerm("is", Operathor.Equals, new [] {"string"}),
new OperathorTerm("is not", Operathor.NotEquals, new [] {"string"}),
@@ -57,7 +48,7 @@ namespace Umbraco.Web.Editors
new OperathorTerm("less than or equal to", Operathor.LessThanEqualTo, new [] {"int"})
};
- private static readonly IEnumerable _properties = new List()
+ private static readonly IEnumerable Properties = new List()
{
new PropertyModel() { Name = "Id", Alias = "Id", Type = "int" },
new PropertyModel() { Name = "Name", Alias = "Name", Type = "string" },
@@ -309,7 +300,7 @@ namespace Umbraco.Web.Editors
///
public IEnumerable GetAllowedProperties()
{
- return _properties.OrderBy(x => x.Name);
+ return Properties.OrderBy(x => x.Name);
}
///
@@ -317,7 +308,7 @@ namespace Umbraco.Web.Editors
///
public IEnumerable