List collectionCollections = collection.getCollections();
List collectionViewCollections = new ArrayList(collectionCollections.size());
for (Iterator it = collectionCollections.iterator(); it.hasNext(); ) {
collectionViewCollections.add(new ViewCollection((Collection) it.next()));
}
this.collections = new ListDataModel();
this.collections.setWrappedData(collectionViewCollections);
List collectionFolders = collection.getFolders();
List collectionViewFolders = new ArrayList(collectionFolders.size());
for (Iterator it = collectionFolders.iterator(); it.hasNext(); ) {
collectionViewFolders.add(new ViewFolder((Folder) it.next()));
}
//Prepare the folderBean with appropriate values
DataModel foldersDataModel = new ListDataModel();
foldersDataModel.setWrappedData(collectionViewFolders);
FolderBean folderBean = (FolderBean) FacesContext.getCurrentInstance().getApplication().createValueBinding(FolderBean.BEAN_REF).getValue(FacesContext.getCurrentInstance());
folderBean.setFolders(foldersDataModel);
return "workspace_content_collection";
}