Added ImportBatchSize option to export screen.

This enables users to optionally provide the desired batch size to use when importing the recipe without having to manually edit it.
This commit is contained in:
Sipke Schoorstra
2015-07-13 17:23:47 +01:00
parent 4d1f1f663f
commit dbc6f61b5c
3 changed files with 14 additions and 7 deletions

View File

@@ -108,6 +108,7 @@ namespace Orchard.ImportExport.Controllers {
if (viewModel.Data) { if (viewModel.Data) {
exportOptions.ExportData = true; exportOptions.ExportData = true;
exportOptions.VersionHistoryOptions = (VersionHistoryOptions)Enum.Parse(typeof(VersionHistoryOptions), viewModel.DataImportChoice, true); exportOptions.VersionHistoryOptions = (VersionHistoryOptions)Enum.Parse(typeof(VersionHistoryOptions), viewModel.DataImportChoice, true);
exportOptions.ImportBatchSize = viewModel.ImportBatchSize;
} }
var exportFilePath = _importExportService.Export(contentTypesToExport, exportOptions); var exportFilePath = _importExportService.Export(contentTypesToExport, exportOptions);

View File

@@ -4,10 +4,11 @@ namespace Orchard.ImportExport.ViewModels {
public class ExportViewModel { public class ExportViewModel {
public IList<ContentTypeEntry> ContentTypes { get; set; } public IList<ContentTypeEntry> ContentTypes { get; set; }
public IList<CustomStepEntry> CustomSteps { get; set; } public IList<CustomStepEntry> CustomSteps { get; set; }
public virtual bool Metadata { get; set; } public bool Metadata { get; set; }
public virtual bool Data { get; set; } public bool Data { get; set; }
public virtual string DataImportChoice { get; set; } public int? ImportBatchSize { get; set; }
public virtual bool SiteSettings { get; set; } public string DataImportChoice { get; set; }
public bool SiteSettings { get; set; }
} }
public class ContentTypeEntry { public class ContentTypeEntry {

View File

@@ -22,12 +22,17 @@
<div> <div>
@Html.EditorFor(m => m.Metadata) @Html.EditorFor(m => m.Metadata)
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.Metadata)">@T("Metadata")</label> <label class="forcheckbox" for="@Html.FieldIdFor(m => m.Metadata)">@T("Metadata")</label>
<span class="hint">@T("Metadata is the definition of your content types: what parts and fields they have, with what settings.")</span> @Html.Hint(T("Metadata is the definition of your content types: what parts and fields they have, with what settings."))
</div> </div>
<div> <div>
@Html.EditorFor(m => m.Data) @Html.EditorFor(m => m.Data)
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.Data)">@T("Data")</label> <label class="forcheckbox" for="@Html.FieldIdFor(m => m.Data)">@T("Data")</label>
<span class="hint">@T("Data is the actual content of your site.")</span> @Html.Hint(T("Data is the actual content of your site."))
</div>
<div>
@Html.LabelFor(m => m.ImportBatchSize, T("Batch Size"))
@Html.TextBoxFor(m => m.ImportBatchSize, new { @class = "text small" })
@Html.Hint(T("The batch size to use when importing the data. Leave empty to disable batched imports."))
</div> </div>
<div> <div>
<p>@T("Version History")</p> <p>@T("Version History")</p>
@@ -40,7 +45,7 @@
<div> <div>
@Html.EditorFor(m => m.SiteSettings) @Html.EditorFor(m => m.SiteSettings)
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.SiteSettings)">@T("Site Settings")</label><br /> <label class="forcheckbox" for="@Html.FieldIdFor(m => m.SiteSettings)">@T("Site Settings")</label><br />
<span class="hint">@T("Please verify that you are not exporting confidential information, such as passwords or application keys.")</span> @Html.Hint(T("Please verify that you are not exporting confidential information, such as passwords or application keys."))
</div> </div>
</fieldset> </fieldset>