${iServerJava6R_Theme_Title}

${iServerJava6R_Theme_Description}

        private static string GetThemeLayer(Theme theme, ThemeParameters param)
        {
            string themeLayerJson = "{";

            List<string> themeLayerList = new List<string>();
            List<string> joinItemsList = new List<string>();

            if (theme is ThemeUnique)
            {
                themeLayerList.Add(string.Format("\"theme\":{0}", ThemeUnique.ToJson((ThemeUnique)theme)));
            }
            else if (theme is ThemeRange)
            {
                themeLayerList.Add(string.Format("\"theme\":{0}", ThemeRange.ToJson((ThemeRange)theme)));
            }
            else if (theme is ThemeDotDensity)
            {
                themeLayerList.Add(string.Format("\"theme\":{0}", ThemeDotDensity.ToJson((ThemeDotDensity)theme)));
            }
            else if (theme is ThemeGraduatedSymbol)
            {
                themeLayerList.Add(string.Format("\"theme\":{0}", ThemeGraduatedSymbol.ToJson((ThemeGraduatedSymbol)theme)));
            }
            else if (theme is ThemeGraph)
            {
                themeLayerList.Add(string.Format("\"theme\":{0}", ThemeGraph.ToJson((ThemeGraph)theme)));
            }
            else if (theme is ThemeLabel)
            {
                themeLayerList.Add(string.Format("\"theme\":{0}", ThemeLabel.ToJson((ThemeLabel)theme)));
            }
            else if (theme is ThemeGridRange)
            {
               themeLayerList.Add(string.Format("\"theme\":{0}", ThemeGridRange.ToJson((ThemeGridRange)theme)));
            }
            else if (theme is ThemeGridUnique)
            {
               themeLayerList.Add(string.Format("\"theme\":{0}", ThemeGridUnique.ToJson((ThemeGridUnique)theme)));
            }
            else
            {
                themeLayerList.Add("\"theme\":null");
            }

            themeLayerList.Add("\"type\":\"UGC\"");
            themeLayerList.Add("\"ugcLayerType\":\"THEME\"");
            //themeLayerList.Add(string.Format("\"name\":\"{0}\"", param.Name));

            themeLayerList.Add(string.Format("\"datasetInfo\":{0}",
                GetDatasetInfo(param.DatasetName, param.DataSourceName)));
            if (param.MinVisibleGeometrySize != null)
            {
                themeLayerList.Add(string.Format("\"minVisibleGeometrySize\":{0}", param.MinVisibleGeometrySize));
            }

            foreach (var item in param.JoinItems)
            {
                joinItemsList.Add(JoinItem.ToJson(item));
            }

            string joinItemsStr = string.Join(",", joinItemsList);
            themeLayerList.Add(string.Format("\"joinItems\":[{0}]", joinItemsStr));
            themeLayerJson += string.Join(",", themeLayerList.ToArray());
            themeLayerJson += "}";
            return themeLayerJson;
        }