public GetNameWithoutSpecialChars ( ) : string | ||
Résultat | string |
public HttpResponseMessage ExportApp(int appId, int zoneId, bool includeContentGroups, bool resetAppGuid) { EnsureUserIsAdmin(); var appWrapper = new SxcAppWrapper(appId); var zipExport = new ZipExport(zoneId, appId); var fileName = string.Format("2sxcApp_{0}_{1}.zip", appWrapper.GetNameWithoutSpecialChars(), appWrapper.GetVersion()); using (var fileStream = zipExport.ExportApp(includeContentGroups, resetAppGuid)) { var fileBytes = fileStream.ToArray(); return(HttpResponseMessageHelper.GetAttachmentHttpResponseMessage(fileName, "application/octet-stream", new MemoryStream(fileBytes))); } }
public HttpResponseMessage ExportContent(int appId, int zoneId, string contentTypeIdsString, string entityIdsString, string templateIdsString) { EnsureUserIsAdmin(); var appWrapper = new SxcAppWrapper(appId); var fileName = string.Format("2sxcContentExport_{0}_{1}.xml", appWrapper.GetNameWithoutSpecialChars(), appWrapper.GetVersion()); var fileXml = new XmlExporter ( zoneId, appId, false, contentTypeIdsString == null ? new string[0] : contentTypeIdsString.Split(';'), entityIdsString == null ? new string[0] : entityIdsString.Split(';') ).GenerateNiceXml(); return(HttpResponseMessageHelper.GetAttachmentHttpResponseMessage(fileName, "text/xml", fileXml)); }