From eb6326487f1efe9fcb80736c4eff1cb374155c50 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 9 Sep 2014 18:53:47 +1000 Subject: [PATCH] Fixes grunt watches, Fixes: U4-3138 Examine mgmt dashboard styling is broken, rebuilds the mgmt dashboard in angular --- src/Umbraco.Web.UI.Client/gruntFile.js | 27 +- .../services/umbrequesthelper.service.js | 15 +- .../developer/examinemanagement.html | 231 ++++++++++++++ .../developer/examinemgmt.controller.js | 144 +++++++++ src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 3 - .../config/Dashboard.Release.config | 4 +- src/Umbraco.Web.UI/config/Dashboard.config | 4 +- .../Dashboards/ExamineManagement.css | 124 -------- .../Dashboards/ExamineManagement.js | 289 ------------------ .../Dashboards/ExamineManagementIco.png | Bin 1818 -> 0 bytes .../Editors/BackOfficeController.cs | 4 + src/Umbraco.Web/Search/ExamineIndexerModel.cs | 9 + .../Search/ExamineSearcherModel.cs | 7 +- .../ExamineManagementApiController.cs | 8 +- 14 files changed, 422 insertions(+), 447 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/views/dashboard/developer/examinemanagement.html create mode 100644 src/Umbraco.Web.UI.Client/src/views/dashboard/developer/examinemgmt.controller.js delete mode 100644 src/Umbraco.Web.UI/umbraco_client/Dashboards/ExamineManagement.css delete mode 100644 src/Umbraco.Web.UI/umbraco_client/Dashboards/ExamineManagement.js delete mode 100644 src/Umbraco.Web.UI/umbraco_client/Dashboards/ExamineManagementIco.png diff --git a/src/Umbraco.Web.UI.Client/gruntFile.js b/src/Umbraco.Web.UI.Client/gruntFile.js index a201d6d88c..d79492b4a2 100644 --- a/src/Umbraco.Web.UI.Client/gruntFile.js +++ b/src/Umbraco.Web.UI.Client/gruntFile.js @@ -193,12 +193,7 @@ module.exports = function (grunt) { { dest: '<%= vsdir %>/views', src: '**', expand: true, cwd: '<%= distdir %>/views' }, { dest: '<%= vsdir %>/preview', src: '**', expand: true, cwd: '<%= distdir %>/preview' } ] - }, - vsLibs: { - files: [ - { dest: '<%= vsdir %>/lib', src: '**', expand: true, cwd: '<%= distdir %>/lib' } - ] - }, + }, packages: { files: [{ dest: '<%= vsdir %>/../App_Plugins', src : '**', expand: true, cwd: 'src/packages/' }] } @@ -347,7 +342,7 @@ module.exports = function (grunt) { watch:{ css: { - files: '**/*.less', + files: 'src/**/*.less', tasks: ['watch-less', 'timestamp'], options: { livereload: true, @@ -374,15 +369,17 @@ module.exports = function (grunt) { tasks:['watch-html','timestamp'] }, - packages: { - files: 'src/packages/**/*.*', - tasks: ['watch-packages', 'timestamp'], - }, + //SD: Removing package watching, we don't even use these anymore and they should be removed, the more watching we do the slower this gets + //packages: { + // files: 'src/packages/**/*.*', + // tasks: ['watch-packages', 'timestamp'], + //} - docs: { - files: ['src/**/*.js', 'src/*.js'], - tasks: ['docs:api'], - } + //SD: Removing watch docs, this gets run with the normal watching which we do not want + //docs: { + // files: ['src/**/*.js', 'src/*.js'], + // tasks: ['docs:api'], + //} }, diff --git a/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js index dfc970422c..48254d0292 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js @@ -18,7 +18,6 @@ function umbRequestHelper($http, $q, umbDataFormatter, angularHelper, dialogServ * @param {Array} queryStrings An array of key/value pairs */ dictionaryToQueryString: function (queryStrings) { - if (angular.isArray(queryStrings)) { return _.map(queryStrings, function (item) { @@ -35,15 +34,13 @@ function umbRequestHelper($http, $q, umbDataFormatter, angularHelper, dialogServ return encodeURIComponent(key) + "=" + encodeURIComponent(val); }).join("&"); } + else if (angular.isObject(queryStrings)) { - /* - //if we have a simple object, we can simply map with $.param - //but with the current structure we cant since an array is an object and an object is an array - if(angular.isObject(queryStrings)){ - return decodeURIComponent($.param(queryStrings)); - }*/ - - throw "The queryString parameter is not an array of key value pairs"; + //this allows for a normal object to be passed in (ie. a dictionary) + return decodeURIComponent($.param(queryStrings)); + } + + throw "The queryString parameter is not an array or object of key value pairs"; }, /** diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/examinemanagement.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/examinemanagement.html new file mode 100644 index 0000000000..aaf170b221 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/examinemanagement.html @@ -0,0 +1,231 @@ +
+ +

Examine Management

+ +
+ Loading... +
+ +

Indexers

+ + + +

Searchers

+ + + +
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/examinemgmt.controller.js b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/examinemgmt.controller.js new file mode 100644 index 0000000000..84a6d0fe3a --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/examinemgmt.controller.js @@ -0,0 +1,144 @@ +function examineMgmtController($scope, umbRequestHelper, $log, $http, $q) { + + $scope.indexerDetails = []; + $scope.searcherDetails = []; + $scope.loading = true; + + function checkProcessing(indexer, checkActionName) { + umbRequestHelper.resourcePromise( + $http.post(umbRequestHelper.getApiUrl("examineMgmtBaseUrl", checkActionName, { indexerName: indexer.name })), + 'Failed to check index processing') + .then(function(data) { + + if (data) { + + //copy all resulting properties + for (var k in data) { + indexer[k] = data[k]; + } + indexer.isProcessing = false; + } + else { + setTimeout(function() { + //don't continue if we've tried 100 times + if (indexer.processingAttempts < 100) { + checkProcessing(indexer, checkActionName); + //add an attempt + indexer.processingAttempts++; + } + else { + //we've exceeded 100 attempts, stop processing + indexer.isProcessing = false; + } + }, 1000); + } + }); + } + + $scope.search = function (searcher, e) { + if (e && e.keyCode !== 13) { + return; + } + + umbRequestHelper.resourcePromise( + $http.get(umbRequestHelper.getApiUrl("examineMgmtBaseUrl", "GetSearchResults", { + searcherName: searcher.name, + query: searcher.searchText, + queryType: searcher.searchType + })), + 'Failed to search') + .then(function(searchResults) { + searcher.isSearching = true; + searcher.searchResults = searchResults; + }); + } + + $scope.toggle = function(provider, propName) { + if (provider[propName] !== undefined) { + provider[propName] = !provider[propName]; + } + else { + provider[propName] = true; + } + } + + $scope.rebuildIndex = function(indexer) { + if (confirm("This will cause the index to be rebuilt. " + + "Depending on how much content there is in your site this could take a while. " + + "It is not recommended to rebuild an index during times of high website traffic " + + "or when editors are editing content.")) { + indexer.isProcessing = true; + + umbRequestHelper.resourcePromise( + $http.post(umbRequestHelper.getApiUrl("examineMgmtBaseUrl", "PostRebuildIndex", { indexerName: indexer.name })), + 'Failed to rebuild index') + .then(function () { + + //rebuilding has started, nothing is returned accept a 200 status code. + //lets poll to see if it is done. + setTimeout(function () { + checkProcessing(indexer, "PostCheckRebuildIndex"); + }, 1000); + + }); + } + } + + $scope.optimizeIndex = function(indexer) { + if (confirm("This will cause the index to be optimized which will improve its performance. " + + "It is not recommended to optimize an index during times of high website traffic " + + "or when editors are editing content.")) { + indexer.isProcessing = true; + + umbRequestHelper.resourcePromise( + $http.post(umbRequestHelper.getApiUrl("examineMgmtBaseUrl", "PostOptimizeIndex", { indexerName: indexer.name })), + 'Failed to optimize index') + .then(function () { + + //optimizing has started, nothing is returned accept a 200 status code. + //lets poll to see if it is done. + setTimeout(function () { + checkProcessing(indexer, "PostCheckOptimizeIndex"); + }, 1000); + + }); + } + } + + $scope.closeSearch = function(searcher) { + searcher.isSearching = true; + } + + + //go get the data + + //combine two promises and execute when they are both done + $q.all([ + + //get the indexer details + umbRequestHelper.resourcePromise( + $http.get(umbRequestHelper.getApiUrl("examineMgmtBaseUrl", "GetIndexerDetails")), + 'Failed to retrieve indexer details') + .then(function(data) { + $scope.indexerDetails = data; + }), + + //get the searcher details + umbRequestHelper.resourcePromise( + $http.get(umbRequestHelper.getApiUrl("examineMgmtBaseUrl", "GetSearcherDetails")), + 'Failed to retrieve searcher details') + .then(function(data) { + $scope.searcherDetails = data; + for (var s in $scope.searcherDetails) { + $scope.searcherDetails[s].searchType = "text"; + } + }) + + ]).then(function () { + //all init loading is complete + $scope.loading = false; + }); + + +} +angular.module("umbraco").controller("Umbraco.Dashboard.ExamineMgmtController", examineMgmtController); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 935bb1db73..dc49796c2e 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -844,9 +844,6 @@ - - - diff --git a/src/Umbraco.Web.UI/config/Dashboard.Release.config b/src/Umbraco.Web.UI/config/Dashboard.Release.config index b4751fcf42..c76ee4c62c 100644 --- a/src/Umbraco.Web.UI/config/Dashboard.Release.config +++ b/src/Umbraco.Web.UI/config/Dashboard.Release.config @@ -22,7 +22,9 @@ - /umbraco/dashboard/ExamineManagement.ascx + + views/dashboard/developer/examinemanagement.html + diff --git a/src/Umbraco.Web.UI/config/Dashboard.config b/src/Umbraco.Web.UI/config/Dashboard.config index 6e961a3972..bc1dfacc63 100644 --- a/src/Umbraco.Web.UI/config/Dashboard.config +++ b/src/Umbraco.Web.UI/config/Dashboard.config @@ -22,7 +22,9 @@ - /umbraco/dashboard/ExamineManagement.ascx + + views/dashboard/developer/examinemanagement.html + diff --git a/src/Umbraco.Web.UI/umbraco_client/Dashboards/ExamineManagement.css b/src/Umbraco.Web.UI/umbraco_client/Dashboards/ExamineManagement.css deleted file mode 100644 index e20dea8189..0000000000 --- a/src/Umbraco.Web.UI/umbraco_client/Dashboards/ExamineManagement.css +++ /dev/null @@ -1,124 +0,0 @@ -#examineManagement .provider -{ - padding-top: 3px; -} - -#examineManagement .propertyPane -{ - padding: 5px; -} - -#examineManagement table th -{ - font-weight: normal; - color: #333; - width: 200px; -} - -#examineManagement table td -{ - color: #999; -} - - #examineManagement table td.highlight - { - font-style: italic; - } - -#examineManagement .propertyPane > a -{ - padding: 3px; - display: block; -} - - #examineManagement .propertyPane > a.expanded - { - border-bottom: 1px solid #CCC; - margin-bottom: 5px; - padding-bottom: 5px; - } - -#examineManagement .provider > a -{ - padding: 7px; - display: block; - font-size: 1.1em; -} - -#examineManagement .provider > div -{ - margin-left: 15px; -} - -#examineManagement a -{ - text-decoration: none; -} - - #examineManagement a:hover - { - text-decoration: underline; - } - -#examineManagement .index-tools table -{ - width: 350px; -} - -#examineManagement .index-tools .index-actions -{ - float: right; -} - - #examineManagement .index-tools .index-actions .error - { - width: 560px; - padding: 5px; - } - -#examineManagement .search-tools input[type="text"] -{ - width: 400px; -} - -#examineManagement .search-tools a.hide -{ - float: right; -} - -#examineManagement .search-tools .search-results -{ - margin-top: 5px; -} - - #examineManagement .search-tools .search-results table - { - border-collapse: collapse; - } - - #examineManagement .search-tools .search-results th.score - { - width: 50px; - } - - #examineManagement .search-tools .search-results th.id - { - width: 50px; - } - - #examineManagement .search-tools .search-results tbody tr td - { - border-bottom: 1px solid #DDD; - padding: 3px; - } - #examineManagement .search-tools .search-results tbody tr td span.key { - display: inline-block; - color: rgb(0, 64, 201); - font-style: italic; - } - #examineManagement .search-tools .search-results tbody tr td span.value { - font-weight: normal; - display: inline-block; - padding-right: 5px; - color: black; - } diff --git a/src/Umbraco.Web.UI/umbraco_client/Dashboards/ExamineManagement.js b/src/Umbraco.Web.UI/umbraco_client/Dashboards/ExamineManagement.js deleted file mode 100644 index 699b21637b..0000000000 --- a/src/Umbraco.Web.UI/umbraco_client/Dashboards/ExamineManagement.js +++ /dev/null @@ -1,289 +0,0 @@ -Umbraco.Sys.registerNamespace("Umbraco.Dashboards"); - -(function ($) { - - Umbraco.Dashboards.ExamineManagement = base2.Base.extend({ - - //private methods/variables - _opts: null, - _koViewModel: null, - - _mapSearcherModelProperties: function (indexerModel) { - var self = this; - - var viewModel = self._mapBaseProviderModelProperties(indexerModel); - - //add custom searcher props - viewModel.searchText = ko.observable(""); - viewModel.searchType = ko.observable("text"); - viewModel.isSearching = ko.observable(false); - viewModel.closeSearch = function() { - this.isSearching(false); - }; - //add flag properties to determine if either button has been pressed - viewModel.isProcessing = ko.observable(false); - //don't need an observable array since it does not change, just need an observable to hold an array. - viewModel.searchResults = ko.observable([]); - viewModel.search = function () { - //NOTE: 'this' is the ko view model - this.isSearching(true); - self._doSearch(this); - }; - viewModel.handleEnter = function(vm, event) { - var keyCode = (event.which ? event.which : event.keyCode); - if (keyCode === 13) { - vm.search(); - return false; - } - return true; - }; - - return viewModel; - }, - - _mapBaseProviderModelProperties : function(indexerModel) { - var self = this; - - //do the ko auto-mapping - var viewModel = ko.mapping.fromJS(indexerModel); - - //need to re-map the dictionary to an array so we can bind to it - //we don't need to have an observable array since we're never adding/removing, just setting the object - viewModel.ProviderProperties = ko.observable(self._mapDictionaryToArray(indexerModel.ProviderProperties)); - - //add toggle and show properties - //(NOTE that 'this' inside of these functions is actually the knockoutjs model that is bound) - viewModel.showProperties = ko.observable(false); - viewModel.toggleProperties = function () { - this.showProperties(!this.showProperties()); - }; - viewModel.showProviderProperties = ko.observable(false); - viewModel.toggleProviderProperties = function () { - this.showProviderProperties(!this.showProviderProperties()); - }; - viewModel.showTools = ko.observable(false); - viewModel.toggleTools = function () { - this.showTools(!this.showTools()); - }; - - return viewModel; - }, - - _mapIndexerModelProperties: function (indexerModel, viewModel) { - var self = this; - - //if we are updating the view model or creating it for the first time. - var isUpdate = viewModel != null; - - if (!isUpdate) { - //do the ko auto-mapping to the new object and create additional properties - - viewModel = self._mapBaseProviderModelProperties(indexerModel); - - //property to track how many attempts have been made to check if the index is optimized or rebuilt - viewModel.processingAttempts = ko.observable(0); - //add a hasDeletions prop - viewModel.hasDeletions = ko.observable(indexerModel.DeletionCount > 0); - //add toggle and show properties - //(NOTE that 'this' inside of these functions is actually the knockoutjs model that is bound) - viewModel.showSystemFields = ko.observable(false); - viewModel.toggleSystemFields = function () { - this.showSystemFields(!this.showSystemFields()); - }; - viewModel.showUserFields = ko.observable(false); - viewModel.toggleUserFields = function () { - this.showUserFields(!this.showUserFields()); - }; - viewModel.showNodeTypes = ko.observable(false); - viewModel.toggleNodeTypes = function () { - this.showNodeTypes(!this.showNodeTypes()); - }; - //add flag properties to determine if either button has been pressed - viewModel.isProcessing = ko.observable(false); - //add the button methods - viewModel.rebuildIndex = function () { - if (confirm("This will cause the index to be rebuilt. " + - "Depending on how much content there is in your site this could take a while. " + - "It is not recommended to rebuild an index during times of high website traffic " + - "or when editors are editing content.")) { - //NOTE: 'this' is the knockoutjs model that is bound - self._doProcessing(this.Name(), this, "PostRebuildIndex", "PostCheckRebuildIndex"); - } - }; - viewModel.optimizeIndex = function () { - if (confirm("This will cause the index to be optimized which will improve its performance. " + - "It is not recommended to optimize an index during times of high website traffic " + - "or when editors are editing content.")) { - //NOTE: 'this' is the knockoutjs model that is bound - self._doProcessing(this.Name(), this, "PostOptimizeIndex", "PostCheckOptimizeIndex"); - } - }; - } - else { - //update it with new data - ko.mapping.fromJS(indexerModel, viewModel); - } - - //whether we are updating or creating we always execute this logic... - - //change the include/exclude node types to say something different if they are empty - viewModel.IndexCriteria.IncludeNodeTypes(indexerModel.IndexCriteria.IncludeNodeTypes.join()); - viewModel.IndexCriteria.ExcludeNodeTypes(indexerModel.IndexCriteria.ExcludeNodeTypes.join()); - if (viewModel.IndexCriteria.IncludeNodeTypes() == "") - viewModel.IndexCriteria.IncludeNodeTypes("Include all"); - if (viewModel.IndexCriteria.ExcludeNodeTypes() == "") - viewModel.IndexCriteria.ExcludeNodeTypes("Exclude none"); - - return viewModel; - }, - - _doSearch: function(viewModel) { - var self = this; - viewModel.isProcessing(true); - $.get(self._opts.restServiceLocation + "GetSearchResults?searcherName=" + viewModel.Name() + "&query=" + viewModel.searchText() + "&queryType=" + viewModel.searchType(), - function(searchResults) { - viewModel.isProcessing(false); - //re-map the fields dictionary to array - for (var s in searchResults) { - searchResults[s].Fields = self._mapDictionaryToArray(searchResults[s].Fields); - } - viewModel.searchResults(searchResults); - }).fail(function(a, b, c) { - alert(b + ": " + a.responseText); - }); - }, - - _doProcessing: function (name, viewModel, processingActionName, pollActionName) { - var self = this; - viewModel.isProcessing(true); //set the model processing - - $.post(self._opts.restServiceLocation + processingActionName + "?indexerName=" + name, - function (data) { - - //optimization has started, nothing is returned accept a 200 status code. - //lets poll to see if it is done. - setTimeout(function() { - self._checkProcessing(name, viewModel, pollActionName); - }, 1000); - - }).fail(function (a, b, c) { - alert(b + ": " + a.responseText); - }); - }, - - _checkProcessing: function (name, viewModel, actionName) { - var self = this; - - $.post(self._opts.restServiceLocation + actionName + "?indexerName=" + name, - function (data) { - if (data) { - //success! now, we need to re-update the whole indexer model - self._mapIndexerModelProperties(data, viewModel); - viewModel.isProcessing(false); - } - else { - //copy local from closure - var vm = viewModel; - var an = actionName; - setTimeout(function () { - //don't continue if we've tried 100 times - if (vm.processingAttempts() < 100) { - self._checkProcessing(name, vm, an); - //add an attempt - vm.processingAttempts(vm.processingAttempts() + 1); - } - else { - //we've exceeded 100 attempts, stop processing - viewModel.isProcessing(false); - } - }, 1000); - } - }).fail(function (a, b, c) { - alert(b + ": " + a.responseText); - }); - }, - - _mapDictionaryToArray: function (dictionary) { - var result = []; - for (var key in dictionary) { - if (dictionary.hasOwnProperty(key)) { - result.push({ key: key, value: dictionary[key] }); - } - } - return result; - }, - - _loadDetails: function () { - var self = this; - self._koViewModel.loading(true); - - var loadingCount = 2; - - $.get(self._opts.restServiceLocation + "GetIndexerDetails", - function (e) { - if (--loadingCount == 0) { - self._koViewModel.loading(false); - } - - //loop through each indexer in the array and remap its properties - for (var item in e) { - e[item] = self._mapIndexerModelProperties(e[item]); - } - - self._koViewModel.indexerDetails(e); - }).fail(function (a, b, c) { - alert(b + ": " + a.responseText); - }); - - $.get(self._opts.restServiceLocation + "GetSearcherDetails", - function (e) { - if (--loadingCount == 0) { - self._koViewModel.loading(false); - } - - for (var item in e) { - e[item] = self._mapSearcherModelProperties(e[item]); - } - - self._koViewModel.searcherDetails(e); - }).fail(function (a, b, c) { - alert(b + ": " + a.responseText); - }); - }, - - // Constructor - constructor: function (opts) { - // Merge options with default - this._opts = $.extend({ - container: $("#examineManagement") - }, opts); - }, - - //public methods/variables - - init: function () { - var self = this; - - //The knockout js view model for the selected item - self._koViewModel = { - indexerDetails: ko.observable(null), - searcherDetails: ko.observable(null), - loading: ko.observable(false) - }; - - ko.applyBindings(self._koViewModel, self._opts.container.get(0)); - - this._loadDetails(); - } - - }); - - - //Set defaults for jQuery ajax calls. - $.ajaxSetup({ - dataType: 'json', - cache: false, - contentType: 'application/json; charset=utf-8' - }); - -})(jQuery); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco_client/Dashboards/ExamineManagementIco.png b/src/Umbraco.Web.UI/umbraco_client/Dashboards/ExamineManagementIco.png deleted file mode 100644 index 4d281e6972a9dc6bd8679285213b45dac8ec0750..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1818 zcmV+#2j%#QP){5J+Uh0*w(hu8lh}F(yEC zLCS{kSU_k+5CIVpN-I!GpJV6MnLBeI{@>|6WgJ=guSfs){@w59zv2s;ZKrD57^9M~H3PLW;#A<@0%(nVF%HkrBFg?;c&a zaDiT@=}^9V_ik!wX`zOO1`3D6g(9zLB%a<>w#>Pg9L?RRn2E}3W_S`Giu3f8T7QDQ^uzB<51cPuS04S9J z!4v@9xpRjmCMGHa(AL%_XvfV#y}bR{*jV+@(9j+R_0HP0Yv1H~AJc8zx^?S8GMW5w z)v8rznwpwYk|i_%ipS&B+1W{F&z`Le0F;M9AweT<137c%%$D}{_M`ju?d#!Nd87}Z ztzNx)12fReteo%b>-%``-n~~bFMR?mGC1K^m9U_La@<%7AG&4d&Yj<~PprWL>5$R^ zaZ6U@*}8S>+pJ{8>C>m*@9piq3Nv6G%m+3r1)xeBLO}b*jT?`$Ppkp8Upyz->{&JD0RZP=Po+(jHbg%>JiKSqrcFKYbSRgKOG8nPC1bq4n|-CX zbS=)R7y$m@K)$^ijYi)Ey|GyAU&^HN^06DLp4!^l{n#((VXD^x0K|Mij454(!~z>G zbn9{uFdG{7jgF4S@ISu6Au9#|w62HyITHMfQNGX|1P%Lm?3Zl576aG-oAai8E|<$= zEDtZId?7O+DzK0He6e5<#BuD`0|3f64NtK%J%o27w=d=crSph;G~PE9T@s$kCa1|r zCrB@(=!5O`^yU7xR|9}@P{yg)P9zd1IfTq7Po9vZb1@%)q*5s?GbhJKPeenyT}(}o zk{PF3dzxZClRB0!c_j!{78eM|e;+a&vf|+2;7iRgH8mv;xP1B2(9(#v&(2H|WhTgz zo1khtNkQEf>s|#y+p%K@$!u6tQ)67Ya%GTnz*`&%F_c&&766hBw`PwQhyOMBCtW@J zL-g+8W39Czc;3z?NXgHT&rDNLHAzzhjno+NQ+qs2=YF4j5x}->+eEsR*^mp*Q!XUG z@V90TuNL+P6+k8@CxsY>fh=fVzkdDP@#EiIsteei(SXurjo;tVq$fS5W#90TL0*+3 zVJ=7n*v4ufwKrG407B#9G7mt~+uGVXlFerO`uqFuGSvzcvY&7fOpe~ZeY^kq&sRSS zsD)$OH?*9(|KMRwS6zB*b3|?Ns7|kD8z$?$tf}Ji^9{qs$crG9_3PJDPfrgmTeb`) z5S6j)L89Eaaif-dAA>MDJ3A7yGt*8XIZk$Zg8YfQ@A-3M--{INR?LEF9^vphrj#N; za|_zd$4UC|&`4 z+gb8Cc~VsEoJLm2v5H+n&s^wsTL7WymrEItU;yH~{t?pUH?RQd?(P;!P!psBNe6{V zgxCgYMx4~#G|_B=>|By8BYSxE=^u`jOC5I0EcSeAu})7oc8ri6k@md-(!((d#y8NZ zO$TY-NHY0U(j3c#LNaG($jl_j%>FILRz6Ls`vYGTGt-APH-X{Cj^;ZOT-tVw*&xjy zCT}!O!Nykd*RP=Y!hPt_p^5>3Vny?is(VTG_(<{aqXnY#LnYRHzL*>jn)ytZo9jt& ztZvho9SO$Q{pzWzB~Nt&SYa?#&rR?$eI=qwVY{nLr@}xKK1i{vqU4wc*+qjwOV@oe zF>u0{eSG_X1fi;W699t+QlH1@VkQ7H0Ov!QM#Xg{1a~QukoyhmyzV}LbVkpA{r1eA z3+p3mwqIGg>%iy5^whAKoq1&DQyE`voV?Zb3j$EwgQVi1t3)afmr2B(kGTI!VAvPT zjSYqZjc=Gd&a&KO`6~11)=%D=CKCV_G67x_*pPR}DDDG(+vK-OA;&+X z@N3HA@Z{f|;d*w!&`SZ7Gvbs0Tijd4b4)>)%zKyW4T{*u2?7%wlA}eYX;p3>7#N`c zqlql2drHJB6e3(T2BLAemevTR{D6Z857K|h4V5-rR9+VSKNr_6e8c|WA^-pY07*qo IM6N<$f-})_4*&oF diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index 3a9886be1e..6343d614b4 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -217,6 +217,10 @@ namespace Umbraco.Web.Editors { "tagsDataBaseUrl", Url.GetUmbracoApiServiceBaseUrl( controller => controller.GetTags("")) + }, + { + "examineMgmtBaseUrl", Url.GetUmbracoApiServiceBaseUrl( + controller => controller.GetIndexerDetails()) } } }, diff --git a/src/Umbraco.Web/Search/ExamineIndexerModel.cs b/src/Umbraco.Web/Search/ExamineIndexerModel.cs index 6aa28505c4..4fb557d318 100644 --- a/src/Umbraco.Web/Search/ExamineIndexerModel.cs +++ b/src/Umbraco.Web/Search/ExamineIndexerModel.cs @@ -1,35 +1,44 @@ using System; +using System.Runtime.Serialization; using Examine; namespace Umbraco.Web.Search { + + [DataContract(Name = "indexer", Namespace = "")] public class ExamineIndexerModel : ExamineSearcherModel { + [DataMember(Name = "indexCriteria")] public IIndexCriteria IndexCriteria { get; set; } /// /// The number of docs in the index /// + [DataMember(Name = "documentCount")] public int DocumentCount { get; set; } /// /// The number of fields in the index /// + [DataMember(Name = "fieldCount")] public int FieldCount { get; set; } /// /// The number of documents flagged for deletion in the index /// + [DataMember(Name = "deletionCount")] public int DeletionCount { get; set; } /// /// Whether or not the indexed is optimized /// + [DataMember(Name = "isOptimized")] public bool IsOptimized{ get; set; } /// /// Generally will always be true unless someone has created a new non-lucene index /// + [DataMember(Name = "isLuceneIndex")] public bool IsLuceneIndex { get; set; } } diff --git a/src/Umbraco.Web/Search/ExamineSearcherModel.cs b/src/Umbraco.Web/Search/ExamineSearcherModel.cs index 18623ff775..d1f1a83453 100644 --- a/src/Umbraco.Web/Search/ExamineSearcherModel.cs +++ b/src/Umbraco.Web/Search/ExamineSearcherModel.cs @@ -1,10 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.Serialization; using System.Text; namespace Umbraco.Web.Search { + [DataContract(Name = "searcher", Namespace = "")] public class ExamineSearcherModel { public ExamineSearcherModel() @@ -12,7 +14,10 @@ namespace Umbraco.Web.Search ProviderProperties = new Dictionary(); } - public string Name { get; set; } + [DataMember(Name = "name")] + public string Name { get; set; } + + [DataMember(Name = "providerProperties")] public IDictionary ProviderProperties { get; private set; } } diff --git a/src/Umbraco.Web/WebServices/ExamineManagementApiController.cs b/src/Umbraco.Web/WebServices/ExamineManagementApiController.cs index 2106cef51e..cf031fbd6a 100644 --- a/src/Umbraco.Web/WebServices/ExamineManagementApiController.cs +++ b/src/Umbraco.Web/WebServices/ExamineManagementApiController.cs @@ -41,7 +41,7 @@ namespace Umbraco.Web.WebServices }; var props = TypeHelper.CachedDiscoverableProperties(searcher.GetType(), mustWrite: false) //ignore these properties - .Where(x => !new[] { "Description" }.InvariantContains(x.Name)) + .Where(x => new[] {"Description"}.InvariantContains(x.Name) == false) .OrderBy(x => x.Name); foreach (var p in props) { @@ -136,7 +136,7 @@ namespace Umbraco.Web.WebServices /// /// /// - /// This is kind of rudementary since there's no way we can know that the index has rebuilt, we'll just check + /// This is kind of rudimentary since there's no way we can know that the index has rebuilt, we'll just check /// if the index is locked based on Lucene apis /// public ExamineIndexerModel PostCheckRebuildIndex(string indexerName) @@ -181,7 +181,7 @@ namespace Umbraco.Web.WebServices }; var props = TypeHelper.CachedDiscoverableProperties(indexer.GetType(), mustWrite: false) //ignore these properties - .Where(x => !new[] { "IndexerData", "Description", "WorkingFolder" }.InvariantContains(x.Name)) + .Where(x => new[] {"IndexerData", "Description", "WorkingFolder"}.InvariantContains(x.Name) == false) .OrderBy(x => x.Name); foreach (var p in props) { @@ -193,7 +193,7 @@ namespace Umbraco.Web.WebServices { indexerModel.IsLuceneIndex = true; indexerModel.DocumentCount = luceneIndexer.GetIndexDocumentCount(); - indexerModel.FieldCount = luceneIndexer.GetIndexDocumentCount(); + indexerModel.FieldCount = luceneIndexer.GetIndexFieldCount(); indexerModel.IsOptimized = luceneIndexer.IsIndexOptimized(); indexerModel.DeletionCount = luceneIndexer.GetDeletedDocumentsCount(); }