permaculture playing cards
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 Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "IBM WCM find root site areas" Watch "IBM WCM find root site areas" New topic

IBM WCM find root site areas

Natt Gonzalez
Ranch Hand

Joined: Apr 28, 2008
Posts: 31
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
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);
ResultIterator results = queryService.execute(folder);
while(results.hasNext()) {
Folder it = (Folder);
ResultIterator childern= it.getChildren();

The problem was that I have a father folder called Content, I didn't know that.
Have you checked out Aspose?
subject: IBM WCM find root site areas
It's not a secret anymore!