} catch (Exception e) {
logger.error("", e);
}
} else if("virtual".equals(catalogType)){
final CatalogVirtual catalogVirtual = catalogService.getVirtualCatalogById(currentMarketArea.getCatalog().getId());
Set<CatalogCategoryVirtual> catalogCategories = new HashSet<CatalogCategoryVirtual>();
if(catalogVirtual.getCatalogCategories() != null){
for (Iterator<CatalogCategoryVirtual> iterator = catalogVirtual.getCatalogCategories().iterator(); iterator.hasNext();) {
CatalogCategoryVirtual categoryVirtual = (CatalogCategoryVirtual) iterator.next();
CatalogCategoryVirtual reloadedCategoryVirtual = catalogCategoryService.getVirtualCatalogCategoryById(categoryVirtual.getId(), new FetchPlan(categoryVirtualFetchPlans));
Set<CatalogCategoryVirtual> reloadedSubCategories = new HashSet<CatalogCategoryVirtual>();
if(reloadedCategoryVirtual.getSortedChildCatalogCategories() != null){
for (Iterator<CatalogCategoryVirtual> iteratorSubCategories = reloadedCategoryVirtual.getSortedChildCatalogCategories().iterator(); iteratorSubCategories.hasNext();) {
CatalogCategoryVirtual subCategory = (CatalogCategoryVirtual) iteratorSubCategories.next();
CatalogCategoryVirtual reloadedSubCategory = catalogCategoryService.getVirtualCatalogCategoryById(subCategory.getId(), new FetchPlan(categoryVirtualFetchPlans));
reloadedSubCategories.add(reloadedSubCategory);
}
}
reloadedCategoryVirtual.setCatalogCategories(reloadedSubCategories);
catalogCategories.add(reloadedCategoryVirtual);
}
}
catalogVirtual.setCatalogCategories(new HashSet<CatalogCategoryVirtual>(catalogCategories));
try {
catalogPojo = (CatalogPojo) catalogPojoService.buildVirtualCatalog(catalogVirtual);
} catch (Exception e) {
logger.error("", e);