Examples of ModelMap


Examples of org.springframework.ui.ModelMap

        widget.setTitle("Widget title");
        widget.setType("OpenSocial");
        widget.setDescription("Lorem ipsum");
        BindingResult errors = new BeanPropertyBindingResult(widget, "widget");
        SessionStatus sessionStatus = createMock(SessionStatus.class);
        ModelMap modelMap = new ExtendedModelMap();

        expect(service.getWidgetByUrl(widgetUrl)).andReturn(widget);
        service.updateWidget(widget);
        sessionStatus.setComplete();
        expectLastCall();
View Full Code Here

Examples of org.springframework.ui.ModelMap

    @Test(expected = SecurityException.class)
    public void updateWidget_wrongToken() {
        Widget widget = new Widget();
        BindingResult errors = new BeanPropertyBindingResult(widget, "widget");
        SessionStatus sessionStatus = createMock(SessionStatus.class);
        ModelMap modelMap = new ExtendedModelMap();

        sessionStatus.setComplete();
        expectLastCall();
        replay(sessionStatus);
View Full Code Here

Examples of org.springframework.ui.ModelMap

    @Test
    public void updateWidget_invalid() {
        Widget widget = new Widget(123L, "http://broken/url");
        BindingResult errors = new BeanPropertyBindingResult(widget, "widget");
        SessionStatus sessionStatus = createMock(SessionStatus.class);
        ModelMap modelMap = new ExtendedModelMap();

        String view = controller.updateWidgetDetail(widget, errors, validToken, validToken, modelMap, sessionStatus);

        assertTrue("Errors", errors.hasErrors());
        assertEquals(ViewNames.ADMIN_WIDGETDETAIL, view);
View Full Code Here

Examples of org.springframework.ui.ModelMap

    }

    @RequestMapping("/users.html")
    public ModelMap usersHandler(HttpServletRequest req) {
        ModelMap rtn = ControllerUtil.getModelMap(req, userService);

        rtn.addAttribute("topUsers", userService.getTopUsers(20));

        return rtn;
    }
View Full Code Here

Examples of org.springframework.ui.ModelMap

    public ModelMap schoolsHandler(HttpServletRequest req,
            @RequestParam(value = "startLetter", required = false)
            String startLetter,
            @RequestParam(value = "start", required = false)
            Integer start) {
        ModelMap rtn = ControllerUtil.getModelMap(req, userService);

        if (start == null) {
            start = 0;
        }

        List<School> schools = null;
        if (startLetter == null) {
            startLetter = "";
            schools = schoolService.getTopSchools(start, 20);
        } else {
            schools = schoolService.getSchoolsStarting(startLetter,
                    start, 20);
        }

        rtn.addAttribute("start", start);
        rtn.addAttribute("startLetter", startLetter);
        rtn.addAttribute("schools", schools);

        return rtn;
    }
View Full Code Here

Examples of org.springframework.ui.ModelMap

    @RequestMapping(method = RequestMethod.GET)
    public ModelAndView forumsHandler(HttpServletRequest req,
            @RequestParam(value = "uniqueForumID", required = false)
            String uniqueForumID) throws InfrastructureException {

        ModelMap rtn = ControllerUtil.getModelMap(req, userService);

        if (uniqueForumID != null) {

            rtn.addAttribute("uniqueForumID", uniqueForumID);

        } else {

            RecentForumPostTopic rfpt = new RecentForumPostTopic();
            PostsList postList = schoolService.getForum(rfpt, 0, 15);

            ForumBootstrap bootstrap = new ForumBootstrap(gwtSerializer,
                    postList, rfpt);

            rtn.addAttribute("bootstrap", bootstrap);

        }

        return new ModelAndView("forums", rtn);
View Full Code Here

Examples of org.springframework.ui.ModelMap

            @RequestParam(value = "searchString", required = false)
            String searchString,
            @RequestParam(value = "message", required = false)
            String message) throws SiteException {

        ModelMap rtn = ControllerUtil.getModelMap(req, userService);

        rtn.addAttribute("message", message);
        addResults(rtn, new SearchCommand(searchString));

        return rtn;
    }
View Full Code Here

Examples of org.springframework.ui.ModelMap

    @RequestMapping(method = RequestMethod.POST)
    public ModelMap searchHandler(HttpServletRequest req,
            @ModelAttribute("command")
            SearchCommand command) throws SiteException {

        ModelMap myModel = ControllerUtil.getModelMap(req, userService);

        addResults(myModel, command);

        return myModel;
    }
View Full Code Here

Examples of org.springframework.ui.ModelMap

        client.friends_get();
       
        FriendsGetResponse response = (FriendsGetResponse)client.getResponsePOJO();
        List<Long> friends = response.getUid();
       
        ModelMap rtn = ControllerUtil.getModelMap(req, userService);

        User user = userService.getUserByNicknameFullFetch("test");

        rtn.addAttribute("viewUser", user);
        rtn.addAttribute("friends", friends);

        return new ModelAndView("facebook/canvas",rtn);

    }
View Full Code Here

Examples of org.springframework.ui.ModelMap

        return model;
    }

    public static ModelMap getModelMap(HttpServletRequest req,
            UserService userService) {
        ModelMap rtn = new ModelMap();
        rtn.addAllAttributes(getDefaultModel(req, userService));
        return rtn;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.