13 | @using (Html.BeginForm("Index", "ElasticSettings"))
14 | {
15 |
@Html.TranslateWithPathRaw("settings", localizationPath)
16 |
17 |
26 |
27 |
28 | }
29 |
30 | @if (Model.Result != null)
31 | {
32 |
@Model.Result
33 | }
34 |
--------------------------------------------------------------------------------
/src/Epinova.ElasticSearch.Core.EPiServer/modules/_protected/ElasticSearch/ClientResources/Scripts/ToolbarProvider.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'dojo/_base/declare',
3 | 'dijit/form/Button',
4 | 'epi-cms/component/command/_GlobalToolbarCommandProvider',
5 | 'epi/i18n!epi/nls/epinovaelasticsearch.widget',
6 | 'epinova-elasticsearch/UpdateIndexCommand'
7 | ],
8 | function (
9 | declare,
10 | Button,
11 | _GlobalToolbarCommandProvider,
12 | translator,
13 | UpdateIndexCommand
14 | ) {
15 | return declare([_GlobalToolbarCommandProvider], {
16 | constructor: function () {
17 | this.inherited(arguments);
18 |
19 | this.addToCenter(new UpdateIndexCommand({ label: translator.button.label }), { showLabel: true, widget: Button });
20 | }
21 | });
22 | });
--------------------------------------------------------------------------------
/src/Epinova.ElasticSearch.Core.EPiServer/modules/_protected/ElasticSearch/ClientResources/Scripts/UpdateIndexCommand.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'dojo/_base/declare',
3 | 'epi/shell/command/_Command',
4 | 'epi/i18n!epi/nls/epinovaelasticsearch.widget'
5 | ], function (
6 | declare,
7 | _Command,
8 | translator
9 | ) {
10 | return declare([_Command], {
11 | name: 'updateIndex',
12 | label: translator.button.label,
13 | tooltip: translator.button.tooltip,
14 | iconClass: 'epi-iconSortAscending',
15 | canExecute: true,
16 |
17 | _execute: function () {
18 | dojo.rawXhrPost({
19 | url: '/ElasticSearchAdmin/ElasticIndexer/UpdateItem',
20 | handleAs: 'json',
21 | headers: { "Content-Type": 'application/json' },
22 | timeout: 10000,
23 | postData: dojo.toJson({ "id": this.model.contentLink }),
24 | load: function (data) {
25 | if (!!console && !!console.info) {
26 | console.info(data.status);
27 | }
28 | },
29 | error: function (error) {
30 | alert('An error occured, unable to update index. Status: ' + error);
31 | }
32 | });
33 | }
34 | });
35 | });
--------------------------------------------------------------------------------
/src/Epinova.ElasticSearch.Core.EPiServer/modules/_protected/ElasticSearch/ClientResources/Scripts/UpdateTreeStructureCommand.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'dojo/topic',
3 | 'dojo/_base/declare',
4 | 'epi/dependency',
5 | 'epi/shell/command/_Command',
6 | 'epi/i18n!epi/nls/epinovaelasticsearch.widget'
7 | ], function (
8 | topic,
9 | declare,
10 | dependency,
11 | _Command,
12 | translator
13 | ) {
14 | return declare([_Command], {
15 | name: 'updateStructure',
16 | label: translator.button.label,
17 | tooltip: translator.button.tooltip,
18 | iconClass: 'epi-iconSortAscending',
19 | canExecute: true,
20 |
21 | _execute: function () {
22 | dojo.rawXhrPost({
23 | url: '/ElasticSearchAdmin/ElasticIndexer/UpdateItem',
24 | handleAs: 'json',
25 | headers: { "Content-Type": 'application/json' },
26 | timeout: 600000,
27 | postData: dojo.toJson({ "id": this.model.contentLink, "recursive": true }),
28 | load: function (data) {
29 | if (!!console && !!console.info) {
30 | console.info(data.status);
31 | }
32 | },
33 | error: function (error) {
34 | alert('An error occured, unable to update index. Status: ' + error);
35 | }
36 | });
37 | }
38 | });
39 | });
--------------------------------------------------------------------------------
/src/Epinova.ElasticSearch.Core.EPiServer/modules/_protected/ElasticSearch/ClientResources/Scripts/init.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'dojo',
3 | 'epi/dependency',
4 | 'epi-cms/plugin-area/navigation-tree',
5 | 'epinova-elasticsearch/ToolbarProvider',
6 | 'epinova-elasticsearch/UpdateTreeStructureCommand'
7 | ],
8 | function (
9 | dojo,
10 | dependency,
11 | navigationTreePluginArea,
12 | ToolbarProvider,
13 | UpdateTreeStructureCommand
14 | ) {
15 | return dojo.declare([], {
16 | initialize: function () {
17 | var commandregistry = dependency.resolve('epi.globalcommandregistry');
18 | commandregistry.registerProvider('epi.cms.contentdetailsmenu', new ToolbarProvider());
19 | navigationTreePluginArea.add(UpdateTreeStructureCommand);
20 | }
21 | });
22 | });
--------------------------------------------------------------------------------
/src/Epinova.ElasticSearch.Core.EPiServer/modules/_protected/ElasticSearch/ElasticSearch.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Epinova/Epinova.Elasticsearch/750ceedab59ace47b407cd0ea5e37cb68df43ae1/src/Epinova.ElasticSearch.Core.EPiServer/modules/_protected/ElasticSearch/ElasticSearch.zip
--------------------------------------------------------------------------------
/src/Epinova.ElasticSearch.Core.EPiServer/modules/_protected/ElasticSearch/module.config:
--------------------------------------------------------------------------------
1 |
2 |