/*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 2017 AT&T 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
- *
+ *
+ * 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.openecomp.portalapp.portal.controller;
@EnableAspectJAutoProxy
@EPAuditLog
public class AppsController extends EPRestrictedBaseController {
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsController.class);
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsController.class);
@Autowired
private AdminRolesService adminRolesService;
* RESTful service method to fetch all Applications available to current
* user
*
- * @return
+ * @param request
+ * HttpServletRequest
+ * @param response
+ * HttpServletResponse
+ * @return List<EcompApp>
*/
@RequestMapping(value = { "/portalApi/userApps" }, method = RequestMethod.GET, produces = "application/json")
public List<EcompApp> getUserApps(HttpServletRequest request, HttpServletResponse response) {
* RESTful service method to fetch all applications accessible to the
* current user, with personalizations.
*
- * @return
+ * @param request
+ * HttpServletRequest
+ * @param response
+ * HttpServletResponse
+ * @return List<EcompApp>
+ * @throws IOException
+ * if sendError fails
*/
@RequestMapping(value = { "/portalApi/persUserApps" }, method = RequestMethod.GET, produces = "application/json")
public List<EcompApp> getPersUserApps(HttpServletRequest request, HttpServletResponse response) throws IOException {
* RESTful service method to fetch applications for which the current user
* is an Administrator
*
- * @return
+ * @param request
+ * HttpServletRequest
+ * @param response
+ * HttpServletResponse
+ * @return List<AppIdAndNameTransportModel>
*/
@RequestMapping(value = { "/portalApi/adminApps" }, method = RequestMethod.GET, produces = "application/json")
public List<AppIdAndNameTransportModel> getAdminApps(HttpServletRequest request, HttpServletResponse response) {
* RESTful service method to fetch Applications for user who is super admin
* and/or app admin.
*
- * @return
+ * @param request
+ * HttpServletRequest
+ * @param response
+ * HttpServletResponse
+ * @return List<AppIdAndNameTransportModel>
*/
@RequestMapping(value = {
"/portalApi/appsForSuperAdminAndAccountAdmin" }, method = RequestMethod.GET, produces = "application/json")
/**
* RESTful service method to fetch left menu items from the user's session.
*
+ * @param request
+ * HttpServletRequest
+ * @param response
+ * HttpServletResponse
* @return JSON with left menu
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
return ecompApps;
}
- /*
- * This method sends the user apps manual sort preference Data to service
- *
- * @request: HTTP servlet request
+ /**
+ * Sets the user apps manual sort preference
*
- * @response: HTTP servlet response
+ * @param request
+ * HTTP servlet request
+ * @param response
+ * HTTP servlet response
+ * @param epAppsManualPref
+ * sort pref
+ * @return FieldsValidator
*/
@RequestMapping(value = {
"/portalApi/saveUserAppsSortingManual" }, method = RequestMethod.PUT, produces = "application/json")
public FieldsValidator putUserAppsSortingManual(HttpServletRequest request,
- @RequestBody List<EPAppsManualPreference> epAppsManualPref, HttpServletResponse response)
- throws IOException {
+ @RequestBody List<EPAppsManualPreference> epAppsManualPref, HttpServletResponse response) {
FieldsValidator fieldsValidator = null;
try {
EPUser user = EPUserUtils.getUserSession(request);
return fieldsValidator;
}
- /*
- * This method is being called to delete the user app manual sort preference
- * record
- *
- * @request: HTTP servlet request
+ /**
+ * Deletes the user app manual sort preference record
*
- * @response: HTTP servlet response
+ * @param request
+ * HTTP servlet request
+ * @param response
+ * HTTP servlet response
+ * @param delManualAppData
+ * data to delete
+ * @return FieldsValidator
*/
@RequestMapping(value = {
"/portalApi/UpdateUserAppsSortManual" }, method = RequestMethod.PUT, produces = "application/json")
* Administrator user. Attention: Users which have Super Administrator roles
* only are not included!
*
- * @return
+ * @param request
+ * HTTP servlet request
+ * @param response
+ * HTTP servlet response
+ * @return List<AdminUserApplications>
*/
@RequestMapping(value = { "/portalApi/accountAdmins" }, method = RequestMethod.GET, produces = "application/json")
public List<AdminUserApplications> getAppsAdministrators(HttpServletRequest request, HttpServletResponse response) {
* regardless of enabled status.
*
* @param request
+ * HTTP servlet request
* @param response
+ * HTTP servlet response
* @return List of applications
*/
- // This API returns
@RequestMapping(value = {
"/portalApi/allAvailableApps" }, method = RequestMethod.GET, produces = "application/json")
public List<AppsResponse> getAllApps(HttpServletRequest request, HttpServletResponse response) {
/**
*
* @param request
+ * HTTP servlet request
* @param response
- * @return
+ * HTTP servlet response
+ * @return List of applications
*/
@RequestMapping(value = { "/portalApi/appsFullList" }, method = RequestMethod.GET, produces = "application/json")
public List<EcompApp> getAppsFullList(HttpServletRequest request, HttpServletResponse response) {
/**
*
* @param request
+ * HTTP servlet request
* @param response
- * @return
+ * HTTP servlet response
+ * @return UserRoles
*/
@RequestMapping(value = { "/portalApi/userProfile" }, method = RequestMethod.GET, produces = "application/json")
public UserRoles getUserProfile(HttpServletRequest request, HttpServletResponse response) {
/**
*
* @param request
+ * HTTP servlet request
* @param appId
- * @return
+ * application ID
+ * @return List<LocalRole>
*/
@RequestMapping(value = { "/portalApi/appRoles/{appId}" }, method = {
RequestMethod.GET }, produces = "application/json")
/**
*
* @param request
+ * HTTP servlet request
* @param response
- * @return
+ * HTTP servlet response
+ * @return List<OnboardingApp>
*/
@RequestMapping(value = { "/portalApi/onboardingApps" }, method = RequestMethod.GET, produces = "application/json")
public List<OnboardingApp> getOnboardingApps(HttpServletRequest request, HttpServletResponse response) {
/**
*
* @param request
- * @param modifiedOnboardingApp
+ * HTTP servlet request
* @param response
- * @return
+ * HTTP servlet response
+ * @param modifiedOnboardingApp
+ * app to update
+ * @return FieldsValidator
*/
@RequestMapping(value = { "/portalApi/onboardingApps" }, method = RequestMethod.PUT, produces = "application/json")
public FieldsValidator putOnboardingApp(HttpServletRequest request,
/**
*
* @param request
- * @param newOnboardingApp
+ * HTTP servlet request
* @param response
- * @return
+ * HTTP servlet response
+ * @param newOnboardingApp
+ * app to add
+ * @return FieldsValidator
*/
@RequestMapping(value = { "/portalApi/onboardingApps" }, method = RequestMethod.POST, produces = "application/json")
public FieldsValidator postOnboardingApp(HttpServletRequest request, @RequestBody OnboardingApp newOnboardingApp,
* REST endpoint to process a request to delete an on-boarded application.
*
* @param request
- * @param appId
+ * HTTP servlet request
* @param response
- * @return
+ * HTTP servlet response
+ * @param appId
+ * ID of app to delete
+ * @return FieldsValidator
*/
@RequestMapping(value = { "/portalApi/onboardingApps/{appId}" }, method = {
RequestMethod.DELETE }, produces = "application/json")
* Gets the application thumbnail image; sets status 404 if none exists.
*
* @param request
- * HttpServletRequest
+ * HTTP servlet request
+ * @param response
+ * HTTP servlet response
* @param appId
* Application ID
* @return Bytes with the app thumbnail image; null if not available.