1 | package�edu.iu.uis.sit.portal.portlet.admin.web; |
2 | � |
3 | import�javax.portlet.PortletRequest; |
4 | � |
5 | import�org.springframework.web.portlet.ModelAndView; |
6 | import�org.springframework.web.portlet.mvc.SimpleFormController; |
7 | � |
8 | import�edu.iu.uis.sit.portal.portlet.admin.domain.PortletApplication; |
9 | import�edu.iu.uis.sit.portal.portlet.admin.services.AdminService; |
10 | � |
11 | public�class�PortletApplicationDeleteController�extends�SimpleFormController�{ |
12 | � |
13 | ��������private�AdminService�adminService; |
14 | � |
15 | ��������protected�void�onSubmitAction(Object�command)�throws�Exception�{ |
16 | ����������������PortletApplication�portletApplication�=�(PortletApplication)�command; |
17 | ����������������getAdminService().deletePortletApplication(portletApplication); |
18 | ��������} |
19 | � |
20 | ��������protected�ModelAndView�onSubmitRender(Object�command)�throws�Exception�{ |
21 | ����������������ModelAndView�modelAndView�=�new�ModelAndView("displayPortletApplications"); |
22 | ����������������modelAndView.addObject("portletApplications",�getAdminService().getPortalConfig().getPortletApplications()); |
23 | ����������������return�modelAndView; |
24 | ��������} |
25 | � |
26 | ��������protected�Object�formBackingObject(PortletRequest�request)�throws�Exception�{ |
27 | ����������������if�(request.getParameter("portletApplicationId")�!=�null)�{ |
28 | ������������������������return�getAdminService().findPortletApplicationById(Long.parseLong(request.getParameter("portletApplicationId"))); |
29 | ����������������} |
30 | ����������������return�new�PortletApplication(); |
31 | ��������} |
32 | � |
33 | ��������public�AdminService�getAdminService()�{ |
34 | ����������������return�adminService; |
35 | ��������} |
36 | � |
37 | ��������public�void�setAdminService(AdminService�adminService)�{ |
38 | ����������������this.adminService�=�adminService; |
39 | ��������} |
40 | � |
41 | } |