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.ContentRouter.java

@Secured("ROLE_USER")
@RequestMapping(value = "/office", method = RequestMethod.GET)
public String getOffice(ModelMap model, @RequestParam Integer id, @RequestParam(required = false) String mode) {
    Office office = officeService.getById(id);
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("office", office);

    return "print".equals(mode) ? "/printforms/officefrm" : "pages/offices/office";

}

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

@Secured("ROLE_USER")
@RequestMapping(value = "/employee", method = RequestMethod.GET)
public String getEmployee(ModelMap model, @RequestParam Integer id,
        @RequestParam(required = false) String mode) {
    Employee employee = employeeService.getById(id);
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("employee", employee);

    return "print".equals(mode) ? "/printforms/employeefrm" : "pages/employees/employee";
}

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

@Secured("ROLE_USER")
@RequestMapping(value = "/organisation", method = RequestMethod.GET)
public String getOrganisation(ModelMap model, @RequestParam Integer id,
        @RequestParam(required = false) String mode) {
    Organisation org = organisationService.getById(id);
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("organisation", org);

    return "print".equals(mode) ? "/printforms/organisationfrm" : "pages/organisations/organisation";
}

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

@Secured("ROLE_USER")
@RequestMapping(value = "/tasks/freetasks", method = RequestMethod.GET)
public String getFreeTasks(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("openTasksCount", taskService.getOpenTaskCount());
    model.addAttribute("freetasks", taskService.getByStatus(Task.Status.NEW));

    return "pages/tasks/free";
}

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

@Secured("ROLE_USER")
@RequestMapping(value = "/tasks/create", method = RequestMethod.GET)
public String newTaskFrm(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("openTasksCount", taskService.getOpenTaskCount());
    model.addAttribute("allEmps", employeeService.getActive());
    model.addAttribute("newTaskFrm", new Task(employeeService.getCurrentUser()));

    return "pages/tasks/newtask";
}

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

@Secured("ROLE_OFFICE")
@RequestMapping(value = "management/expencetypes/edit", method = RequestMethod.GET)
public String getExpenceTypeEditPage(@RequestParam("id") Integer id, ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("expenceType", expenceTypeService.getById(id));

    return "management/expencetypeedit";
}

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

@Secured("ROLE_OFFICE")
@RequestMapping(value = "/management/expencetypes", method = RequestMethod.GET)
public String getExpenceTypesPage(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("allExpenceTypes", expenceTypeService.getAll());
    model.addAttribute("expenceTypeFrm", new ExpenceType());

    return "management/expencetypes";
}

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

@Secured("ROLE_ADMIN")
@RequestMapping(value = "/admin/employees", method = RequestMethod.GET)
public String getEmplyees(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("allemps", employeeService.getAll());

    return "admin/employees";
}

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

@Secured("ROLE_ADMIN")
@RequestMapping(value = "/admin/organisations", method = RequestMethod.GET)
public String getOrganisations(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("allorgs", organisationService.getAll());

    return "admin/organisations";
}

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

@Secured("ROLE_ADMIN")
@RequestMapping(value = "/admin/shops", method = RequestMethod.GET)
public String getShops(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("allshops", shopService.getAll());

    return "admin/shops";
}