Permalink
Browse files

Removed stuff thats not needed anymore/needs major rework

  • Loading branch information...
1 parent d0ecc03 commit 9ed909100fe7fa93bd22a08166de1b3946d5d3c8 @kmees kmees committed Mar 13, 2013
Showing with 65 additions and 176,593 deletions.
  1. +1 −1 src/IronSharePoint.Framework/{IronField.cs → FieldHelper.cs}
  2. +1 −1 src/IronSharePoint.Framework/Hives/SPDocumentHive.cs
  3. +7 −0 src/IronSharePoint.Framework/IronConstant.cs
  4. +0 −6 src/IronSharePoint.Framework/IronExpressionBuilder.cs
  5. +0 −15 src/IronSharePoint.Framework/IronHelper.cs
  6. +6 −10 src/IronSharePoint.Framework/IronHttpModule.cs
  7. +0 −142 src/IronSharePoint.Framework/IronLog/IronLogWorkItemJobDefinition.cs
  8. +0 −52 src/IronSharePoint.Framework/IronLog/IronLogger.cs
  9. +0 −13 src/IronSharePoint.Framework/IronLog/LogLevel.cs
  10. +12 −13 src/IronSharePoint.Framework/IronRuntime.cs
  11. +13 −0 src/IronSharePoint.Framework/IronScriptHost.cs
  12. +1 −5 src/IronSharePoint.Framework/IronSharePoint.Framework.csproj
  13. +5 −5 src/IronSharePoint.Framework/IronWrapperControl.cs
  14. +5 −5 src/IronSharePoint.Framework/IronWrapperUserControl.cs
  15. +0 −30 src/IronSharePoint/ControlTemplates/IronSP/IronHiveScriptControl.ascx
  16. +0 −14 src/IronSharePoint/ControlTemplates/IronSP/IronHiveScriptControl.ascx.cs
  17. +0 −15 src/IronSharePoint/ControlTemplates/IronSP/IronHiveScriptControl.ascx.designer.cs
  18. +0 −4 src/IronSharePoint/ControlTemplates/SharePointProjectItem.spdata
  19. +0 −1 src/IronSharePoint/EventReceivers/IronHiveEventReceiver.cs
  20. +4 −14 src/IronSharePoint/EventReceivers/IronScriptCompilerReceiver.cs
  21. +9 −43 src/IronSharePoint/Features/IronSP_Hive_Site/IronSP_Hive_Site.EventReceiver.cs
  22. +1 −1 src/IronSharePoint/Features/IronSP_WebApp/IronSP_WebApp.EventReceiver.cs
  23. +0 −74 src/IronSharePoint/IronSharePoint.csproj
  24. +0 −65 src/IronSharePoint/Layouts/IronSP/IronEditor.aspx
  25. +0 −37 src/IronSharePoint/Layouts/IronSP/IronEditor.aspx.cs
  26. +0 −24 src/IronSharePoint/Layouts/IronSP/IronEditor.aspx.designer.cs
  27. +0 −17,319 src/IronSharePoint/Layouts/IronSP/ace/ace-uncompressed.js
  28. +0 −15,689 src/IronSharePoint/Layouts/IronSP/ace/ace.js
  29. +0 −2,504 src/IronSharePoint/Layouts/IronSP/ace/cockpit-uncompressed.js
  30. +0 −1 src/IronSharePoint/Layouts/IronSP/ace/cockpit.js
  31. +0 −367 src/IronSharePoint/Layouts/IronSP/ace/keybinding-emacs.js
  32. +0 −1,635 src/IronSharePoint/Layouts/IronSP/ace/keybinding-vim.js
  33. +0 −275 src/IronSharePoint/Layouts/IronSP/ace/mode-c9search.js
  34. +0 −744 src/IronSharePoint/Layouts/IronSP/ace/mode-c_cpp.js
  35. +0 −364 src/IronSharePoint/Layouts/IronSP/ace/mode-clojure.js
  36. +0 −527 src/IronSharePoint/Layouts/IronSP/ace/mode-coffee.js
  37. +0 −1,966 src/IronSharePoint/Layouts/IronSP/ace/mode-coldfusion.js
  38. +0 −633 src/IronSharePoint/Layouts/IronSP/ace/mode-csharp.js
  39. +0 −499 src/IronSharePoint/Layouts/IronSP/ace/mode-css.js
  40. +0 −250 src/IronSharePoint/Layouts/IronSP/ace/mode-diff.js
  41. +0 −822 src/IronSharePoint/Layouts/IronSP/ace/mode-glsl.js
  42. +0 −681 src/IronSharePoint/Layouts/IronSP/ace/mode-golang.js
  43. +0 −1,240 src/IronSharePoint/Layouts/IronSP/ace/mode-groovy.js
  44. +0 −633 src/IronSharePoint/Layouts/IronSP/ace/mode-haxe.js
  45. +0 −2,064 src/IronSharePoint/Layouts/IronSP/ace/mode-html.js
  46. +0 −1,202 src/IronSharePoint/Layouts/IronSP/ace/mode-java.js
  47. +0 −1,069 src/IronSharePoint/Layouts/IronSP/ace/mode-javascript.js
  48. +0 −588 src/IronSharePoint/Layouts/IronSP/ace/mode-json.js
  49. +0 −646 src/IronSharePoint/Layouts/IronSP/ace/mode-jsx.js
  50. +0 −95 src/IronSharePoint/Layouts/IronSP/ace/mode-latex.js
  51. +0 −512 src/IronSharePoint/Layouts/IronSP/ace/mode-less.js
  52. +0 −1,125 src/IronSharePoint/Layouts/IronSP/ace/mode-liquid.js
  53. +0 −551 src/IronSharePoint/Layouts/IronSP/ace/mode-lua.js
  54. +0 −2,415 src/IronSharePoint/Layouts/IronSP/ace/mode-luahtml.js
  55. +0 −2,604 src/IronSharePoint/Layouts/IronSP/ace/mode-luapage.js
  56. +0 −2,369 src/IronSharePoint/Layouts/IronSP/ace/mode-markdown.js
  57. +0 −464 src/IronSharePoint/Layouts/IronSP/ace/mode-ocaml.js
  58. +0 −432 src/IronSharePoint/Layouts/IronSP/ace/mode-perl.js
  59. +0 −970 src/IronSharePoint/Layouts/IronSP/ace/mode-pgsql.js
  60. +0 −1,718 src/IronSharePoint/Layouts/IronSP/ace/mode-php.js
  61. +0 −610 src/IronSharePoint/Layouts/IronSP/ace/mode-powershell.js
  62. +0 −397 src/IronSharePoint/Layouts/IronSP/ace/mode-python.js
  63. +0 −318 src/IronSharePoint/Layouts/IronSP/ace/mode-ruby.js
  64. +0 −732 src/IronSharePoint/Layouts/IronSP/ace/mode-scad.js
  65. +0 −1,237 src/IronSharePoint/Layouts/IronSP/ace/mode-scala.js
  66. +0 −537 src/IronSharePoint/Layouts/IronSP/ace/mode-scss.js
  67. +0 −250 src/IronSharePoint/Layouts/IronSP/ace/mode-sh.js
  68. +0 −140 src/IronSharePoint/Layouts/IronSP/ace/mode-sql.js
  69. +0 −1,681 src/IronSharePoint/Layouts/IronSP/ace/mode-svg.js
  70. +0 −320 src/IronSharePoint/Layouts/IronSP/ace/mode-tcl.js
  71. 0 src/IronSharePoint/Layouts/IronSP/ace/mode-text.js
  72. +0 −182 src/IronSharePoint/Layouts/IronSP/ace/mode-textile.js
  73. +0 −829 src/IronSharePoint/Layouts/IronSP/ace/mode-xml.js
  74. +0 −605 src/IronSharePoint/Layouts/IronSP/ace/mode-xquery.js
  75. +0 −189 src/IronSharePoint/Layouts/IronSP/ace/mode-yaml.js
  76. +0 −213 src/IronSharePoint/Layouts/IronSP/ace/theme-chrome.js
  77. +0 −167 src/IronSharePoint/Layouts/IronSP/ace/theme-clouds.js
  78. +0 −168 src/IronSharePoint/Layouts/IronSP/ace/theme-clouds_midnight.js
  79. +0 −194 src/IronSharePoint/Layouts/IronSP/ace/theme-cobalt.js
  80. +0 −200 src/IronSharePoint/Layouts/IronSP/ace/theme-crimson_editor.js
  81. +0 −198 src/IronSharePoint/Layouts/IronSP/ace/theme-dawn.js
  82. +0 −230 src/IronSharePoint/Layouts/IronSP/ace/theme-dreamweaver.js
  83. +0 −157 src/IronSharePoint/Layouts/IronSP/ace/theme-eclipse.js
  84. +0 −182 src/IronSharePoint/Layouts/IronSP/ace/theme-github.js
  85. +0 −186 src/IronSharePoint/Layouts/IronSP/ace/theme-idle_fingers.js
  86. +0 −189 src/IronSharePoint/Layouts/IronSP/ace/theme-kr_theme.js
  87. +0 −189 src/IronSharePoint/Layouts/IronSP/ace/theme-merbivore.js
  88. +0 −195 src/IronSharePoint/Layouts/IronSP/ace/theme-merbivore_soft.js
  89. +0 −197 src/IronSharePoint/Layouts/IronSP/ace/theme-mono_industrial.js
  90. +0 −194 src/IronSharePoint/Layouts/IronSP/ace/theme-monokai.js
  91. +0 −199 src/IronSharePoint/Layouts/IronSP/ace/theme-pastel_on_dark.js
  92. +0 −180 src/IronSharePoint/Layouts/IronSP/ace/theme-solarized_dark.js
  93. +0 −179 src/IronSharePoint/Layouts/IronSP/ace/theme-solarized_light.js
  94. +0 −216 src/IronSharePoint/Layouts/IronSP/ace/theme-textmate.js
  95. +0 −213 src/IronSharePoint/Layouts/IronSP/ace/theme-tomorrow.js
  96. +0 −213 src/IronSharePoint/Layouts/IronSP/ace/theme-tomorrow_night.js
  97. +0 −213 src/IronSharePoint/Layouts/IronSP/ace/theme-tomorrow_night_blue.js
  98. +0 −213 src/IronSharePoint/Layouts/IronSP/ace/theme-tomorrow_night_bright.js
  99. +0 −209 src/IronSharePoint/Layouts/IronSP/ace/theme-tomorrow_night_eighties.js
  100. +0 −211 src/IronSharePoint/Layouts/IronSP/ace/theme-twilight.js
  101. +0 −190 src/IronSharePoint/Layouts/IronSP/ace/theme-vibrant_ink.js
  102. +0 −7,187 src/IronSharePoint/Layouts/IronSP/ace/worker-coffee.js
  103. +0 −10,914 src/IronSharePoint/Layouts/IronSP/ace/worker-css.js
  104. +0 −10,417 src/IronSharePoint/Layouts/IronSP/ace/worker-javascript.js
  105. +0 −2,920 src/IronSharePoint/Layouts/IronSP/ace/worker-json.js
  106. +0 −66,464 src/IronSharePoint/Layouts/IronSP/ace/worker-xquery.js
  107. +0 −5 src/IronSharePoint/Layouts/IronSP/jquery-fieldselection.min.js
  108. +0 −1 src/IronSharePoint/Package/Package.package
