List visibleDocumentsList = new ArrayList();
if (containedBIObjects != null && containedBIObjects.size() > 0) {
for (Iterator it = containedBIObjects.iterator(); it.hasNext();) {
BIObject obj = (BIObject) it.next();
if (ObjectsAccessVerifier.checkProfileVisibility(obj, profile)) {
SDKDocument aDoc = new SDKObjectsConverter().fromBIObjectToSDKDocument(obj);
visibleDocumentsList.add(aDoc);
}
}
}
SDKDocument[] containedDocuments = new SDKDocument[visibleDocumentsList.size()];
containedDocuments = (SDKDocument[]) visibleDocumentsList.toArray(containedDocuments);
parentFunctionality.setContainedDocuments(containedDocuments);
// loading contained functionalities
List containedFunctionalitiesList = DAOFactory.getLowFunctionalityDAO().loadChildFunctionalities(parentFunctionality.getId(), false);
List visibleFunctionalitiesList = new ArrayList();
for (Iterator it = containedFunctionalitiesList.iterator(); it.hasNext();) {
LowFunctionality lowFunctionality = (LowFunctionality) it.next();
boolean canSeeFunctionality = ObjectsAccessVerifier.canSee(lowFunctionality, profile);
if (canSeeFunctionality) {
SDKFunctionality childFunctionality = new SDKObjectsConverter().fromLowFunctionalityToSDKFunctionality(lowFunctionality);
visibleFunctionalitiesList.add(childFunctionality);
// recursion
setFunctionalityContent(childFunctionality);
}
}