Skip to content

Commit 0a96737

Browse files
committed
Umbraco installer WIP
1 parent 5928a41 commit 0a96737

File tree

7 files changed

+47
-40
lines changed

7 files changed

+47
-40
lines changed

build/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<Action runat="uninstall" undo="true" alias="UmbracoFileSystemProviders.Azure.TransformConfig" file="~/Media/web.config" xdtfile="~/App_Plugins/UmbracoFileSystemProviders/Azure/Install/media-web.config"></Action>
3636
</Actions>
3737

38-
<control>/App_Plugins/UmbracoFileSystemProviders/Azure/Install/Configurator/Views/Configure.ascx</control>
38+
<view>/App_Plugins/UmbracoFileSystemProviders/Azure/Install/Configurator/Views/configure.htm</view>
3939

4040
<files />
4141

src/UmbracoFileSystemProviders.Azure.Installer/Configurator/Controllers/Configure.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
var configApp = angular.module("UFSPLoader", []);
2-
3-
configApp.controller("Loader", function ($scope, $http, $log) {
1+
angular.module("umbraco").controller("Loader", function ($scope, $http, $log) {
42
var getDataUrl = "/Umbraco/backoffice/FileSystemProviders/Installer/GetParameters";
53
var postDataUrl = "/Umbraco/backoffice/FileSystemProviders/Installer/PostParameters";
64

src/UmbracoFileSystemProviders.Azure.Installer/Configurator/Views/Configure.ascx renamed to src/UmbracoFileSystemProviders.Azure.Installer/Configurator/Views/Configure.htm

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
1-
<%@ Control Language="c#" AutoEventWireup="True" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
2-
3-
<script src="<%=ResolveUrl("~/umbraco/lib/angular/1.1.5/angular.min.js") %>"></script>
4-
<script src="<%=ResolveUrl("~/App_Plugins/UmbracoFileSystemProviders/Azure/Install/Configurator/Controllers/Configure.js")%>"></script>
5-
6-
<div ng-app ="UFSPLoader">
7-
<div ng-controller="Loader">
8-
<div class="row">
1+
 <div ng-controller="Loader">
2+
<div class="row">
93
<div class="span1">
10-
<img src="<%=ResolveUrl("~/App_Plugins/UmbracoFileSystemProviders/Azure/Install/azure-logo-32.png")%>"/>
4+
<img src="/App_Plugins/UmbracoFileSystemProviders/Azure/Install/azure-logo-32.png"/>
115
</div>
126
<div><h4>Umbraco Azure File System Provider</h4></div>
137
</div>
148
<div class="row">
159
<div><hr /></div>
1610
</div>
17-
<div class="row" ng-show="!saved">
11+
<div class="row" ng-show="!saved">
1812
<div>
1913
<fieldset>
20-
<legend><h4>To complete installation, please enter the required parameters for the Azure storage provider below</h4></legend>
21-
<form name="paramForm" class="form-horizontal" role="form">
14+
<legend><h4>To complete installation, please enter the required parameters for the Azure storage provider below</h4></legend>
15+
<form name="paramForm" class="form-horizontal" role="form">
2216
<div ng-repeat="param in parameters" class="control-group">
2317
<ng-form name="form">
24-
<label class="control-label" for="param.key">{{ capitalizeFirstLetter(param.key) }}</label>
18+
<label class="control-label" for="param.key">{{ capitalizeFirstLetter(param.key) }}</label>
2519
<div class="controls">
26-
<span ng-if="getInputType(param.key) === 'checkbox'" ng-include="'<%=ResolveUrl("/App_Plugins/UmbracoFileSystemProviders/Azure/Install/Configurator/Views/checkbox.htm")%>'"></span>
27-
<span ng-if="getInputType(param.key) === 'text'" ng-include="'<%=ResolveUrl("/App_Plugins/UmbracoFileSystemProviders/Azure/Install/Configurator/Views/textfield.htm")%>'"></span>
20+
<span ng-if="getInputType(param.key) === 'checkbox'" ng-include="/App_Plugins/UmbracoFileSystemProviders/Azure/Install/Configurator/Views/checkbox.htm"></span>
21+
<span ng-if="getInputType(param.key) === 'text'" ng-include="/App_Plugins/UmbracoFileSystemProviders/Azure/Install/Configurator/Views/textfield.htm"></span>
2822
</div>
2923
<span data-ng-show=" {{'form.'+param.key+'.$dirty && form.'+param.key+'.$error.required'}}">Required!</span>
3024
</ng-form>
@@ -33,31 +27,29 @@
3327
</form>
3428
</fieldset>
3529
</div>
36-
</div>
30+
</div>
3731
<div class="row" ng-show="!saved">
3832
<div><hr /></div>
39-
</div>
33+
</div>
4034

4135
<div class="row">
4236
<div>
4337
<div class="alert alert-success" ng-show="saved && (status === 'Ok' || status === 'ImageProcessorWebCompatibility' || status === 'ImageProcessorWebConfigError')">
44-
The Azure storage provider was sucessfully configured and your media is now as light as candyfloss
38+
The Azure storage provider was sucessfully configured and your media is now as light as candyfloss
4539
</div>
4640
<div class="alert alert-info" ng-show="saved && status === 'ImageProcessorWebCompatibility'">
47-
<strong>Warning!</strong> You need to upgrade the installed version of ImageProcessor.Web to v4.3.2+ (reinstall this package once you've updated) to be fully compatible with this package <a href="https://our.umbraco.org/projects/collaboration/imageprocessor/" target="_blank">https://our.umbraco.org/projects/collaboration/imageprocessor/</a>
41+
<strong>Warning!</strong> You need to upgrade the installed version of ImageProcessor.Web to v4.3.2+ (reinstall this package once you've updated) to be fully compatible with this package <a href="https://our.umbraco.org/projects/collaboration/imageprocessor/" target="_blank">https://our.umbraco.org/projects/collaboration/imageprocessor/</a>
4842
</div>
4943
<div class="alert alert-info" ng-show="saved && status === 'ImageProcessorWebConfigError'">
50-
<strong>Warning!</strong> The installer was unable to configure ImageProcessor.Web, please see documentation to fix the issue <a href="https://our.umbraco.org/projects/collaboration/umbracofilesystemprovidersazure/" target="_blank">https://our.umbraco.org/projects/collaboration/umbracofilesystemprovidersazure/</a>
44+
<strong>Warning!</strong> The installer was unable to configure ImageProcessor.Web, please see documentation to fix the issue <a href="https://our.umbraco.org/projects/collaboration/umbracofilesystemprovidersazure/" target="_blank">https://our.umbraco.org/projects/collaboration/umbracofilesystemprovidersazure/</a>
5145
</div>
5246
<div class="alert alert-error" ng-show="saved && status != 'Ok' && status != 'ImageProcessorWebCompatibility'">
5347
<strong>Oh no</strong>, something went wrong saving, please check Umbraco log files for exceptions
5448
</div>
5549
<div class="alert alert-error" ng-show="!saved && status === 'ConnectionError'">
5650
<strong>Oh no</strong>, there was something wrong with your Azure connection string, please check and try again, more info in the Umbraco log files
57-
</div>
51+
</div>
5852
</div>
5953
</div>
60-
61-
</div>
62-
</div>
6354

55+
</div>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"javascript": [
3+
"/App_Plugins/UmbracoFileSystemProviders/Azure/Install/Configurator/Controllers/Configure.js"
4+
]
5+
}

src/UmbracoFileSystemProviders.Azure.Installer/InstallerController.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,16 @@ internal static IEnumerable<Parameter> GetParametersFromXdt(string xdtPath, stri
332332
/// <param name="xmlPath">The file path</param>
333333
/// <returns>The <see cref="IEnumerable{Parameter}"/>.</returns>
334334
internal static IEnumerable<Parameter> GetParametersFromXml(string xmlPath)
335-
{
335+
{
336336
List<Parameter> settings = new List<Parameter>();
337+
338+
// *** TEMP for testing ***
339+
340+
settings.Add(new Parameter(){Key = "ContainerName", Value = ""});
341+
settings.Add(new Parameter() { Key = "ConnectionString", Value = "" });
342+
return settings;
343+
344+
337345
XmlDocument document = XmlHelper.OpenAsXmlDocument(xmlPath);
338346

339347
XmlNodeList parameters = document.SelectNodes($"//Provider[@type = '{Constants.ProviderType}']/Parameters/add");

src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@
305305
</ItemGroup>
306306
<ItemGroup>
307307
<None Include="app.config" />
308+
<None Include="Configurator\package.manifest" />
308309
<None Include="config\imageprocessor\cache.config" />
309310
<None Include="config\imageprocessor\processing.config" />
310311
<None Include="config\imageprocessor\security.config" />
@@ -316,9 +317,7 @@
316317
<ItemGroup>
317318
<Content Include="Configurator\Controllers\Configure.js" />
318319
<Content Include="Configurator\Views\checkbox.htm" />
319-
<Content Include="Configurator\Views\Configure.ascx">
320-
<SubType>ASPXCodeBehind</SubType>
321-
</Content>
320+
<Content Include="Configurator\Views\configure.htm" />
322321
<Content Include="Configurator\Views\textfield.htm" />
323322
</ItemGroup>
324323
<ItemGroup>

src/UmbracoFileSystemProviders.Azure/AzureFileSystemComposer.cs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,22 @@ public class AzureFileSystemComposer : IComposer
1111
{
1212
public void Compose(Composition composition)
1313
{
14-
//Configuration
15-
var config = CreateConfiguration();
14+
// if no connectionString appSetting then Umbraco installer hasn't completed yet
15+
var connectionString = ConfigurationManager.AppSettings[Constants.Configuration.ConnectionStringKey];
16+
if (connectionString != null)
17+
{
18+
//Configuration
19+
var config = CreateConfiguration();
1620

17-
//Reads config from AppSetting keys
18-
composition.RegisterUnique(config);
21+
//Reads config from AppSetting keys
22+
composition.RegisterUnique(config);
1923

20-
//Set the Media FS to use our Azure FS with our config from AppSettings
21-
composition.SetMediaFileSystem(_ => new AzureBlobFileSystem(config));
24+
//Set the Media FS to use our Azure FS with our config from AppSettings
25+
composition.SetMediaFileSystem(_ => new AzureBlobFileSystem(config));
2226

23-
//Register component that deals with the VirtualPathProvider
24-
composition.Components().Append<AzureFileSystemComponent>();
27+
//Register component that deals with the VirtualPathProvider
28+
composition.Components().Append<AzureFileSystemComponent>();
29+
}
2530
}
2631

2732
private AzureBlobFileSystemConfig CreateConfiguration()

0 commit comments

Comments
 (0)