DBA Data[Home] [Help]

PACKAGE: APPS.JTF_PERZ_PROFILE_PUB

Source


1 PACKAGE JTF_PERZ_PROFILE_PUB as
2 /* $Header: jtfzppfs.pls 120.2 2005/11/02 04:34:03 skothe ship $ */
3 --
4 --
5 -- Start of Comments
6 --
7 -- NAME
8 --   JTF_PERZ_PROFILE_PUB
9 --
10 -- PURPOSE
11 --   Public API for creating, getting and updating profiles in the Personalization
12 -- 	 framework.
13 --
14 -- NOTES
15 --   This is a pulicly accessible pacakge.  It should be used by all
16 --   sources for creating, getting and updating profiles in the Personalization
17 -- 	 framework. A profile is a mechanism that is used to tag a personalization
18 --	 construct to a user, application, template etc. In essence defining the
19 --	 audience for that personalization construct.
20 --
21 
22 -- HISTORY
23 --   05/25/99   CCHANDRA	Created
24 -- 09/30/99	SMATTEGU	Changed update_profile()
25 --
26 --
27 -- End of Comments
28 
29 --
30 --******************************************************************************
31 --
32 -- Start of Comments
33 --
34 --	PROFILE_ATTRIBUTE_REC_TYPE
35 --
36 --	This record is used to set the profile atibutes. If one is setting a
37 --	profile attribute, the columns PROFILE_ATTRIBUTE, ATTRIBUTE_TYPE and
38 --	ATTRIBUTE_VALUE are required.
39 --
40 --	Parameters
41 --
42 --  ATTRIBUTE_ID		NUMBER		OPTIONAL
43 --  PROFILE_ID		  	NUMBER		REQUIRED
44 --  PROFILE_ATTRIBUTE 		VARCHAR2(60)	REQUIRED
45 --  ATTRIBUTE_TYPE		VARCHAR2(30)    REQUIRED
46 --  ATTRIBUTE_VALUE 		VARCHAR2(30)	REQUIRED
47 --
48 -- End of Comments
49 
50 
51 TYPE PROFILE_ATTRIB_REC_TYPE		IS RECORD (
52 
53 	ATTRIBUTE_ID		NUMBER		:= FND_API.G_MISS_NUM,
54 	PROFILE_ID		NUMBER 		:= FND_API.G_MISS_NUM,
55 	PROFILE_ATTRIBUTE	VARCHAR2(100) 	:= FND_API.G_MISS_CHAR,
56 	ATTRIBUTE_TYPE		VARCHAR2(100) 	:= FND_API.G_MISS_CHAR,
57 	ATTRIBUTE_VALUE		VARCHAR2(100) 	:= FND_API.G_MISS_CHAR
58 );
59 
60 -- Start of Comments
61 --
62 --      Profile_Attribute Table: PROFILE_ATTRIB_TBL_TYPE
63 --
64 -- End of Comments
65 
66 TYPE PROFILE_ATTRIB_TBL_TYPE	IS TABLE OF PROFILE_ATTRIB_REC_TYPE
67 				INDEX BY BINARY_INTEGER;
68 
69 
70 -- Defining G_MISS type for the table
71 G_MISS_PROFILE_ATTRIB_TBL	PROFILE_ATTRIB_TBL_TYPE;
72 
73 -- Start of Comments
74 --
75 -- PROFILE_ATTRIB_OUT_REC_TYPE
76 --
77 -- This record defines the out record for a get performed on the database.
78 -- The table of results returned from a Get_Profile(..) will be a table of this
79 -- record type.
80 --
81 -- End of Comments
82 
83 
84 TYPE PROFILE_OUT_REC_TYPE IS RECORD (
85 
86 	 	PROFILE_ID		NUMBER	  	:= NULL,
87 		PROFILE_NAME		VARCHAR2(60)  := NULL,
88 		PROFILE_TYPE		VARCHAR2(30)  := NULL,
89 		PROFILE_DESCRIPTION	VARCHAR2(240) := NULL,
90 		ACTIVE_FLAG		VARCHAR2(1)   := NULL,
91 		PROFILE_ATTRIBUTE	VARCHAR2(100)  := NULL,
92 		ATTRIBUTE_TYPE		VARCHAR2(100)  := NULL,
93 		ATTRIBUTE_VALUE		VARCHAR2(100)  := NULL
94 );
95 
96 
97 -- Defining Table of records
98 TYPE PROFILE_OUT_TBL_TYPE	IS TABLE OF PROFILE_OUT_REC_TYPE
99 				INDEX BY BINARY_INTEGER;
100 
101 
102 -- *****************************************************************************
103 --
104 -- START API SPECIFICATIONS
105 --
106 --	API NAME 	: Create_Profile
107 --	TYPE		: Public
108 --	FUNCTION	: This API is used to create a profile, given a profile name
109 --				  profile type and set of attributes/values.
110 --
111 --	PARAMETERS	:
112 --
113 --	IN		:
114 --			p_api_version_number	IN NUMBER	Required
115 --			p_init_msg_list		IN VARCHAR2 	Optional
116 --			p_commit		IN VARCHAR2	Optional
117 --			p_profile_id            IN NUMBER	Optional
118 --			p_profile_name          IN VARCHAR2	Required
119 --			p_profile_type		IN VARCHAR2 	Required
120 --			p_profile_desc		IN VARCHAR2 	Optional
121 --			p_profile_attrib_tbl	IN JTF_PERZ_PROFILE_PUB.PROFILE_ATTRIB_TBL_TYPE,
122 --
123 -- OUT :
124 --			x_return_status	 OUT VARCHAR2(1)
125 --			x_msg_count	 OUT NUMBER
126 --			x_msg_data	 OUT VARCHAR2(2000)
127 --
128 --
129 --
130 --	VERSION	:	Current version	1.0
131 --			 	Initial version 1.0
132 --
133 --	NOTES	:	Personalization Framework API to create a profile,
134 --				This API will create a profile based on profile name,
135 --				profile type, profile attributes and values.
136 --
137 -- *****************************************************************************
138 --
139 -- USAGE NOTES :
140 --
141 --	1. This API creates a profile in the profile store. Of the input parameters
142 --	p_profile_name (the name of the profile) is a required field. This field has to
143 --	be unique or the API will return an error. This field also has to be made of
144 --	characters with no spaces (underscores allowed).
145 --
146 --	2. The p_profile_type is the type of profile this is where the caller can specify
147 --	the type of profile (like USER, TEMPLATE, APPLICATION etc.) these type are defined
148 --	in FND_LOOKUPS under PERSONALIZATION_PROFILE_TYPES.
149 --
150 --	3. A description for the profile is passed via p_profile_desc
151 --
152 --	4. The p_profile_attrib_tbl is the table that holds the attributes and values
153 --	associated with a profile. The PROFILE_ATTRIBUTE field holds the name/tag
154 --	associated with a profile. The ATTRIBUTE_VALUE field holds the value for this
155 --	profile attribute. The ATTRIBUTE_TYPE is used to store the type of attribute
156 --	value being stored. For example, one could have a record like :
157 --	[PERSONALIZATION, 235, USER_ID]. this essentially says that the attribute is
158 --	for the user with id 235 and used for personalization.
159 --
160 --	5. The main out parameter for this API is x_return_status which returns
161 --	FND_API.G_RETURN_SUCCESS when the API completes successfully
162 --	FND_API.G_RETURN_UNEXPECTED when the API reaches a unxpected state
163 --	FND_API.G_RETURN_ERROR when the API hits an error
164 --
165 -- *****************************************************************************
166 --
167 
168 PROCEDURE Create_Profile
169 ( 	p_api_version_number	IN	NUMBER,
170 	p_init_msg_list		IN	VARCHAR2 := FND_API.G_FALSE,
171 	p_commit		IN	VARCHAR2 := FND_API.G_FALSE,
172 	p_profile_id            IN	NUMBER,
173 	p_profile_name          IN	VARCHAR2 := NULL,
174 	p_profile_type		IN 	VARCHAR2 := NULL,
175 	p_profile_desc		IN 	VARCHAR2 := NULL,
176 	p_profile_attrib_tbl	IN	JTF_PERZ_PROFILE_PUB.PROFILE_ATTRIB_TBL_TYPE
177 					:= JTF_PERZ_PROFILE_PUB.G_MISS_PROFILE_ATTRIB_TBL,
178 
179 	x_profile_name       OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
180 	x_profile_id         OUT NOCOPY /* file.sql.39 change */ NUMBER,
181 	x_return_status	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
182 	x_msg_count	 OUT NOCOPY /* file.sql.39 change */ NUMBER,
183 	x_msg_data	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
184 );
185 
186 
187 -- Start of Comments
188 --
189 --	API name 	: Get_Profile
190 --	Type		: Public
191 --	Function	: Return a profile(s) for a given set of parameters
192 --
193 --	Parameters	:
194 --	IN		:
195 --			p_api_version_number	IN NUMBER			Required
196 --			p_init_msg_list		IN VARCHAR2 			Optional
197 --			p_profile_id            IN NUMBER			Optional
198 --			p_profile_name          IN VARCHAR2			Optional
199 --			p_profile_type		IN VARCHAR2 			Optional
200 --			p_profile_attrib_tbl	IN	JTF_PERZ_PROFILE_PUB.PROFILE_ATTRIB_TBL_TYPE,
201 --
202 -- OUT :
203 --			x_profile_tbl OUT JTF_PERZ_PROFILE_PUB.PROFILE_OUT_TBL,
204 --			x_return_status OUT VARCHAR2(1)
205 --			x_msg_count	 OUT NUMBER
206 --			x_msg_data	 OUT VARCHAR2(2000)
207 --
208 --
209 --
210 --	Version	:	Current version	    1.0
211 --		 	Initial version 	1.0
212 --
213 --
214 -- *****************************************************************************
215 --
216 -- USAGE NOTES :
217 --
218 --	1. This API gets/queries a profile and its attributes in the profile store.
219 --	Of the input parameters p_profile_name (the name of the profile) is a required field or the
220 --	profile_id.
221 --
222 --	2. The x_profile_tbl holds the output set from the query. this is a table of type
223 --	JTF_PERZ_PROFILE_PUB.PROFILE_OUT_TBL.
224 --
225 --	2. The other out parameter for this API is x_return_status which returns
226 --	FND_API.G_RETURN_SUCCESS when the API completes successfully
227 --	FND_API.G_RETURN_UNEXPECTED when the API reaches a unxpected state
228 --	FND_API.G_RETURN_ERROR when the API hits an error
229 --
230 -- *****************************************************************************
231 --
232 
233 
234 PROCEDURE Get_Profile
235 ( 	p_api_version_number	IN	NUMBER,
236 	p_init_msg_list			IN	VARCHAR2  := FND_API.G_FALSE,
237 
238 	p_profile_id           	IN	NUMBER,
239 	p_profile_name          IN	VARCHAR2,
240 	p_profile_type			IN 	VARCHAR2,
241 	p_profile_attrib_tbl	IN	JTF_PERZ_PROFILE_PUB.PROFILE_ATTRIB_TBL_TYPE
242 						:= JTF_PERZ_PROFILE_PUB.G_MISS_PROFILE_ATTRIB_TBL,
243 
244 	x_profile_tbl	 OUT NOCOPY /* file.sql.39 change */ JTF_PERZ_PROFILE_PUB.PROFILE_OUT_TBL_TYPE,
245 	x_return_status	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
246 	x_msg_count		 OUT NOCOPY /* file.sql.39 change */ NUMBER,
247 	x_msg_data		 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
248 );
249 
250 
251 -- Start of Comments
252 --
253 --	API name 	: Update_Profile
254 --	Type		: Public
255 --	Function	: Update a profile with a given set of parameters
256 --
257 --	Parameters	:
258 --	IN		:
259 --			p_api_version_number	IN NUMBER				Required
260 --			p_init_msg_list			IN VARCHAR2 			Optional
261 --			p_profile_id            IN	NUMBER				Optional
262 --			p_profile_name          IN	VARCHAR2			Optional
263 --			p_profile_type			IN VARCHAR2 			Optional
264 --			p_profile_desc			IN VARCHAR2 			Optional
265 --			p_profile_attrib_tbl	IN	JTF_PERZ_PROFILE_PUB.PROFILE_ATTRIB_TBL_TYPE,
266 --
267 -- OUT :
268 --			x_Profile_Tbl OUT JTF_PERZ_PROFILE_PUB.PROFILE_OUT_TBL,
269 --			x_return_status OUT VARCHAR2(1)
270 --			x_msg_count	 OUT NUMBER
271 --			x_msg_data	 OUT VARCHAR2(2000)
272 --
273 --
274 --
275 --	Version	:	Current version	1.0
276 --			 	Initial version 1.0
277 --
278 -- *****************************************************************************
279 --
280 -- USAGE NOTES :
281 --
282 --	1. This API updates a profile in the profile store. Of the input parameters
283 --	p_profile_name (the name of the profile) is a required field or the profile_id.
284 --
285 --	2. The p_profile_type is the type of profile this is where the caller can specify
286 --	the type of profile (like USER, TEMPLATE, APPLICATION etc.) these type are defined
287 --	in FND_LOOKUPS under PERSONALIZATION_PROFILE_TYPES. The existing profile will be updated
288 --	with this new profile_type.
289 --
290 --	3. A description for the profile is passed via p_profile_desc
291 --
292 --	4. The p_profile_attrib_tbl can hold the attribute-value pairs that need to be
293 --	update. if an attribute being sent in does not exist another attribute is inserted
294 --	against the existing profile.
295 --
296 --	5. The main out parameter for this API are x_profile_id and x_return_status which returns
297 --	FND_API.G_RETURN_SUCCESS when the API completes successfully
298 --	FND_API.G_RETURN_UNEXPECTED when the API reaches a unxpected state
299 --	FND_API.G_RETURN_ERROR when the API hits an error
300 --
301 -- *****************************************************************************
302 --
303 
304 PROCEDURE Update_Profile
305 ( 	p_api_version_number	IN	NUMBER,
306 	p_init_msg_list		IN	VARCHAR2 := FND_API.G_FALSE,
307 	p_commit		IN	VARCHAR2 := FND_API.G_FALSE,
308 
309 	p_profile_id            IN	NUMBER,
310 	p_profile_name          IN	VARCHAR2,
311 	p_profile_type		IN 	VARCHAR2,
312 	p_profile_desc		IN	VARCHAR2,
313 	p_active_flag		IN 	VARCHAR2,
314 	p_profile_attrib_tbl	IN	JTF_PERZ_PROFILE_PUB.PROFILE_ATTRIB_TBL_TYPE
315 				:= JTF_PERZ_PROFILE_PUB.G_MISS_PROFILE_ATTRIB_TBL,
316 
317 	x_profile_id	 OUT NOCOPY /* file.sql.39 change */ NUMBER,
318 	x_return_status	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
319 	x_msg_count	 OUT NOCOPY /* file.sql.39 change */ NUMBER,
320 	x_msg_data	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
321 );
322 
323 -- *****************************************************************************
324 -- *****************************************************************************
325 END  JTF_PERZ_PROFILE_PUB ;