Example usage for org.springframework.ui ModelMap addAllAttributes

List of usage examples for org.springframework.ui ModelMap addAllAttributes

Introduction

In this page you can find the example usage for org.springframework.ui ModelMap addAllAttributes.

Prototype

public ModelMap addAllAttributes(@Nullable Map<String, ?> attributes) 

Source Link

Document

Copy all attributes in the supplied Map into this Map .

Usage

From source file:ru.codemine.ccms.router.AdminRouter.java

@Secured("ROLE_ADMIN")
@RequestMapping(value = "/admin/offices")
public String getOffices(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("alloffices", officeService.getAll());

    return "admin/offices";
}

From source file:ru.codemine.ccms.router.AdminRouter.java

@Secured("ROLE_ADMIN")
@RequestMapping(value = "/admin/addemployee", method = RequestMethod.GET)
public String addEmployeeFrm(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("addEmployeeFrm", new Employee());
    model.addAttribute("rolesList", employeeService.getAllRoles());

    return "admin/addemployee";
}

From source file:ru.codemine.ccms.router.AdminRouter.java

@Secured("ROLE_ADMIN")
@RequestMapping(value = "/admin/profile", method = RequestMethod.GET)
public String employeeProfile(@RequestParam("id") Integer id, ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("employee", employeeService.getById(id));
    model.addAttribute("rolesList", employeeService.getAllRoles());

    return "admin/profile";
}

From source file:ru.codemine.ccms.router.AdminRouter.java

@Secured("ROLE_ADMIN")
@RequestMapping(value = "/admin/addorganisation", method = RequestMethod.GET)
public String addOrganisationFrm(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("addOrganisationFrm", new Organisation());
    model.addAttribute("emps", employeeService.getAll());

    return "admin/addorganisation";
}

From source file:ru.codemine.ccms.router.AdminRouter.java

@Secured("ROLE_ADMIN")
@RequestMapping(value = "/admin/orgprofile", method = RequestMethod.GET)
public String organisationProfile(@RequestParam("id") Integer id, ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("organisation", organisationService.getById(id));
    model.addAttribute("emps", employeeService.getAll());

    return "admin/orgprofile";
}

From source file:ru.codemine.ccms.router.AdminRouter.java

@Secured("ROLE_ADMIN")
@RequestMapping(value = "/admin/settings", method = RequestMethod.GET)
public String getSettingsPage(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("settingsForm", settingsService.createForm());

    return "admin/settings";

}

From source file:ru.codemine.ccms.router.AdminRouter.java

@Secured("ROLE_ADMIN")
@RequestMapping(value = "/admin/tasks")
public String getTasks(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("openTasksCount", taskService.getOpenTaskCount());
    model.addAttribute("alltasks", taskService.getAll());

    return "admin/tasks";
}

From source file:ru.codemine.ccms.router.AdminRouter.java

@Secured("ROLE_ADMIN")
@RequestMapping(value = "/admin/addshop", method = RequestMethod.GET)
public String addShopFrm(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("addShopFrm", new Shop());
    model.addAttribute("emps", employeeService.getAll());
    model.addAttribute("orgs", organisationService.getAll());

    return "admin/addshop";
}

From source file:ru.codemine.ccms.router.AdminRouter.java

@Secured("ROLE_ADMIN")
@RequestMapping(value = "/admin/shopprofile", method = RequestMethod.GET)
public String shopProfile(@RequestParam("id") Integer id, ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("shop", shopService.getById(id));
    model.addAttribute("emps", employeeService.getAll());
    model.addAttribute("orgs", organisationService.getAll());

    return "admin/shopprofile";
}

From source file:ru.codemine.ccms.router.AdminRouter.java

@Secured("ROLE_ADMIN")
@RequestMapping(value = "/admin/addoffice", method = RequestMethod.GET)
public String addOfficeFrm(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("addOfficeFrm", new Office());
    model.addAttribute("emps", employeeService.getAll());
    model.addAttribute("orgs", organisationService.getAll());

    return "admin/addoffice";
}