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.transport.FieldsValidator;
32 import org.openecomp.portalapp.portal.transport.LocalRole;
33 import org.openecomp.portalapp.portal.transport.OnboardingApp;
34 import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem;
36 public interface EPAppService {
39 * Get all applications adminId is an admin
43 * @return the admin's applications
45 List<EPApp> getUserAsAdminApps(EPUser user);
47 List<EPApp> getUserByOrgUserIdAsAdminApps(String attuid);
50 * Gets all rows and all fields from the fn_app table.
52 * @return list of EPApp objects
54 List<EPApp> getAppsFullList();
57 * Gets all rows and most fields from the fn_app table.
59 * @return list of EcompApp objects.
61 List<EcompApp> getEcompAppAppsFullList();
64 * Get apps with app app admins
68 List<AdminUserApplications> getAppsAdmins();
71 * Get all apps from fn_app table (index, name, title only). If all is true,
72 * return active and inactive apps; otherwise, just active apps.
74 * @return List of AppsResponse objects.
76 List<AppsResponse> getAllApps(Boolean all);
78 UserRoles getUserProfile(String loginId);
80 List<LocalRole> getAppRoles(Long appId);
82 List<AppIdAndNameTransportModel> getAdminApps(EPUser user);
84 List<AppIdAndNameTransportModel> getAppsForSuperAdminAndAccountAdmin(EPUser user);
86 List<EPApp> getUserRemoteApps(String id);
89 * Gets the applications accessible to the specified user, which includes
90 * all enabled open applications, plus all enabled applications for which
91 * the user has a defined role for that app.
94 * EPUser object with the user's UID
95 * @return the user's list of applications, which may be empty.
97 List<EPApp> getUserApps(EPUser user);
100 * Gets the user-personalized list of applications for the Portal (super)
101 * admin, which includes enabled open applications, enabled applications for
102 * which the user has a defined role for that app, and/or enabled
103 * applications which the user has chosen to show.
106 * EPUser object with the user's UID
107 * @return the user's personalized list of applications, which may be empty.
109 List<EPApp> getPersAdminApps(EPUser user);
112 * Gets the user-personalized list of accessible applications, which
113 * includes enabled open applications and/or enabled applications for which
114 * the user has a defined role for that app. Personalization means the user
115 * can indicate an accessible application should be excluded from this
119 * EPUser object with the user's UID
120 * @return the user's personalized list of applications, which may be empty.
122 List<EPApp> getPersUserApps(EPUser user);
125 * Gets the application catalog for the specified user who is a super admin.
126 * This includes all enabled applications. Each item indicates whether the
127 * user has access (open or via a role), and whether the application is
128 * selected for showing in the user's home (applications) page. Admin sees
129 * slightly different behavior - can force an app onto the home page using
130 * the personalization feature (user-app-selection table).
133 * @return list of all enabled applications, which may be empty
135 List<AppCatalogItem> getAdminAppCatalog(EPUser user);
138 * Gets the application catalog for the specified user, who is a regular
139 * user. This includes all enabled applications. Each item indicates whether
140 * the user has access (open or via a role), and whether the application is
141 * selected for showing in the user's home (applications) page.
144 * @return list of all enabled applications, which may be empty
146 List<AppCatalogItem> getUserAppCatalog(EPUser user);
148 List<OnboardingApp> getOnboardingApps();
150 List<OnboardingApp> getEnabledNonOpenOnboardingApps();
152 FieldsValidator modifyOnboardingApp(OnboardingApp modifiedOnboardingApp, EPUser user);
154 FieldsValidator addOnboardingApp(OnboardingApp newOnboardingApp, EPUser user);
156 FieldsValidator deleteOnboardingApp(EPUser user, Long onboardingAppId);
158 List<EcompApp> transformAppsToEcompApps(List<EPApp> appsList);
160 EPApp getApp(Long appId);
162 void writeAppsImagesToDiskCacheIfNecessary();