Upgrade sonar plugin
[vid.git] / vid-app-common / src / main / java / org / openecomp / vid / controller / ViewEditSubController.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * VID\r
4  * ================================================================================\r
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  * \r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * \r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ============LICENSE_END=========================================================\r
19  */\r
20 \r
21 package org.openecomp.vid.controller;\r
22 \r
23 \r
24 import java.io.File;\r
25 import java.text.DateFormat;\r
26 import java.util.HashMap;\r
27 import java.util.Map;\r
28 \r
29 \r
30 \r
31 \r
32 import javax.servlet.ServletContext;\r
33 import javax.servlet.http.HttpServletRequest;\r
34 \r
35 import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;\r
36 import org.springframework.beans.factory.annotation.Autowired;\r
37 import org.springframework.web.bind.annotation.PathVariable;\r
38 import org.springframework.web.bind.annotation.RequestMapping;\r
39 import org.springframework.web.bind.annotation.RequestMethod;\r
40 import org.springframework.web.bind.annotation.RestController;\r
41 import org.springframework.web.servlet.ModelAndView;\r
42 \r
43 import org.openecomp.portalsdk.core.controller.RestrictedBaseController;\r
44 \r
45 \r
46 /**\r
47  * The Class ViewEditSubController.\r
48  */\r
49 @RestController\r
50 public class ViewEditSubController extends RestrictedBaseController{\r
51         \r
52         /** The view name. */\r
53         String viewName;\r
54         \r
55         /** The logger. */\r
56         EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ViewEditSubController.class);\r
57         \r
58         /** The model. */\r
59         private Map<String, Object> model = new HashMap<String, Object>();\r
60         \r
61         /** The servlet context. */\r
62         private @Autowired ServletContext servletContext;\r
63         \r
64         /**\r
65          * Welcome.\r
66          *\r
67          * @param request the request\r
68          * @return the model and view\r
69          */\r
70         @RequestMapping(value = {"/vieweditsub" }, method = RequestMethod.GET)\r
71         public ModelAndView welcome(HttpServletRequest request) {\r
72                 return new ModelAndView("vieweditsub","model", model);\r
73     //  return new ModelAndView(getViewName());         \r
74         }\r
75         \r
76         /**\r
77          * Post subscriber.\r
78          *\r
79          * @param request the request\r
80          */\r
81         @RequestMapping(value="/vieweditsub/subedit", method = RequestMethod.POST)\r
82         public void PostSubscriber(HttpServletRequest request) {\r
83                 \r
84                 String        subID = request.getParameter("subscriberID");\r
85                 model.put("subInfo", subID);\r
86                 \r
87         }\r
88         \r
89         /* (non-Javadoc)\r
90          * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#getViewName()\r
91          */\r
92         public String getViewName() {\r
93                 return viewName;\r
94         }\r
95         \r
96         /* (non-Javadoc)\r
97          * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#setViewName(java.lang.String)\r
98          */\r
99         public void setViewName(String viewName) {\r
100                 this.viewName = viewName;\r
101         }\r
102 \r
103 \r
104         \r
105 \r
106 }\r
107 \r