@@ -5,7 +5,7 @@
namespace IronSharePoint
{
- public class IronField
+ public static class FieldHelper
{
public static readonly Guid IronOutput = new Guid("{C1183929-9B30-4773-B3B4-F3098079AAA6}");
public static readonly Guid IronErrorFlag = new Guid("{FD08839D-BBEE-41E9-AEE9-DCD4A2E187DA}");
@@ -166,7 +166,7 @@ public void Reset()
private T OpenLibrary<T>(Func<SPDocumentLibrary, T> func)
{
- var siteKey = IronHelper.GetPrefixedKey("Hive_" + _siteId);
+ var siteKey = IronConstant.GetPrefixed("Site_" + _siteId);
var context = HttpContext.Current;
T result;
@@ -23,6 +23,13 @@ public static class IronConstant
public static string IronSPRootDirectory =
@"C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\TEMPLATE\FEATURES\IronSP_Root";
+ public static string IronRubyRootDirectory =
+ @"C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\FEATURES\IronSP_IronRuby";
+
+ public static string GetPrefixed(string s)
+ {
+ return string.Format("{0}_{1}", IronPrefix, s);
+ }
public static IronEnvironment IronEnv
{
@@ -10,7 +10,6 @@
using System.IO;
using System.Text.RegularExpressions;
using Microsoft.Scripting.Hosting;
-using IronSharePoint.IronLog;
namespace IronSharePoint
{
@@ -67,11 +66,6 @@ public override object EvaluateExpression(object target, System.Web.UI.BoundProp
IronRuntime.LogError(String.Format("Error executing script {0}: {1}", scriptName, error), ex);
value = error;
-
- if (engine != null)
- {
- new IronLogger(engine.IronRuntime).Log(String.Format("Ruby Error: {0} at {1}", ex.Message, error));
- }
}
else
{
@@ -1,15 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace IronSharePoint
-{
- public class IronHelper
- {
- public static string GetPrefixedKey(string name)
- {
- return IronConstant.IronPrefix + name;
- }
- }
-}
@@ -4,7 +4,6 @@
using System.Text;
using System.Web;
using Microsoft.SharePoint;
-using IronSharePoint.IronLog;
using Microsoft.Scripting.Hosting;
namespace IronSharePoint
@@ -37,22 +36,19 @@ void Error(object sender, EventArgs e)
if (SPContext.Current != null)
{
var runtime = IronRuntime.GetDefaultIronRuntime(SPContext.Current.Site);
-
- var logger = new IronLogger(runtime);
-
- var exception = application.Server.GetLastError();
-
- logger.Log(String.Format("Error: {0} at {1}!", exception.Message, exception.StackTrace), LogLevel.Fatal);
-
var engine = runtime.GetEngineByExtension(".rb");
+ var exception = application.Server.GetLastError();
if (engine != null)
{
var eo = engine.ScriptEngine.GetService<ExceptionOperations>();
string error = eo.FormatException(exception);
- logger.Log(String.Format("Ruby Error: {0} at {1}", exception.Message, error), LogLevel.Fatal);
-
+ IronRuntime.LogError(error, exception);
+ }
+ else
+ {
+ IronRuntime.LogError("Error in IronHttpModule", exception);
}
}
}
@@ -1,142 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Text;
-using Microsoft.SharePoint;
-using Microsoft.SharePoint.Administration;
-
-namespace IronSharePoint.IronLog
-{
- public class IronLogWorkItemJobDefinition : SPWorkItemJobDefinition
- {
- public static readonly Guid WorkItemGuid = new Guid("{2C59953B-1344-4D94-8ADF-3FB291342D30}");
- public static readonly String JobName = "IronLog Worker";
-
- public IronLogWorkItemJobDefinition()
- :base()
- {
- }
-
- public IronLogWorkItemJobDefinition(SPWebApplication webApplication)
- : base(JobName, webApplication)
- {
-
- }
-
- public override Guid WorkItemType()
- {
- return WorkItemGuid;
- }
-
- protected override bool ProcessWorkItem(SPContentDatabase contentDatabase,
- Microsoft.SharePoint.SPWorkItemCollection workItems,
- Microsoft.SharePoint.SPWorkItem workItem, SPJobState jobState)
- {
- // process the workItem
- using (var site = new SPSite(workItem.SiteId))
- {
- using (var web = site.OpenWeb(workItem.WebId))
- {
- //var logEntry = IronLogger.Entry.Base64Deserialize(workItem.TextPayload);
-
- if (true)//logEntry.Level <= WebLogLevel(web))
- {
- SPDocumentLibrary logLib = null;
- try
- {
- logLib = (SPDocumentLibrary)web.GetList(web.ServerRelativeUrl + "/" + IronConstant.IronLogsListPath);
- }
- catch (Exception ex)
- {
- throw new SPException("Couldn't find IronLog document library", ex);
- throw ex;
- }
- if (logLib != null)
- {
- var logFileCandidates = logLib.GetItems(LogFileQuery(2));
- if (logFileCandidates.Count > 0)
- {
- var logFile = logFileCandidates[0].File;
- AppendToFile(logFile, workItem.TextPayload);
- }
- else
- {
- var url = DateTime.Now.ToString("s").Replace(":", "_");
- url = string.Format("{0}.log", url);
-
- logLib.RootFolder.Files.Add(url, GetBytes(workItem.TextPayload));
- }
- }
- }
- // delete the workItem after we've processed it
- workItems.SubCollection(site, web, 0,
- (uint) workItems.Count).DeleteWorkItem(workItem.Id);
- }
- }
-
- // returning true allows the timer job to process additional items in the queue
- // returning false will end this occurance of the timer job
- return true;
- }
-
- LogLevel WebLogLevel(SPWeb web)
- {
- string logLevelName = web.Properties[IronHelper.GetPrefixedKey("LogLevel")];
-
- if (String.IsNullOrEmpty(logLevelName))
- {
- return LogLevel.All;
- }
- return (LogLevel) Enum.Parse(typeof (LogLevel), logLevelName);
- }
-
- SPQuery LogFileQuery(double sizeMB)
- {
- var sizeByte = (int) Math.Round(sizeMB*1024*1024);
- var queryString = @"
-<Query>
- <Where>
- <Lt>
- <FieldRef Name='File_x0020_Size' />
- <Value Type='Integer'>{0}</Value>
- </Lt>
- </Where>
- <OrderBy>
- <FieldRef Name='Modified' Ascending='False' />
- </OrderBy>
-</Query>";
-
- return new SPQuery() {Query = String.Format(queryString, sizeByte)};
- }
-
- public void AppendToFile(SPFile file, string message)
- {
- using (var stream = file.OpenBinaryStream())
- {
- using (var reader = new StreamReader(stream))
- {
-
- var content = reader.ReadToEnd();
- if (!content.EndsWith(Environment.NewLine))
- {
- content += Environment.NewLine;
- }
- var writeStream = new MemoryStream();
- using (var writer = new StreamWriter(writeStream, Encoding.UTF8))
- {
- writer.Write(content);
- writer.WriteLine(message);
- }
- file.SaveBinary(writeStream.ToArray());
- }
- }
- }
-
- public byte[] GetBytes(string message)
- {
- return Encoding.UTF8.GetBytes(message);
- }
- }
-}
@@ -1,52 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.Runtime.Serialization;
-using System.Runtime.Serialization.Formatters.Binary;
-using Microsoft.SharePoint;
-
-namespace IronSharePoint.IronLog
-{
- public class IronLogger
- {
- private readonly IronRuntime _runtime;
-
- public IronLogger(IronRuntime runtime)
- {
- _runtime = runtime;
- }
-
- public void Log(string message)
- {
- Log(message, LogLevel.Info);
- }
-
- public void Log(string message, LogLevel level)
- {
- var logText = string.Format("[{0}]\t{1} - {2}", level, DateTime.Now, message);
-
- try
- {
- var site = _runtime.Site;
-
- site.AddWorkItem(Guid.NewGuid(),
- DateTime.UtcNow,
- IronLogWorkItemJobDefinition.WorkItemGuid,
- site.RootWeb.ID,
- site.ID,
- 1,
- false,
- site.RootWeb.GetList(site.RootWeb.ServerRelativeUrl + "/" + IronConstant.IronLogsListPath).ID,
- Guid.Empty,
- site.SystemAccount.ID,
- null,
- logText,
- Guid.Empty
- );
- }
- catch
- {
- }
- }
- }
-}
@@ -1,13 +0,0 @@
-namespace IronSharePoint.IronLog
-{
- public enum LogLevel
- {
- Off = 0,
- Fatal = 1,
- Error = 2,
- Warn = 3,
- Info = 4,
- Debug = 5,
- All = 6,
- }
-}
@@ -31,6 +31,8 @@ private IronRuntime(Guid siteId)
DynamicTypeRegistry = new Dictionary<string, Object>();
DynamicFunctionRegistry = new Dictionary<string, Object>();
Engines = new Dictionary<string, IronEngine>();
+
+ Initialize();
}
internal static Dictionary<Guid, IronRuntime> LivingRuntimes
@@ -84,7 +86,7 @@ public SPSite Site
{
get
{
- var key = IronHelper.GetPrefixedKey("Site_" + Id);
+ var key = IronConstant.GetPrefixed("Site_" + Id);
var httpContext = HttpContext.Current;
SPSite site;
@@ -144,16 +146,14 @@ private void Initialize()
using (new SPMonitoredScope("Creating IronEngine(s)"))
{
- string ironRubyRoot =
- @"C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\FEATURES\IronSP_IronRuby";
- SPSecurity.RunWithElevatedPrivileges(() => PrivilegedInitialize(ironRubyRoot));
+ SPSecurity.RunWithElevatedPrivileges(PrivilegedInitialize);
ScriptEngine rubyEngine = _scriptRuntime.GetEngineByFileExtension(".rb");
rubyEngine.SetSearchPaths(new List<String>
{
- Path.Combine(ironRubyRoot, @"ironruby"),
- Path.Combine(ironRubyRoot, @"ruby\site_ruby\1.9.1"),
- Path.Combine(ironRubyRoot, @"ruby\1.9.1")
+ Path.Combine(IronConstant.IronRubyRootDirectory, @"ironruby"),
+ Path.Combine(IronConstant.IronRubyRootDirectory, @"ruby\site_ruby\1.9.1"),
+ Path.Combine(IronConstant.IronRubyRootDirectory, @"ruby\1.9.1")
});
var ironRubyEngine = new IronEngine(this, rubyEngine);
@@ -162,7 +162,7 @@ private void Initialize()
ScriptScope scope = rubyEngine.CreateScope();
scope.SetVariable("iron_runtime", this);
scope.SetVariable("ruby_engine", ironRubyEngine);
- scope.SetVariable("rails_root", ironRubyRoot);
+ scope.SetVariable("rails_root", IronConstant.IronRubyRootDirectory);
scope.SetVariable("rails_env",
IronConstant.IronEnv == IronEnvironment.Debug
? "development"
@@ -190,11 +190,11 @@ IRON_DEFAULT_LOGGER.error ex
}
}
- private void PrivilegedInitialize(string rubyRoot)
+ private void PrivilegedInitialize()
{
- string gemDir = Path.Combine(rubyRoot, "lib/ironruby/gems/1.9.1").Replace("\\", "/");
+ string gemDir = Path.Combine(IronConstant.IronRubyRootDirectory, "lib/ironruby/gems/1.9.1").Replace("\\", "/");
- Environment.SetEnvironmentVariable("IRONRUBY_10_20", rubyRoot);
+ Environment.SetEnvironmentVariable("IRONRUBY_10_20", IronConstant.IronRubyRootDirectory);
Environment.SetEnvironmentVariable("GEM_PATH", gemDir);
Environment.SetEnvironmentVariable("GEM_HOME", gemDir);
}
@@ -216,7 +216,6 @@ public static IronRuntime GetDefaultIronRuntime(SPSite targetSite)
{
runtime = new IronRuntime(targetId);
LivingRuntimes[targetId] = runtime;
- runtime.Initialize();
}
}
}
@@ -286,7 +285,7 @@ public static void LogError(string msg, Exception ex)
{
IronDiagnosticsService.Local.WriteTrace(1, IronDiagnosticsService.Local[IronCategoryDiagnosticsId.Core],
TraceSeverity.Unexpected,
- String.Format("{0}. Error:{1}; Stack:{2}", msg, ex.Message,
+ String.Format("{0}\nError:{1}\nStack:{2}", msg, ex.Message,
ex.StackTrace));
}
Oops, something went wrong.

0 comments on commit 9ed9091

Please sign in to comment.