1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
|
/*-
* ================================================================================
* 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.
* You may obtain a copy of the License at
*
* 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.
* ================================================================================
*/
package org.openecomp.portalapp.portal.service;
import java.util.List;
import org.openecomp.portalapp.portal.domain.AdminUserApplications;
import org.openecomp.portalapp.portal.domain.AppIdAndNameTransportModel;
import org.openecomp.portalapp.portal.domain.AppsResponse;
import org.openecomp.portalapp.portal.domain.EPApp;
import org.openecomp.portalapp.portal.domain.EPUser;
import org.openecomp.portalapp.portal.domain.EcompApp;
import org.openecomp.portalapp.portal.domain.UserRoles;
import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem;
import org.openecomp.portalapp.portal.transport.EPAppsManualPreference;
import org.openecomp.portalapp.portal.transport.EPAppsSortPreference;
import org.openecomp.portalapp.portal.transport.EPDeleteAppsManualSortPref;
import org.openecomp.portalapp.portal.transport.EPWidgetsSortPreference;
import org.openecomp.portalapp.portal.transport.FieldsValidator;
import org.openecomp.portalapp.portal.transport.LocalRole;
import org.openecomp.portalapp.portal.transport.OnboardingApp;
public interface EPAppService {
/**
* Get all applications adminId is an admin
*
* @param user
* the admin user
* @return the admin's applications
*/
List<EPApp> getUserAsAdminApps(EPUser user);
List<EPApp> getUserByOrgUserIdAsAdminApps(String orgUserId);
/**
* Gets all rows and all fields from the fn_app table.
*
* @return list of EPApp objects
*/
List<EPApp> getAppsFullList();
/**
* Gets all rows and most fields from the fn_app table.
*
* @return list of EcompApp objects.
*/
List<EcompApp> getEcompAppAppsFullList();
/**
* Get apps with app app admins
*
* @return List of AdminUserApplications
*/
List<AdminUserApplications> getAppsAdmins();
/**
* Get all apps from fn_app table (index, name, title only).
*
* @param all
* If all is true, returns active and inactive apps; otherwise,
* just active apps.
* @return List of AppsResponse objects.
*/
List<AppsResponse> getAllApps(Boolean all);
UserRoles getUserProfile(String loginId);
UserRoles getUserProfileNormalized(EPUser user);
List<LocalRole> getAppRoles(Long appId);
List<AppIdAndNameTransportModel> getAdminApps(EPUser user);
List<AppIdAndNameTransportModel> getAppsForSuperAdminAndAccountAdmin(EPUser user);
/**
* Gets the applications accessible to the specified user, which includes
* all enabled open applications, plus all enabled applications for which
* the user has a defined role for that app.
*
* @param user
* EPUser object with the user's ATT UID
* @return the user's list of applications, which may be empty.
*/
List<EPApp> getUserApps(EPUser user);
/**
* Gets the user-personalized list of applications for the Portal (super)
* admin, which includes enabled open applications, enabled applications for
* which the user has a defined role for that app, and/or enabled
* applications which the user has chosen to show.
*
* @param user
* EPUser object with the user's ATT UID
* @return the user's personalized list of applications, which may be empty.
*/
List<EPApp> getPersAdminApps(EPUser user);
/**
* Gets the user-personalized list of accessible applications, which
* includes enabled open applications and/or enabled applications for which
* the user has a defined role for that app. Personalization means the user
* can indicate an accessible application should be excluded from this
* result.
*
* @param user
* EPUser object with the user's ATT UID
* @return the user's personalized list of applications, which may be empty.
*/
List<EPApp> getPersUserApps(EPUser user);
/**
* Gets the application catalog for the specified user who is a super admin.
* This includes all enabled applications. Each item indicates whether the
* user has access (open or via a role), and whether the application is
* selected for showing in the user's home (applications) page. Admin sees
* slightly different behavior - can force an app onto the home page using
* the personalization feature (user-app-selection table).
*
* @param user
* @return list of all enabled applications, which may be empty
*/
List<AppCatalogItem> getAdminAppCatalog(EPUser user);
/**
* Gets the application catalog for the specified user, who is a regular
* user. This includes all enabled applications. Each item indicates whether
* the user has access (open or via a role), and whether the application is
* selected for showing in the user's home (applications) page.
*
* @param user
* @return list of all enabled applications, which may be empty
*/
List<AppCatalogItem> getUserAppCatalog(EPUser user);
List<OnboardingApp> getOnboardingApps();
List<OnboardingApp> getEnabledNonOpenOnboardingApps();
FieldsValidator modifyOnboardingApp(OnboardingApp modifiedOnboardingApp, EPUser user);
FieldsValidator addOnboardingApp(OnboardingApp newOnboardingApp, EPUser user);
/**
* Deletes the specified application from all tables where the app_id is
* used, and ultimately from the fn_app table.
*
* @param user
* Must be Portal (super) administrator
* @param onboardingAppId
* ID of application to be deleted
* @return Status code
*/
FieldsValidator deleteOnboardingApp(EPUser user, Long onboardingAppId);
List<EcompApp> transformAppsToEcompApps(List<EPApp> appsList);
EPApp getApp(Long appId);
EPApp getAppDetail(String appName);
List<EPApp> getAppsOrderByName(EPUser user);
FieldsValidator saveAppsSortPreference(EPAppsSortPreference appsSortPreference, EPUser user);
FieldsValidator saveAppsSortManual(List<EPAppsManualPreference> appsSortManual, EPUser user);
FieldsValidator saveWidgetsSortManual(List<EPWidgetsSortPreference> widgetsSortManual, EPUser user);
/**
* Deletes the sort order of user apps by sort manual preference
*
* @param delAppSortManual
* User Apps Data
* @param user
* LoggedIn User Data
* @return FieldsValidator
*/
FieldsValidator deleteUserAppSortManual(EPDeleteAppsManualSortPref delAppSortManual, EPUser user);
FieldsValidator deleteUserWidgetSortPref(List<EPWidgetsSortPreference> delWidgetSortPref, EPUser user);
String getUserAppsSortTypePreference(EPUser user);
List<EPApp> getAppsOrderByLastUsed(EPUser user);
List<EPApp> getAppsOrderByMostUsed(EPUser user);
List<EPApp> getAppsOrderByManual(EPUser user);
List<EPApp> getUserRemoteApps(String id);
void createOnboardingFromApp(EPApp app, OnboardingApp onboardingApp);
}
|