2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ================================================================================
20 package org.openecomp.portalapp.portal.service;
22 import java.util.List;
24 import org.openecomp.portalapp.portal.domain.AdminUserApplications;
25 import org.openecomp.portalapp.portal.domain.AppIdAndNameTransportModel;
26 import org.openecomp.portalapp.portal.domain.AppsResponse;
27 import org.openecomp.portalapp.portal.domain.EPApp;
28 import org.openecomp.portalapp.portal.domain.EPUser;
29 import org.openecomp.portalapp.portal.domain.EcompApp;
30 import org.openecomp.portalapp.portal.domain.UserRoles;
31 import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem;
32 import org.openecomp.portalapp.portal.transport.EPAppsManualPreference;
33 import org.openecomp.portalapp.portal.transport.EPAppsSortPreference;
34 import org.openecomp.portalapp.portal.transport.EPDeleteAppsManualSortPref;
35 import org.openecomp.portalapp.portal.transport.EPWidgetsSortPreference;
36 import org.openecomp.portalapp.portal.transport.FieldsValidator;
37 import org.openecomp.portalapp.portal.transport.LocalRole;
38 import org.openecomp.portalapp.portal.transport.OnboardingApp;
40 public interface EPAppService {
43 * Get all applications adminId is an admin
47 * @return the admin's applications
49 List<EPApp> getUserAsAdminApps(EPUser user);
51 List<EPApp> getUserByOrgUserIdAsAdminApps(String orgUserId);
54 * Gets all rows and all fields from the fn_app table.
56 * @return list of EPApp objects
58 List<EPApp> getAppsFullList();
61 * Gets all rows and most fields from the fn_app table.
63 * @return list of EcompApp objects.
65 List<EcompApp> getEcompAppAppsFullList();
68 * Get apps with app app admins
70 * @return List of AdminUserApplications
72 List<AdminUserApplications> getAppsAdmins();
75 * Get all apps from fn_app table (index, name, title only).
78 * If all is true, returns active and inactive apps; otherwise,
80 * @return List of AppsResponse objects.
82 List<AppsResponse> getAllApps(Boolean all);
84 UserRoles getUserProfile(String loginId);
86 UserRoles getUserProfileNormalized(EPUser user);
88 List<LocalRole> getAppRoles(Long appId);
90 List<AppIdAndNameTransportModel> getAdminApps(EPUser user);
92 List<AppIdAndNameTransportModel> getAppsForSuperAdminAndAccountAdmin(EPUser user);
95 * Gets the applications accessible to the specified user, which includes
96 * all enabled open applications, plus all enabled applications for which
97 * the user has a defined role for that app.
100 * EPUser object with the user's Org User ID
101 * @return the user's list of applications, which may be empty.
103 List<EPApp> getUserApps(EPUser user);
106 * Gets the user-personalized list of applications for the Portal (super)
107 * admin, which includes enabled open applications, enabled applications for
108 * which the user has a defined role for that app, and/or enabled
109 * applications which the user has chosen to show.
112 * EPUser object with the user's Org User ID
113 * @return the user's personalized list of applications, which may be empty.
115 List<EPApp> getPersAdminApps(EPUser user);
118 * Gets the user-personalized list of accessible applications, which
119 * includes enabled open applications and/or enabled applications for which
120 * the user has a defined role for that app. Personalization means the user
121 * can indicate an accessible application should be excluded from this
125 * EPUser object with the user's Org User ID
126 * @return the user's personalized list of applications, which may be empty.
128 List<EPApp> getPersUserApps(EPUser user);
131 * Gets the application catalog for the specified user who is a super admin.
132 * This includes all enabled applications. Each item indicates whether the
133 * user has access (open or via a role), and whether the application is
134 * selected for showing in the user's home (applications) page. Admin sees
135 * slightly different behavior - can force an app onto the home page using
136 * the personalization feature (user-app-selection table).
139 * @return list of all enabled applications, which may be empty
141 List<AppCatalogItem> getAdminAppCatalog(EPUser user);
144 * Gets the application catalog for the specified user, who is a regular
145 * user. This includes all enabled applications. Each item indicates whether
146 * the user has access (open or via a role), and whether the application is
147 * selected for showing in the user's home (applications) page.
150 * @return list of all enabled applications, which may be empty
152 List<AppCatalogItem> getUserAppCatalog(EPUser user);
154 List<OnboardingApp> getOnboardingApps();
156 List<OnboardingApp> getEnabledNonOpenOnboardingApps();
158 FieldsValidator modifyOnboardingApp(OnboardingApp modifiedOnboardingApp, EPUser user);
160 FieldsValidator addOnboardingApp(OnboardingApp newOnboardingApp, EPUser user);
163 * Deletes the specified application from all tables where the app_id is
164 * used, and ultimately from the fn_app table.
167 * Must be Portal (super) administrator
168 * @param onboardingAppId
169 * ID of application to be deleted
170 * @return Status code
172 FieldsValidator deleteOnboardingApp(EPUser user, Long onboardingAppId);
174 List<EcompApp> transformAppsToEcompApps(List<EPApp> appsList);
176 EPApp getApp(Long appId);
178 EPApp getAppDetail(String appName);
180 List<EPApp> getAppsOrderByName(EPUser user);
182 FieldsValidator saveAppsSortPreference(EPAppsSortPreference appsSortPreference, EPUser user);
184 FieldsValidator saveAppsSortManual(List<EPAppsManualPreference> appsSortManual, EPUser user);
186 FieldsValidator saveWidgetsSortManual(List<EPWidgetsSortPreference> widgetsSortManual, EPUser user);
189 * Deletes the sort order of user apps by sort manual preference
191 * @param delAppSortManual
195 * @return FieldsValidator
197 FieldsValidator deleteUserAppSortManual(EPDeleteAppsManualSortPref delAppSortManual, EPUser user);
199 FieldsValidator deleteUserWidgetSortPref(List<EPWidgetsSortPreference> delWidgetSortPref, EPUser user);
201 String getUserAppsSortTypePreference(EPUser user);
203 List<EPApp> getAppsOrderByLastUsed(EPUser user);
205 List<EPApp> getAppsOrderByMostUsed(EPUser user);
207 List<EPApp> getAppsOrderByManual(EPUser user);
209 List<EPApp> getUserRemoteApps(String id);
211 void createOnboardingFromApp(EPApp app, OnboardingApp onboardingApp);
213 UserRoles getUserProfileNormalizedForLeftMenu(EPUser user);
215 UserRoles getUserProfileForLeftMenu(String loginId);