public Sitecore.XConnect.Facet GetFacetByKey(string facetKey)
        {
            Sitecore.XConnect.Facet toReturn = null;

            if (!string.IsNullOrEmpty(facetKey) && XConnectFacets?.Facets != null && XConnectFacets.Facets.ContainsKey(facetKey))
            {
                toReturn = XConnectFacets.Facets[facetKey];
            }
            return(toReturn);
        }
Ejemplo n.º 2
0
        public IWeKnowTreeNode LastModified(Facet facet)
        {
            IWeKnowTreeNode toReturn = null;

            if (TreeOptions.IncludeLastModified)
            {
                toReturn = new WeKnowTreeNode("Last Modified", facet.LastModified.ToString(), TreeOptions);
            }

            return(toReturn);
        }
        public IWeKnowTreeNode BuildFacetsNode(string targetFacetKey)
        {
            Sitecore.Diagnostics.Log.Debug(ProjConstants.Logger.Prefix + "s) GetFacetTreeNode: " + typeof(FacetsNodeBuilder).Name);
            IWeKnowTreeNode toReturn = null;


            Sitecore.XConnect.Facet facet       = GetFacetByKey(targetFacetKey);
            IFacetNodeFactory       treeFactory = new GenericFacetBranchFactory(targetFacetKey, TreeOptions, XConnectClient);

            if (facet != null)
            {
                treeFactory.SetClient(XConnectClient);
                toReturn = treeFactory.BuildTreeNode(facet);
            }

            Sitecore.Diagnostics.Log.Debug(ProjConstants.Logger.Prefix + "e) GetFacetTreeNode: " + typeof(FacetsNodeBuilder).Name);
            return(toReturn);
        }