2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ================================================================================
20 package org.openecomp.portalsdk.analytics.system.fusion.web;
25 import javax.servlet.http.*;
27 import org.openecomp.portalsdk.analytics.system.fusion.domain.CR_Report;
28 import org.openecomp.portalsdk.analytics.system.fusion.service.RaptorService;
29 import org.springframework.web.bind.*;
30 import org.springframework.web.servlet.*;
33 public class ReportsSearchListController {
35 private RaptorService raptorService = null;
38 * @return the raptorService
40 public RaptorService getRaptorService() {
45 * @param raptorService the raptorService to set
47 public void setRaptorService(RaptorService raptorService) {
48 this.raptorService = raptorService;
51 public ModelAndView handleRequestInternal(HttpServletRequest request,
52 HttpServletResponse response) {
55 int reportId = ServletRequestUtils.getIntParameter(request, "report_id", 0);
56 String task = ServletRequestUtils.getStringParameter(request, "task", TASK_GET);
58 HashMap additionalParams = new HashMap();
59 additionalParams.put(Parameters.PARAM_HTTP_REQUEST, request);
61 if (reportId != 0 && task.equals(TASK_DELETE)) { // delete the selected record
62 getRaptorService().deleteReport(new Long(reportId));
65 items = getRaptorService().getReports();
67 Map model = new HashMap();
68 model.put("items", items);
70 return new ModelAndView(getViewName(), "model", model);
72 //return new ModelAndView(getViewName(), "model", null);
73 System.out.println("Fill with proper code");