import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
import io.swagger.annotations.ApiOperation;
@ApiOperation(value = "Gets session slot-check interval, a duration in milliseconds.",
response = Integer.class)
- @RequestMapping(value={"/getSessionSlotCheckInterval"}, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value={"/getSessionSlotCheckInterval"}, produces = "application/json")
public Integer getSessionSlotCheckInterval(HttpServletRequest request, HttpServletResponse response) throws Exception {
return manageService.fetchSessionSlotCheckInterval();
}
@ApiOperation(value = "Extends session timeout values for all on-boarded applications.",
response = Boolean.class)
- @RequestMapping(value={"/extendSessionTimeOuts"}, method = RequestMethod.POST)
+ @PostMapping(value={"/extendSessionTimeOuts"})
public Boolean extendSessionTimeOuts(HttpServletRequest request, HttpServletResponse response, @RequestParam String sessionMap) {
manageService.extendSessionTimeOuts(sessionMap);
* ===================================================================
* Copyright © 2018 AT&T Intellectual Property. All rights reserved.
* ===================================================================
+ * Modifications Copyright (c) 2020 IBM
+ * ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
public Session get(String id) {
if(musicCache){
- // todo need to add the clean up for "sessions" map if musicCache is enabled
+ // need to add the clean up for "sessions" map if musicCache is enabled
return this.sessions.get(id);
}else{
try {
- Session session = MusicService.getMetaAttribute(id);
- return session;
+ return MusicService.getMetaAttribute(id);
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "get failed with id " + id, e);
return null;
public void remove(String id) {
if(musicCache){
- // todo need to add the clean up for "sessions" map if musicCache is enabled
+ // need to add the clean up for "sessions" map if musicCache is enabled
sessions.remove(id);
}else{
try {
public void put(String id, MusicSession musicSession) {
if(musicCache){
- // todo need to add the clean up for "sessions" map if musicCache is enabled
+ //need to add the clean up for "sessions" map if musicCache is enabled
sessions.put(id, musicSession);
}else{
try {
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+
@RestController
@org.springframework.context.annotation.Configuration
* @throws IOException If sendError fails
* @return List of items suitable for display
*/
- @RequestMapping(value = { "/portalApi/appCatalog" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/portalApi/appCatalog" }, produces = "application/json")
public List<AppCatalogItem> getAppCatalog(HttpServletRequest request, HttpServletResponse response)
throws IOException {
EPUser user = EPUserUtils.getUserSession(request);
* @return FieldsValidator
* @throws IOException If sendError fails
*/
- @RequestMapping(value = { "/portalApi/appCatalog" }, method = RequestMethod.PUT, produces = "application/json")
+ @PutMapping(value = { "/portalApi/appCatalog" }, produces = "application/json")
public FieldsValidator putAppCatalogSelection(HttpServletRequest request,
@RequestBody AppCatalogPersonalization persRequest, HttpServletResponse response) throws IOException {
FieldsValidator result = new FieldsValidator();
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
@RestController
@RequestMapping("/portalApi/contactus")
* @param request HttpServletRequest
* @return PortalRestResponse
*/
- @RequestMapping(value = "/feedback", method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = "/feedback", produces = "application/json")
public PortalRestResponse<String> getPortalDetails(HttpServletRequest request) {
PortalRestResponse<String> portalRestResponse;
try {
* @param request HttpServletRequest
* @return PortalRestResponse<List<AppContactUsItem>>
*/
- @RequestMapping(value = "/list", method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = "/list", produces = "application/json")
public PortalRestResponse<List<AppContactUsItem>> getAppContactUsList(HttpServletRequest request) {
PortalRestResponse<List<AppContactUsItem>> portalRestResponse;
try {
* @param request HttpServletRequest
* @return PortalRestResponse<List<AppContactUsItem>>
*/
- @RequestMapping(value = "/allapps", method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = "/allapps", produces = "application/json")
public PortalRestResponse<List<AppContactUsItem>> getAppsAndContacts(HttpServletRequest request) {
PortalRestResponse<List<AppContactUsItem>> portalRestResponse;
try {
* @param request HttpServletRequest
* @return PortalRestResponse<List<AppCategoryFunctionsItem>>
*/
- @RequestMapping(value = "/functions", method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = "/functions", produces = "application/json")
public PortalRestResponse<List<AppCategoryFunctionsItem>> getAppCategoryFunctions(HttpServletRequest request) {
PortalRestResponse<List<AppCategoryFunctionsItem>> portalRestResponse;
try {
* @param contactUs AppContactUsItem
* @return PortalRestResponse<String>
*/
- @RequestMapping(value = "/save", method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = "/save", produces = "application/json")
public PortalRestResponse<String> save(@RequestBody AppContactUsItem contactUs) {
if (contactUs == null || contactUs.getAppName() == null) {
return new PortalRestResponse<>(PortalRestStatusEnum.OK, saveAppContactUs, "");
}
- @RequestMapping(value = "/saveAll", method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = "/saveAll", produces = "application/json")
public PortalRestResponse<String> save(@RequestBody List<AppContactUsItem> contactUsList) {
if (contactUsList == null) {
* @param id app ID
* @return PortalRestResponse<String>
*/
- @RequestMapping(value = "/delete/{appid}", method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = "/delete/{appid}", produces = "application/json")
public PortalRestResponse<String> delete(@PathVariable("appid") Long id) {
String saveAppContactUs = FAILURE;
*/
package org.onap.portalapp.portal.controller;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.cxf.transport.http.HTTPException;
import org.onap.portalapp.controller.EPRestrictedBaseController;
-import org.onap.portalapp.portal.domain.EPApp;
import org.onap.portalapp.portal.domain.EPRole;
import org.onap.portalapp.portal.domain.EPUser;
import org.onap.portalapp.portal.domain.EPUserAppCatalogRoles;
import org.onap.portalapp.portal.logging.logic.EPLogUtil;
import org.onap.portalapp.portal.service.AdminRolesService;
import org.onap.portalapp.portal.service.ApplicationsRestClientService;
-import org.onap.portalapp.portal.service.EPAppService;
import org.onap.portalapp.portal.service.SearchService;
import org.onap.portalapp.portal.service.UserRolesService;
import org.onap.portalapp.portal.transport.AppNameIdIsAdmin;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
-import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
-import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-
import javax.validation.Valid;
import org.hibernate.validator.constraints.SafeHtml;
import org.onap.portalsdk.core.domain.support.DomainVo;
--- /dev/null
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2020 IBM Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotNull;
+
+public class EPServiceCookieTest {
+ EPServiceCookie ep=new EPServiceCookie();
+
+ @Test
+ public void testGetValue() throws NullPointerException{
+ Map<String, String> mymap = new HashMap<>();
+ mymap.put("1", "one");
+ ep.setValue(mymap);
+ assertNotNull(ep.getValue());
+ assertTrue(ep.getValue().equals(mymap));
+ }
+
+}
--- /dev/null
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2020 IBM Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+package org.onap.portalapp.portal.exceptions;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class DuplicateRecordExceptionTest {
+ @Test
+ public void Test1()
+ {
+ String s1 = "Duplicate Record";
+ DuplicateRecordException mde=new DuplicateRecordException(s1);
+ assertEquals(mde.getMessage(),"Duplicate Record");
+
+ }
+}
--- /dev/null
+/*-
+ * ============LICENSE_START============================================
+ * ONAP Portal
+ * =====================================================================
+ * Copyright (C) 2020 IBM Intellectual Property. All rights reserved.
+ * =====================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END================================================
+ *
+ *
+ */
+package org.onap.portalapp.portal.exceptions;
+
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+
+public class NotValidDataExceptionTest {
+
+ @Test
+ public void TestException2() {
+ String s1 = "data";
+ NotValidDataException nca = new NotValidDataException(s1);
+ assertEquals(nca.toString(),"NotValidDataException{}: data");
+ }
+}
-->
-
+<div class="diaplay-banner" *ngIf="diaplayBanner">
+ <span>{{browserCompatibilityMsg}}</span>
+</div>
<router-outlet></router-outlet>
* ============LICENSE_END============================================
*
*
- */
\ No newline at end of file
+ */
+
+ .diaplay-banner{
+ margin-top: 14px;
+ background-color: yellow;
+ font-weight: bold;
+ position: fixed;
+ z-index: 9999;
+ margin-left: 34em;
+ height: 24px;
+}
\ No newline at end of file
*
*
*/
-import { Component } from '@angular/core';
+import { Component, OnInit } from '@angular/core';
+import { environment } from 'src/environments/environment';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
-export class AppComponent {
-
-}
+export class AppComponent implements OnInit {
+ diaplayBanner : boolean = false;
+ api = environment.api;
+ browserCompatibilityMsg: string;
+
+ ngOnInit() {
+ this.diaplayBanner = false;
+ this.browserCompatibilityMsg = this.api.browserCompatibilityMsg;
+ this.getBrowserName();
+ }
+
+ /**
+ * Identify Browser
+ */
+ getBrowserName() {
+ const agent = window.navigator.userAgent.toLowerCase();
+ switch (true) {
+ case agent.indexOf('edge') > -1:
+ return 'edge';
+ case agent.indexOf('opr') > -1 && !!(<any>window).opr:
+ this.diaplayBanner = true;
+ return 'opera';
+ case agent.indexOf('chrome') > -1 && !!(<any>window).chrome:
+ return 'chrome';
+ case agent.indexOf('trident') > -1:
+ this.diaplayBanner = true;
+ return 'ie';
+ case agent.indexOf('firefox') > -1:
+ return 'firefox';
+ case agent.indexOf('safari') > -1:
+ this.diaplayBanner = true;
+ return 'safari';
+ default:
+ this.diaplayBanner = true;
+ return 'other';
+ }
+ }
+}
\ No newline at end of file
"footerLogoImagePath": "",
"footerLogoText": "",
"intraSearcLink": "",
- "extraSearcLink": "https://wiki.onap.org/dosearchsite.action?cql=siteSearch+~+searchStringPlaceHolder&queryString=searchStringPlaceHolder"
+ "extraSearcLink": "https://wiki.onap.org/dosearchsite.action?cql=siteSearch+~+searchStringPlaceHolder&queryString=searchStringPlaceHolder",
+ "browserCompatibilityMsg": "This Application is best viewed on Firefox, Chrome and Edge."
},
"getAccessUrl": "",
"getAccessName":"",
"footerLogoImagePath": "",
"footerLogoText": "",
"intraSearcLink": "",
- "extraSearcLink": "https://wiki.onap.org/dosearchsite.action?cql=siteSearch+~+searchStringPlaceHolder&queryString=searchStringPlaceHolder"
+ "extraSearcLink": "https://wiki.onap.org/dosearchsite.action?cql=siteSearch+~+searchStringPlaceHolder&queryString=searchStringPlaceHolder",
+ "browserCompatibilityMsg": "This Application is best viewed on Firefox, Chrome and Edge."
},
"getAccessUrl": "",
"getAccessName": "",