/// <summary> /// Initializes a new instance of the <see cref="UPConfigTreeViewTable"/> class. /// </summary> /// <param name="definition"> /// The definition. /// </param> /// <param name="treeView"> /// The _tree view. /// </param> public UPConfigTreeViewTable(List <object> definition, UPConfigTreeView treeView) { if (definition == null) { return; } this.TreeView = treeView; this.Nr = JObjectExtensions.ToInt(definition[0]); this.InfoAreaId = definition[2] as string; this.LinkId = JObjectExtensions.ToInt(definition[3]); this.RelationName = definition[4] as string; this.SearchAndListName = definition[5] as string; this.ExpandName = definition[6] as string; this.TableCaptionName = definition[7] as string; this.RootMenuLabel = definition[8] as string; this.MenuLabel = definition[9] as string; this.Flags = (UPConfigTreeViewTableFlags)JObjectExtensions.ToInt(definition[10]); this.FilterName = definition[11] as string; if (definition.Count > 12) { this.RecordCustomControl = definition[12] as string; this.InfoAreaCustomControl = definition[13] as string; } if (definition.Count > 14) { this.RecordCount = JObjectExtensions.ToInt(definition[14]); this.Label = definition[15] as string; } }
/// <summary> /// Builds the page. /// </summary> protected override void BuildPage() { base.BuildPage(); IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore; string rootTreeNodeName = this.ViewReference.ContextValueForKey("ConfigName"); if (!string.IsNullOrEmpty(rootTreeNodeName)) { this.rootTreeNode = configStore.TreeViewByName(rootTreeNodeName); } UPMCircleOfInfluencePage page = this.CreatePageInstance(); this.TopLevelElement = page; if (this.rootTreeNode == null) { SimpleIoc.Default.GetInstance <ILogger>().LogError($"No treeView found for configName: {rootTreeNodeName}"); return; } // Root FieldGroup string rootNodeExpandName = this.rootTreeNode.RootNode.ExpandName; this.ExpandSettings = configStore.ExpandByName(rootNodeExpandName) ?? configStore.ExpandByName(this.InfoAreaId); List <FieldControl> fieldControler = new List <FieldControl>(); FieldControl details = configStore.FieldControlByNameFromGroup("Details", this.ExpandSettings.FieldGroupName); if (details != null) { fieldControler.Add(details); } FieldControl miniDetails = configStore.FieldControlByNameFromGroup("MiniDetails", this.ExpandSettings.FieldGroupName); if (miniDetails != null) { fieldControler.Add(miniDetails); } if (fieldControler.Count > 0) { this.rootNodeFieldControl = new FieldControl(fieldControler); } this.ApplyViewConfigOnPage(page); page.Invalid = true; this.ApplyLoadingStatusOnPage(page); this.TopLevelElement = page; }
private UPContainerMetaInfo CreateQueryWithRecordIdentifier(string recordIdentifier) { string childSearchAndListName = this.childrenTreeConfig.SearchAndListName; IConfigurationUnitStore configStore = ConfigurationUnitStore.DefaultStore; SearchAndList searchAndList = configStore.SearchAndListByName(childSearchAndListName); UPContainerMetaInfo metainfo = this.CreateQueryLinkIdSearchAndList(recordIdentifier, this.childrenTreeConfig.LinkId, searchAndList); if (metainfo == null) { return(null); } if (this.childrenTreeConfig.RecordCount <= 0) { metainfo.MaxResults = 0; } else { metainfo.MaxResults = this.childrenTreeConfig.RecordCount - 1; } // Add additionalConfig for RecordNodeChilds foreach (UPConfigTreeViewTable childTree in this.childrenTreeConfig.ChildNodes) { if (this.IsRecordNode(childTree)) { string recordCustomControl = childTree.RecordCustomControl; Dictionary <string, object> customControlDict = recordCustomControl.JsonDictionaryFromString(); string nodeType = customControlDict["Type"] as string; if (nodeType.StartsWith("Tree:")) { CoITreeInfoAreaConfig infoAreaConfig = new CoITreeInfoAreaConfig { InfoAreaId = childTree.InfoAreaId, LinkId = childTree.LinkId }; string jumpTreeConfigName = nodeType.Substring(5); UPConfigTreeView treeConfig = configStore.TreeViewByName(jumpTreeConfigName); infoAreaConfig.Config = treeConfig.RootNode; infoAreaConfig.FunctionNameSuffix = childTree.RelationName; infoAreaConfig.Definition = customControlDict; this.infoAreaConfigs.Add(infoAreaConfig); } else if (nodeType.StartsWith("LinkNode")) { CoITreeInfoAreaConfig infoAreaConfig = new CoITreeInfoAreaConfig { InfoAreaId = childTree.InfoAreaId, LinkId = childTree.LinkId, Config = childTree, FunctionNameSuffix = childTree.RelationName, Definition = customControlDict }; this.infoAreaConfigs.Add(infoAreaConfig); } else { SimpleIoc.Default.GetInstance <ILogger>().LogWarn($"UPCoITree cant handle nodeType: {nodeType}"); } } } return(metainfo); }