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.PortalConfig; |
9 | import edu.iu.uis.sit.portal.portlet.admin.services.AdminService; |
10 | |
11 | public class PortalConfigController extends SimpleFormController { |
12 | private AdminService adminService; |
13 | |
14 | protected void onSubmitAction(Object command) throws Exception { |
15 | PortalConfig portalConfig = (PortalConfig) command; |
16 | getAdminService().savePortalConfig(portalConfig); |
17 | } |
18 | |
19 | protected ModelAndView onSubmitRender(Object command) throws Exception { |
20 | ModelAndView modelAndView = new ModelAndView("message"); |
21 | modelAndView.addObject("message", "Saved successfully"); |
22 | return modelAndView; |
23 | } |
24 | |
25 | protected Object formBackingObject(PortletRequest request) throws Exception { |
26 | return getAdminService().getPortalConfig(); |
27 | } |
28 | |
29 | public AdminService getAdminService() { |
30 | return adminService; |
31 | } |
32 | |
33 | public void setAdminService(AdminService adminService) { |
34 | this.adminService = adminService; |
35 | } |
36 | } |