1 PACKAGE AS_MESSAGE AUTHID CURRENT_USER as
2 /* $Header: asxutmgs.pls 115.4 2002/11/06 00:57:21 appldev ship $ */
3
4 /*------------------------------- EXCEPTIONS --------------------------------*/
5 ABORT EXCEPTION; -- Raise when server program should abort and
6 -- return processing to the client.
7
8 /*-------------------------------- ROUTINES ---------------------------------*/
9
10 --
11 -- NAME
12 -- Initialize
13 --
14 -- PURPOSE
15 -- Initializes package AS_MESSAGE to control how messages are stored
16 -- (either in a db table or in memory) and sets the request_id of
17 -- the concurrent program using this package.
18 --
19 -- ARGUMENTS
20 -- Output_Code Possible values are 'TABLE' and 'STACK'
21 -- 'TABLE' specifies that messages should be inserted
22 -- into the table AS_CONC_REQUEST_MESSAGES
23 --
24 -- 'STACK' specifies that messages should be stored
25 -- in memory on the message stack.
26 --
27 -- Debug_Flag Enables or Disables Debug Mode. ('Y' or 'N')
28 -- Debug_Outut_Code Same logic as above but applies to debugging
29 -- messages.
30 -- NOTES
31 -- Initialize should be the first call to package AS_MESSAGE.
32 -- Output_Code defaults to 'STACK' and Conc_Request_Id defaults to 0
33 -- if Initialize is not called.
34 -- References to 'Output Buffer' below refer to AS_CONC_REQUEST_MESSAGES or
35 -- the message stack depending on initialization.
36 --
37 PROCEDURE Initialize(Output_Code VARCHAR2,
38 Conc_Request_Id NUMBER,
39 Debug_Flag VARCHAR2 Default 'N',
40 Debug_Output_Code VARCHAR2 Default 'STACK');
41 --
42 -- NAME
43 -- Put_Line
44 --
45 -- PURPOSE
46 -- Writes a NON-TRANSLATED message to the output buffer.
47 --
48 -- NOTES
49 -- Same as Set_Line. This will be removed eventually.
50 --
51 --
52
53 PROCEDURE Set_Line(Message_Text IN VARCHAR2);
54 --
55 -- NAME
56 -- Set_Line
57 --
58 -- PURPOSE
59 -- Writes a NON-TRANSLATED message to the output buffer.
60 --
61
62 PROCEDURE Put_Line(Message_Text IN VARCHAR2);
63 --
64 -- NAME
65 -- Flush
66 --
67 -- PURPOSE
68 -- Flush is called to ensure that all translated messages that have
69 -- been set with Set_Name will be inserted in AS_CONC_REQUEST_MESSAGES
70 -- if Initialize has been called with Output_Code = 'TABLE'
71 --
72 -- USAGE
73 -- Flush is not applicable when Output_Code = 'STACK'.
74 -- Flush should be called after the last call to AS_MESSAGE before
75 -- program control is returned to the client calling program.
76 --
77 PROCEDURE Flush;
78
79 --
80 -- NAME
81 -- Debug
82 --
83 -- PURPOSE
84 -- Writes a non-translated message to the output buffer only when
85 -- the value for profile option AS_DEBUG = 'Y' or is NULL.
86 --
87 PROCEDURE Debug(Message_Text IN VARCHAR2);
88
89 --
90 -- NAME
91 -- Set_Name
92 --
93 -- PURPOSE
94 -- Puts a Message Dictionary message on the message stack.
95 -- (Same syntax as FND_MESSAGE.Set_Name)
96 --
97 PROCEDURE Set_Name(Appl_Short_Name IN VARCHAR2,
98 Message_Name IN VARCHAR2);
99 --
100 -- NAME
101 -- Set_Token
102 --
103 -- PURPOSE
104 -- Sets the token of the current message on the message stack.
105 -- (Same syntax as FND_MESSAGE.Set_Token
106 --
107 PROCEDURE Set_Token(Token_Name IN VARCHAR2,
108 Token_Value IN VARCHAR2,
109 Translate IN BOOLEAN Default False);
110 --
111 -- NAME
112 -- Get
113 --
114 -- PURPOSE
115 -- Gets the current message from the output buffer.
116 --
117 -- Arguments
118 -- Message_Buf The target variable for the message.
119 -- Message_Type The target variable for the message type.
120 -- Status The Target variable for the length of the message
121 -- retrieved. If no more messages are stored in the
122 -- output buffer then Status = 0;
123 --
124 PROCEDURE Get(Message_Buf OUT VARCHAR2,
125 Message_Type OUT VARCHAR2,
126 Status OUT NUMBER);
127 --
128 -- NAME
129 -- Set_Error
130 --
131 -- PURPOSE
132 -- Writes the error message of the most recently encountered
133 -- Oracle Error to the output buffer.
134 --
135 -- Arguments
136 -- Routine The name of the routine where the Oracle Error
137 -- occured. (Optional)
138 -- Context Any context information relating to the error
139 -- (e.g. Customer_Id) (Optional)
140 --
141 PROCEDURE Set_Error(Routine IN VARCHAR2 Default NULL,
142 Context IN VARCHAR2 Default NULL);
143 --
144 -- Obsolete. This will be deleted shortely.
145 -- Use Set_Error instead.
146 --
147 PROCEDURE Put_DB_Error(Routine IN VARCHAR2 Default NULL,
148 Context IN VARCHAR2 Default NULL);
149 --
150 -- NAME
151 -- Clear
152 --
153 -- PURPOSE
154 -- Clears the message stack and frees memory used by it.
155 --
156 PROCEDURE Clear;
157
158 --
159 -- NAME
160 --
161 -- PURPOSE
162 -- Returns the number of messages currently on the message stack.
163 --
164 FUNCTION Message_Count Return NUMBER;
165
166 --
167 -- NAME
168 -- Purge_Messages
169 --
170 -- PURPOSE
171 -- When the output buffer is AS_CONC_REQUEST_MESSAGES, this procedure will
172 -- delete any messages from AS_CONC_REQUEST_MESSAGES for the current
173 -- request id.
174 --
175 -- USAGE
176 -- Call Purge_Messages after the client calling program has
177 -- completed writing a log file or displayed the appropriate messages
178 -- in a report.
179 --
180 PROCEDURE Purge_Messages(X_Request_Id IN NUMBER);
181
182 --
183 -- NAME
184 -- Last_Message_Sequence
185 --
186 -- PURPOSE
187 -- Returns the last value for
188 -- AS_CONC_REQUEST_MESSAGES.Conc_Request_Message_Id used by the current
189 -- session.
190 --
191 FUNCTION Last_Message_Sequence RETURN NUMBER;
192
193 END AS_MESSAGE;