In logs, I have seen that the function GetUrlDataNodes is called with success, resulting in one node that is returned.
[ { "Id": "CMGT_CATEGORY_15_8452", "ParentId": "8452", "AreaId": 0, "PathName": "test", "IgnoreInChildPath": false, "IgnoreParentPath": false, "IncludeInSitemapXml": true, "Hidden": false, "ActiveFrom": "0001-01-01T00:00:00", "ActiveTo": "0001-01-01T00:00:00", "PathExact": "", "QueryStringParameter": "DiagramCategoryId", "QueryStringValue": "15", "QueryStringExact": "", "IgnoreParentQuerystring": false, "ProviderTypeName": null, "ProviderParameters": null } ]
[AddInName("ExplodedDiagrams")]
public class ExplodedDiagramsUrlDataProvider : UrlDataProvider, IParameterOptions, IParameterVisibility
{
public override IEnumerable<UrlDataNode> GetUrlDataNodes(UrlDataNode parent, UrlDataContext dataContext)
{
LogManager.System.GetLogger(LogCategory.Health,"CmgtExploadedDiagrams").Info($"GetUrlDataNodes start!");
var nodes = new List<UrlDataNode>();
var categories = GetTopCategories();
if (categories is null)
{
return nodes;
}
var settings = GetUrlDataSettings();
foreach (DiagramCategory category in categories)
AddNodesRecursive(nodes, parent, category, settings);
LogManager.System.GetLogger(LogCategory.Health,"CmgtExploadedDiagrams").Info($"GetUrlDataNodes finished!");
LogManager.System.GetLogger(LogCategory.Health,"CmgtExploadedDiagrams").Info($"GetUrlDataNodes finished {DfCustom.ToJson(nodes, Newtonsoft.Json.Formatting.Indented)}!");
return nodes;
}
private UrlDataSettings GetUrlDataSettings()
{
var settings = new UrlDataSettings();
settings.IncludeDiagrams = false;
return settings;
}
private static List<DiagramCategory> GetTopCategories()
{
return Services.Diagrams.GetTopLevelCategories().ToList();
}
private void AddNodesRecursive(IList<UrlDataNode> entries, UrlDataNode parent, DiagramCategory category, UrlDataSettings settings)
{
var groupUrlData = CreateGroupUrlData(parent, category);
entries.Add(groupUrlData);
IEnumerable<DiagramCategory> subGroups = GetSubGroups(category);
foreach (DiagramCategory subCategory in subGroups)
AddNodesRecursive(entries, groupUrlData, subCategory, settings);
}
private static UrlDataNode CreateGroupUrlData(UrlDataNode parent, DiagramCategory group)
{
var nodeData = new UrlDataNode()
{
Id = $"CMGT_CATEGORY_{group.Id}_{parent.Id}",
ParentId = parent.Id,
PathName = group.Name,
IgnoreInChildPath = false,
IgnoreParentPath = false,
PathExact = string.Empty,
QueryStringParameter = "DiagramCategoryId",
QueryStringValue = group.Id.ToString(),
QueryStringExact = string.Empty,
IgnoreParentQuerystring = false,
IncludeInSitemapXml = true,
};
return nodeData;
}
private static List<DiagramCategory> GetSubGroups(DiagramCategory group)
{
return Services.Diagrams.GetChildCategories(group.Id).ToList();
}
#region IParameterOptions, IParameterVisibility, IParameterSectionVisibility
IEnumerable<ParameterOption> IParameterOptions.GetParameterOptions(string dropdownName)
{
var options = new List<ParameterOption>();
switch (dropdownName ?? "")
{ }
return options;
}
IEnumerable<string> IParameterVisibility.GetHiddenParameterNames(string parameterName, object parameterValue)
{
var parameters = new List<string>();
switch (parameterName)
{ }
return parameters;
}
#endregion
private class UrlDataSettings
{
public bool IncludeDiagrams
{
get; set;
} = false;
}
}