GeeCON Prague 2014*
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


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.
 
GeeCON Prague 2014
 
subject: IBM WCM find root site areas