-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPart ExportBundles.cshtml
58 lines (55 loc) · 1.97 KB
/
Part ExportBundles.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@inherits Custom.Hybrid.RazorTyped
@using System
@using ToSic.Eav.Data
@*
This file is used both multiple Apps
- System-Types
- Data Sources (WIP - not used yet)
- System Queries
*@
@{
var exports = AsItems(App.Data.GetStream("🧑💻SystemExportConfiguration")).ToList();
}
<h2>Export Bundles (@exports.Count())</h2>
@foreach (var export in exports)
{
var exportMarkers = export.Parents(type: "SystemExportDecorator").ToList();
<div>
<h3 @Kit.Toolbar.Default(export)>
@export.Title (@exportMarkers.Count)
</h3>
<ul>
<li>File Name: @export.Get("FileName")</li>
<li>Preserve Markers: @export.Get("PreserveMarkers")</li>
<li><a href="/api/2sxc/admin/type/JsonBundleExport?appId=@(App.AppId)&[email protected]&indentation=1" target="_blank">download</a></li>
</ul>
<h4>Contents</h4>
<ol>
@foreach (var marker in exportMarkers)
{
var markerEntity = AsEntity(marker);
var target = markerEntity.MetadataFor;
var tType = target.TargetType;
var tTypeName = tType == 4 ? "Entity" : tType == 5 ? "ContentType" : "Unknown";
string targetTitle = "unknown";
string targetIdentifier = "unknown";
if (tType == 5) {
var ct = App.Data.GetContentType(target.KeyString);
if (ct == null) {
targetTitle = "Error ContentType not Found; Metadata seems to point to bad entry. Md: " + markerEntity.EntityId + "; KeyString: " + target.KeyString;
} else {
targetTitle = ct.Name;
targetIdentifier = ct.NameId;
targetIdentifier = (ct.NameId == targetTitle) ? "" : "(" + ct.NameId + ")";
}
} else if (tType == 4 && target.KeyGuid != null) {
var e = AsItem(App.Data.List.One((Guid)target.KeyGuid));
targetTitle = e.Title;
targetIdentifier = e.Guid.ToString();
}
<li>@tTypeName: @targetTitle (@targetIdentifier)</li>
}
</ol>
</div>
<hr>
}