1 package FND_MESSAGE AUTHID DEFINER as
2 /* $Header: AFNLMSGS.pls 120.2.12000000.1 2007/01/18 13:21:41 appldev ship $ */
3 /*#
4 * APIs to Set, Retrieve, Clear the messages in Message Stack.
5 * @rep:scope public
6 * @rep:product FND
7 * @rep:displayname Message Dictionary
8 * @rep:lifecycle active
9 * @rep:compatibility S
10 * @rep:category BUSINESS_ENTITY FND_MESSAGE
11 * @rep:ihelp FND/@mesgdict#mesgdict See the related online help
12 */
13
14
15 /*
16 ** SET_NAME - sets the message name
17 */
18
19 /*#
20 * In Database Server, this Sets a message name in the global area
21 * without actually retrieving the message from Message Dictionary.
22 * FND_MESSAGE.SET_NAME should be called before calling FND_MESSAGE.SET_TOKEN.
23 * @param application The short name of the application this message is associated with.
24 * @param name Message Name
25 * @rep:scope public
26 * @rep:lifecycle active
27 * @rep:displayname Set Message Name
28 * @rep:compatibility S
29 * @rep:ihelp FND/@mesgdict#mesgdict See the related online help
30 */
31 procedure SET_NAME(APPLICATION in varchar2, NAME in varchar2);
32 pragma restrict_references(SET_NAME, WNDS);
33
34 /*
35 ** SET_TOKEN - defines a message token with a value
36 */
37
38 /*#
39 * In Database Server, SET_TOKEN adds a token/value pair to the
40 * global area without actually doing the substitution.
41 * Call FND_MESSAGE.SET_TOKEN once for each token/value pair in a
42 * message. The optional translate parameter can be set to TRUE to
43 * indicate that the value should be translated before substitution. (The
44 * value should be translated if it is, itself, a Message Dictionary
45 * message name).
46 * @param token name of the token you want to substitute - token should not include the '&' in Message Dictionary calls
47 * @param value substitute text
48 * @param translate Indicates whether the value is itself a Message Dictionary message
49 * @rep:scope public
50 * @rep:lifecycle active
51 * @rep:displayname Set Token value
52 * @rep:compatibility S
53 * @rep:ihelp FND/@mesgdict#mesgdict See the related online help
54 */
55 procedure SET_TOKEN(TOKEN in varchar2,
56 VALUE in varchar2,
57 TRANSLATE in boolean default false);
58 pragma restrict_references(SET_TOKEN, WNDS);
59
60 /*
61 ** SET_MODULE - defines the Module for FND_LOG purposes
62 */
63 procedure SET_MODULE(MODULE in varchar2);
64
65 /*
66 ** GET_MESSAGE_INTERNAL - Internal use only.
67 */
68 procedure GET_MESSAGE_INTERNAL(APPIN in varchar2,
69 NAMEIN in varchar2, LANGIN in varchar2,
70 AUTO_LOG in varchar2,
71 MSG out NOCOPY varchar2, MSG_NUMBER out NOCOPY NUMBER,
72 MSG_TYPE out NOCOPY varchar2,
73 FND_LOG_SEVERITY out NOCOPY NUMBER,
74 ALERT_CATEGORY out NOCOPY varchar2,
75 ALERT_SEVERITY out NOCOPY varchar2);
76 pragma restrict_references(GET_MESSAGE_INTERNAL, WNDS);
77
78 /*
79 ** SET_TOKEN_SQL - define a message token with a SQL query value
80 **
81 ** Description:
82 ** Like SET_TOKEN, except here the value is a SQL statement which
83 ** returns a single varchar2 value. (e.g. A translated concurrent
84 ** manager name.) This statement is run when the message text is
85 ** resolved, and the result is used in the token substitution.
86 **
87 ** Arguments:
88 ** token - Token name
89 ** value - Token value. A SQL statement
90 **
91 */
92 procedure SET_TOKEN_SQL (TOKEN in varchar2,
93 VALUE in varchar2);
94
95 /*
96 ** RETRIEVE - gets the message and token data, clears message buffer
97 */
98 procedure RETRIEVE(MSGOUT out NOCOPY varchar2);
99 pragma restrict_references(RETRIEVE, WNDS);
100
101 /*
102 ** CLEAR - clears the message buffer
103 */
104
105 /*#
106 * Clears the message stack of all messages
107 * @rep:scope public
108 * @rep:lifecycle active
109 * @rep:displayname Clear Message Buffer
110 * @rep:compatibility S
111 * @rep:ihelp FND/@mesgdict#mesgdict See the related online help
112 */
113 procedure CLEAR;
114 pragma restrict_references(CLEAR, WNDS);
115
116 /*
117 ** GET_STRING- get a particular translated message
118 ** from the message dictionary database.
119 **
120 ** This is a one-call interface for when you just want to get a
121 ** message without doing any token substitution.
122 ** Returns NULL if the message cannot be found.
123 */
124 function GET_STRING(APPIN in varchar2,
125 NAMEIN in varchar2) return varchar2;
126 /* bug 4287370 - added back pragma WNPS with TRUST for backwards compatibility */
127 pragma restrict_references(GET_STRING, WNDS, WNPS, TRUST);
128
129 /*
130 ** GET_STRING- get a particular translated message
131 ** from the message dictionary database.
132 **
133 ** This is a one-call interface for when you just want to get a
134 ** message without doing any token substitution.
135 ** Returns NULL if the message cannot be found.
136 */
137 function GET_STRING(APPIN in varchar2,
138 NAMEIN in varchar2, AUTO_LOG in varchar2) return varchar2;
139 pragma restrict_references(GET_STRING, WNDS);
140
141
142 /*
143 ** FETCH_SQL_TOKEN- get the value for a SQL Query token
144 ** This procedure is only to be called by the ATG
145 ** not for external use
146 */
147 function FETCH_SQL_TOKEN(TOK_VAL in varchar2) return varchar2;
148 pragma restrict_references(FETCH_SQL_TOKEN, WNDS);
149
150 /*
151 ** GET_NUMBER- get the message number of a particular message.
152 **
153 ** Returns 0 if the message has no message number,
154 ** or if its message number is zero.
155 ** NULL if the message can't be found.
156 */
157 function GET_NUMBER(APPIN in varchar2,
158 NAMEIN in varchar2) return NUMBER;
159 pragma restrict_references(GET_NUMBER, WNDS);
160
161 /*
162 ** GET- get a translated and token substituted message
163 ** from the message dictionary database.
164 ** Returns NULL if the message cannot be found.
165 */
166
167 /*#
168 * Retrieves a translated and token-substituted message from the
169 * message stack and then clears that message from the message stack.
170 * GET returns up to 2000 bytes of message. <p>
171 * If this function is called from a stored procedure on the database server
172 * side, the message is retrieved from the Message Dictionary table. If the
173 * function is called from a form or forms library, the message is retrieved
174 * from the messages file on the forms server.
175 * @return text Message Text
176 * @rep:scope public
177 * @rep:lifecycle active
178 * @rep:displayname Get Message Text
179 * @rep:compatibility S
180 * @rep:ihelp FND/@mesgdict#mesgdict See the related online help
181 */
182 function GET return varchar2;
183 pragma restrict_references(GET, WNDS);
184
185 /*
186 ** GET- get a translated and token substituted message
187 ** from the message dictionary database.
188 ** Returns NULL if the message cannot be found.
189 */
190 function GET(AUTO_LOG in varchar2) return varchar2;
191 pragma restrict_references(GET, WNDS);
192
193 /*
194 ** GET_ENCODED- Get an encoded message from the message stack.
195 */
196 function GET_ENCODED return varchar2;
197 pragma restrict_references(GET_ENCODED, WNDS);
198
199 /*
200 ** GET_ENCODED- Get an encoded message from the message stack.
201 */
202 function GET_ENCODED(AUTO_LOG in varchar2) return varchar2;
203 pragma restrict_references(GET_ENCODED, WNDS);
204
205 /*
206 ** PARSE_ENCODED- Parse the message name and application short name
207 ** out of a message in "encoded" format.
208 */
209 procedure PARSE_ENCODED(ENCODED_MESSAGE IN varchar2,
210 APP_SHORT_NAME OUT NOCOPY varchar2,
211 MESSAGE_NAME OUT NOCOPY varchar2);
212 pragma restrict_references(PARSE_ENCODED, WNDS);
213
214 /*
215 ** SET_ENCODED- Set an encoded message onto the message stack
216 */
217 procedure SET_ENCODED(ENCODED_MESSAGE IN varchar2);
218 pragma restrict_references(SET_ENCODED, WNDS);
219
220 /*
221 ** raise_error - raises the error to the calling entity
222 ** via raise_application_error() prodcedure
223 */
224 procedure RAISE_ERROR;
225 pragma restrict_references(RAISE_ERROR, WNDS);
226
227 /*
228 ** GET_TOKEN- Obtains the value of a named token from the
229 ** current message.
230 ** IN: TOKEN- the name of the token that was passed to SET_TOKEN
231 ** REMOVE_FROM_MESSAGE- default NULL means 'N'
232 ** 'Y'- Remove the token value from the current message
233 ** 'N'- Leave the token value on the current message
234 ** RETURNs: the token value that was set previously with SET_TOKEN
235 */
236 function GET_TOKEN(TOKEN IN VARCHAR2
237 ,REMOVE_FROM_MESSAGE IN VARCHAR2 default NULL /* NULL means 'N'*/
238 ) return varchar2;
239
240 /*
241 ** GET_TOKEN- Obtains the value of a named token from the
242 ** current message.
243 ** IN: TOKEN- the name of the token that was passed to SET_TOKEN
244 ** REMOVE_FROM_MESSAGE- default NULL means 'N'
245 ** 'Y'- Remove the token value from the current message
246 ** 'N'- Leave the token value on the current message
247 ** RETURNs: the token value that was set previously with SET_TOKEN
248 */
249 function GET_TOKEN(TOKEN IN VARCHAR2
250 ,REMOVE_FROM_MESSAGE IN VARCHAR2 default NULL /* NULL means 'N'*/
251 ,AUTO_LOG in varchar2) return varchar2;
252
253 /*
254 ** GET_TEXT_NUMBER - get a particular message text
255 ** and message number from the message dictionary database.
256 **
257 ** This is a one-call interface for when you just want to get a
258 ** message text and number without doing any token substitution.
259 **
260 ** IN
261 ** APPIN: Application Short Name of message
262 ** NAMEIN: Message Name
263 ** OUT
264 ** MSGTEXT: Returns NAMEIN (Msg name) if the message cannot be found.
268 */
265 ** MSGNUMBER: Returns 0 if the message has no message number,
266 ** or if its message number is zero.
267 ** NULL if the message can't be found.
269
270 /*#
271 * Retrieves the message text and message number from fnd_new_messages
272 * table for a given message name.
273 * param appin message application short name
274 * param namein message name
275 * param msgtext message text
276 * param msgnumber message number
277 * @rep:scope public
278 * @rep:lifecycle active
279 * @rep:displayname Get Message Text and Number
280 * @rep:compatibility S
281 * @rep:ihelp FND/@mesgdict#mesgdict See the related online help
282 */
283 procedure GET_TEXT_NUMBER(APPIN in varchar2,
284 NAMEIN in varchar2,
285 MSGTEXT out nocopy varchar2,
286 MSGNUMBER out nocopy number);
287 pragma restrict_references(GET_TEXT_NUMBER, WNDS);
288 end FND_MESSAGE;