Ejemplo n.º 1
0
        /// <summary>
        /// Gets the map nodes contained in a map from a Glyma repository.
        /// </summary>
        /// <param name="repositoryName">The name of the Glyma repository.</param>
        /// <param name="domainId">The GUID of the map node's domain.</param>
        /// <param name="rootMapId">The GUID of the node's root map.</param>
        /// <param name="mapId">The GUID of the map node's parent map.</param>
        /// <param name="nodeId">The GUID of the map node to retrieve nodes from.</param>
        /// <param name="lastCrawlStartTime">Specifies the last crawl time.</param>
        /// <param name="entityFields">A ITypeDescriptorCollection object that contains the fields to retrieve for each node.</param>
        /// <returns>A collection of DynamicType objects containing details of the nodes retrieved from a Glyma repository.</returns>
        /// <remarks>This is intended to be used as an AssociationNavigator method for a map entity in a BCS model.</remarks>
        public List <DynamicType> GetMapNodesInMap(string repositoryName, Guid domainId, Guid rootMapId, Guid mapId, Guid nodeId, DateTime lastCrawlStartTime, ITypeDescriptorCollection entityFields)
        {
            GlymaSearchLogger.WriteTrace(LogCategoryId.Connector, TraceSeverity.Verbose, "GetMapNodesInMap(" + repositoryName + ", " + domainId + ", " + rootMapId + ", " + mapId + ", " + nodeId + ")");

            List <DynamicType> nodes = MapRepository.GetNodesInMap(repositoryName, nodeId, entityFields, true);

            nodes.RemoveAll(node => !CrawlRules.Apply(node, MapRepository));

            return(nodes);
        }
Ejemplo n.º 2
0
        public void AddCrawlRule(ACrawlRule <TArachnodeDAO> crawlRule, CrawlRuleType crawlRuleType, bool isEnabled, int order)
        {
            //TODO: AssemblyName should be Namespace...
            crawlRule.AssemblyName  = crawlRule.GetType().Namespace;
            crawlRule.CrawlRuleType = crawlRuleType;
            crawlRule.IsEnabled     = isEnabled;
            crawlRule.Order         = order;
            crawlRule.TypeName      = crawlRule.GetType().FullName;

            CrawlRules.Add(crawlRule.TypeName, crawlRule);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get the details of a Glyma node.
        /// </summary>
        /// <param name="repositoryName">The name of the Glyma repository.</param>
        /// <param name="domainId">The GUID of the node's domain.</param>
        /// <param name="rootMapId">The GUID of the node's root map.</param>
        /// <param name="mapId">The GUID of the node's parent map.</param>
        /// <param name="nodeId">The GUID of the node to retrieve details from.</param>
        /// <param name="entityFields">A ITypeDescriptorCollection object that contains the fields to retrieve for each node.</param>
        /// <returns>A DynamicType object containing the details for the node.</returns>
        public DynamicType GetNode(string repositoryName, Guid domainId, Guid rootMapId, Guid mapId, Guid nodeId, ITypeDescriptorCollection entityFields)
        {
            GlymaSearchLogger.WriteTrace(LogCategoryId.Connector, TraceSeverity.Verbose, "GetNode(" + repositoryName + ", " + domainId + ", " + rootMapId + ", " + mapId + ", " + nodeId + ")");

            DynamicType node = null;

            node = MapRepository.GetNode(repositoryName, nodeId, entityFields);
            if (node != null)
            {
                CrawlRules.Apply(node, MapRepository);
            }

            return(node);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets the root map nodes from a Glyma repository.
        /// </summary>
        /// <param name="entityFields">A ITypeDescriptorCollection object that contains the fields to retrieve for each node.</param>
        /// <returns>A collection of DynamicType objects containing details of the nodes retrieved from a Glyma repository.</returns>
        /// <remarks>This is intended to be used as a Finder method in a BCS model.</remarks>
        public List <DynamicType> GetRooMaps(ITypeDescriptorCollection entityFields)
        {
            GlymaSearchLogger.WriteTrace(LogCategoryId.Connector, TraceSeverity.Verbose, "GetRootMaps");

            Uri  startUrl = new Uri(StartAddress);
            Guid domainId = Guid.Empty;

            if (startUrl.Segments.Length == 2)
            {
                domainId = new Guid(startUrl.Segments[1].TrimEnd('/'));
            }

            List <DynamicType> nodes = MapRepository.GetRootMaps(RepositoryName, domainId, entityFields);

            nodes.RemoveAll(node => !CrawlRules.Apply(node, MapRepository));

            return(nodes);
        }