1 package FND_MESSAGE_CACHE AUTHID DEFINER as
2 /* $Header: AFNCMSGS.pls 120.2 2005/10/26 03:26:19 skghosh noship $ */
3 /* The record to hold the cached data */
4 TYPE MessageRec IS RECORD (
5 MESSAGE_NAME VARCHAR2(30) ,
6 MESSAGE_TEXT VARCHAR2(2000)
7 );
8 TYPE MessageTAB IS TABLE OF MessageRec index by binary_integer;
9
10
11 /*
12 ** SET_NAME - sets the message name
13 */
14 procedure SET_NAME(APPLICATION in varchar2, NAME in varchar2);
15
16 /*
17 ** SET_TOKEN - defines a message token with a value
18 */
19 procedure SET_TOKEN(TOKEN in varchar2,
20 VALUE in varchar2,
21 TRANSLATE in boolean default false);
22
23 /*
24 ** SET_TOKEN_SQL - define a message token with a SQL query value
25 **
26 ** Description:
27 ** Like SET_TOKEN, except here the value is a SQL statement which
28 ** returns a single varchar2 value. (e.g. A translated concurrent
29 ** manager name.) This statement is run when the message text is
30 ** resolved, and the result is used in the token substitution.
31 **
32 ** Arguments:
33 ** token - Token name
34 ** value - Token value. A SQL statement
35 **
36 */
37 procedure SET_TOKEN_SQL (TOKEN in varchar2,
38 VALUE in varchar2);
39
40 /*
41 ** RETRIEVE - gets the message and token data, clears message buffer
42 */
43 procedure RETRIEVE(MSGOUT OUT NOCOPY varchar2);
44
45 /*
46 ** CLEAR - clears the message buffer
47 */
48 procedure CLEAR;
49
50 /*
51 ** GET_STRING- get a particular translated message
52 ** from the message dictionary database.
53 **
54 ** This is a one-call interface for when you just want to get a
55 ** message without doing any token substitution.
56 ** Returns NULL if the message cannot be found.
57 */
58 function GET_STRING(APPIN in varchar2,
59 NAMEIN in varchar2) return varchar2;
60
61 /*
62 ** FETCH_SQL_TOKEN- get the value for a SQL Query token
63 ** This procedure is only to be called by the ATG
64 ** not for external use
65 */
66 function FETCH_SQL_TOKEN(TOK_VAL in varchar2) return varchar2;
67 pragma restrict_references(FETCH_SQL_TOKEN, WNDS);
68
69 /*
70 ** GET_NUMBER- get the message number of a particular message.
71 **
72 ** Returns 0 if the message has no message number,
73 ** or if its message number is zero.
74 ** NULL if the message can't be found.
75 */
76 function GET_NUMBER(APPIN in varchar2,
77 NAMEIN in varchar2) return NUMBER;
78
79 /*
80 ** GET- get a translated and token substituted message
81 ** from the message dictionary database.
82 ** Returns NULL if the message cannot be found.
83 */
84 function GET return varchar2;
85
86 /*
87 ** GET_ENCODED- Get an encoded message from the message stack.
88 */
89 function GET_ENCODED return varchar2;
90
91 /*
92 ** PARSE_ENCODED- Parse the message name and application short name
93 ** out of a message in "encoded" format.
94 */
95 procedure PARSE_ENCODED(ENCODED_MESSAGE IN varchar2,
96 APP_SHORT_NAME OUT NOCOPY varchar2,
97 MESSAGE_NAME OUT NOCOPY varchar2);
98
99 /*
100 ** SET_ENCODED- Set an encoded message onto the message stack
101 */
102 procedure SET_ENCODED(ENCODED_MESSAGE IN varchar2);
103
104 /*
105 ** raise_error - raises the error to the calling entity
106 ** via raise_application_error() prodcedure
107 */
108 procedure RAISE_ERROR;
109
110 /*
111 ** GET_TOKEN- Obtains the value of a named token from the
112 ** current message.
113 ** IN: TOKEN- the name of the token that was passed to SET_TOKEN
114 ** REMOVE_FROM_MESSAGE- default NULL means 'N'
115 ** 'Y'- Remove the token value from the current message
116 ** 'N'- Leave the token value on the current message
117 ** RETURNs: the token value that was set previously with SET_TOKEN
118 */
119 function GET_TOKEN(TOKEN IN VARCHAR2
120 ,REMOVE_FROM_MESSAGE IN VARCHAR2 default NULL /* NULL means 'N'*/
121 ) return varchar2;
122
123 end fnd_message_cache;