예제 #1
0
    public string GetConfiguration(string configFile)
    {
        if (string.IsNullOrEmpty(configFile))
        {
            return("false");
        }

        Sage.Platform.SummaryView.WebSummaryViewConfiguration config;
        var serializer = new System.Xml.Serialization.XmlSerializer(typeof(Sage.Platform.SummaryView.WebSummaryViewConfiguration));

        using (var reader = new System.IO.StreamReader(Page.MapPath(string.Format("~/SummaryConfigData/{0}.xml", configFile))))
        {
            config = serializer.Deserialize(reader) as Sage.Platform.SummaryView.WebSummaryViewConfiguration;
        }
        if (config == null)
        {
            return(string.Empty);
        }

        var obj = new Sage.Common.Syndication.Json.Linq.JObject();

        obj["mashupName"]       = config.MashupName;
        obj["queryName"]        = config.QueryName;
        obj["templateLocation"] = config.Template;

        return(Sage.Common.Syndication.Json.JsonConvert.SerializeObject(obj));
    }
예제 #2
0
    public string GetConfiguration(string configFile)
    {
        if (string.IsNullOrEmpty(configFile))
        {
            return "false";
        }

        Sage.Platform.SummaryView.WebSummaryViewConfiguration config;
        var serializer = new System.Xml.Serialization.XmlSerializer(typeof(Sage.Platform.SummaryView.WebSummaryViewConfiguration));
        using (var reader = new System.IO.StreamReader(Page.MapPath(string.Format("~/SummaryConfigData/{0}.xml", configFile))))
        {
            config = serializer.Deserialize(reader) as Sage.Platform.SummaryView.WebSummaryViewConfiguration;
        }
        if (config == null)
        {
            return string.Empty;
        }

        var obj = new Sage.Common.Syndication.Json.Linq.JObject();
        obj["mashupName"] = config.MashupName;
        obj["queryName"] = config.QueryName;
        obj["templateLocation"] = config.Template;

        return Sage.Common.Syndication.Json.JsonConvert.SerializeObject(obj);
    }