Esempio n. 1
0
        private IDictionary <string, object> ConvertFieldIntToGuid(IDictionary <string, object> inputDictionary)
        {
            var newDictionary = new Dictionary <string, object>();
            var lang          = string.Empty;

            if (inputDictionary.ContainsKey(EPiServer.Forms.Constants.SYSTEMCOLUMN_Language))
            {
                lang = inputDictionary[EPiServer.Forms.Constants.SYSTEMCOLUMN_Language].ToString();
            }
            foreach (var dicItem in inputDictionary)
            {
                if (EpiFormDataExport.IsFieldElement(dicItem.Key))
                {
                    var contentId = GetContentFromField(dicItem.Key, lang);
                    if (!string.IsNullOrEmpty(contentId))
                    {
                        newDictionary.Add($"{EpiFormDataExport._formFieldString}{contentId}", dicItem.Value);
                    }
                }
                else if (EpiFormDataExport.IsSYSTEMCOLUMNHostedPageField(dicItem.Key))
                {
                    var contentId = GetContentFromField(dicItem.Value.ToString(), lang);
                    if (!string.IsNullOrEmpty(contentId))
                    {
                        newDictionary.Add(EPiServer.Forms.Constants.SYSTEMCOLUMN_HostedPage, contentId);
                    }
                }
                else
                {
                    newDictionary.Add(dicItem.Key, dicItem.Value);
                }
            }
            return(newDictionary);
        }
Esempio n. 2
0
        public async Task <ActionResult> DoExportToXml(string guidId, int homePageId)
        {
            var contentGuid    = new Guid(guidId);
            var exportData     = new EpiFormDataExport(contentGuid, homePageId);
            var submissionData = exportData.GetFormSubmissionXmlData();

            return(File(submissionData, System.Net.Mime.MediaTypeNames.Text.Xml, $"Home_{homePageId}" + ".xml"));
        }