2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
8 * Unless otherwise specified, all software contained herein is licensed
9 * under the Apache License, Version 2.0 (the "License");
10 * you may not use this software except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * Unless otherwise specified, all documentation contained herein is licensed
22 * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23 * you may not use this documentation except in compliance with the License.
24 * You may obtain a copy of the License at
26 * https://creativecommons.org/licenses/by/4.0/
28 * Unless required by applicable law or agreed to in writing, documentation
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
34 * ============LICENSE_END============================================
38 package org.onap.portalapp.portal.service;
40 import java.util.List;
42 import org.onap.portalapp.portal.domain.AdminUserApplications;
43 import org.onap.portalapp.portal.domain.AppIdAndNameTransportModel;
44 import org.onap.portalapp.portal.domain.AppsResponse;
45 import org.onap.portalapp.portal.domain.EPApp;
46 import org.onap.portalapp.portal.domain.EPUser;
47 import org.onap.portalapp.portal.domain.EcompApp;
48 import org.onap.portalapp.portal.domain.UserRoles;
49 import org.onap.portalapp.portal.ecomp.model.AppCatalogItem;
50 import org.onap.portalapp.portal.transport.EPAppsManualPreference;
51 import org.onap.portalapp.portal.transport.EPAppsSortPreference;
52 import org.onap.portalapp.portal.transport.EPDeleteAppsManualSortPref;
53 import org.onap.portalapp.portal.transport.EPWidgetsSortPreference;
54 import org.onap.portalapp.portal.transport.FieldsValidator;
55 import org.onap.portalapp.portal.transport.LocalRole;
56 import org.onap.portalapp.portal.transport.OnboardingApp;
57 import org.springframework.http.ResponseEntity;
59 public interface EPAppService {
62 * Get all applications adminId is an admin
66 * @return the admin's applications
68 List<EPApp> getUserAsAdminApps(EPUser user);
70 List<EPApp> getUserByOrgUserIdAsAdminApps(String orgUserId);
73 * Gets all rows and all fields from the fn_app table.
75 * @return list of EPApp objects
77 List<EPApp> getAppsFullList();
80 * Gets all rows and most fields from the fn_app table.
82 * @return list of EcompApp objects.
84 List<EcompApp> getEcompAppAppsFullList();
87 * Get apps with app app admins
89 * @return List of AdminUserApplications
91 List<AdminUserApplications> getAppsAdmins();
94 * Get all apps from fn_app table (index, name, title only).
97 * If all is true, returns active and inactive apps; otherwise,
99 * @return List of AppsResponse objects.
101 List<AppsResponse> getAllApps(Boolean all);
103 UserRoles getUserProfile(String loginId);
105 UserRoles getUserProfileNormalized(EPUser user);
107 List<LocalRole> getAppRoles(Long appId);
109 List<AppIdAndNameTransportModel> getAdminApps(EPUser user);
111 List<AppIdAndNameTransportModel> getAppsForSuperAdminAndAccountAdmin(EPUser user);
114 * Gets the applications accessible to the specified user, which includes
115 * all enabled open applications, plus all enabled applications for which
116 * the user has a defined role for that app.
119 * EPUser object with the user's Org User ID
120 * @return the user's list of applications, which may be empty.
122 List<EPApp> getUserApps(EPUser user);
125 * Gets the user-personalized list of applications for the Portal (super)
126 * admin, which includes enabled open applications, enabled applications for
127 * which the user has a defined role for that app, and/or enabled
128 * applications which the user has chosen to show.
131 * EPUser object with the user's Org User ID
132 * @return the user's personalized list of applications, which may be empty.
134 List<EPApp> getPersAdminApps(EPUser user);
137 * Gets the user-personalized list of accessible applications, which
138 * includes enabled open applications and/or enabled applications for which
139 * the user has a defined role for that app. Personalization means the user
140 * can indicate an accessible application should be excluded from this
144 * EPUser object with the user's Org User ID
145 * @return the user's personalized list of applications, which may be empty.
147 List<EPApp> getPersUserApps(EPUser user);
150 * Gets the application catalog for the specified user who is a super admin.
151 * This includes all enabled applications. Each item indicates whether the
152 * user has access (open or via a role), and whether the application is
153 * selected for showing in the user's home (applications) page. Admin sees
154 * slightly different behavior - can force an app onto the home page using
155 * the personalization feature (user-app-selection table).
158 * @return list of all enabled applications, which may be empty
160 List<AppCatalogItem> getAdminAppCatalog(EPUser user);
163 * Gets the application catalog for the specified user, who is a regular
164 * user. This includes all enabled applications. Each item indicates whether
165 * the user has access (open or via a role), and whether the application is
166 * selected for showing in the user's home (applications) page.
169 * @return list of all enabled applications, which may be empty
171 List<AppCatalogItem> getUserAppCatalog(EPUser user);
173 List<OnboardingApp> getOnboardingApps();
175 List<OnboardingApp> getEnabledNonOpenOnboardingApps();
177 FieldsValidator modifyOnboardingApp(OnboardingApp modifiedOnboardingApp, EPUser user);
179 FieldsValidator addOnboardingApp(OnboardingApp newOnboardingApp, EPUser user);
182 * Deletes the specified application from all tables where the app_id is
183 * used, and ultimately from the fn_app table.
186 * Must be Portal (super) administrator
187 * @param onboardingAppId
188 * ID of application to be deleted
189 * @return Status code
191 FieldsValidator deleteOnboardingApp(EPUser user, Long onboardingAppId);
193 List<EcompApp> transformAppsToEcompApps(List<EPApp> appsList);
195 EPApp getApp(Long appId);
197 EPApp getAppDetail(String appName);
201 * It return app information
203 * @param appName it contains application name
206 EPApp getAppDetailByAppName(String appName);
208 List<EPApp> getAppsOrderByName(EPUser user);
210 FieldsValidator saveAppsSortPreference(EPAppsSortPreference appsSortPreference, EPUser user);
212 FieldsValidator saveAppsSortManual(List<EPAppsManualPreference> appsSortManual, EPUser user);
214 FieldsValidator saveWidgetsSortManual(List<EPWidgetsSortPreference> widgetsSortManual, EPUser user);
217 * Deletes the sort order of user apps by sort manual preference
219 * @param delAppSortManual
223 * @return FieldsValidator
225 FieldsValidator deleteUserAppSortManual(EPDeleteAppsManualSortPref delAppSortManual, EPUser user);
227 FieldsValidator deleteUserWidgetSortPref(List<EPWidgetsSortPreference> delWidgetSortPref, EPUser user);
229 String getUserAppsSortTypePreference(EPUser user);
231 List<EPApp> getAppsOrderByLastUsed(EPUser user);
233 List<EPApp> getAppsOrderByMostUsed(EPUser user);
235 List<EPApp> getAppsOrderByManual(EPUser user);
237 List<EPApp> getUserRemoteApps(String id);
239 void createOnboardingFromApp(EPApp app, OnboardingApp onboardingApp);
241 UserRoles getUserProfileNormalizedForLeftMenu(EPUser user);
243 UserRoles getUserProfileForLeftMenu(String loginId);
245 UserRoles getUserProfileForRolesLeftMenu(String loginId);
247 UserRoles getUserProfileNormalizedForRolesLeftMenu(EPUser user);
248 public List<OnboardingApp> getAdminAppsOfUser(EPUser user);
250 public ResponseEntity<String> checkIfNameSpaceIsValid(String namespace) throws Exception ;
252 List<AppsResponse> getAllApplications(Boolean all);