This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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.
 
 
subject: IBM WCM find root site areas
 
Similar Threads
JTreeTable
Sort Directory paths, sort of.
compare the two xml file generate the third xml
Method visibility among classes...
are real exam quesions so complicated????