/* (non-Javadoc)
* @see org.apache.jetspeed.page.PageManager#getFolders(org.apache.jetspeed.om.folder.Folder)
*/
public NodeSet getFolders(Folder folder) throws DocumentException
{
FolderImpl folderImpl = (FolderImpl)folder;
// perform lookup of folder folders collection and cache in folder
try
{
// query for folders
Criteria filter = new Criteria();
filter.addEqualTo("parent", Integer.valueOf(folderImpl.getId()));
QueryByCriteria query = QueryFactory.newQuery(FolderImpl.class, filter);
Collection folders = getPersistenceBrokerTemplate().getCollectionByQuery(query);
// cache folders in folder
folderImpl.accessFolders().clear();
if (folders != null)
{
folderImpl.accessFolders().addAll(folders);
}
folderImpl.resetFolders(true);
}
catch (Exception e)
{
// reset cache in folder
folderImpl.resetFolders(false);
throw new DocumentException("Unable to access folders for folder " + folder.getPath() + ".");
}
// folder folders cache populated, get folders from folder
// to provide packaging as filtered node set