private PreInstallWarnings GetPreInstallWarnings(XElement rootElement)
        {
            XElement files       = rootElement.Element(Constants.Packaging.FilesNodeName);
            XElement styleSheets = rootElement.Element(Constants.Packaging.StylesheetsNodeName);
            XElement templates   = rootElement.Element(Constants.Packaging.TemplatesNodeName);
            XElement alias       = rootElement.Element(Constants.Packaging.MacrosNodeName);

            var sourceDestination = EmptyArrayIfNull <KeyValuePair <string, string> >(files) ?? ExtractSourceDestinationFileInformation(files);

            var installWarnings = new PreInstallWarnings();

            var macroAliases = EmptyEnumerableIfNull <IMacro>(alias) ?? ConflictingPackageData.FindConflictingMacros(alias);

            installWarnings.ConflictingMacroAliases = macroAliases;

            var templateAliases = EmptyEnumerableIfNull <ITemplate>(templates) ?? ConflictingPackageData.FindConflictingTemplates(templates);

            installWarnings.ConflictingTemplateAliases = templateAliases;

            var stylesheetNames = EmptyEnumerableIfNull <IFile>(styleSheets) ?? ConflictingPackageData.FindConflictingStylesheets(styleSheets);

            installWarnings.ConflictingStylesheetNames = stylesheetNames;

            installWarnings.UnsecureFiles = FindUnsecureFiles(sourceDestination);
            installWarnings.FilesReplaced = FindFilesToBeReplaced(sourceDestination);

            return(installWarnings);
        }
Example #2
0
        public void PackagingService_Can_GetPackageWarnings()
        {
            var packagingService = (PackagingService)ServiceContext.PackagingService;

            const string documentTypePickerUmb = "Document_Type_Picker_1.1.umb";

            string testPackagePath = GetTestPackagePath(documentTypePickerUmb);

            PreInstallWarnings preInstallWarnings = packagingService.GetPackageWarnings(testPackagePath);

            Assert.IsNotNull(preInstallWarnings);
        }
Example #3
0
        private PreInstallWarnings GetPreInstallWarnings(CompiledPackage package, string applicationRootFolder)
        {
            var sourceDestination = ExtractSourceDestinationFileInformation(package.Files);

            var installWarnings = new PreInstallWarnings
            {
                ConflictingMacros      = _conflictingPackageData.FindConflictingMacros(package.Macros),
                ConflictingTemplates   = _conflictingPackageData.FindConflictingTemplates(package.Templates),
                ConflictingStylesheets = _conflictingPackageData.FindConflictingStylesheets(package.Stylesheets),
                UnsecureFiles          = FindUnsecureFiles(sourceDestination),
                FilesReplaced          = FindFilesToBeReplaced(sourceDestination, applicationRootFolder)
            };

            return(installWarnings);
        }