@@ -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 }
0 commit comments