Ejemplo n.º 1
0
        /// <summary>
        /// "Save as" button logic
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveAs_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Filter      = "PNG (*.png)|*.png|PDF (*.pdf)|*.pdf|SVG (*.svg)|*.svg|Spreadsheet (*.csv)|*.csv";
            saveFileDialog.FilterIndex = 1;

            if (saveFileDialog.ShowDialog() == true)
            {
                ExportSelection exportSelection = (ExportSelection)saveFileDialog.FilterIndex;
                switch (exportSelection)
                {
                case ExportSelection.PNG:
                    SaveAsPNG(saveFileDialog.FileName);
                    break;

                case ExportSelection.PDF:
                    SaveAsPDF(saveFileDialog.FileName);
                    break;

                case ExportSelection.SVG:
                    SaveAsSVG(saveFileDialog.FileName);
                    break;

                case ExportSelection.CSV:
                    SaveAsCSV(saveFileDialog.FileName);
                    break;
                }
            }
        }
Ejemplo n.º 2
0
 [AllowAnonymous] // will do security check internally
 public HttpResponseMessage Download(
     int appId,
     string language,
     string defaultLanguage,
     string contentType,
     ExportSelection recordExport, ExportResourceReferenceMode resourcesReferences,
     ExportLanguageResolution languageReferences, string selectedIds = null)
 => _contentExportLazy.Value.Init(appId, Log).ExportContent(
     GetContext().User,
     language, defaultLanguage, contentType,
     recordExport, resourcesReferences,
     languageReferences, selectedIds);
Ejemplo n.º 3
0
 [AllowAnonymous] // will do security check internally
 public HttpResponseMessage ExportContent(int appId, string language, string defaultLanguage, string contentType,
                                          ExportSelection recordExport, ExportResourceReferenceMode resourcesReferences,
                                          ExportLanguageResolution languageReferences, string selectedIds = null)
 {
     Log.Add($"export content start app:{appId}, language:{language}, defLang:{defaultLanguage}, type:{contentType}, ids:{selectedIds}");
     // do security check and get data
     return(PortalSettings.UserInfo.IsInRole(PortalSettings.AdministratorRoleName)
         ? _eavCtc.ExportContent(appId, language, defaultLanguage, contentType,
                                 recordExport, resourcesReferences,
                                 languageReferences, selectedIds)
         : throw new HttpRequestException("Needs admin permissions to do this"));
 }
Ejemplo n.º 4
0
 [AllowAnonymous] // will do security check internally
 public HttpResponseMessage Download(
     int appId,
     string language,
     string defaultLanguage,
     string contentType,
     ExportSelection recordExport, ExportResourceReferenceMode resourcesReferences,
     ExportLanguageResolution languageReferences, string selectedIds = null)
 => GetService <ContentExportApi>().Init(appId, Log).ExportContent(
     new DnnUser(),
     language, defaultLanguage, contentType,
     recordExport, resourcesReferences,
     languageReferences, selectedIds);
Ejemplo n.º 5
0
 [AllowAnonymous] // will do security check internally
 public HttpResponseMessage ExportContent(
     int appId,
     string language,
     string defaultLanguage,
     string contentType,
     ExportSelection recordExport, ExportResourceReferenceMode resourcesReferences,
     ExportLanguageResolution languageReferences, string selectedIds = null)
 => new Eav.WebApi.ContentExportApi(Log).ExportContent(
     new DnnUser(UserInfo), appId,
     language, defaultLanguage, contentType,
     recordExport, resourcesReferences,
     languageReferences, selectedIds);