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