• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IBM WCM find root site areas

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
On top of spaghetti all covered in cheese, there was this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic