/** * @param categoryType * @return an array of Categories, empty array if no one found. */ public Category[] getCategoriesOfType(CategoryType categoryType) { CategoryMapper categoryMapper = contentManagementSystem.getInternal().getCategoryMapper(); Set<CategoryDomainObject> categoriesOfType = categoryMapper.getCategoriesOfType( categoryType.getInternal(), internalDocument.getCategoryIds()); CategoryDomainObject[] categories = categoriesOfType.toArray(new CategoryDomainObject[categoriesOfType.size()]); return getCategoryArrayFromCategoryDomainObjectArray(categories); }
/** @return An array of Categories, an empty if no one found. */ public Category[] getCategories() { Set<CategoryDomainObject> categories = contentManagementSystem .getInternal() .getCategoryMapper() .getCategories(internalDocument.getCategoryIds()); CategoryDomainObject[] categoryDomainObjects = categories.toArray(new CategoryDomainObject[categories.size()]); return getCategoryArrayFromCategoryDomainObjectArray(categoryDomainObjects); }