Skip to content

Commit

Permalink
Issue #267 - solution refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamNaj committed Jan 4, 2015
1 parent 21cbf49 commit d2a3d84
Show file tree
Hide file tree
Showing 150 changed files with 418 additions and 504 deletions.
114 changes: 57 additions & 57 deletions App_Config/Include/Cognifide.PowerShell.config

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Sitecore.Web.UI.HtmlControls;
using Sitecore.Web.UI.Sheer;

namespace Cognifide.PowerShell.SitecoreIntegrations.Applications
namespace Cognifide.PowerShell.Client.Applications
{
public class ConfirmChoice : BaseForm
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.Resources.Media;
using Sitecore.Shell.Applications.Links;
using Sitecore.Shell.Framework;
using Sitecore.Text;
using Sitecore.Web;
using Sitecore.Web.UI.HtmlControls;
using Sitecore.Web.UI.Pages;
using Sitecore.Web.UI.Sheer;

namespace Cognifide.PowerShell.SitecoreIntegrations.Applications
namespace Cognifide.PowerShell.Client.Applications
{
public class DownloadFile : DialogForm
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Cognifide.PowerShell.SitecoreIntegrations.Applications
namespace Cognifide.PowerShell.Client.Applications
{
public static class ExecutionMessages
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
using System.Management.Automation;
using System.Web;
using System.Web.UI;
using Cognifide.PowerShell.Extensions;
using Cognifide.PowerShell.PowerShellIntegrations;
using Cognifide.PowerShell.Core.Extensions;
using Sitecore;
using Sitecore.Data;
using Sitecore.Data.Fields;
Expand All @@ -21,7 +20,7 @@
using Sitecore.Web.UI.Sheer;
using Job = Sitecore.Jobs.Job;

namespace Cognifide.PowerShell.SitecoreIntegrations.Applications
namespace Cognifide.PowerShell.Client.Applications
{
[Serializable]
public class FieldEditor : Command
Expand Down Expand Up @@ -56,7 +55,7 @@ protected virtual void EnsureContext(ClientPipelineArgs args)
{
string path = args.Parameters[PathParameter];
Item currentItem = Database.GetItem(ItemUri.Parse(args.Parameters[UriParameter]));
CurrentItem = string.IsNullOrEmpty(path) ? currentItem : Client.ContentDatabase.GetItem(path);
CurrentItem = string.IsNullOrEmpty(path) ? currentItem : Sitecore.Client.ContentDatabase.GetItem(path);
Assert.IsNotNull(CurrentItem, CurrentItemIsNull);
IncludeStandardFields = args.Parameters[IncludeStandardFieldsParameter] == "1";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Sitecore.Web.UI.HtmlControls;
using Sitecore.Web.UI.Sheer;

namespace Cognifide.PowerShell.SitecoreIntegrations.Applications
namespace Cognifide.PowerShell.Client.Applications
{
public class GetStringResponse : BaseForm
{
Expand Down
9 changes: 9 additions & 0 deletions Client/Applications/IPowerShellRunner.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Cognifide.PowerShell.Client.Controls;

namespace Cognifide.PowerShell.Client.Applications
{
public interface IPowerShellRunner
{
SpeJobMonitor Monitor { get; }
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using System;
using System.Web;
using Cognifide.PowerShell.PowerShellIntegrations.Host;
using Cognifide.PowerShell.PowerShellIntegrations.Settings;
using Cognifide.PowerShell.SitecoreIntegrations.Controls;
using Cognifide.PowerShell.Client.Controls;
using Cognifide.PowerShell.Core.Host;
using Cognifide.PowerShell.Core.Settings;
using Sitecore;
using Sitecore.Diagnostics;
using Sitecore.Shell.Framework;
using Sitecore.Text;
using Sitecore.Web.UI.HtmlControls;
using Sitecore.Web.UI.Sheer;

namespace Cognifide.PowerShell.SitecoreIntegrations.Applications
namespace Cognifide.PowerShell.Client.Applications
{
public class PowerShellConsole : BaseForm, IPowerShellRunner
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
using System.Linq;
using System.Text;
using System.Web;
using Cognifide.PowerShell.Extensions;
using Cognifide.PowerShell.PowerShellIntegrations;
using Cognifide.PowerShell.PowerShellIntegrations.Host;
using Cognifide.PowerShell.PowerShellIntegrations.Settings;
using Cognifide.PowerShell.SitecoreIntegrations.Controls;
using Cognifide.PowerShell.Client.Controls;
using Cognifide.PowerShell.Core.Extensions;
using Cognifide.PowerShell.Core.Host;
using Cognifide.PowerShell.Core.Settings;
using Sitecore;
using Sitecore.Collections;
using Sitecore.Configuration;
Expand All @@ -24,7 +23,7 @@
using Sitecore.Web.UI.WebControls.Ribbons;
using Action = Sitecore.Web.UI.HtmlControls.Action;

namespace Cognifide.PowerShell.SitecoreIntegrations.Applications
namespace Cognifide.PowerShell.Client.Applications
{
public class PowerShellIse : BaseForm, IHasCommandContext, IPowerShellRunner
{
Expand Down Expand Up @@ -65,7 +64,7 @@ public static string ScriptItemId

public CommandContext GetCommandContext()
{
Item itemNotNull = Client.CoreDatabase.GetItem("{FDD5B2D5-31BE-41C3-AA76-64E5CC63B187}");
Item itemNotNull = Sitecore.Client.CoreDatabase.GetItem("{FDD5B2D5-31BE-41C3-AA76-64E5CC63B187}");
// /sitecore/content/Applications/PowerShell/PowerShellIse/Ribbon
var context = new CommandContext {RibbonSourceUri = itemNotNull.Uri};
return context;
Expand Down Expand Up @@ -137,7 +136,7 @@ protected override void OnLoad(EventArgs e)
Monitor.JobFinished += MonitorJobFinished;
Monitor.JobDisappeared += MonitorJobFinished;

BuildDatabases(Client.ContentDatabase.Name);
BuildDatabases(Sitecore.Client.ContentDatabase.Name);
ParentFrameName = WebUtil.GetQueryString("pfn");
UpdateRibbon();
}
Expand All @@ -155,7 +154,7 @@ private void MonitorJobFinished(object sender, EventArgs e)
public override void HandleMessage(Message message)
{
Error.AssertObject(message, "message");
Item item = ScriptItemId == null ? null : Client.ContentDatabase.GetItem(ScriptItemId);
Item item = ScriptItemId == null ? null : Sitecore.Client.ContentDatabase.GetItem(ScriptItemId);

base.HandleMessage(message);

Expand All @@ -181,7 +180,7 @@ protected void Open(ClientPipelineArgs args)
{
if (!args.HasResult)
return;
LoadItem(Client.ContentDatabase.Name, args.Result);
LoadItem(Sitecore.Client.ContentDatabase.Name, args.Result);
UpdateRibbon();
}
else
Expand Down Expand Up @@ -243,8 +242,8 @@ protected void MruUpdate(Item scriptItem)
string icon = scriptItem[FieldIDs.Icon];
ScriptName.Value = string.Format("{1}", db, scriptItem.Paths.Path.Substring(ApplicationSettings.ScriptLibraryPath.Length));
SheerResponse.SetInnerHtml("ScriptName", ScriptName.Value);
Item mruMenu = Client.CoreDatabase.GetItem("/sitecore/system/Modules/PowerShell/MRU") ??
Client.CoreDatabase.CreateItemPath("/sitecore/system/Modules/PowerShell/MRU");
Item mruMenu = Sitecore.Client.CoreDatabase.GetItem("/sitecore/system/Modules/PowerShell/MRU") ??
Sitecore.Client.CoreDatabase.CreateItemPath("/sitecore/system/Modules/PowerShell/MRU");

ChildList mruItems = mruMenu.Children;
if (mruItems.Count == 0 || !(mruItems[0]["Message"].Contains(id)))
Expand Down Expand Up @@ -356,7 +355,7 @@ protected void SaveItem(ClientPipelineArgs args)
}
else
{
Item scriptItem = Client.ContentDatabase.GetItem(new ID(ScriptItemId));
Item scriptItem = Sitecore.Client.ContentDatabase.GetItem(new ID(ScriptItemId));
if (scriptItem == null)
return;
scriptItem.Edit(
Expand All @@ -367,7 +366,7 @@ protected void SaveItem(ClientPipelineArgs args)
[HandleMessage("ise:reload", true)]
protected void ReloadItem(ClientPipelineArgs args)
{
LoadItem(Client.ContentDatabase.Name, ScriptItemId);
LoadItem(Sitecore.Client.ContentDatabase.Name, ScriptItemId);
}

private void LoadItem(string db, string id)
Expand Down Expand Up @@ -404,7 +403,7 @@ protected virtual void ClientExecute(ClientPipelineArgs args)
{
scriptSession.ExecuteScriptPart(Settings.Prescript);
scriptSession.SetItemLocationContext(DataContext.CurrentItem);
scriptSession.SetExecutedScript(Client.ContentDatabase.Name, ScriptItemId);
scriptSession.SetExecutedScript(Sitecore.Client.ContentDatabase.Name, ScriptItemId);
scriptSession.ExecuteScriptPart(Editor.Value);

if (scriptSession.Output != null)
Expand Down Expand Up @@ -437,7 +436,7 @@ protected virtual void JobExecute(ClientPipelineArgs args)
Settings = ApplicationSettings.GetInstance(ApplicationNames.IseConsole);
var scriptSession = new ScriptSession(Settings.ApplicationName);
scriptSession.SetItemLocationContext(DataContext.CurrentItem);
scriptSession.SetExecutedScript(Client.ContentDatabase.Name, ScriptItemId);
scriptSession.SetExecutedScript(Sitecore.Client.ContentDatabase.Name, ScriptItemId);
var parameters = new object[]
{
scriptSession,
Expand Down Expand Up @@ -585,7 +584,7 @@ protected void UpdateRibbon(Message message)
private void UpdateRibbon()
{
var ribbon = new Ribbon {ID = "PowerShellRibbon"};
Item item = ScriptItemId == null ? null : Client.ContentDatabase.GetItem(ScriptItemId);
Item item = ScriptItemId == null ? null : Sitecore.Client.ContentDatabase.GetItem(ScriptItemId);
ribbon.CommandContext = new CommandContext(item);
ribbon.ShowContextualTabs = false;
ribbon.CommandContext.Parameters["HasFile"] = HasFile.Disabled ? "0" : "1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Management.Automation;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.UI.WebControls;
using Cognifide.PowerShell.Extensions;
using Cognifide.PowerShell.PowerShellIntegrations;
using Cognifide.PowerShell.PowerShellIntegrations.Settings;
using Cognifide.PowerShell.SitecoreIntegrations.Controls;
using Cognifide.PowerShell.Client.Controls;
using Cognifide.PowerShell.Core.Extensions;
using Sitecore;
using Sitecore.Configuration;
using Sitecore.Controls;
using Sitecore.Data;
using Sitecore.Data.Items;
Expand All @@ -29,7 +25,7 @@
using Literal = Sitecore.Web.UI.HtmlControls.Literal;
using Memo = Sitecore.Web.UI.HtmlControls.Memo;

namespace Cognifide.PowerShell.SitecoreIntegrations.Applications
namespace Cognifide.PowerShell.Client.Applications
{
public class PowerShellMultiValuePrompt : DialogPage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Management.Automation;
using System.Text;
using System.Web;
using Cognifide.PowerShell.Client.Controls;
using Cognifide.PowerShell.Commandlets.Interactive;
using Cognifide.PowerShell.Extensions;
using Cognifide.PowerShell.PowerShellIntegrations;
using Cognifide.PowerShell.PowerShellIntegrations.Host;
using Cognifide.PowerShell.PowerShellIntegrations.Settings;
using Cognifide.PowerShell.SitecoreIntegrations.Controls;
using Cognifide.PowerShell.Core.Extensions;
using Cognifide.PowerShell.Core.Host;
using Cognifide.PowerShell.Core.Settings;
using Sitecore;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.Jobs.AsyncUI;
using Sitecore.Shell.Framework;
using Sitecore.Shell.Framework.Commands;
using Sitecore.Text;
Expand All @@ -27,7 +24,7 @@
using Sitecore.Web.UI.WebControls.Ribbons;
using Image = Sitecore.Web.UI.HtmlControls.Image;

namespace Cognifide.PowerShell.SitecoreIntegrations.Applications
namespace Cognifide.PowerShell.Client.Applications
{
public class PowerShellResultViewerList : BaseForm, IHasCommandContext, IPowerShellRunner
{
Expand Down Expand Up @@ -229,7 +226,7 @@ public void OnDoubleClick()
public override void HandleMessage(Message message)
{
Error.AssertObject(message, "message");
Item item = ScriptItemId == null ? null : Client.ContentDatabase.GetItem(ScriptItemId);
Item item = ScriptItemId == null ? null : Sitecore.Client.ContentDatabase.GetItem(ScriptItemId);

switch (message.Name)
{
Expand Down Expand Up @@ -364,7 +361,7 @@ protected void UpdateRibbon(Message message)
private void UpdateRibbon()
{
var ribbon = new Ribbon {ID = "PowerShellRibbon"};
Item item = ScriptItemId == null ? null : Client.ContentDatabase.GetItem(ScriptItemId);
Item item = ScriptItemId == null ? null : Sitecore.Client.ContentDatabase.GetItem(ScriptItemId);
ribbon.CommandContext = new CommandContext(item);
ribbon.ShowContextualTabs = false;
Item obj2 = Context.Database.GetItem("/sitecore/content/Applications/PowerShell/PowerShellListView/Ribbon");
Expand All @@ -382,7 +379,7 @@ private void UpdateRibbon()

public CommandContext GetCommandContext()
{
Item itemNotNull = Client.CoreDatabase.GetItem("{98EF2F7D-C17A-4A53-83A8-0EA2C0517AD6}");
Item itemNotNull = Sitecore.Client.CoreDatabase.GetItem("{98EF2F7D-C17A-4A53-83A8-0EA2C0517AD6}");
// /sitecore/content/Applications/PowerShell/PowerShellGridView/Ribbon
var context = new CommandContext {RibbonSourceUri = itemNotNull.Uri};
return context;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;
using System.Web;
using Cognifide.PowerShell.PowerShellIntegrations.Host;
using Cognifide.PowerShell.PowerShellIntegrations.Settings;
using Cognifide.PowerShell.Core.Host;
using Cognifide.PowerShell.Core.Settings;
using Sitecore.Web;
using Sitecore.Web.UI.HtmlControls;
using Sitecore.Web.UI.Sheer;

namespace Cognifide.PowerShell.SitecoreIntegrations.Applications
namespace Cognifide.PowerShell.Client.Applications
{
public class PowerShellResultViewerText : BaseForm
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using System.Management.Automation;
using System.Text;
using System.Web;
using Cognifide.PowerShell.PowerShellIntegrations.Host;
using Cognifide.PowerShell.PowerShellIntegrations.Settings;
using Cognifide.PowerShell.SitecoreIntegrations.Controls;
using Cognifide.PowerShell.Client.Controls;
using Cognifide.PowerShell.Core.Host;
using Cognifide.PowerShell.Core.Settings;
using Sitecore;
using Sitecore.Configuration;
using Sitecore.Data;
Expand All @@ -22,7 +22,7 @@
using Job = Sitecore.Jobs.Job;
using Version = Sitecore.Data.Version;

namespace Cognifide.PowerShell.SitecoreIntegrations.Applications
namespace Cognifide.PowerShell.Client.Applications
{
public class PowerShellRunner : BaseForm, IPowerShellRunner
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Sitecore.Web.UI.WebControls;
using Sitecore.Web.UI.XmlControls;

namespace Cognifide.PowerShell.SitecoreIntegrations.Applications
namespace Cognifide.PowerShell.Client.Applications
{
public class PowerShellScriptBrowser : DialogForm
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Sitecore.Jobs.AsyncUI;
using Sitecore.Shell.Applications.Dialogs.ProgressBoxes;

namespace Cognifide.PowerShell.SitecoreIntegrations.Applications
namespace Cognifide.PowerShell.Client.Applications
{
public class ScriptRunner
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using Sitecore.Shell.Framework.Commands;

namespace Cognifide.PowerShell.SitecoreIntegrations.Commands
namespace Cognifide.PowerShell.Client.Commands
{
[Serializable]
public class AbortQueryState : Command
Expand Down

0 comments on commit d2a3d84

Please sign in to comment.