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.portalapp.controller;
22 import java.security.Principal;
25 import javax.annotation.Resource;
26 import javax.servlet.http.HttpServletRequest;
27 import javax.servlet.http.HttpServletResponse;
29 import org.mitre.openid.connect.client.SubjectIssuerGrantedAuthority;
30 import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
31 import org.springframework.context.annotation.EnableAspectJAutoProxy;
32 import org.springframework.stereotype.Controller;
33 import org.springframework.ui.Model;
34 import org.springframework.web.bind.annotation.RequestMapping;
35 import org.springframework.web.bind.annotation.RequestMethod;
36 import org.springframework.web.servlet.ModelAndView;
40 @org.springframework.context.annotation.Configuration
41 @EnableAspectJAutoProxy
43 public class WelcomeController extends EPRestrictedBaseController{
46 @RequestMapping(value = {"/welcome" }, method = RequestMethod.GET)
47 public ModelAndView welcome(HttpServletRequest request) {
48 return new ModelAndView(getViewName());
51 @RequestMapping(value = "/index.htm", method = RequestMethod.GET)
52 public String getIndexPage(HttpServletRequest request) {
56 @RequestMapping(value = {"/applicationsHome", "/dashboard", "/widgetsHome", "/kpidash*", "/admins", "/users", "/portalAdmins", "/applications", "/widgets", "/functionalMenu", "/contactUs", "/getAccess","/appCatalog" }, method = RequestMethod.GET)
57 public String getEcompSinglePage(HttpServletRequest request, HttpServletResponse response) {
58 return "forward:/index.html";
61 protected String getViewName() {
65 protected void setViewName(String viewName) {
66 this.viewName = viewName;
70 @Resource(name = "namedAdmins")
71 private Set<SubjectIssuerGrantedAuthority> admins;
73 @RequestMapping("/user")
74 public String user(Principal p) {
78 @RequestMapping("/admin")
79 public String admin(Model model, Principal p) {
81 model.addAttribute("admins", admins);
85 @RequestMapping("/oid-login")
86 public ModelAndView login(Principal p) {
87 return new ModelAndView("openIdLogin");