public string GetModelData(ModuleInstanceView parent, string settingsData, IDictionary<string, string> parameters, bool isConfigView)
        {
            // Create Or Deserialize View Data
            if (string.IsNullOrEmpty(settingsData))
                _viewSettings = new DetailView();
            else
                _viewSettings = CommonUtils.JsonDeserialize<DetailView>(settingsData);

            // Load settings
            EnsureSeoSettings();

            _mappingSettings = parent.ProcessRequest<ReadMappingSettingsResponse>(new ReadMappingSettingsRequest());
            _viewSettings.BingMappingKey = _mappingSettings.BingMapsKey;
            _viewSettings.GoogleMappingKey = _mappingSettings.GoogleMapsKey;

            // Handle specific commands
            if (parameters.ContainsKey("Command"))
            {
                var result = HandleCommand(parent, parameters);
                if (result != null)
                    return result;
            }

            // Build Admin or Public View
            if (isConfigView)
                BuildAdminSettingsView(parent);
            else
            {
                BuildPublicSettingsView(parent, parameters);
                _viewSettings.AvailableFields.Clear();
            }

            return CommonUtils.JsonSerializeMinimum(_viewSettings);
        }
        public string GetModelData(ModuleInstanceView parent, string settingsData, IDictionary<string, string> parameters, bool isConfigView)
        {
            if (string.IsNullOrEmpty(settingsData))
                _viewSettings = new DetailView();
            else
                _viewSettings = CommonUtils.JsonDeserialize<DetailView>(settingsData);

            EnsureSeoSettings();

            _mappingSettings = parent.ProcessRequest<ReadMappingSettingsResponse>(new ReadMappingSettingsRequest());
            _viewSettings.BingMappingKey = _mappingSettings.BingMapsKey;
            _viewSettings.GoogleMappingKey = _mappingSettings.GoogleMapsKey;

            if (isConfigView)
                BuildAdminSettingsView(parent);
            else
            {
                BuildPublicSettingsView(parent, parameters);
                _viewSettings.AvailableFields.Clear();
            }

            return CommonUtils.JsonSerializeMinimum(_viewSettings);
        }
Esempio n. 3
0
 protected void SetMapSettings(ReadMappingSettingsResponse mappingSettings)
 {
     _viewSettings.BingMappingKey = mappingSettings.BingMapsKey;
     _viewSettings.GoogleMappingKey = mappingSettings.GoogleMapsKey;
     _viewSettings.MappingProvider = mappingSettings.MappingProvider.ToString().ToUpperInvariant();
 }