public string ExportModule(int moduleId)
        {
            string xml = "";
            OpenContentController ctrl = new OpenContentController(PortalSettings.Current.PortalId);

            var tabModules = ModuleController.Instance.GetTabModulesByModule(moduleId);

            Hashtable moduleSettings = tabModules.Any() ? tabModules.First().ModuleSettings : new Hashtable();

            var items = ctrl.GetContents(moduleId);

            xml += "<opencontent>";
            foreach (var item in items)
            {
                xml += "<item>";
                xml += "<json>" + XmlUtils.XMLEncode(item.Json) + "</json>";
                xml += "<collection>" + XmlUtils.XMLEncode(item.Collection) + "</collection>";
                xml += "<key>" + XmlUtils.XMLEncode(item.Id) + "</key>";
                xml += "</item>";
            }

            foreach (DictionaryEntry moduleSetting in moduleSettings)
            {
                xml += "<moduleSetting>";
                xml += "<settingName>" + XmlUtils.XMLEncode(moduleSetting.Key.ToString()) + "</settingName>";
                xml += "<settingValue>" + XmlUtils.XMLEncode(moduleSetting.Value.ToString()) + "</settingValue>";
                xml += "</moduleSetting>";
            }

            xml += "</opencontent>";
            return(xml);
        }
Exemple #2
0
        public string ExportModule(int moduleId)
        {
            string xml = "";
            OpenContentController ctrl = new OpenContentController(PortalSettings.Current.PortalId);
            var items = ctrl.GetContents(moduleId);

            xml += "<opencontent>";
            foreach (var item in items)
            {
                xml += "<item>";
                xml += "<json>" + XmlUtils.XMLEncode(item.Json) + "</json>";
                xml += "<collection>" + XmlUtils.XMLEncode(item.Collection) + "</collection>";
                xml += "<key>" + XmlUtils.XMLEncode(item.Id) + "</key>";
                xml += "</item>";
            }
            xml += "</opencontent>";
            return(xml);
        }