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 [PortletApplicationController.java]

nameclass, %method, %block, %line, %
PortletApplicationController.java100% (1/1)100% (6/6)100% (74/74)100% (18/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PortletApplicationController100% (1/1)100% (6/6)100% (74/74)100% (18/18)
PortletApplicationController (): void 100% (1/1)100% (3/3)100% (1/1)
formBackingObject (PortletRequest): Object 100% (1/1)100% (38/38)100% (8/8)
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% (15/15)100% (3/3)
setAdminService (AdminService): void 100% (1/1)100% (4/4)100% (2/2)

1package edu.iu.uis.sit.portal.portlet.admin.web;
2 
3import java.util.Iterator;
4 
5import javax.portlet.PortletRequest;
6 
7import org.springframework.web.portlet.ModelAndView;
8import org.springframework.web.portlet.mvc.SimpleFormController;
9 
10import edu.iu.uis.sit.portal.portlet.admin.domain.PortletApplication;
11import edu.iu.uis.sit.portal.portlet.admin.services.AdminService;
12 
13public class PortletApplicationController extends SimpleFormController {
14        private AdminService adminService;
15 
16        protected void onSubmitAction(Object command) throws Exception {
17                WebPortalConfig webPortalConfig = (WebPortalConfig) command;
18                getAdminService().savePortletApplication(webPortalConfig.getPortalConfig(), webPortalConfig.getPortletApplication());
19        }
20 
21        protected ModelAndView onSubmitRender(Object command) throws Exception {
22                ModelAndView modelAndView = new ModelAndView("displayPortletApplications");
23                modelAndView.addObject("portletApplications", getAdminService().getPortalConfig().getPortletApplications());
24                return modelAndView;
25        }
26 
27        protected Object formBackingObject(PortletRequest request) throws Exception {
28                WebPortalConfig webPortalConfig = new WebPortalConfig(getAdminService().getPortalConfig());
29                if (request.getParameter("portletApplicationId") != null) {
30                        for (Iterator iter = webPortalConfig.getPortalConfig().getPortletApplications().iterator(); iter.hasNext();) {
31                                PortletApplication application = (PortletApplication) iter.next();
32                                if (application.getPortletApplicationId().longValue() == Long.parseLong(request.getParameter("portletApplicationId"))) {
33                                        webPortalConfig.setPortletApplication(application);
34                                }
35                        }
36                }
37                return webPortalConfig;
38        }
39 
40        public AdminService getAdminService() {
41                return adminService;
42        }
43 
44        public void setAdminService(AdminService adminService) {
45                this.adminService = adminService;
46        }
47}

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