Skip to content

Commit 65448c6

Browse files
Merge pull request #135 from warrenbuckley/develop8
WIP - Initial help/work to get this working for V8.0.0
2 parents eadd7f2 + a2229b5 commit 65448c6

30 files changed

+1028
-772
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
[*.cs]
5+
indent_style = space
6+
indent_size = 4
7+
csharp_style_var_for_built_in_types = false:warning
8+
csharp_style_var_elsewhere = false:warning
9+
csharp_style_var_when_type_is_apparent = true:warning
10+
end_of_line = crlf
11+
dotnet_sort_system_directives_first = true
12+
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
13+
dotnet_style_predefined_type_for_member_access = true:warning
14+
dotnet_style_qualification_for_field = true:warning
15+
dotnet_style_qualification_for_method = true:warning
16+
dotnet_style_qualification_for_property = true:warning

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#VS 2015 hidden folder
55
src/.vs/*
66

7-
build/tools/vswhere.2.0.2
7+
build/tools/vswhere*
88
build/tools/vswhere.exe
99

1010
artifacts/*
@@ -237,3 +237,4 @@ $RECYCLE.BIN/
237237

238238
# Windows shortcuts
239239
*.lnk
240+
.vs/

NuGet.Config

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<!--
4+
this is Umbraco's NuGet configuration,
5+
content of this file is merged with the system-wide configuration,
6+
at %APPDATA%\NuGet\NuGet.config
7+
-->
8+
<packageSources>
9+
<add key="UmbracoCoreMyGet" value="https://www.myget.org/F/umbracocore/api/v3/index.json" />
10+
<add key="ExamineAppVeyor" value="https://ci.appveyor.com/nuget/examine-f73l6qv0oqfh/" />
11+
</packageSources>
12+
</configuration>

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
os: Visual Studio 2017
22

33
# Version format
4-
version: 1.0.3.{build}
4+
version: 2.0.0.{build}
55

66
cache:
77
- src\packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified

build-appveyor.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ IF NOT EXIST "%toolsFolder%" (
1414

1515
IF NOT EXIST "%toolsFolder%vswhere.exe" (
1616
ECHO vswhere not found - fetching now
17-
nuget install vswhere -Version 2.0.2 -Source nuget.org -OutputDirectory tools
17+
tools\nuget.exe install vswhere -Version 2.5.9 -Source nuget.org -OutputDirectory tools
1818
)
1919

2020
FOR /f "delims=" %%A in ('dir "%toolsFolder%vswhere.*" /b') DO SET "vswhereExePath=%toolsFolder%%%A\"

build/UmbracoFileSystemProviders.Azure.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<!-- SHARED PROPERTIES -->
1818
<PropertyGroup>
1919
<PackageName>UmbracoFileSystemProviders.Azure</PackageName>
20-
<MinUmbracoVersion>7.1.9</MinUmbracoVersion>
20+
<MinUmbracoVersion>8.0.0-alpha.58.1580</MinUmbracoVersion>
2121
<Readme>An Azure Blob Storage IFileSystem provider for Umbraco.</Readme>
2222
<AuthorName>James Jackson-South, Dirk Seefeld, Lars-Erik Aabech, Jeavon Leopold</AuthorName>
2323
<AuthorUrl>https://github.com/JimBobSquarePants/UmbracoFileSystemProviders.Azure/graphs/contributors</AuthorUrl>

build/tools/NuGet.exe

680 KB
Binary file not shown.

src/UmbracoFileSystemProviders.Azure.Installer/InstallerController.cs

Lines changed: 61 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ namespace Our.Umbraco.FileSystemProviders.Azure.Installer
1717
using System.Xml;
1818
using Enums;
1919
using global::Umbraco.Core;
20+
using global::Umbraco.Core.Composing;
2021
using global::Umbraco.Core.Logging;
22+
using global::Umbraco.Core.Xml;
23+
using global::Umbraco.Web._Legacy.PackageActions;
2124
using global::Umbraco.Web.Mvc;
2225
using global::Umbraco.Web.WebApi;
2326
using Microsoft.WindowsAzure.Storage;
2427
using Microsoft.WindowsAzure.Storage.Blob;
25-
2628
using Models;
27-
using umbraco.cms.businesslogic.packager.standardPackageActions;
2829

2930
/// <summary>
3031
/// The installer controller for managing installer logic.
@@ -191,8 +192,7 @@ internal static bool SaveParametersToFileSystemProvidersXdt(string xdtPath, ILis
191192
catch (Exception e)
192193
{
193194
// Log error message
194-
string message = "Error saving XDT Parameters: " + e.Message;
195-
LogHelper.Error(typeof(InstallerController), message, e);
195+
Current.Logger.Error<InstallerController>(e, "Error saving XDT Parameters");
196196
}
197197

198198
return result;
@@ -230,8 +230,7 @@ internal static bool SaveContainerNameToWebConfigXdt(string xdtPath, string cont
230230
catch (Exception e)
231231
{
232232
// Log error message
233-
string message = "Error saving XDT Parameters: " + e.Message;
234-
LogHelper.Error(typeof(InstallerController), message, e);
233+
Current.Logger.Error<InstallerController>(e, "Error saving XDT Parameters");
235234
}
236235

237236
return result;
@@ -292,8 +291,7 @@ internal static bool SaveBlobPathToImageProcessorSecurityXdt(string xdtPath, str
292291
catch (Exception e)
293292
{
294293
// Log error message
295-
string message = "Error saving XDT Settings: " + e.Message;
296-
LogHelper.Error(typeof(InstallerController), message, e);
294+
Current.Logger.Error<InstallerController>(e, "Error saving XDT Parameters");
297295
}
298296

299297
return result;
@@ -361,46 +359,49 @@ internal static IEnumerable<Parameter> GetParametersFromXml(string xmlPath)
361359
/// <returns>True if the transform is successful, otherwise false.</returns>
362360
private static bool ExecuteFileSystemConfigTransform()
363361
{
364-
XmlNode transFormConfigAction =
365-
helper.parseStringToXmlNode("<Action runat=\"install\" "
366-
+ "undo=\"true\" "
367-
+ "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
368-
+ "file=\"~/Config/FileSystemProviders.config\" "
369-
+ "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/FileSystemProviders.config\">"
370-
+ "</Action>").FirstChild;
371-
372-
PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
373-
return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
362+
//XmlNode transFormConfigAction =
363+
// PackageHelper.ParseStringToXmlNode("<Action runat=\"install\" "
364+
// + "undo=\"true\" "
365+
// + "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
366+
// + "file=\"~/Config/FileSystemProviders.config\" "
367+
// + "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/FileSystemProviders.config\">"
368+
// + "</Action>").FirstChild;
369+
370+
//PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
371+
//return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
372+
return true;
374373
}
375374

376375
private static bool ExecuteWebConfigTransform()
377376
{
378-
XmlNode transFormConfigAction =
379-
helper.parseStringToXmlNode("<Action runat=\"install\" "
380-
+ "undo=\"true\" "
381-
+ "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
382-
+ "file=\"~/web.config\" "
383-
+ "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/web.config\">"
384-
+ "</Action>").FirstChild;
385-
386-
PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
387-
return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
377+
//XmlNode transFormConfigAction =
378+
// PackageHelper.ParseStringToXmlNode("<Action runat=\"install\" "
379+
// + "undo=\"true\" "
380+
// + "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
381+
// + "file=\"~/web.config\" "
382+
// + "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/web.config\">"
383+
// + "</Action>").FirstChild;
384+
385+
//PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
386+
//return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
387+
return true;
388388
}
389389

390390
private static bool ExecuteMediaWebConfigTransform()
391391
{
392392
if (File.Exists(HttpContext.Current.Server.MapPath("~/Media/web.config")))
393393
{
394-
XmlNode transFormConfigAction =
395-
helper.parseStringToXmlNode("<Action runat=\"install\" "
396-
+ "undo=\"true\" "
397-
+ "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
398-
+ "file=\"~/Media/web.config\" "
399-
+ "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/media-web.config\">"
400-
+ "</Action>").FirstChild;
401-
402-
PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
403-
return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
394+
//XmlNode transFormConfigAction =
395+
// PackageHelper.ParseStringToXmlNode("<Action runat=\"install\" "
396+
// + "undo=\"true\" "
397+
// + "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
398+
// + "file=\"~/Media/web.config\" "
399+
// + "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/media-web.config\">"
400+
// + "</Action>").FirstChild;
401+
402+
//PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
403+
//return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
404+
return true;
404405
}
405406

406407
return true;
@@ -419,30 +420,32 @@ private static bool ExecuteImageProcessorSecurityConfigTransform()
419420
File.Copy(ImageProcessorSecurityDefaultConfigPath, ImageProcessorSecurityConfigPath);
420421
}
421422

422-
XmlNode transFormConfigAction =
423-
helper.parseStringToXmlNode("<Action runat=\"install\" "
424-
+ "undo=\"false\" "
425-
+ "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
426-
+ "file=\"~/config/imageprocessor/security.config\" "
427-
+ "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/security.config\">"
428-
+ "</Action>").FirstChild;
423+
//XmlNode transFormConfigAction =
424+
// PackageHelper.ParseStringToXmlNode("<Action runat=\"install\" "
425+
// + "undo=\"false\" "
426+
// + "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
427+
// + "file=\"~/config/imageprocessor/security.config\" "
428+
// + "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/security.config\">"
429+
// + "</Action>").FirstChild;
429430

430-
PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
431-
return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
431+
//PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
432+
//return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
433+
return true;
432434
}
433435

434436
private static bool ExecuteImageProcessorWebConfigTransform()
435437
{
436-
XmlNode transFormConfigAction =
437-
helper.parseStringToXmlNode("<Action runat=\"install\" "
438-
+ "undo=\"false\" "
439-
+ "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
440-
+ "file=\"~/web.config\" "
441-
+ "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/imageprocessor.web.config\">"
442-
+ "</Action>").FirstChild;
443-
444-
PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
445-
return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
438+
//XmlNode transFormConfigAction =
439+
// PackageHelper.ParseStringToXmlNode("<Action runat=\"install\" "
440+
// + "undo=\"false\" "
441+
// + "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
442+
// + "file=\"~/web.config\" "
443+
// + "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/imageprocessor.web.config\">"
444+
// + "</Action>").FirstChild;
445+
446+
//PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
447+
//return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
448+
return true;
446449
}
447450

448451
private static bool TestAzureCredentials(string connectionString, string containerName)
@@ -463,7 +466,7 @@ private static bool TestAzureCredentials(string connectionString, string contain
463466
}
464467
catch (Exception e)
465468
{
466-
LogHelper.Error<InstallerController>($"Error validating Azure storage connection: {e.Message}", e);
469+
Current.Logger.Error<InstallerController>(e, "Error validating Azure storage connection");
467470
return false;
468471
}
469472
}

src/UmbracoFileSystemProviders.Azure.Installer/PackageActions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ namespace Our.Umbraco.FileSystemProviders.Azure.Installer
77
using System;
88
using System.Web;
99
using System.Xml;
10-
10+
using global::Umbraco.Core._Legacy.PackageActions;
11+
using global::Umbraco.Core.Composing;
1112
using global::Umbraco.Core.Logging;
13+
using global::Umbraco.Web._Legacy.PackageActions;
1214
using Microsoft.Web.XmlTransform;
13-
using umbraco.cms.businesslogic.packager.standardPackageActions;
14-
using umbraco.interfaces;
1515

1616
/// <summary>
1717
/// Handles installer package actions.
@@ -42,7 +42,8 @@ public XmlNode SampleXml()
4242
+ "undo=\"true\" alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
4343
+ "file=\"~/web.config\" xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/web.config\">"
4444
+ "</Action>";
45-
return helper.parseStringToXmlNode(xml);
45+
//return PackageHelper.ParseStringToXmlNode(xml);
46+
return null;
4647
}
4748

4849
/// <inheritdoc/>
@@ -97,8 +98,7 @@ private bool Transform(string packageName, XmlNode xmlData, bool uninstall = fal
9798
catch (Exception e)
9899
{
99100
// Log error message
100-
string message = "Error executing TransformConfig package action (check file write permissions): " + e.Message;
101-
LogHelper.Error(typeof(TransformConfig), message, e);
101+
Current.Logger.Error<TransformConfig>(e, "Error executing TransformConfig package action (check file write permissions)");
102102
return false;
103103
}
104104
}

0 commit comments

Comments
 (0)