1 PACKAGE JTF_DEBUG_PUB as
2 /* $Header: JTFPDBGS.pls 120.2 2006/02/20 02:17:33 snellepa ship $ */
3 -- Start of Comments
4 -- Package name : JTF_DEBUG_PUB
5 -- Purpose :
6 -- History :
7 -- NOTE :
8 -- End of Comments
9
10
11 /**
12 * The record type for a PL/SQL table (collection) used for TABLE mode.
13 * <p>
14 */
15
16 -- Changed for 4862507 , Cannot access Remote package variable
17 TYPE Debug_Rec_Type IS RECORD
18 (
19 module_name varchar2(240) := Chr(0),
20 debug_message varchar2(4000) := Chr(0)
21 );
22 TYPE Debug_Tbl_Type IS TABLE OF Debug_Rec_Type
23 INDEX BY BINARY_INTEGER;
24
25 G_MISS_DEBUG_TBL Debug_Tbl_Type;
26 G_EXC_OTHERS NUMBER := 100;
27 PAD_LENGTH NUMBER := 50;
28 FILE_LINESIZE NUMBER := 1023;
29
30 /** The format functions return a varchar2 which formats and concatenates
31 * the parameters passed to it.
32 *
33 * @parameter varchar2 name of the parameter e.g., 'COLUMN NAME'
34 * @value value of the parameter
35 *
36 */
37 FUNCTION FormatNumber(parameter in varchar2, value in number) RETURN VARCHAR2;
38 FUNCTION FormatDate(parameter in varchar2, value in date) RETURN VARCHAR2;
39 FUNCTION FormatChar(parameter in varchar2, value in varchar2) RETURN VARCHAR2;
40 FUNCTION FormatBoolean(parameter in varchar2, value in boolean) RETURN VARCHAR2;
41 FUNCTION FormatIndent(parameter in varchar2) RETURN VARCHAR2;
42 FUNCTION FormatSeperator RETURN VARCHAR2;
43
44 /** getVersion returns the Header information of this package */
45 FUNCTION getVersion RETURN VARCHAR2;
46
47 /** Debug writes debugging information to a file. It includes server
48 * debugging info and information passed through the p_debug_tbl.
49 *
50 * @param p_file_name filename (including the path) of the file where
51 * debugging information should be written to.
52 * CURRENTLY, NOT IMPLEMENTED.
53 * @param p_debug_tbl other (midtier, client) debugging information
54 * that needs to be written to the file.
55 * @param p_module The module that we need to use for selecting data
56 * from fnd_log_messages
57 */
58 PROCEDURE Debug(
59 p_file_name IN varchar2 := FND_API.G_MISS_CHAR,
60 p_debug_tbl IN debug_tbl_type := G_MISS_DEBUG_TBL,
61 p_module IN varchar2,
62 x_path OUT NOCOPY varchar2,
63 x_filename OUT NOCOPY varchar2,
64 x_msg_count OUT NOCOPY number,
65 X_MSG_DATA OUT NOCOPY VARCHAR2,
66 X_RETURN_STATUS OUT NOCOPY VARCHAR2
67 );
68 /*
69 * Start of Comments
70 *
71 * API name : Handle_Exceptions
72 * Type : Public
73 * Function : Exception handling routine
74 * 1. Called by Call_Exception_Handlers
75 * 2. Handle exception according to different
76 * p_exception_level
77 *
78 *
79 * Parameters :
80 * IN :
81 * p_api_name IN VARCHAR2
82 * p_pkg_name IN VARCHAR2
83 * p_exception_level IN NUMBER
84 * p_package_type IN VARCHAR2
85 * x_msg_count IN NUMBER
86 * x_msg_data IN VARCHAR2
87 * p_log_level IN NUMBER
88 * p_log_module IN VARCHAR2
89 * OUT NOCOPY :
90 *
91 *
92 * Version : Current version 1.0
93 * Initial version 1.0
94 *
95 * End of Comments
96 */
97
98 PROCEDURE Handle_Exceptions(
99 P_API_NAME IN VARCHAR2 := FND_API.G_MISS_CHAR,
100 P_PKG_NAME IN VARCHAR2 := FND_API.G_MISS_CHAR,
101 P_EXCEPTION_LEVEL IN NUMBER := FND_API.G_MISS_NUM,
102 P_SQLCODE IN NUMBER DEFAULT NULL,
103 P_SQLERRM IN VARCHAR2 DEFAULT NULL,
104 P_MSG_COUNT IN NUMBER := FND_API.G_MISS_NUM,
105 P_LOG_LEVEL IN NUMBER DEFAULT NULL,
106 P_LOG_MODULE IN VARCHAR2 DEFAULT NULL,
107 X_MSG_COUNT OUT NOCOPY NUMBER,
108 X_MSG_DATA OUT NOCOPY VARCHAR2,
109 X_RETURN_STATUS OUT NOCOPY VARCHAR2);
110
111
112 /* Returns upto 15 messages (4000 characters) from the message stack
113 *
114 * @param p_message_count number of messages that need to be retrieved.
115 * @param x_message_count number of messages actually retrieved.
116 * @param x_msgs the message information
117 *
118 * Currently x_message_count can be less than p_message_count.
119 *
120 *
121 * This procedure was built to satisfy the following special case:
122 * In the spreadtable when you use Ctl+ Alt + F1 to log messages any errors
123 * raised in this procedure should be handled. The messages shown to the user * should be those raised in the logging process and not other application
124 * errors. Also, these messages should be deleted once they are displayed -
125 * this ensures that if the application displays all messages at some point
126 * in future these messages are not displayed.
127 *
128 * For all other purposes use the standard get_messages
129 *
130 */
131 PROCEDURE Get_Messages (
132 p_message_count IN NUMBER,
133 x_message_count OUT NOCOPY NUMBER,
134 x_msgs OUT NOCOPY VARCHAR2);
135
136
137 /* Method to set global variable for setting session ID
138 *
139 * @param p_sessionID ICX session ID for current session
140 *
141 * set the global session ID
142 */
143 PROCEDURE SET_ICX_SESSION_ID(
144 p_sessionID IN NUMBER);
145
146 /* Logs the messages into FND_LOG_MESSAGES table
147 *
148 * @param p_log_level logging level for the message
149 * @param p_module module for which message is being logged
150 * @param p_message actual message
151 * @param p_icx_session_id ICX session ID for the module
152 *
153 * Writes the message to the log file for the spec'd level and module
154 * if logging is enabled for this level and module
155 */
156 PROCEDURE LOG_DEBUG(p_log_level IN NUMBER,
157 p_module IN VARCHAR2,
158 p_message IN VARCHAR2,
159 p_icx_session_id IN NUMBER);
160
161 /* Logs the messages into FND_LOG_MESSAGES table
162 *
163 * @param p_log_level logging level for the message
164 * @param p_module module for which message is being logged
165 * @param p_message actual message
166 *
167 * Writes the message to the log file for the spec'd level and module
168 * if logging is enabled for this level and module
169 */
170 PROCEDURE LOG_DEBUG(p_log_level IN NUMBER,
171 p_module IN VARCHAR2,
172 p_message IN VARCHAR2);
173
174 /*
175 * Utility method to write specific kind of logging messages
176 * @param p_module module for which message is being logged
177 * @param p_message actual message
178 *
179 */
180 PROCEDURE LOG_ENTERING_METHOD( p_module IN VARCHAR2,
181 p_message IN VARCHAR2);
182
183 /*
184 * Utility method to write specific kind of logging messages
185 * @param p_module module for which message is being logged
186 * @param p_message actual message
187 *
188 */
189 PROCEDURE LOG_EXITING_METHOD( p_module IN VARCHAR2,
190 p_message IN VARCHAR2);
191
192 /*
193 * Utility method to write specific kind of logging messages
194 * @param p_module module for which message is being logged
195 * @param p_message actual message
196 *
197 */
198 PROCEDURE LOG_UNEXPECTED_ERROR( p_module IN VARCHAR2,
199 p_message IN VARCHAR2);
200
201 /*
202 * Utility method to write specific kind of logging messages
203 * @param p_module module for which message is being logged
204 * @param p_message actual message
205 *
206 */
207 PROCEDURE LOG_PARAMETERS( p_module IN VARCHAR2,
208 p_message IN VARCHAR2);
209
210 /*
211 * A method to find out, if logging is on at the level of
212 * logging parameters
213 */
214
215 FUNCTION IS_LOG_PARAMETERS_ON( p_module IN VARCHAR2) RETURN BOOLEAN;
216 /*
217 * Utility method to write specific kind of logging messages
218 * @param p_module module for which message is being logged
219 * @param p_message actual message
220 *
221 */
222 PROCEDURE LOG_EXCEPTION( p_module IN VARCHAR2,
223 p_message IN VARCHAR2);
224
225 /*
226 * Utility method to write specific kind of logging messages
227 * @param p_module module for which message is being logged
228 * @param p_message actual message
229 *
230 */
231 PROCEDURE LOG_EVENT( p_module IN VARCHAR2,
232 p_message IN VARCHAR2);
233
234 /*
235 * Utility method to write specific kind of logging messages
236 * @param p_module module for which message is being logged
237 * @param p_message actual message
238 *
239 */
240 PROCEDURE LOG_STATEMENT( p_module IN VARCHAR2,
241 p_message IN VARCHAR2);
242
243
244 /*
245 * This function will substitute a token for an invalid paramater
246 *
247 */
248
249 FUNCTION GET_INVALID_PARAM_MSG (p_token_value IN VARCHAR2) RETURN VARCHAR2;
250
251 End JTF_DEBUG_PUB;