forked from vladcheg/Sitecore.DataExchange.Gutters
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
DK\vls
committed
Jul 31, 2017
1 parent
a187339
commit f8de4cb
Showing
10 changed files
with
205 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
Sitecore.DataExchange.Gutters/Commands/GoToReferenceCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace Sitecore.DataExchange.Gutters.Commands | ||
{ | ||
using System; | ||
using Shell.Framework.Commands; | ||
|
||
[Serializable] | ||
public class GoToReferenceCommand : Command | ||
{ | ||
public override void Execute(CommandContext context) | ||
{ | ||
var item = context.Items[0]; | ||
string id = context.Parameters["id"]; | ||
|
||
//Sitecore.Context.ClientPage.ClientResponse.Timer(string.Format("item:load(id={0})", id), 100); | ||
Sitecore.Text.UrlString parameters = new Sitecore.Text.UrlString(); | ||
parameters.Add("id", id); | ||
parameters.Add("fo", id); | ||
Sitecore.Shell.Framework.Windows.RunApplication("Content Editor", parameters.ToString()); | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
Sitecore.DataExchange.Gutters/Commands/ReferenceMenuCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace Sitecore.DataExchange.Gutters.Commands | ||
{ | ||
using System; | ||
using Shell.Framework.Commands; | ||
using Web.UI.HtmlControls; | ||
using Web.UI.Sheer; | ||
|
||
[Serializable] | ||
public class ReferenceMenuCommand : Command | ||
{ | ||
public override void Execute(CommandContext context) | ||
{ | ||
var item = context.Items[0]; | ||
string fieldName = context.Parameters["fieldName"]; | ||
|
||
Sitecore.Data.Fields.MultilistField multilistField = | ||
(Sitecore.Data.Fields.MultilistField) item.Fields[fieldName]; | ||
|
||
var targetIDs = multilistField.TargetIDs; | ||
|
||
Menu menu = new Menu(); | ||
SheerResponse.DisableOutput(); | ||
|
||
foreach (var targetID in targetIDs) | ||
{ | ||
var item1 = item.Database.GetItem(targetID); | ||
|
||
menu.Add(item1.DisplayName, "Office/32x32/radio_button_selected.png", | ||
string.Concat(new object[] { "dataExchange:goToReference(id=", targetID, ")" })); | ||
} | ||
SheerResponse.EnableOutput(); | ||
SheerResponse.ShowContextMenu(Sitecore.Context.ClientPage.ClientRequest.Control, "right", menu); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
Sitecore.DataExchange.Gutters/Commands/ValueMappingContextMenuCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace Sitecore.DataExchange.Gutters.Commands | ||
{ | ||
using System; | ||
using Shell.Framework.Commands; | ||
using Sitecore.Diagnostics; | ||
using Web.UI.HtmlControls; | ||
using Web.UI.Sheer; | ||
|
||
[Serializable] | ||
public class ValueMappingContextMenuCommand : Command | ||
{ | ||
public override void Execute(CommandContext context) | ||
{ | ||
Assert.ArgumentNotNull(context, nameof(context)); | ||
|
||
Menu menu = new Menu(); | ||
SheerResponse.DisableOutput(); | ||
menu.Add("Source Accessor", "Office/32x32/radio_button_selected.png", string.Concat(new object[] { "dataExchange:referenceMenu(fieldName=", "SourceAccessor", ")" })); | ||
menu.Add("Target Accessor", "Office/32x32/radio_button_selected.png", string.Concat(new object[] { "dataExchange:referenceMenu(fieldName=", "TargetAccessor", ")" })); | ||
menu.Add("Source Pre Transformer", "Office/32x32/graph_from.png", string.Concat(new object[] { "dataExchange:referenceMenu(fieldName=", "SourceValuePreTransformer", ")" })); | ||
menu.Add("Source Transformer", "Office/32x32/graph_from.png", string.Concat(new object[] { "dataExchange:referenceMenu(fieldName=", "SourceValueTransformer", ")" })); | ||
|
||
SheerResponse.EnableOutput(); | ||
SheerResponse.ShowContextMenu(Sitecore.Context.ClientPage.ClientRequest.Control, "right", menu); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace Sitecore.DataExchange.Gutters | ||
{ | ||
using Data; | ||
using Data.Items; | ||
using Data.Managers; | ||
using Shell.Applications.ContentEditor.Gutters; | ||
using Sitecore.Diagnostics; | ||
|
||
public class ValueMappingGutter : GutterRenderer | ||
{ | ||
protected readonly ID ValueMappingTemplateId = new ID("{450C8F38-91C9-4896-957B-6F7DAF18CCFC}"); | ||
|
||
|
||
protected override GutterIconDescriptor GetIconDescriptor(Item item) | ||
{ | ||
Assert.ArgumentNotNull(item, nameof(item)); | ||
if (item.TemplateID == this.ValueMappingTemplateId) | ||
{ | ||
var gutterIconDescriptor = new GutterIconDescriptor() { Icon = TemplateManager.GetTemplate(item).Icon, Tooltip = item.DisplayName }; | ||
gutterIconDescriptor.Click = "dataExchange:valueMappingContextMenu()"; | ||
return gutterIconDescriptor; | ||
} | ||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...re/sitecore/content/Applications/Content Editor/Gutters/DataExchange - Value Mapping.item
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
----item---- | ||
version: 1 | ||
id: {AB2C6026-635C-419A-AC2C-204D1A4F03D1} | ||
database: core | ||
path: /sitecore/content/Applications/Content Editor/Gutters/DataExchange - Value Mapping | ||
parent: {59F37069-3118-4151-8C01-5DA0EF12CB4E} | ||
name: DataExchange - Value Mapping | ||
master: {00000000-0000-0000-0000-000000000000} | ||
template: {F5D247E0-80E6-4F31-9921-D30D00B61B3C} | ||
templatekey: Gutter Renderer | ||
created: 20170731T113243Z | ||
|
||
----field---- | ||
field: {7A108204-DC61-4D25-A138-FD6F53F48ABF} | ||
name: Type | ||
key: type | ||
content-length: 78 | ||
|
||
Sitecore.DataExchange.Gutters.ValueMappingGutter,Sitecore.DataExchange.Gutters | ||
----version---- | ||
language: en | ||
version: 1 | ||
revision: c571d857-124a-4487-8f39-fea50a68667b | ||
|
||
----field---- | ||
field: {5024402F-0B92-4C13-A7D2-86ED85FF3560} | ||
name: Header | ||
key: header | ||
content-length: 29 | ||
|
||
Data Exchange - Value Mapping | ||
----field---- | ||
field: {52807595-0F8F-4B20-8D2A-CB71D28C6103} | ||
name: __Owner | ||
key: __owner | ||
content-length: 14 | ||
|
||
sitecore\admin | ||
----field---- | ||
field: {25BED78C-4957-4165-998A-CA1B52F67497} | ||
name: __Created | ||
key: __created | ||
content-length: 16 | ||
|
||
20170119T082920Z | ||
----field---- | ||
field: {5DD74568-4D4B-44C1-B513-0AF5F4CDA34F} | ||
name: __Created by | ||
key: __created by | ||
content-length: 14 | ||
|
||
sitecore\admin | ||
----field---- | ||
field: {8CDC337E-A112-42FB-BBB4-4143751E123F} | ||
name: __Revision | ||
key: __revision | ||
content-length: 36 | ||
|
||
c571d857-124a-4487-8f39-fea50a68667b | ||
----field---- | ||
field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522} | ||
name: __Updated | ||
key: __updated | ||
content-length: 16 | ||
|
||
20170731T113340Z | ||
----field---- | ||
field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A} | ||
name: __Updated by | ||
key: __updated by | ||
content-length: 14 | ||
|
||
sitecore\admin |