2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright © 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============================================
36 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
38 package org.openecomp.portalapp.portal.service;
40 import java.util.List;
42 import org.openecomp.portalapp.portal.domain.AdminUserApplications;
43 import org.openecomp.portalapp.portal.domain.AppIdAndNameTransportModel;
44 import org.openecomp.portalapp.portal.domain.AppsResponse;
45 import org.openecomp.portalapp.portal.domain.EPApp;
46 import org.openecomp.portalapp.portal.domain.EPUser;
47 import org.openecomp.portalapp.portal.domain.EcompApp;
48 import org.openecomp.portalapp.portal.domain.UserRoles;
49 import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem;
50 import org.openecomp.portalapp.portal.transport.EPAppsManualPreference;
51 import org.openecomp.portalapp.portal.transport.EPAppsSortPreference;
52 import org.openecomp.portalapp.portal.transport.EPDeleteAppsManualSortPref;
53 import org.openecomp.portalapp.portal.transport.EPWidgetsSortPreference;
54 import org.openecomp.portalapp.portal.transport.FieldsValidator;
55 import org.openecomp.portalapp.portal.transport.LocalRole;
56 import org.openecomp.portalapp.portal.transport.OnboardingApp;
58 public interface EPAppService {
61 * Get all applications adminId is an admin
65 * @return the admin's applications
67 List<EPApp> getUserAsAdminApps(EPUser user);
69 List<EPApp> getUserByOrgUserIdAsAdminApps(String orgUserId);
72 * Gets all rows and all fields from the fn_app table.
74 * @return list of EPApp objects
76 List<EPApp> getAppsFullList();
79 * Gets all rows and most fields from the fn_app table.
81 * @return list of EcompApp objects.
83 List<EcompApp> getEcompAppAppsFullList();
86 * Get apps with app app admins
88 * @return List of AdminUserApplications
90 List<AdminUserApplications> getAppsAdmins();
93 * Get all apps from fn_app table (index, name, title only).
96 * If all is true, returns active and inactive apps; otherwise,
98 * @return List of AppsResponse objects.
100 List<AppsResponse> getAllApps(Boolean all);
102 UserRoles getUserProfile(String loginId);
104 UserRoles getUserProfileNormalized(EPUser user);
106 List<LocalRole> getAppRoles(Long appId);
108 List<AppIdAndNameTransportModel> getAdminApps(EPUser user);
110 List<AppIdAndNameTransportModel> getAppsForSuperAdminAndAccountAdmin(EPUser user);
113 * Gets the applications accessible to the specified user, which includes
114 * all enabled open applications, plus all enabled applications for which
115 * the user has a defined role for that app.
118 * EPUser object with the user's Org User ID
119 * @return the user's list of applications, which may be empty.
121 List<EPApp> getUserApps(EPUser user);
124 * Gets the user-personalized list of applications for the Portal (super)
125 * admin, which includes enabled open applications, enabled applications for
126 * which the user has a defined role for that app, and/or enabled
127 * applications which the user has chosen to show.
130 * EPUser object with the user's Org User ID
131 * @return the user's personalized list of applications, which may be empty.
133 List<EPApp> getPersAdminApps(EPUser user);
136 * Gets the user-personalized list of accessible applications, which
137 * includes enabled open applications and/or enabled applications for which
138 * the user has a defined role for that app. Personalization means the user
139 * can indicate an accessible application should be excluded from this
143 * EPUser object with the user's Org User ID
144 * @return the user's personalized list of applications, which may be empty.
146 List<EPApp> getPersUserApps(EPUser user);
149 * Gets the application catalog for the specified user who is a super admin.
150 * This includes all enabled applications. Each item indicates whether the
151 * user has access (open or via a role), and whether the application is
152 * selected for showing in the user's home (applications) page. Admin sees
153 * slightly different behavior - can force an app onto the home page using
154 * the personalization feature (user-app-selection table).
157 * @return list of all enabled applications, which may be empty
159 List<AppCatalogItem> getAdminAppCatalog(EPUser user);
162 * Gets the application catalog for the specified user, who is a regular
163 * user. This includes all enabled applications. Each item indicates whether
164 * the user has access (open or via a role), and whether the application is
165 * selected for showing in the user's home (applications) page.
168 * @return list of all enabled applications, which may be empty
170 List<AppCatalogItem> getUserAppCatalog(EPUser user);
172 List<OnboardingApp> getOnboardingApps();
174 List<OnboardingApp> getEnabledNonOpenOnboardingApps();
176 FieldsValidator modifyOnboardingApp(OnboardingApp modifiedOnboardingApp, EPUser user);
178 FieldsValidator addOnboardingApp(OnboardingApp newOnboardingApp, EPUser user);
181 * Deletes the specified application from all tables where the app_id is
182 * used, and ultimately from the fn_app table.
185 * Must be Portal (super) administrator
186 * @param onboardingAppId
187 * ID of application to be deleted
188 * @return Status code
190 FieldsValidator deleteOnboardingApp(EPUser user, Long onboardingAppId);
192 List<EcompApp> transformAppsToEcompApps(List<EPApp> appsList);
194 EPApp getApp(Long appId);
196 EPApp getAppDetail(String appName);
198 List<EPApp> getAppsOrderByName(EPUser user);
200 FieldsValidator saveAppsSortPreference(EPAppsSortPreference appsSortPreference, EPUser user);
202 FieldsValidator saveAppsSortManual(List<EPAppsManualPreference> appsSortManual, EPUser user);
204 FieldsValidator saveWidgetsSortManual(List<EPWidgetsSortPreference> widgetsSortManual, EPUser user);
207 * Deletes the sort order of user apps by sort manual preference
209 * @param delAppSortManual
213 * @return FieldsValidator
215 FieldsValidator deleteUserAppSortManual(EPDeleteAppsManualSortPref delAppSortManual, EPUser user);
217 FieldsValidator deleteUserWidgetSortPref(List<EPWidgetsSortPreference> delWidgetSortPref, EPUser user);
219 String getUserAppsSortTypePreference(EPUser user);
221 List<EPApp> getAppsOrderByLastUsed(EPUser user);
223 List<EPApp> getAppsOrderByMostUsed(EPUser user);
225 List<EPApp> getAppsOrderByManual(EPUser user);
227 List<EPApp> getUserRemoteApps(String id);
229 void createOnboardingFromApp(EPApp app, OnboardingApp onboardingApp);
231 UserRoles getUserProfileNormalizedForLeftMenu(EPUser user);
233 UserRoles getUserProfileForLeftMenu(String loginId);