Ejemplo n.º 1
0
        public List <Node> GetAllHierarchies()
        {
            List <Node> result = new List <Node>();

            EAAPI.Collection searchResult = _repository.GetElementsByQuery("SpecificationPackages", "");

            if (searchResult.Count > 0)
            {
                for (short counter = 0; counter < searchResult.Count; counter++)
                {
                    EAAPI.Element packageElement = searchResult.GetAt(counter) as EAAPI.Element;

                    EAAPI.Package package = _repository.GetPackageByGuid(packageElement.ElementGUID);

                    CachedDataProvider eaCacheDataProvider = new CachedDataProvider(_repository);

                    EADM.Element specificationPackageElement = eaCacheDataProvider.GetCachedSpecification(package);

                    Node rootNode = new Node();

                    ConvertEaDataToSpecifNodeRecursively(specificationPackageElement, rootNode);

                    result = rootNode.Nodes;
                }
            }

            return(result);
        }