Search in sources :

Example 1 with Category

use of com.ganster.cms.core.pojo.Category in project Ganster-CMS by Gangster-trio.

the class CategoryController method show.

@RequestMapping("{id}")
public String show(@PathVariable("id") Integer id, Model model) {
    ModelResult result = webService.getCategoryModel(id);
    if (result == null) {
        return "404";
    }
    // Add result to module
    model.addAttribute("result", result);
    Category category = (Category) result.get("category");
    // If skin = null, set default skin
    if (category.getCategorySkin() == null) {
        category.setCategorySkin(CmsConst.DEFAULT_SKIN);
    }
    // Return to the site's skin view, for example : default-category
    return category.getCategorySkin() + CmsConst.CATEGORY_SKIN_SUFFIX;
}
Also used : ModelResult(com.ganster.cms.web.dto.ModelResult) Category(com.ganster.cms.core.pojo.Category) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

Category (com.ganster.cms.core.pojo.Category)1 ModelResult (com.ganster.cms.web.dto.ModelResult)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1