Skip to content

Commit 9d9e19a

Browse files
author
Michael West
committed
Added items and config needed for DataSync.
1 parent 3441c7f commit 9d9e19a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1573
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
3+
<sitecore>
4+
<unicorn>
5+
<configurations>
6+
<configuration name="Spe.DataSync" description="Sitecore PowerShell Extensions DataSync" dependencies="Spe.Core" >
7+
<targetDataStore physicalRootPath="C:\Work\DataSync\App_Data\Unicorn\SPE\Extensions" useDataCache="false" singleInstance="true" />
8+
<predicate type="Unicorn.Predicates.SerializationPresetPredicate, Unicorn" singleInstance="true">
9+
<include name="Templates" database="master" path="/sitecore/templates/Modules/PowerShell DataSync" />
10+
<include database="master" path="/sitecore/system/Modules/PowerShell/Script Library/SPE/Extensions/DataSync">
11+
<exclude childrenOfPath="Imports" />
12+
</include>
13+
</predicate>
14+
</configuration>
15+
</configurations>
16+
</unicorn>
17+
</sitecore>
18+
</configuration>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
ID: "819f0f13-6c01-44f0-990c-2a3e3e7d2017"
3+
Parent: "67b5e3af-75c1-4e0e-9947-f51106122be5"
4+
Template: "6d82fcd8-c379-443c-97a9-c6423c71e7d5"
5+
Path: /sitecore/system/Modules/PowerShell/Script Library/SPE/Extensions/DataSync
6+
DB: master
7+
SharedFields:
8+
- ID: "06d5295c-ed2f-4a54-9bf2-26228d113318"
9+
Hint: __Icon
10+
Value: Office/32x32/jar_coffee_bean.png
11+
- ID: "218ca464-cb77-4c97-b141-34871ecae00b"
12+
Hint: Enabled
13+
Type: Checkbox
14+
Value: 1
15+
Languages:
16+
- Language: en
17+
Versions:
18+
- Version: 1
19+
Fields:
20+
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
21+
Hint: __Created
22+
Value: 20190109T174012Z
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
ID: "d8394784-a396-48bb-b588-2eabce3d2bff"
3+
Parent: "819f0f13-6c01-44f0-990c-2a3e3e7d2017"
4+
Template: "ab154d3d-1126-4ab4-ac21-8b86e6bd70ea"
5+
Path: /sitecore/system/Modules/PowerShell/Script Library/SPE/Extensions/DataSync/Content Editor
6+
DB: master
7+
Languages:
8+
- Language: en
9+
Versions:
10+
- Version: 1
11+
Fields:
12+
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
13+
Hint: __Created
14+
Value: 20190117T180756Z
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
ID: "28401f60-c5f3-44ac-9049-37be6225ea1e"
3+
Parent: "d8394784-a396-48bb-b588-2eabce3d2bff"
4+
Template: "ab154d3d-1126-4ab4-ac21-8b86e6bd70ea"
5+
Path: /sitecore/system/Modules/PowerShell/Script Library/SPE/Extensions/DataSync/Content Editor/Insert Item
6+
DB: master
7+
Languages:
8+
- Language: en
9+
Versions:
10+
- Version: 1
11+
Fields:
12+
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
13+
Hint: __Created
14+
Value: 20190117T180757Z
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
ID: "8069c987-78f7-4c3c-b83f-66569319b736"
3+
Parent: "28401f60-c5f3-44ac-9049-37be6225ea1e"
4+
Template: "dd22f1b3-bd87-4db2-9e7d-f7a496888d43"
5+
Path: /sitecore/system/Modules/PowerShell/Script Library/SPE/Extensions/DataSync/Content Editor/Insert Item/Import Set
6+
DB: master
7+
SharedFields:
8+
- ID: "06d5295c-ed2f-4a54-9bf2-26228d113318"
9+
Hint: __Icon
10+
Value: office/32x32/escalator_up.png
11+
- ID: "1c76313e-3c8c-4807-a826-135d10c39299"
12+
Hint: ShowRule
13+
Type: Rules
14+
Value: |
15+
<ruleset>
16+
<rule
17+
uid="{C1B7A434-8940-47A1-9668-BD53D69361E2}"
18+
name="Show for Imports">
19+
<conditions>
20+
<condition
21+
id="{4F5389E9-79B7-4FE1-A43A-EEA4ECD19C94}"
22+
uid="8AE3D2E74DBE4222B007BE50A03F4845"
23+
operatorid="{10537C58-1684-4CAB-B4C0-40C10907CE31}"
24+
value="{3AC2E23D-0296-4647-BE58-93E4D55CB8F6}" />
25+
</conditions>
26+
</rule>
27+
</ruleset>
28+
- ID: "b1a94ff0-6897-47c0-9c51-aa6acb80b1f0"
29+
Hint: Script
30+
Value: |
31+
$templateId = "{CCD5E896-36A1-4EAC-9A7F-C2AA23ED8080}"
32+
$inputProps = @{
33+
Prompt = "Enter a new name for the item:"
34+
Validation = [Sitecore.Configuration.Settings]::ItemNameValidation
35+
ErrorMessage = "'`$Input' is not a valid name."
36+
MaxLength = [Sitecore.Configuration.Settings]::MaxItemNameLength
37+
}
38+
39+
$itemName = Show-Input @inputProps
40+
if([string]::IsNullOrEmpty($itemName)) { exit }
41+
42+
$parentItem = Get-Item -Path "."
43+
New-Item -Parent $parentItem -Name $itemName -ItemType "{CCD5E896-36A1-4EAC-9A7F-C2AA23ED8080}"
44+
Close-Window
45+
Languages:
46+
- Language: en
47+
Versions:
48+
- Version: 1
49+
Fields:
50+
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
51+
Hint: __Created
52+
Value: 20190117T180851Z
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
ID: "dea7f20b-df4b-4c32-a35f-274d5419a50d"
3+
Parent: "28401f60-c5f3-44ac-9049-37be6225ea1e"
4+
Template: "dd22f1b3-bd87-4db2-9e7d-f7a496888d43"
5+
Path: /sitecore/system/Modules/PowerShell/Script Library/SPE/Extensions/DataSync/Content Editor/Insert Item/Import Step
6+
DB: master
7+
SharedFields:
8+
- ID: "06d5295c-ed2f-4a54-9bf2-26228d113318"
9+
Hint: __Icon
10+
Value: office/32x32/stairs_up.png
11+
- ID: "1c76313e-3c8c-4807-a826-135d10c39299"
12+
Hint: ShowRule
13+
Type: Rules
14+
Value: |
15+
<ruleset>
16+
<rule
17+
uid="{1F1EC4CB-F6E8-4FD4-8A40-63A6E524A54C}"
18+
name="Show for children of Imports">
19+
<conditions>
20+
<and
21+
uid="43A9B8A3A21847FEBEDC6A6D08AD33DE">
22+
<condition
23+
id="{7D5DA661-BEF9-441C-B1F7-D80DE3E0972F}"
24+
uid="3CB26FA6F12B46DD89B3F59104B32B00"
25+
itemid="{3AC2E23D-0296-4647-BE58-93E4D55CB8F6}" />
26+
<condition
27+
id="{4F5389E9-79B7-4FE1-A43A-EEA4ECD19C94}"
28+
uid="06000EFECFD74B6A80AF7EC0DB0350B2"
29+
except="true"
30+
operatorid="{10537C58-1684-4CAB-B4C0-40C10907CE31}"
31+
value="{3AC2E23D-0296-4647-BE58-93E4D55CB8F6}" />
32+
</and>
33+
</conditions>
34+
</rule>
35+
</ruleset>
36+
- ID: "b1a94ff0-6897-47c0-9c51-aa6acb80b1f0"
37+
Hint: Script
38+
Value: |
39+
$defaultScript = '
40+
param($ContextScript)
41+
$importRunnerScriptItemId = "{CD9B18D5-0361-486F-9839-02FB9C3CFF7D}"
42+
Get-Item -Path "master:" -ID $importRunnerScriptItemId | Invoke-Script -ArgumentList $ContextScript
43+
'
44+
45+
filter Where-InheritsTemplate {
46+
param(
47+
[Parameter(ValueFromPipeline = $true)]
48+
[Item]$Item,
49+
[ID]$TemplateId,
50+
[switch]$DescendsOnly
51+
)
52+
53+
if($DescendsOnly -and $Item.ID -eq $TemplateId) { return }
54+
$itemTemplate = [Sitecore.Data.Managers.TemplateManager]::GetTemplate($item.ID, $item.Database)
55+
if($itemTemplate -and $itemTemplate.DescendsFromOrEquals($TemplateId)) { $Item }
56+
}
57+
58+
$importScriptTemplateId = [ID]::Parse("{3D772520-C232-4B3D-93B6-6941CDB3BF1D}")
59+
$supportedTemplates = Get-ChildItem -Path "master:" -ID "{116571F4-6797-4825-B79D-FE88CA1C0E9B}" -Recurse |
60+
Where-InheritsTemplate -TemplateId $importScriptTemplateId -DescendsOnly
61+
$options = [ordered]@{}
62+
$optionTooltips = [ordered]@{}
63+
foreach($supportedTemplate in $supportedTemplates) {
64+
$options[$supportedTemplate.Name] = $supportedTemplate.ID
65+
$optionTooltips[$supportedTemplate.ID] = $supportedTemplate.Fields["__Short description"].Value
66+
}
67+
68+
$props = @{
69+
Parameters = @(
70+
@{Name="selectedTemplateId"; Title="Choose an import step"; Tooltip="Use the sort order to control sequence of execution."; Options=$options; OptionTooltips=$optionTooltips; Editor="combo"; },
71+
@{Name="selectedItemName"; Title="Enter the name of import step"; Tooltip="The name helps to identify what the import process will perform."; Editor="text"; Validator = {
72+
if([string]::IsNullOrEmpty($variable.Value)) {
73+
$variable.Error = "Please enter a name."
74+
} elseif($variable.Value -notmatch [Sitecore.Configuration.Settings]::ItemNameValidation) {
75+
$variable.Error = "'$($variable.Value)' is not a valid name format."
76+
} elseif($variable.Value.Length -gt [Sitecore.Configuration.Settings]::MaxItemNameLength) {
77+
$variable.Error = "'$($variable.Value)' is not a valid name length."
78+
}
79+
}}
80+
)
81+
Title = "Import Step Selector"
82+
Icon = "OfficeWhite/32x32/stairs_up.png"
83+
Description = "Choose an import step to add."
84+
Width = 450
85+
Height = 300
86+
ShowHints = $true
87+
}
88+
89+
$result = Read-Variable @props
90+
if($result -ne "ok") { exit }
91+
92+
$parentItem = Get-Item -Path "."
93+
$newItem = New-Item -Parent $parentItem -Name $selectedItemName -ItemType $selectedTemplateId
94+
$newItem.Script = $defaultScript
95+
Close-Window
96+
97+
Languages:
98+
- Language: en
99+
Versions:
100+
- Version: 1
101+
Fields:
102+
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
103+
Hint: __Created
104+
Value: 20190117T180910Z
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
ID: "a5fdab53-7805-4b12-ae4e-37a8d831ab23"
3+
Parent: "819f0f13-6c01-44f0-990c-2a3e3e7d2017"
4+
Template: "ab154d3d-1126-4ab4-ac21-8b86e6bd70ea"
5+
Path: /sitecore/system/Modules/PowerShell/Script Library/SPE/Extensions/DataSync/Development
6+
DB: master
7+
Languages:
8+
- Language: en
9+
Versions:
10+
- Version: 1
11+
Fields:
12+
- ID: "25bed78c-4957-4165-998a-ca1b52f67497"
13+
Hint: __Created
14+
Value: 20190109T183142Z

0 commit comments

Comments
 (0)