ossiejhmoore icon

NodeCrawler and ChildCount

ossiejhmoore | PRO | 07/25/12 01:26:54 PM UTC | 0 ⭐ | 273 👁️ | Never ⏰ | []
text |

1.08 KB

|

None

|

0 👍

/

0 👎

I am using NodeCrawler to crawl a directory structure in an application. I was having a problem with it not crawling a particular folder. The problem lied in a line of code in NodeCrawler._Crawl. 
 function Assoc _Crawl()
	...
	if ok && rec.ChildCount > 0
		...
		._ParentNode(..)
		...
	end
	…
end
 The node in question had a fouled ChildCount value. NodeCrawler uses ChildCount to decide whether or not it should even consider whether there are children. Yes, you can provide a NodeCrawlerCallback and provide a custom "ParentNode" method to determine whether or not NodeCrawler should query for children nodes, but due to the ChildCount check noted above, that method will never get called in this scenario.
 Given that ChildCount is frequently off, this is something in mind when using NodeCrawler. Personally, it feels like they should have put this check of the ChildCount value in the NodeCrawler._ParentNode default functionality and executed only when no NodeCrawlerCallback.ParentNode override is provided so that we as developers could decide whether we want to rely on ChildCount.

Comments