internal static string SaveConfigurationImpl(string configurationXml) { using (Tracer.GetTracer().StartTrace(configurationXml)) { using (SessionAwareCoreServiceClient client = CoreServiceManager.GetCoreServiceClient()) { try { XmlDocument appDataXml = new XmlDocument(); appDataXml.LoadXml(configurationXml); ApplicationDataAdapter ada = new ApplicationDataAdapter(Constants.DXA_RESOLVER_CONFIGURATION_NAME, appDataXml.DocumentElement); client.SaveApplicationData(null, new[] { ada.ApplicationData }); return(configurationXml); } catch (Exception ex) { throw new Exception( Resources.DXA_CM_Extensions_DXAResolver_Models_Strings.CR_SaveConfigurationFailed, ex); } } } }
internal static string LoadConfigurationImpl() { using (Tracer.GetTracer().StartTrace()) { using (SessionAwareCoreServiceClient client = CoreServiceManager.GetCoreServiceClient()) { try { ApplicationData appData = client.ReadApplicationData(null, Constants.DXA_RESOLVER_CONFIGURATION_NAME); if (appData != null) { ApplicationDataAdapter ada = new ApplicationDataAdapter(appData); XmlElement appDataXml = ada.GetAs <XmlElement>(); return(appDataXml.OuterXml); } return(String.Format( "<Configuration xmlns:{0}=\"{1}\"></Configuration>", Constants.DXA_RESOLVER_CONFIGURATION_PREFIX, Constants.DXA_RESOLVER_CONFIGURATION_NAMESPACE )); } catch (Exception ex) { throw new Exception( Resources.DXA_CM_Extensions_DXAResolver_Models_Strings.CR_LoadConfigurationFailed, ex); } } } }