Esempio n. 1
0
        public static void TestSitefinityApiAccess()
        {
            var sitefinityBaseUrl  = MigrationSettings.Settings.SitefinityBaseUrl;
            var sitefinityUsername = MigrationSettings.Settings.SitefinityUsername;
            var sitefinityPassword = MigrationSettings.Settings.SitefinityPassword;

            using (var sf = new SitefinityRestClient(sitefinityUsername, sitefinityPassword, sitefinityBaseUrl))
            {
                var local = new LocalizationCulturesServiceWrapper(sf);
                local.GetCultures("", 0, int.MaxValue, "", "");
            }
        }
Esempio n. 2
0
        private void GetCatalogCultures(SitefinityCatalogCurrencyCulture catalog, SitefinityRestClient sf)
        {
            var localizationWrapper = new LocalizationCulturesServiceWrapper(sf);
            var availableCultures   = localizationWrapper.GetCultures("", 0, int.MaxValue, "", "");

            if (!availableCultures.Items.Any())
            {
                Log.Error("No cultures returned from Sitefinity");
                throw new MigrationException("There must be at least one culture to import from Sitefinity");
            }

            catalog.Cultures = availableCultures.Items.ToList();
        }