1 PACKAGE IMC_RECENT_OBJECT_ACCESS_PUB AUTHID CURRENT_USER AS
2 /* $Header: imcroas.pls 115.7 2002/11/12 21:53:35 tsli noship $ */
3
4 TYPE ref_cursor_rec_obj_acc IS REF CURSOR;
5
6 g_module CONSTANT VARCHAR2(30) := 'IMC_RECENT_OBJECT_ACCESS';
7
8 /* Messages */
9 g_invalid_user_id CONSTANT VARCHAR2(30) := 'IMC_INVALID_USER_ID';
10 g_invalid_object_type CONSTANT VARCHAR2(30) := 'IMC_INVALID_OBJ_TYPE';
11 g_invalid_object_id CONSTANT VARCHAR2(30) := 'IMC_INVALID_OBJ_ID';
12 g_invalid_object_name CONSTANT VARCHAR2(30) := 'IMC_INVALID_OBJ_NAME';
13 g_recent_api_others_ex CONSTANT VARCHAR2(30) := 'IMC_RECENT_API_OTHERS_EX';
14 g_no_objs_recently_accessed CONSTANT VARCHAR2(30) := 'IMC_NO_OBJS_RECY_ACCD';
15 g_could_not_delete_entry CONSTANT VARCHAR2(30) := 'IMC_COULD_NOT_DEL_ENTRY';
16
17 /* Profiles */
18 -- g_maintenance_profile CONSTANT VARCHAR2(30) := 'IMC_MAINTAIN_REC_OBJ_ACC';
19 -- g_store_max_profile CONSTANT VARCHAR2(30) := 'IMC_MAX_STORE_REC_OBJ_ACC';
20 g_display_max_profile CONSTANT VARCHAR2(30) := 'IMC_MAX_DISPLAY_REC_OBJ_ACC';
21
22 /* Object types supported currently */
23 g_object_type_org CONSTANT VARCHAR2(30) := 'PARTY_ORGANIZATION';
24 g_object_type_per CONSTANT VARCHAR2(30) := 'PARTY_PERSON';
25 g_object_type_con CONSTANT VARCHAR2(30) := 'PARTY_CONTACT_RELATIONSHIP';
26
27 /* Default object version number */
28 g_object_version_number CONSTANT NUMBER := 1;
29
30 /* Profile defaults */
31 -- g_default_maintenance CONSTANT VARCHAR2(1) := 'Y';
32 -- g_default_max_store CONSTANT NUMBER := 50;
33 g_default_max_display CONSTANT NUMBER := 10;
34
35 ---------------------------------------------------------------------------------
36 --
37 -- API name : Add_Recently_Accessed_Object
38 --
39 -- TYPE : Public
40 --
41 -- FUNCTION : Add a recent object access for a user. For now, the object can be
42 -- an organization, a contact relationship or a person. If a record
43 -- already exists for this object and user on this date, do nothing.
44 -- Else, check profile option IMC_MAX_DISPLAY_REC_OBJ_ACC. If limit
45 -- is not reached, insert new record; else, update the record for
46 -- least recently accessed object by this user with details of the
47 -- new object access.
48 --
49 -- Parameters:
50 --
51 -- IN :
52 -- p_user_id IN NUMBER (required)
53 -- User for whom the object access will be added.
54 --
55 -- p_object_type IN VARCHAR2 (required)
56 -- Type of Object that is going to be recorded as accessed by user.
57 -- Valid Values (now): PARTY_ORGANIZATION, PARTY_C0NTACT_RELATIONSHIP,
58 -- PARTY_PERSON.
59 --
60 -- p_object_id IN NUMBER (required)
61 -- Object that is going to be recorded as accessed by user.
62 --
63 -- p_object_name IN VARCHAR2 (optional)
64 -- User-friendly name of the object accessed by user.
65 --
66 -- p_application_id IN VARCHAR2 (optional)
67 -- Application recording object access by user.
68 --
69 -- p_additional_value1 IN VARCHAR2 (optional)
70 -- Additional value for this entry.
71 --
72 -- p_additional_value2 IN VARCHAR2 (optional)
73 -- Additional value for this entry.
74 --
75 -- p_additional_value3 IN VARCHAR2 (optional)
76 -- Additional value for this entry.
77 --
78 -- p_additional_value4 IN VARCHAR2 (optional)
79 -- Additional value for this entry.
80 --
81 -- p_additional_value5 IN VARCHAR2 (optional)
82 -- Additional value for this entry.
83 --
84 -- p_object_version_number IN NUMBER (optional)
85 -- Version number for concurrency control. Defaulted to 1.
86 --
87 -- OUT NOCOPY :
88 -- x_return_status
89 -- 1 byte result code:
90 -- 'S' Success (FND_API.G_RET_STS_SUCCESS)
91 -- 'E' Error (FND_API.G_RET_STS_ERROR)
92 -- 'U' Unexpected Error (FND_API.G_RET_STS_UNEXP_ERROR)
93 --
94 -- x_msg_count
95 -- Number of messages in message stack.
96 -- If 'E' or 'U' is returned, there will be an error message on the
97 -- FND_MESSAGE stack which can be retrieved with
98 -- FND_MESSAGE.GET_ENCODED().
99 --
100 -- x_msg_data
101 -- The first message in the FND_MESSAGE stack
102 --
103 -- Version: Current Version 1.0
104 -- Previous Version : None
105 --
106 -- Notes :
107 --
108 ---------------------------------------------------------------------------------
109 PROCEDURE Add_Recently_Accessed_Object (
110 p_user_id IN IMC_RECENT_ACCESSED_OBJ.user_id%TYPE,
111 p_object_type IN IMC_RECENT_ACCESSED_OBJ.object_type%TYPE,
112 p_object_id IN IMC_RECENT_ACCESSED_OBJ.object_id%TYPE,
113 p_object_name IN IMC_RECENT_ACCESSED_OBJ.object_name%TYPE,
114 p_application_id IN IMC_RECENT_ACCESSED_OBJ.application_id%TYPE,
115 p_additional_value1 IN IMC_RECENT_ACCESSED_OBJ.additional_value1%TYPE,
116 p_additional_value2 IN IMC_RECENT_ACCESSED_OBJ.additional_value2%TYPE,
117 p_additional_value3 IN IMC_RECENT_ACCESSED_OBJ.additional_value3%TYPE,
118 p_additional_value4 IN IMC_RECENT_ACCESSED_OBJ.additional_value4%TYPE,
119 p_additional_value5 IN IMC_RECENT_ACCESSED_OBJ.additional_value5%TYPE,
120 p_object_version_number IN IMC_RECENT_ACCESSED_OBJ.object_version_number%TYPE,
121 x_return_status OUT NOCOPY VARCHAR2,
122 x_msg_count OUT NOCOPY VARCHAR2,
123 x_msg_data OUT NOCOPY VARCHAR2
124 );
125
126 ---------------------------------------------------------------------------------
127 --
128 -- API name : Get_Recently_Accessed_Objects
129 --
130 -- TYPE : Public
131 --
132 -- FUNCTION : Retrieve objects that have been recently accessed by a user. If
133 -- no type is specified, all objects are returned. Else, only those
134 -- recently accessed objects matching the specified type are
135 -- returned. The number of records returned is controlled by the
136 -- profile option IMC_MAX_DISPLAY_REC_OBJ_ACC.
137 --
138 -- Parameters:
139 --
140 -- IN :
141 -- p_user_id IN NUMBER (required)
142 -- User for whom the recently accessed objects are requested.
143 --
144 -- p_object_type IN VARCHAR2 (optional)
145 -- Type of objects that have been accessed by user.
146 -- Valid Values (now): PARTY_ORGANIZATION, PARTY_C0NTACT_RELATIONSHIP,
147 -- PARTY_PERSON.
148 -- If NULL, all valid values (above) are included.
149 --
150 -- p_application_id IN NUMBER (optional)
151 -- Application requesting recent object access for user. Ignored if
152 -- NULL.
153 --
154 -- p_object_version_number IN NUMBER (optional)
155 -- Version number for concurrency control. Ignored if NULL.
156 --
157 -- OUT NOCOPY :
158 -- x_object_info
159 -- A reference cursor returns the type, id and name of objects
160 -- recently accessed by the user. Returns NULL if no objects
161 -- have been recently accessed by the user.
162 --
163 -- x_return_status
164 -- 1 byte result code:
165 -- 'S' Success (FND_API.G_RET_STS_SUCCESS)
166 -- 'E' Error (FND_API.G_RET_STS_ERROR)
167 -- 'U' Unexpected Error (FND_API.G_RET_STS_UNEXP_ERROR)
168 --
169 -- x_msg_count
170 -- Number of messages in message stack.
171 -- If 'E' or 'U' is returned, there will be an error message on the
172 -- FND_MESSAGE stack which can be retrieved with
173 -- FND_MESSAGE.GET_ENCODED().
174 --
175 -- x_msg_data
176 -- The first message in the FND_MESSAGE stack
177 --
178 -- Version: Current Version 1.0
179 -- Previous Version : None
180 --
181 -- Notes :
182 --
183 ---------------------------------------------------------------------------------
184 PROCEDURE Get_Recently_Accessed_Objects (
185 p_user_id IN IMC_RECENT_ACCESSED_OBJ.user_id%TYPE,
186 p_object_type IN IMC_RECENT_ACCESSED_OBJ.object_type%TYPE,
187 p_application_id IN IMC_RECENT_ACCESSED_OBJ.application_id%TYPE,
188 p_object_version_number IN IMC_RECENT_ACCESSED_OBJ.object_version_number%TYPE,
189 x_object_info OUT NOCOPY ref_cursor_rec_obj_acc,
190 x_return_status OUT NOCOPY VARCHAR2,
191 x_msg_count OUT NOCOPY VARCHAR2,
192 x_msg_data OUT NOCOPY VARCHAR2
193 );
194
195 ---------------------------------------------------------------------------------
196 --
197 -- API name : Flush
198 --
199 -- TYPE : Public
200 --
201 -- FUNCTION : Remove all records for a user that are over the number specified
202 -- in the profile IMC_MAX_DISPLAY_REC_OBJ_ACC.
203 --
204 -- Parameters:
205 --
206 -- IN :
207 -- p_user_id IN NUMBER (required)
208 -- User for whom the recently accessed objects are requested.
209 --
210 -- OUT NOCOPY :
211 -- x_flush_count
212 -- Number of records deleted for this user to keep at profile
213 -- specified limit.
214 --
215 -- x_return_status
216 -- 1 byte result code:
217 -- 'S' Success (FND_API.G_RET_STS_SUCCESS)
218 -- 'E' Error (FND_API.G_RET_STS_ERROR)
219 -- 'U' Unexpected Error (FND_API.G_RET_STS_UNEXP_ERROR)
220 --
221 -- x_msg_count
222 -- Number of messages in message stack.
223 -- If 'E' or 'U' is returned, there will be an error message on the
224 -- FND_MESSAGE stack which can be retrieved with
225 -- FND_MESSAGE.GET_ENCODED().
226 --
227 -- x_msg_data
228 -- The first message in the FND_MESSAGE stack
229 --
230 -- Version: Current Version 1.0
231 -- Previous Version : None
232 --
233 -- Notes :
234 --
235 ---------------------------------------------------------------------------------
236 PROCEDURE Flush (
237 p_user_id IN IMC_RECENT_ACCESSED_OBJ.user_id%TYPE,
238 x_flush_count OUT NOCOPY NUMBER,
239 x_return_status OUT NOCOPY VARCHAR2,
240 x_msg_count OUT NOCOPY VARCHAR2,
241 x_msg_data OUT NOCOPY VARCHAR2
242 );
243
244 END IMC_RECENT_OBJECT_ACCESS_PUB;