EMMA Coverage Report (generated Fri Sep 15 10:32:43 EDT 2006)
[all classes][edu.iu.uis.sit.portal.portlet.admin.web]

COVERAGE SUMMARY FOR SOURCE FILE [PortletConfigController.java]

nameclass, %method, %block, %line, %
PortletConfigController.java100% (1/1)100% (6/6)100% (88/88)100% (21/21)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PortletConfigController100% (1/1)100% (6/6)100% (88/88)100% (21/21)
PortletConfigController (): void 100% (1/1)100% (3/3)100% (1/1)
formBackingObject (PortletRequest): Object 100% (1/1)100% (39/39)100% (9/9)
getAdminService (): AdminService 100% (1/1)100% (3/3)100% (1/1)
onSubmitAction (Object): void 100% (1/1)100% (11/11)100% (3/3)
onSubmitRender (Object): ModelAndView 100% (1/1)100% (28/28)100% (5/5)
setAdminService (AdminService): void 100% (1/1)100% (4/4)100% (2/2)

1package edu.iu.uis.sit.portal.portlet.admin.web;
2 
3import javax.portlet.PortletRequest;
4 
5import org.springframework.web.portlet.ModelAndView;
6import org.springframework.web.portlet.mvc.SimpleFormController;
7 
8import edu.iu.uis.sit.portal.portlet.admin.domain.PortletApplication;
9import edu.iu.uis.sit.portal.portlet.admin.domain.PortletConfig;
10import edu.iu.uis.sit.portal.portlet.admin.services.AdminService;
11 
12public class PortletConfigController extends SimpleFormController {
13        private AdminService adminService;
14 
15        protected void onSubmitAction(Object command) throws Exception {
16                WebPortletConfig webPortletConfig = (WebPortletConfig) command;
17                getAdminService().savePortletConfig(webPortletConfig.getPortletApplication(), webPortletConfig.getPortletConfig());
18        }
19 
20        protected ModelAndView onSubmitRender(Object command) throws Exception {
21                ModelAndView modelAndView = new ModelAndView("displayPortletConfigs");
22                WebPortletConfig webPortletConfig = (WebPortletConfig) command;
23                modelAndView.addObject("portletApplicationId", webPortletConfig.getPortletApplication().getPortletApplicationId());
24                modelAndView.addObject("portletConfigs", getAdminService().findPortletApplicationById(webPortletConfig.getPortletApplication().getPortletApplicationId()).getPortletConfigs());
25                return modelAndView;
26        }
27 
28        protected Object formBackingObject(PortletRequest request) throws Exception {
29                WebPortletConfig webPortletConfig = new WebPortletConfig();
30                if (request.getParameter("portletConfigId") != null) {
31                        PortletConfig portletConfig = getAdminService().findPortletConfigById(Long.parseLong(request.getParameter("portletConfigId")));
32                        webPortletConfig.setPortletApplication(portletConfig.getPortletApplication());
33                        webPortletConfig.setPortletConfig(portletConfig);
34                } else {
35                        PortletApplication portletApplication = getAdminService().findPortletApplicationById(Long.parseLong(request.getParameter("portletApplicationId")));
36                        webPortletConfig.setPortletApplication(portletApplication);
37                }
38 
39                return webPortletConfig;
40        }
41 
42        public AdminService getAdminService() {
43                return adminService;
44        }
45 
46        public void setAdminService(AdminService adminService) {
47                this.adminService = adminService;
48        }
49}

[all classes][edu.iu.uis.sit.portal.portlet.admin.web]
EMMA 2.0.5312 (C) Vladimir Roubtsov