* ===================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
- * Modifications Copyright (c) 2019 Samsung
+ * Modifications Copyright (c) 2019 Samsung
* ===================================================================
- *
+ * Modifications Copyright (c) 2020 IBM
+ * ===================================================================
+ *
* 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
+ * 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
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
* @throws Exception
*/
- @RequestMapping(value = { "/portalApi/get_roles/{appId}" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/get_roles/{appId}" })
public void getRoles(HttpServletRequest request, HttpServletResponse response, @PathVariable("appId") Long appId)
throws Exception {
try {
}
}
- @RequestMapping(value = { "/portalApi/role_list/toggleRole/{appId}/{roleId}" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role_list/toggleRole/{appId}/{roleId}" })
public Map<String, Object> toggleRole(HttpServletRequest request, HttpServletResponse response,
@PathVariable("appId") Long appId, @PathVariable("roleId") Long roleId) throws Exception {
EPApp requestedApp = null;
return responseMap;
}
- @RequestMapping(value = { "/portalApi/role_list/removeRole/{appId}/{roleId}" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role_list/removeRole/{appId}/{roleId}" })
public Map<String, Object> removeRole(HttpServletRequest request, HttpServletResponse response,
@PathVariable("appId") Long appId, @PathVariable("roleId") Long roleId) throws Exception {
return responseMap;
}
- @RequestMapping(value = { "/portalApi/role/saveRole/{appId}" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role/saveRole/{appId}" })
public Map<String, Object> saveRole(HttpServletRequest request, HttpServletResponse response,
@PathVariable("appId") Long appId) throws Exception {
EPUser user = EPUserUtils.getUserSession(request);
return responseMap;
}
- @RequestMapping(value = { "/portalApi/role/removeRoleFunction" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role/removeRoleFunction" })
public ModelAndView removeRoleRoleFunction(HttpServletRequest request, HttpServletResponse response)
throws Exception {
return getRoleController().removeRoleFunction(request, response);
}
- @RequestMapping(value = { "/portalApi/role/addRoleFunction" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role/addRoleFunction" })
public ModelAndView addRoleRoRoleFunction(HttpServletRequest request, HttpServletResponse response)
throws Exception {
return getRoleController().addRoleFunction(request, response);
}
- @RequestMapping(value = { "/portalApi/role/removeChildRole" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role/removeChildRole" })
public ModelAndView removeChildRole(HttpServletRequest request, HttpServletResponse response) throws Exception {
return getRoleController().removeChildRole(request, response);
}
- @RequestMapping(value = { "/portalApi/role/addChildRole" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role/addChildRole" })
public ModelAndView addChildRole(HttpServletRequest request, HttpServletResponse response) throws Exception {
return getRoleController().addChildRole(request, response);
}
- @RequestMapping(value = { "/portalApi/get_role/{appId}/{roleId}" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/get_role/{appId}/{roleId}" })
public void getRole(HttpServletRequest request, HttpServletResponse response, @PathVariable("appId") Long appId,
@PathVariable("roleId") Long roleId) throws Exception {
try {
}
}
- @RequestMapping(value = { "/portalApi/get_role_functions/{appId}" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/get_role_functions/{appId}" })
public void getRoleFunctionList(HttpServletRequest request, HttpServletResponse response,
@PathVariable("appId") Long appId) throws Exception {
try {
}
}
- @RequestMapping(value = { "/portalApi/role_function_list/saveRoleFunction/{appId}" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role_function_list/saveRoleFunction/{appId}" })
public PortalRestResponse<String> saveRoleFunction(HttpServletRequest request, HttpServletResponse response, @Valid @RequestBody CentralV2RoleFunction roleFunc,
@PathVariable("appId") Long appId) throws Exception {
if (roleFunc!=null) {
}
}
- @RequestMapping(value = { "/portalApi/role_function_list/removeRoleFunction/{appId}" }, method = RequestMethod.POST)
+ @PostMapping(value = { "/portalApi/role_function_list/removeRoleFunction/{appId}" })
public PortalRestResponse<String> removeRoleFunction(HttpServletRequest request, HttpServletResponse response,
@RequestBody String roleFunc, @PathVariable("appId") Long appId) throws Exception {
EPUser user = EPUserUtils.getUserSession(request);
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "Deleted Successfully!", "Success");
}
- @RequestMapping(value = { "/portalApi/centralizedApps" }, method = RequestMethod.GET)
+ @GetMapping(value = { "/portalApi/centralizedApps" })
public List<CentralizedApp> getCentralizedAppRoles(HttpServletRequest request, HttpServletResponse response, String userId) {
if(userId!=null) {
SecureString secureString = new SecureString(userId);
this.roleController = roleController;
}
- @RequestMapping(value = { "/portalApi/syncRoles" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/portalApi/syncRoles" }, produces = "application/json")
public PortalRestResponse<String> syncRoles(HttpServletRequest request, HttpServletResponse response,
@RequestBody Long appId) {
EPUser user = EPUserUtils.getUserSession(request);
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "Sync roles completed successfully!", "Success");
}
- @RequestMapping(value = { "/portalApi/syncFunctions" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/portalApi/syncFunctions" }, produces = "application/json")
public PortalRestResponse<String> syncFunctions(HttpServletRequest request, HttpServletResponse response,
@RequestBody Long appId) {
EPUser user = EPUserUtils.getUserSession(request);
response.getWriter().write("Unauthorized User");
}
- @RequestMapping(value = {
- "/portalApi/uploadRoleFunction/{appId}" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = {
+ "/portalApi/uploadRoleFunction/{appId}" }, produces = "application/json")
public PortalRestResponse<String> bulkUploadRoleFunc(HttpServletRequest request, HttpServletResponse response,
@RequestBody UploadRoleFunctionExtSystem data, @PathVariable("appId") Long appId) {
EPUser user = EPUserUtils.getUserSession(request);
* ===================================================================
* Copyright (C) 2017 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");
* 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
+ * 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,
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
private static final String SUCCESS = "success";
private static final String FAILURE = "FAILURE";
- @RequestMapping(value = {
- "/portalApi/getFunctionalMenuRole" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/getFunctionalMenuRole" }, produces = "application/json")
public List<FunctionalMenuRole> getMenuIdRoleId(HttpServletRequest request, HttpServletResponse response) {
// EPUser user = EPUserUtils.getUserSession(request);
List<FunctionalMenuRole> menuRoleList = null;
return menuRoleList;
}
- @RequestMapping(value = {
- "/portalApi/getNotifications" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/getNotifications" }, produces = "application/json")
public PortalRestResponse<List<EpNotificationItem>> getNotifications(HttpServletRequest request,
HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
return portalRestResponse;
}
- @RequestMapping(value = {
- "/portalApi/getAdminNotifications" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/getAdminNotifications" }, produces = "application/json")
public List<EpNotificationItemVO> getAdminNotifications(HttpServletRequest request, HttpServletResponse response) {
List<EpNotificationItemVO> adminNotificationList = null;
EPUser user = EPUserUtils.getUserSession(request);
return adminNotificationList;
}
- @RequestMapping(value = "/portalApi/saveNotification", method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = "/portalApi/saveNotification", produces = "application/json")
public PortalRestResponse<String> save(HttpServletRequest request, HttpServletResponse response,
@RequestBody EpNotificationItem notificationItem) {
return new PortalRestResponse<>(PortalRestStatusEnum.OK, "SUCCESS", "");
}
- @RequestMapping(value = {
- "/portalApi/notificationUpdateRate" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/notificationUpdateRate" }, produces = "application/json")
public PortalRestResponse<Map<String, String>> getNotificationUpdateRate(HttpServletRequest request) {
try {
String updateRate = SystemProperties.getProperty(EPCommonSystemProperties.NOTIFICATION_UPDATE_RATE);
}
}
- @RequestMapping(value = {
- "/portalApi/notificationRead" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/notificationRead" }, produces = "application/json")
public PortalRestResponse<Map<String, String>> notificationRead(
@RequestParam("notificationId") String notificationID, HttpServletRequest request) {
try {
}
}
- @RequestMapping(value = {
- "/portalApi/getNotificationHistory" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/getNotificationHistory" }, produces = "application/json")
public List<EpNotificationItemVO> getNotificationHistory(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
List<EpNotificationItemVO> notificationList = null;
return notificationList;
}
- @RequestMapping(value = { "/portalApi/notificationRole/{notificationId}/roles" }, method = {
- RequestMethod.GET }, produces = "application/json")
+ @GetMapping(value = { "/portalApi/notificationRole/{notificationId}/roles" }, produces = "application/json")
public List<Integer> testGetRoles(HttpServletRequest request, @PathVariable("notificationId") Long notificationId) {
List<EpRoleNotificationItem> notifRoles = userNotificationService.getNotificationRoles(notificationId);
ArrayList<Integer> rolesList = new ArrayList<>();
return rolesList;
}
- @RequestMapping(value = { "/portalApi/getNotificationAppRoles" }, method = {
- RequestMethod.GET }, produces = "application/json")
+ @GetMapping(value = { "/portalApi/getNotificationAppRoles" }, produces = "application/json")
public List<EcompAppRole> getNotificationAppRoles(HttpServletRequest request, HttpServletResponse response) {
List<EcompAppRole> epAppRoleList = null;
try {
return epAppRoleList;
}
- @RequestMapping(value = {
- "/portalApi/getMessageRecipients" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = {
+ "/portalApi/getMessageRecipients" }, produces = "application/json")
public List<String> getMessageRecipients(@RequestParam("notificationId") Long notificationID) {
// EPUser user = EPUserUtils.getUserSession(request);
List<String> messageUserRecipients = null;
* ===================================================================
* Copyright (C) 2019 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");
import org.springframework.util.concurrent.SuccessCallback;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
* @return String
*/
@ApiOperation(value = "Gets javascript with functions that support gathering and reporting web analytics.", response = String.class)
- @RequestMapping(value = { "/analytics" }, method = RequestMethod.GET, produces = "application/javascript")
+ @GetMapping(value = { "/analytics" }, produces = "application/javascript")
public String getAnalyticsScript(HttpServletRequest request) {
String responseText = "";
EPApp app = null;
* Analytics
* @return PortalAPIResponse
*/
- @RequestMapping(value = { "/storeAnalytics" }, method = RequestMethod.POST, produces = "application/json")
+ @PostMapping(value = { "/storeAnalytics" }, produces = "application/json")
@ResponseBody
@ApiOperation(value = "Accepts data from partner applications with web analytics data.", response = PortalAPIResponse.class)
public PortalAPIResponse storeAnalyticsScript(HttpServletRequest request, @RequestBody Analytics analyticsMap) {
* ===================================================================
* Copyright © 2017 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");
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
this.persUserWidgetService = persUserWidgetService;
}
- @RequestMapping(value = { "/portalApi/widgets" }, method = RequestMethod.GET, produces = "application/json")
+ @GetMapping(value = { "/portalApi/widgets" }, produces = "application/json")
public List<OnboardingWidget> getOnboardingWidgets(HttpServletRequest request, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
List<OnboardingWidget> onboardingWidgets = null;
// Attention: real json has all OnboardingWidget fields except "id", we use OnboardingWidget for not
// to create new class for parsing
- @RequestMapping(value = { "/portalApi/widgets/{widgetId}" }, method = { RequestMethod.PUT },
+ @PutMapping(value = { "/portalApi/widgets/{widgetId}" },
produces = "application/json")
public FieldsValidator putOnboardingWidget(HttpServletRequest request, @PathVariable("widgetId") Long widgetId,
@RequestBody OnboardingWidget onboardingWidget, HttpServletResponse response) {
// Attention: real json has all OnboardingWidget fields except "id", we use OnboardingWidget for not
// to create new class for parsing
- @RequestMapping(value = { "/portalApi/widgets" }, method = { RequestMethod.POST }, produces = "application/json")
+ @PostMapping(value = { "/portalApi/widgets" }, produces = "application/json")
public FieldsValidator postOnboardingWidget(HttpServletRequest request,
@RequestBody OnboardingWidget onboardingWidget, HttpServletResponse response) {
EPUser user = EPUserUtils.getUserSession(request);
return fieldsValidator;
}
- @RequestMapping(value = { "/portalApi/widgets/{widgetId}" }, method = { RequestMethod.DELETE },
+ @DeleteMapping(value = { "/portalApi/widgets/{widgetId}" },
produces = "application/json")
public FieldsValidator deleteOnboardingWidget(HttpServletRequest request, @PathVariable("widgetId") Long widgetId,
HttpServletResponse response) {
* @return FieldsValidator
* @throws IOException
*/
- @RequestMapping(value = { "portalApi/widgetCatalogSelection" }, method = RequestMethod.PUT,
+ @PutMapping(value = { "portalApi/widgetCatalogSelection" },
produces = "application/json")
public FieldsValidator putWidgetCatalogSelection(HttpServletRequest request,
@RequestBody WidgetCatalogPersonalization persRequest, HttpServletResponse response) throws IOException {