1 | package edu.iu.uis.sit.portal.portlet.publishing.web; |
2 | |
3 | import javax.portlet.ActionRequest; |
4 | import javax.portlet.ActionResponse; |
5 | import javax.portlet.RenderRequest; |
6 | import javax.portlet.RenderResponse; |
7 | |
8 | import org.springframework.web.portlet.ModelAndView; |
9 | |
10 | import edu.iu.uis.sit.portal.portlet.publishing.services.PublishingService; |
11 | import edu.iu.uis.sit.portal.portlet.web.MultiActionController; |
12 | |
13 | public class TabDeleteController extends MultiActionController { |
14 | |
15 | private PublishingService publishingService; |
16 | |
17 | public void deleteTab(ActionRequest request, ActionResponse response) throws Exception { |
18 | getPublishingService().deleteTab(getPublishingService().findTabById(new Long(request.getParameter("tabId")))); |
19 | } |
20 | |
21 | public ModelAndView deleteTab(RenderRequest request, RenderResponse response) throws Exception { |
22 | ModelAndView modelAndView = new ModelAndView("displayTabs"); |
23 | modelAndView.addObject("tabs", getPublishingService().findTabsByPublisher()); |
24 | return modelAndView; |
25 | } |
26 | |
27 | public ModelAndView displayTab(RenderRequest request, RenderResponse response) throws Exception { |
28 | ModelAndView modelAndView = new ModelAndView("deleteTab"); |
29 | modelAndView.addObject("tab", getPublishingService().findTabById(new Long(request.getParameter("tabId")))); |
30 | return modelAndView; |
31 | } |
32 | |
33 | public ModelAndView start(RenderRequest request, RenderResponse response) throws Exception { |
34 | return displayTab(request, response); |
35 | } |
36 | |
37 | public PublishingService getPublishingService() { |
38 | return publishingService; |
39 | } |
40 | |
41 | public void setPublishingService(PublishingService publishingService) { |
42 | this.publishingService = publishingService; |
43 | } |
44 | |
45 | } |