Esempio n. 1
0
        public static PortalSolutions ConfigurePortalSolutionsDetails(this IAppBuilder app, CrmDbContext context)
        {
            var portalSolutions = new PortalSolutions(context);

            app.CreatePerOwinContext(() => portalSolutions);

            return(portalSolutions);
        }
Esempio n. 2
0
        public static ContentMapProvider ConfigureContentMap(
            this IAppBuilder app,
            Func <CrmDbContext> createContext,
            CrmWebsite website,
            EventHubJobSettings eventHubJobSettings,
            PortalSolutions portalSolutions)
        {
            var solutionDefinitionProvider = new CmsSolutionDefinitionProvider(portalSolutions, website);
            var contentMapProvider         = new ContentMapProvider(createContext, solutionDefinitionProvider, eventHubJobSettings, portalSolutions);

            app.CreatePerOwinContext(() => contentMapProvider);

            // support legacy accessors
            AdxstudioCrmConfigurationProvider.Set(solutionDefinitionProvider);
            AdxstudioCrmConfigurationProvider.Set(contentMapProvider);

            return(contentMapProvider);
        }
Esempio n. 3
0
        public static void UpdatePrimaryDomainName <TWebsite, TKey>(this IAppBuilder app, WebsiteManager <TWebsite, TKey> websiteManager, TWebsite website, PortalSolutions portalSolutions)
            where TWebsite : CrmWebsite <TKey>
            where TKey : IEquatable <TKey>
        {
            if (portalSolutions.BaseSolutionCrmVersion < BaseSolutionVersions.PotassiumVersion)
            {
                return;
            }

            var domainName           = PortalSettings.Instance.DomainName;
            var websiteBindingsCount = website.Bindings.Count();

            // ensure that there is only one website binding
            if (!string.Equals(website.PrimaryDomainName, domainName, StringComparison.OrdinalIgnoreCase) && websiteBindingsCount == 1)
            {
                website.PrimaryDomainName = domainName;
                websiteManager.UpdateAsync(website).GetAwaiter().GetResult();
                return;
            }

            ADXTrace.Instance.TraceInfo(TraceCategory.Application, "Multiple website bindings found. Not updating Primary Domain Name");
        }