-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
713 additions
and
91 deletions.
There are no files selected for viewing
14 changes: 6 additions & 8 deletions
14
OnTopic.Editor.AspNetCore.Host/OnTopic.Editor.AspNetCore.Host.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Export.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
@model ExportViewModel | ||
|
||
@{ | ||
ViewBag.Title = "Export Topic"; | ||
} | ||
|
||
<form method="post"> | ||
|
||
<div id="Toolbar" class="toolbar"> | ||
<!-- Action Buttons --> | ||
<div class="action buttons"> | ||
<button type="submit" class="btn btn-primary btn-sm">Export</button> | ||
</div> | ||
</div> | ||
|
||
<div id="FormArea" class="row form area"> | ||
|
||
<div class="col-lg-9 col-sm-12"> | ||
|
||
<h2>Export Options</h2> | ||
|
||
<section class="attribute"> | ||
<input type="checkbox" asp-for="ExportOptions.IncludeChildTopics" /> | ||
<label asp-for="ExportOptions.IncludeChildTopics">Include Child Topics?</label> | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Recursively includes all child topics—including nested topics—in the export."></i> | ||
</section> | ||
|
||
<section class="attribute"> | ||
<input type="checkbox" asp-for="ExportOptions.IncludeNestedTopics" /> | ||
<label asp-for="ExportOptions.IncludeNestedTopics">Include Nested Topics?</label> | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Includes nested topics that are part of the current topic to be included in the export."></i> | ||
</section> | ||
|
||
<section class="attribute"> | ||
<input type="checkbox" asp-for="ExportOptions.IncludeExternalReferences" /> | ||
<label asp-for="ExportOptions.IncludeExternalReferences">Include External References?</label> | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Includes relationships even if the topic they are referencing falls outside the scope of the export."></i> | ||
</section> | ||
|
||
</div> | ||
|
||
@if (!Model.IsModal) { | ||
<div class="col-lg-3 callouts"> | ||
<div class="callout topic-info"> | ||
|
||
<h3 class="h5">Topic Information</h3> | ||
<dl> | ||
<dt><i class="fa fa-cogs"></i> Content Type</dt> | ||
<dd><a href="/Configuration/ContentTypes/@Model.Topic.ContentType">@Model.Topic.ContentType</a></dd> | ||
<dt><i class="fa fa-database"></i> Topic ID</dt> | ||
<dd><a href="/Topic/@Model.Topic.Id/">@Model.Topic.Id</a></dd> | ||
<dt><i class="fa fa-eye"></i> Current</dt> | ||
<dd><a href="@Model.Topic.WebPath">View Page</a></dd> | ||
</dl> | ||
|
||
</div> | ||
</div> | ||
} | ||
|
||
</div> | ||
|
||
</form> |
195 changes: 195 additions & 0 deletions
195
OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Import.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,195 @@ | ||
@model ImportViewModel | ||
|
||
@{ | ||
ViewBag.Title = "Import Topic"; | ||
} | ||
|
||
<form method="post" enctype="multipart/form-data"> | ||
|
||
<div id="Toolbar" class="toolbar"> | ||
<!-- Action Buttons --> | ||
<div class="action buttons"> | ||
<button type="submit" class="btn btn-primary btn-sm">Import</button> | ||
</div> | ||
<ul id="DisplayGroupNavTabs" class="nav nav-tabs" role="tablist"> | ||
<li class="nav-item"> | ||
<a id="Tab_Options" class="nav-link active" href="#Group_Options" data-toggle="tab" role="tab" aria-controls="#Group_Options" aria-expanded="true">Options</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a id="Tab_LastModified" class="nav-link" href="#Group_LastModified" data-toggle="tab" role="tab" aria-controls="#Group_LastModified" aria-expanded="true">Attribution</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a id="Tab_Advanced" class="nav-link" href="#Group_Advanced" data-toggle="tab" role="tab" aria-controls="#Group_Advanced" aria-expanded="true">Advanced</a> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<div id="FormArea" class="row form area"> | ||
|
||
<div class="col-md-12"> | ||
@if (Model.IsImported) { | ||
<div class="alert alert-primary" role="alert"> | ||
The JSON file has been successfully imported and merged into the target database. | ||
</div> | ||
} | ||
<div asp-validation-summary="All"></div> | ||
</div> | ||
|
||
<div class="col-lg-9 col-sm-12"> | ||
<div id="DisplayGroupTabsContent" class="tab-content tab-validate"> | ||
|
||
<div id="Group_Options" class="tab-pane fade show active" role="tabpanel" aria-labelledby="Tab_Options"> | ||
<section id="Section_Options"> | ||
|
||
<h2>Import Options</h2> | ||
|
||
<h3> | ||
Source | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="The JSON file containing a previous export from a topic graph."></i> | ||
</h3> | ||
<section class="attribute"> | ||
<input name="JsonFile" type="file" accept=".json" required /> | ||
</section> | ||
|
||
<h3>Strategy</h3> | ||
<section class="attribute"> | ||
<label> | ||
<input type="radio" asp-for="ImportOptions.Strategy" value="@ImportStrategy.Add" /> Add | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Adds missing attributes; leaves existing attributes alone."></i> | ||
</label> | ||
<br /> | ||
<label> | ||
<input type="radio" asp-for="ImportOptions.Strategy" value="@ImportStrategy.Merge" /> Merge | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Adds missing attributes; replaces existing attributes if the imported value is newer."></i> | ||
</label> | ||
<br /> | ||
<label> | ||
<input type="radio" asp-for="ImportOptions.Strategy" value="@ImportStrategy.Overwrite" /> Overwrite | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Overwrites all attributes. Leaves unmatched attributes as is."></i> | ||
</label> | ||
<br /> | ||
<label> | ||
<input type="radio" asp-for="ImportOptions.Strategy" value="@ImportStrategy.Replace" /> Replace | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Overwrites all attributes. Deletes unmatched attributes, relationships, and topics."></i> | ||
</label> | ||
</section> | ||
|
||
</section> | ||
</div> | ||
|
||
<div id="Group_LastModified" class="tab-pane fade" role="tabpanel" aria-labelledby="Tab_LastModified"> | ||
<section id="Section_LastModified"> | ||
|
||
<h2>Attribution</h2> | ||
<p> | ||
Offers granular control over how the byline ("Last Modified By") and dateline ("Last Modified") are updated as part of the import process. | ||
</p> | ||
|
||
<h3>Byline</h3> | ||
<section class="attribute"> | ||
<label> | ||
<input type="radio" asp-for="ImportOptions.LastModifiedByStrategy" value="@LastModifiedImportStrategy.Inherit" /> Use Import Strategy | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Will treat the byline just like any other attribute, merging it according to the import strategy."></i> | ||
</label> | ||
<br /> | ||
<label> | ||
<input type="radio" asp-for="ImportOptions.LastModifiedByStrategy" value="@LastModifiedImportStrategy.TargetValue" /> Previous Value | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Will always retain the existing byline, if present."></i> | ||
</label> | ||
<br /> | ||
<label> | ||
<input type="radio" asp-for="ImportOptions.LastModifiedByStrategy" value="@LastModifiedImportStrategy.Current" /> Current User (@(Context.User.Identity.Name?? "System")) | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Updates the byline to the current user, just like it would when manually updating a topic via the editor."></i> | ||
</label> | ||
<br /> | ||
<label> | ||
<input type="radio" asp-for="ImportOptions.LastModifiedByStrategy" value="@LastModifiedImportStrategy.System" /> System | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Updates the byline to 'System', which indicates that this was part of a system update and shouldn't be assigned to a specific contributor."></i> | ||
</label> | ||
</section> | ||
|
||
<h3>Dateline</h3> | ||
<section class="attribute"> | ||
<label> | ||
<input type="radio" asp-for="ImportOptions.LastModifiedStrategy" value="@LastModifiedImportStrategy.Inherit" /> Use Import Strategy | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Will treat the dateline just like any other attribute, merging it according to the import strategy."></i> | ||
</label> | ||
<br /> | ||
<label> | ||
<input type="radio" asp-for="ImportOptions.LastModifiedStrategy" value="@LastModifiedImportStrategy.TargetValue" /> Previous Value | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Will always retain the existing last modified date, if present."></i> | ||
</label> | ||
<br /> | ||
<label> | ||
<input type="radio" asp-for="ImportOptions.LastModifiedStrategy" value="@LastModifiedImportStrategy.Current" /> Current Time (@DateTime.Now.ToString("g")) | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Updates the dateline to the current time, just like it would when manually updating a topic via the editor."></i> | ||
</label> | ||
<br /> | ||
</section> | ||
|
||
</section> | ||
</div> | ||
|
||
<div id="Group_Advanced" class="tab-pane fade" role="tabpanel" aria-labelledby="Tab_Advanced"> | ||
<section id="Section_Advanced"> | ||
|
||
<h2>Advanced Options</h2> | ||
The following options are usually determined by the merge strategy, but can optionally be set individually if you require fine-tuned control during an import. | ||
|
||
<h3>Overwrite…?</h3> | ||
<section class="attribute"> | ||
<label> | ||
<input type="checkbox" asp-for="ImportOptions.OverwriteContentType" /> Content Type | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Overwrites the content type if imported content type differs from the existing content type. Implicit if the merge strategy is set to overwrite or replace."></i> | ||
</label> | ||
</section> | ||
|
||
<h3>Delete Unmatched…?</h3> | ||
<section class="attribute"> | ||
<label> | ||
<input type="checkbox" name="@nameof(ImportOptions).@nameof(ImportOptions.DeleteUnmatchedAttributes)" value="true" /> Attributes | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Deletes existing attributes if they aren't included in the import. Implicit if the merge strategy is set to replace."></i> | ||
</label> | ||
<br /> | ||
<label> | ||
<input type="checkbox" name="@nameof(ImportOptions).@nameof(ImportOptions.DeleteUnmatchedRelationships)" value="true" /> Relationships | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Deletes existing relationships if they aren't included in the import. Implicit if the merge strategy is set to replace."></i> | ||
</label> | ||
<br /> | ||
<label> | ||
<input type="checkbox" name="@nameof(ImportOptions).@nameof(ImportOptions.DeleteUnmatchedNestedTopics)" value="true" /> Nested Topics | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Deletes existing nested topics if they aren't included in the import. Implicit if the merge strategy is set to replace."></i> | ||
</label> | ||
<br /> | ||
<label> | ||
<input type="checkbox" name="@nameof(ImportOptions).@nameof(ImportOptions.DeleteUnmatchedChildren)" value="true" /> Children | ||
<i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="Deletes existing children—including nested topics—if they aren't included in the import. Implicit if the merge strategy is set to replace."></i> | ||
</label> | ||
</section> | ||
|
||
</section> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
@if (!Model.IsModal) { | ||
<div class="col-lg-3 callouts"> | ||
<div class="callout topic-info"> | ||
|
||
<h3 class="h5">Topic Information</h3> | ||
<dl> | ||
<dt><i class="fa fa-cogs"></i> Content Type</dt> | ||
<dd><a href="/Configuration/ContentTypes/@Model.Topic.ContentType">@Model.Topic.ContentType</a></dd> | ||
<dt><i class="fa fa-database"></i> Topic ID</dt> | ||
<dd><a href="/Topic/@Model.Topic.Id/">@Model.Topic.Id</a></dd> | ||
<dt><i class="fa fa-eye"></i> Current</dt> | ||
<dd><a href="@Model.Topic.WebPath">View Page</a></dd> | ||
</dl> | ||
|
||
</div> | ||
</div> | ||
} | ||
|
||
</div> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.