-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSimpleInstallScriptsProxyXP91.asmx
47 lines (43 loc) · 1.46 KB
/
SimpleInstallScriptsProxyXP91.asmx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<%@ WebService Language="C#" Class="SimpleInstallScriptsProxy" %>
using System.Collections.Generic;
using System.ComponentModel;
using System.Web.Services;
using Newtonsoft.Json;
using Sitecore;
using Sitecore.Jobs;
using Sitecore.SecurityModel;
using Sitecore.Shell.Client.Applications.Marketing.Utilities.DeployMarketingDefinitions;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
public class SimpleInstallScriptsProxy : WebService
{
[WebMethod(Description = "Deploys Marketing Definitions")]
public void DeployMarketingDefinitions()
{
JobManager.Start(new JobOptions("DeployMarketingDefinitions", "SimpleInstallScripts", "shell", this, "DeployMarketingDefinitionsInternal"));
}
[UsedImplicitly]
private void DeployMarketingDefinitionsInternal()
{
var controller = new DeployMarketingDefinitionsController();
var definitionTypes = new List<string>
{
"automationplans",
"campaigns",
"events",
"funnels",
"goals",
"marketingassets",
"outcomes",
"pageevents",
"profiles",
"segments"
};
var definitionTypesJson = JsonConvert.SerializeObject(definitionTypes);
using (new SecurityDisabler())
{
var x = controller.DeployDefinitions(definitionTypesJson, true).Result;
}
}
}