public MetadataNavigationHierarchyConfig FindConfiguredHierarchy(Guid guid) { var root = SettingDocument.Root; var parentNode = root.Descendants("NavigationHierarchies").FirstOrDefault(); if (parentNode == null) { return(null); } var nodes = parentNode.Descendants("MetadataField"); var targetNode = nodes.FirstOrDefault(n => n.GetAttributeValue("FieldID") == guid.ToString("D")); if (targetNode != null) { var result = new MetadataNavigationHierarchyConfig(); result.FieldId = ConvertUtils.ToGuid(targetNode.GetAttributeValue("FieldID")).Value; result.FieldType = ConvertUtils.ToString(targetNode.GetAttributeValue("FieldType")); result.CachedDisplayName = ConvertUtils.ToString(targetNode.GetAttributeValue("CachedDisplayName")); result.CachedName = ConvertUtils.ToString(targetNode.GetAttributeValue("CachedName")); return(result); } return(null); }
public void AddConfiguredHierarchy(MetadataNavigationHierarchyConfig item) { var currentKey = FindConfiguredKeyFilter(item.FieldId); if (currentKey == null) { var root = SettingDocument.Root; var parentNode = root.Descendants("NavigationHierarchies").FirstOrDefault(); if (parentNode == null) { parentNode = new XElement("NavigationHierarchies"); root.Add(parentNode); var folderHierarchyNode = new XElement("FolderHierarchy"); folderHierarchyNode.SetAttribute("HideFoldersNode", "False"); parentNode.Add(folderHierarchyNode); } var newNode = new XElement("MetadataField"); newNode.SetAttributeValue("FieldID", item.FieldId.ToString("D")); newNode.SetAttributeValue("FieldType", item.FieldType); newNode.SetAttributeValue("CachedName", item.CachedName); newNode.SetAttributeValue("CachedDisplayName", item.CachedDisplayName); parentNode.Add(newNode); } }
public void AddConfiguredHierarchy(MetadataNavigationHierarchyConfig item) { var currentKey = FindConfiguredKeyFilter(item.FieldId); if (currentKey == null) { EnsureDefaultFolderHierarchyNode(); // parentNode should be ensured iearly in EnsureDefaultFolderHierarchyNode() var root = SettingDocument.Root; var parentNode = root.Descendants("NavigationHierarchies").FirstOrDefault(); var newNode = new XElement("MetadataField"); newNode.SetAttributeValue("FieldID", item.FieldId.ToString("D")); newNode.SetAttributeValue("FieldType", item.FieldType); newNode.SetAttributeValue("CachedName", item.CachedName); newNode.SetAttributeValue("CachedDisplayName", item.CachedDisplayName); parentNode.Add(newNode); } }
public void AddConfiguredHierarchy(MetadataNavigationHierarchyConfig metadataNavigationHierarchy) { throw new SPMeta2NotImplementedException("MetadataNavigationSettings provision for CSOM isnot yet implemented by M2 - https://github.com/SubPointSolutions/spmeta2/issues/738"); }
public void AddConfiguredHierarchy(MetadataNavigationHierarchyConfig metadataNavigationHierarchy) { throw new NotImplementedException(); }