File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Portals and Portlets and the fly likes IBM WCM find root site areas Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "IBM WCM find root site areas" Watch "IBM WCM find root site areas" New topic
Author

IBM WCM find root site areas

Natt Gonzalez
Ranch Hand

Joined: Apr 28, 2008
Posts: 31
Hello,
I'm trying to recover the site areas that are direct children of the Library.
I have tried this wcmWks.findByPath("/", Workspace.WORKFLOWSTATUS_ALL);
wcmWks.findByPath("/libraryName", Workspace.WORKFLOWSTATUS_ALL);
wcmWks.findByPath("/libraryName/", Workspace.WORKFLOWSTATUS_ALL);
But I don't have results.
I have also tried wcmWks.findByType(DocumentTypes.SiteArea,Workspace.WORKFLOWSTATUS_ALL);
And here I have all the library's siteAreas but I only want the direct children.
Thanks in adavance.
Natt Gonzalez
Ranch Hand

Joined: Apr 28, 2008
Posts: 31
Hello,
I've solved my problem.
DocumentLibrary library = wcmWorkspace.getCurrentDocumentLibrary();
if (library == null) {
throw new LibraryNotFoundException(sRootLibPath);
}

QueryService queryService = wcmWorkspace.getQueryService();
Query folder= queryService.createQuery(Folder.class);
folder.addSelector(Selectors.nameEquals(nameFatherFolder));
folder.addSelector(
Selectors.libraryEquals(wcmWorkspace.getCurrentDocumentLibrary()));
ResultIterator results = queryService.execute(folder);
while(results.hasNext()) {
Folder it = (Folder) results.next();
ResultIterator childern= it.getChildren();
......
}

The problem was that I have a father folder called Content, I didn't know that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IBM WCM find root site areas
 
Similar Threads
compare the two xml file generate the third xml
Method visibility among classes...
Sort Directory paths, sort of.
are real exam quesions so complicated????
JTreeTable