summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-analytics/src/main/java/org/openecomp/portalsdk/analytics/system/IAppUtils.java
blob: e459dde79ea12f176bfb46dad6be1dd5691a7650 (plain)
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
/*-
 * ================================================================================
 * eCOMP Portal SDK
 * ================================================================================
 * 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.portalsdk.analytics.system;

import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

import org.openecomp.portalsdk.analytics.error.RaptorException;
import org.openecomp.portalsdk.analytics.error.ReportSQLException;

public interface IAppUtils {
	void initializeAppUtils(ServletContext servletContext);

	/** Returns ID of the user currently logged in */
	String getUserID(HttpServletRequest request);

	/** Obtains user name by ID */
	String getUserName(HttpServletRequest request);
	String getUserName(String userId);
    
    /** Obtains user email by ID */    
    String getUserEmail(HttpServletRequest request);    
    String getUserEmail(String userId);    

    /** Obtains user login ID */    
    String getUserLoginId(HttpServletRequest request);    
    String getUserLoginId(String userId);    

    /** Obtains user back door log id */    
    String getUserBackdoorLoginId(HttpServletRequest request);    

    /** Obtains list of all users (in IdNameValue objects) */
	Vector getAllUsers(String customizedQuery, String param, boolean isAdmin);

	/** Obtains role name by ID */
	String getRoleName(String roleId);

	/** Obtains list of all roles (in IdNameValue objects) */
	Vector getAllRoles(String customizedQuery, String param, boolean isAdmin);

	/** Checks whether the user currently logged in has the specified role */
	// boolean isUserInRole(HttpServletRequest request, String roleId);
	/** Checks whether the specified user has the specified role */
	boolean isUserInRole(HttpServletRequest request, String roleId)  throws RaptorException ;

	/**
	 * Returns Vector containing the IDs of all the roles to which the user
	 * currently logged in belongs
	 */
	// Vector getUserRoles(HttpServletRequest request);
	/**
	 * Returns Vector containing the IDs of all the roles to which the specified
	 * user belongs
	 */
	Vector getUserRoles(HttpServletRequest request)throws RaptorException;

	Vector getUserRoles(String userID)throws RaptorException;
	/** Empties cached lists of app users and roles */
	void resetUserCache();

	/** Returns the ID of the super role (all powerful) */
	String getSuperRoleID();

	/** Returns Vector containing the IDs of all Admin roles */
	Vector getAdminRoleIDs();

	/** Returns Temp folder file path */
	String getTempFolderPath();

	/** Returns Upload folder file path */
	String getUploadFolderPath();

	/** Returns Temp folder web URL */
	String getTempFolderURL();

	/** Returns Upload folder web URL */
	String getUploadFolderURL();

	/** Returns SMTP server to be used for notifications */
	String getSMTPServer()throws RaptorException ;

	/** Returns Encrypted SMTP server to be used for notifications */
	String getEncryptedSMTPServer()throws RaptorException ;

	/**
	 * Returns email address used for the "From" field in the system
	 * notifications
	 */
	String getDefaultEmailSender() throws RaptorException;

	/** Returns the application error page */
	String getErrorPage();
	
	/** Returns the application error page with menu for fusion*/
	String getErrorPageWMenu();

	/** Returns path to the folder containing JSP pages */
	String getJspContextPath();

	/** Returns web URL of the folder containing the images */
	String getImgFolderURL();

	/** Returns web URL to the base raptor folder */
	String getBaseFolderURL();

	/** Returns the URL used for executing a report - system specific */
	// String getReportExecuteActionURL();
	/** Returns the URL used for displaying data record - system specific */
	// String getDataViewActionURL();
	/**
	 * Returns the parameter name of the ID value used for displaying data
	 * record - system specific
	 */
	// String getDataViewActionParam();
	/** Returns full web URL for direct access to execute a report */
	String getDirectAccessURL();

	/** Returns the URL of the controller servlet - system specific */
	String getBaseActionURL();

	/** Returns the base URL of the NG report - system specific */
	String getBaseActionURLNG();

	/** Returns the URL of the Report Run specifc to AngularJS */
	String getDrillActionURL();
	
	/** Returns the primary parameter name - system specific */
	String getBaseActionParam();

	/** Returns Vector containing menu IDs for quick links */
	Vector getQuickLinksMenuIDs();

	/** Obtains menu label by ID */
	String getMenuLabel(String menuId);

	/**
	 * SQL for loading the screen labels and restricting to active cols only for
	 * report columns; can return null => use straight data dictionary For
	 * PRISMS - based on "useFieldTable" config parameter
	 */
	String getReportDbColsMaskSQL();

	/**
	 * SQL for replacing lookup tables with id and name values; can return null =>
	 * do NOT replace lookups Returns SQL with columns - Table_name, Field_name,
	 * New_Lookup_Table_name, New_Lookup_Id_Field_name,
	 * New_Lookup_Name_Field_name For PRISMS - based on "useFieldTable" config
	 * parameter
	 */
	String getReportDbLookupsSQL();

	/** Obtains menu label by ID */
	void processErrorNotification(HttpServletRequest request, RaptorException e);
	
	/** Returns Excel template PATH web URL */
	String getExcelTemplatePath();
	
	String getFolderPathAdj();
} // IAppUtils