/** * Reads all first level categories, including sub categories if needed.<p> * * @param cms the current cms context * @param includeSubCats flag to indicate if sub categories should also be read * * @return a list of {@link CmsCategory} objects * * @throws CmsException if something goes wrong * * @deprecated use {@link #readCategories(CmsObject, String, boolean, String)} instead */ public List readAllCategories(CmsObject cms, boolean includeSubCats) throws CmsException { return readCategories(cms, null, includeSubCats, null); }
categories = catService.readCategories(cms, "", true, sitePath); result = buildCategoryTree(cms, categories); } else {
/** * Returns all sub categories of the given category.<p> * * @param cms the current cms context * @param categoryPath the path of the category to get the sub categories for * @param includeSubCats if to include sub-subcategories * * @return a list of {@link CmsCategory} objects * * @throws CmsException if something goes wrong * * @deprecated use {@link #readCategories(CmsObject, String, boolean, String)} instead */ public List readSubCategories(CmsObject cms, String categoryPath, boolean includeSubCats) throws CmsException { return readCategories(cms, categoryPath, includeSubCats, null); }
/** * @see org.opencms.workplace.commons.A_CmsResourceCategoriesList#getCategories() */ @Override protected List getCategories() throws CmsException { List resourceRelations = getResourceCategories(); List result = getCategoryService().readCategories(getJsp().getCmsObject(), null, true, getParamResource()); Iterator itResourceRelations = resourceRelations.iterator(); while (itResourceRelations.hasNext()) { CmsCategory category = (CmsCategory)itResourceRelations.next(); if (result.contains(category) && resourceRelations.containsAll(getCategoryService().readCategories( getJsp().getCmsObject(), category.getPath(), true, getParamResource()))) { result.remove(category); } } return result; }
/** * @see org.opencms.workplace.commons.A_CmsResourceCategoriesList#getCategories() */ @Override protected List<CmsCategory> getCategories() throws CmsException { List<CmsCategory> resourceRelations = getResourceCategories(); List<CmsCategory> result = getCategoryService().readCategories( getJsp().getCmsObject(), null, true, getParamResource()); Iterator<CmsCategory> itResourceRelations = resourceRelations.iterator(); while (itResourceRelations.hasNext()) { CmsCategory category = itResourceRelations.next(); if (result.contains(category) && resourceRelations.containsAll( getCategoryService().readCategories( getJsp().getCmsObject(), category.getPath(), true, getParamResource()))) { result.remove(category); } } return result; }
@Override public Object transform(Object categoryPath) { try { List<CmsCategory> categories = CmsCategoryService.getInstance().readCategories( m_cms, (String)categoryPath, true, m_cms.getRequestContext().getUri()); CmsJspCategoryAccessBean result = new CmsJspCategoryAccessBean( categories, (String)categoryPath); return result; } catch (CmsException e) { LOG.warn(e.getLocalizedMessage(), e); return null; } }
foundCategories = catService.readCategories(getCms(), "", true, editedResource); } catch (CmsException e) {
foundCategories = catService.readCategories(getCms(), "", true, editedResource); } catch (CmsException e) {
String referencePath = cms.getSitePath(getResource(cms, param)); String startingCat = getStartingCategory(cms, referencePath); List cats = CmsCategoryService.getInstance().readCategories(cms, startingCat, true, referencePath); int baseLevel; if (CmsStringUtil.isEmptyOrWhitespaceOnly(startingCat)) {
List<CmsCategory> cats = CmsCategoryService.getInstance().readCategories( cms, startingCat,
CmsCategoryService.getInstance().readCategory(cms, catPath, refPath); if (((CmsCategoryWidget)widget).isOnlyLeafs()) { if (!CmsCategoryService.getInstance().readCategories(cms, catPath, false, refPath).isEmpty()) { errorHandler.addError( value,
CmsCategoryService.getInstance().readCategory(cms, catPath, refPath); if (((CmsCategoryWidget)widget).isOnlyLeafs()) { if (!CmsCategoryService.getInstance().readCategories(cms, catPath, false, refPath).isEmpty()) { errorHandler.addError(value, Messages.get().getBundle(value.getLocale()).key( Messages.GUI_CATEGORY_CHECK_NOLEAF_ERROR_0));