CategoryService

In this article:

Introduction

Imcms has single interface support and different manipulation with categories for documents. We can easy, create/update/delete/get all categories over this bean CategoryService. Of course you can use old version category service with oldest API objects - you have to use CategoryMapper, more information about it CategoryMapper That be init new bean CategoryService and work with methods need to look at the code below:

Use API

CategoryService categoryService = Imcms.getServices().getManagedBean(CategoryService.class);

List<Category> getAll();

Optional<Category> getById(int id);

Category save(Category saveMe);  //create new Category

Category update(Category updateMe);

void delete(int id);

List<CategoryJPA> getCategoriesByCategoryType(Integer id);

Description about Category

Category object has any fields:

  1. Integer id - identifier category object

  2. String name - name category object

  3. String description - something description about category

  4. CategoryTypeDTO type - type category which relation current the category