We are trying to crawl data from WCM 7.0 (our application WAR is deployed on WAS). Two new entities: ‘Folder’ and ‘Project’ have been added in WCM 7 release. We are facing some problem with these entities.
The Folder entity provides hierarchical structure to the Component, Authoring template and Presentation template entities under Library (top entity).
Can someone suggest some way by which we can crawl the Documents under a Folder using WCM APIs.
I can get the ‘DocumentId’ for the folders and sub-folders under library using the ‘DocumentIdIterator findByType(DocumentType type)’ method of Workspace Interface. However I cannot create the actual object/handle for these folders. The related method provided by Workspace is: ‘Document getById(DocumentId id)’. But Folder does not implement Document (it implements ‘Item’).
I need the handle so as to be able to call methods like getChildren() on the Folder entities. (note: the findByType(DocumentType type) does not return Document(s) that are under a Folder). So currently I am not able to crawl the Document entities that are stored under a Folder.
I have tried the findByPath(String p_path, int p_workFlowStatus) method also to get the Documents. However it seems that p_path does not accept the ‘Library/Folder’ syntax.
Please suggest us some mechanism to proceed or some sample code.