DBA Data[Home] [Help]

PACKAGE: APPS.HZ_LOCATION_BO_PUB

Source


1 PACKAGE HZ_LOCATION_BO_PUB AS
2 /*$Header: ARHBLCBS.pls 120.4 2006/09/21 17:59:56 acng noship $ */
3 /*#
4  * Location Business Object API
5  * Public API that allows users to manage Location business objects in the Trading Community Architecture. Several
6  * operations are supported, including the creation and update of the business object.
7  *
8  * @rep:scope public
9  * @rep:product HZ
10  * @rep:lifecycle active
11  * @rep:category BUSINESS_ENTITY HZ_ADDRESS
12  * @rep:displayname Location Business Object API
13  * @rep:doccd 120hztig.pdf Location Business Object API, Oracle Trading Community Architecture Technical Implementation Guide
14  */
15 
16   -- PROCEDURE create_location_bo
17   --
18   -- DESCRIPTION
19   --     Create a location business object.
20   --
21   -- EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
22   --
23   -- ARGUMENTS
24   --   IN:
25   --     p_init_msg_list      Initialize message stack if it is set to
26   --                          FND_API.G_TRUE. Default is FND_API.G_FALSE.
27   --     p_validate_bo_flag   If it is set to FND_API.G_TRUE, validate
28   --                          the completeness of business object.
29   --     p_location_obj       Location business object.
30   --     p_created_by_module  Created by module.
31   --   OUT:
32   --     x_return_status      Return status after the call. The status can
33   --                          be fnd_api.g_ret_sts_success (success),
34   --                          fnd_api.g_ret_sts_error (error),
35   --                          FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
36   --     x_msg_count          Number of messages in message stack.
37   --     x_msg_data           Message text if x_msg_count is 1.
38   --     x_location_id        Location ID.
39   --     x_location_os        Location orig system.
40   --     x_location_osr       Location orig system reference.
41   --
42   -- NOTES
43   --
44   -- MODIFICATION HISTORY
45   --
46   --   14-DEC-2004    Arnold Ng          Created.
47   --
48 
49   PROCEDURE create_location_bo(
50     p_init_msg_list       IN            VARCHAR2 := fnd_api.g_false,
51     p_validate_bo_flag    IN            VARCHAR2 := fnd_api.g_true,
52     p_location_obj        IN            HZ_LOCATION_OBJ,
53     p_created_by_module   IN            VARCHAR2,
54     x_return_status       OUT NOCOPY    VARCHAR2,
55     x_msg_count           OUT NOCOPY    NUMBER,
56     x_msg_data            OUT NOCOPY    VARCHAR2,
57     x_location_id         OUT NOCOPY    NUMBER,
58     x_location_os         OUT NOCOPY    VARCHAR2,
59     x_location_osr        OUT NOCOPY    VARCHAR2
60   );
61 
62 /*#
63  * Create Location Business Object (create_location_bo)
64  * Creates a Location business object. You pass object data to the procedure, packaged within an object type defined
65  * specifically for the API. The object type is HZ_LOCATION_OBJ for the Location business object. In addition to the
66  * object's business object attributes, the object type also includes lower-level embedded child entities or objects
67  * that can be simultaneously created.
68  *
69  * @param p_return_obj_flag Indicates if the created object is to be returned to the caller as an output parameter. Default value: false
70  * @param p_validate_bo_flag Indicates if the passed business object is to be validated for completeness. Default value: true
71  * @param p_location_obj The Location business object to be created in its entirety
72  * @param p_created_by_module The module creating this business object. Must be a valid created_by_module value
73  * @param p_obj_source The source of this business object
74  * @param x_return_status Return status after the call
75  * @param x_return_obj The Location business object that was created, returned as an output parameter
76  * @param x_messages Messages returned from the creation of the business object
77  * @param x_location_id TCA identifier for the Location business object
78  * @param x_location_os Location original system name
79  * @param x_location_osr Location original system reference
80  * @rep:scope public
81  * @rep:lifecycle active
82  * @rep:displayname Create Location Business Object
83  * @rep:doccd 120hztig.pdf Create Location Business Object, Oracle Trading Community Architecture Technical Implementation Guide
84  */
85   PROCEDURE create_location_bo(
86     p_validate_bo_flag    IN            VARCHAR2 := fnd_api.g_true,
87     p_location_obj        IN            HZ_LOCATION_OBJ,
88     p_created_by_module   IN            VARCHAR2,
89     p_obj_source          IN            VARCHAR2 := null,
90     p_return_obj_flag     IN            VARCHAR2 := fnd_api.g_true,
91     x_return_status       OUT NOCOPY    VARCHAR2,
92     x_messages            OUT NOCOPY    HZ_MESSAGE_OBJ_TBL,
93     x_return_obj          OUT NOCOPY    HZ_LOCATION_OBJ,
94     x_location_id         OUT NOCOPY    NUMBER,
95     x_location_os         OUT NOCOPY    VARCHAR2,
96     x_location_osr        OUT NOCOPY    VARCHAR2
97   );
98 
99   -- PROCEDURE update_location_bo
100   --
101   -- DESCRIPTION
102   --     Update a location business object.
103   --
104   -- EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
105   --
106   -- ARGUMENTS
107   --   IN:
108   --     p_init_msg_list      Initialize message stack if it is set to
109   --                          FND_API.G_TRUE. Default is FND_API.G_FALSE.
110   --     p_location_obj       Location business object.
111   --     p_created_by_module  Created by module.
112   --   OUT:
113   --     x_return_status      Return status after the call. The status can
114   --                          be fnd_api.g_ret_sts_success (success),
115   --                          fnd_api.g_ret_sts_error (error),
116   --                          FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
117   --     x_msg_count          Number of messages in message stack.
118   --     x_msg_data           Message text if x_msg_count is 1.
119   --     x_location_id        Location ID.
120   --     x_location_os        Location orig system.
121   --     x_location_osr       Location orig system reference.
122   --
123   -- NOTES
124   --
125   -- MODIFICATION HISTORY
126   --
127   --   14-DEC-2004    Arnold Ng          Created.
128   --
129 
130   PROCEDURE update_location_bo(
131     p_init_msg_list       IN            VARCHAR2 := fnd_api.g_false,
132     p_location_obj        IN            HZ_LOCATION_OBJ,
133     p_created_by_module   IN            VARCHAR2,
134     x_return_status       OUT NOCOPY    VARCHAR2,
135     x_msg_count           OUT NOCOPY    NUMBER,
136     x_msg_data            OUT NOCOPY    VARCHAR2,
137     x_location_id         OUT NOCOPY    NUMBER,
138     x_location_os         OUT NOCOPY    VARCHAR2,
139     x_location_osr        OUT NOCOPY    VARCHAR2
140   );
141 
142 /*#
143  * Update Location Business Object (update_location_bo)
144  * Updates a Location business object. You pass any modified object data to the procedure, packaged within an object type
145  * defined specifically for the API. The object type is HZ_LOCATION_OBJ for the Location business object. In addition to
146  * the object's business object attributes, the object type also includes embedded child business entities or objects that
147  * can be simultaneously created or updated.
148  *
149  * @param p_return_obj_flag Indicates if the updated object is to be returned to the caller as an output parameter. Default value: false
150  * @param p_location_obj The Location business object to be updated
151  * @param p_created_by_module The module updating this business object
152  * @param p_obj_source The source of this business object
153  * @param x_return_status Return status after the call
154  * @param x_return_obj The Location business object that was updated, returned as an output parameter
155  * @param x_messages Messages returned from the update of the business object
156  * @param x_location_id TCA identifier for the Location business object
157  * @param x_location_os Location original system name
158  * @param x_location_osr Location original system reference
159  * @rep:scope public
160  * @rep:lifecycle active
161  * @rep:displayname Update Location Business Object
162  * @rep:doccd 120hztig.pdf Update Location Business Object, Oracle Trading Community Architecture Technical Implementation Guide
163  */
164   PROCEDURE update_location_bo(
165     p_location_obj        IN            HZ_LOCATION_OBJ,
166     p_created_by_module   IN            VARCHAR2,
167     p_obj_source          IN            VARCHAR2 := null,
168     p_return_obj_flag     IN            VARCHAR2 := fnd_api.g_true,
169     x_return_status       OUT NOCOPY    VARCHAR2,
170     x_messages            OUT NOCOPY    HZ_MESSAGE_OBJ_TBL,
171     x_return_obj          OUT NOCOPY    HZ_LOCATION_OBJ,
172     x_location_id         OUT NOCOPY    NUMBER,
173     x_location_os         OUT NOCOPY    VARCHAR2,
174     x_location_osr        OUT NOCOPY    VARCHAR2
175   );
176 
177   -- PROCEDURE save_location_bo
178   --
179   -- DESCRIPTION
180   --     Create or update a location business object.
181   --
182   -- EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
183   --
184   -- ARGUMENTS
185   --   IN:
186   --     p_init_msg_list      Initialize message stack if it is set to
187   --                          FND_API.G_TRUE. Default is FND_API.G_FALSE.
188   --     p_location_obj       Location business object.
189   --     p_created_by_module  Created by module.
190   --   OUT:
191   --     x_return_status      Return status after the call. The status can
192   --                          be fnd_api.g_ret_sts_success (success),
193   --                          fnd_api.g_ret_sts_error (error),
194   --                          FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
195   --     x_msg_count          Number of messages in message stack.
196   --     x_msg_data           Message text if x_msg_count is 1.
197   --     x_location_id        Location ID.
198   --     x_location_os        Location orig system.
199   --     x_location_osr       Location orig system reference.
200   --
201   -- NOTES
202   --
203   -- MODIFICATION HISTORY
204   --
205   --   14-DEC-2004    Arnold Ng          Created.
206   --
207 
208   PROCEDURE save_location_bo(
209     p_init_msg_list       IN            VARCHAR2 := fnd_api.g_false,
210     p_validate_bo_flag    IN            VARCHAR2 := fnd_api.g_true,
211     p_location_obj        IN            HZ_LOCATION_OBJ,
212     p_created_by_module   IN            VARCHAR2,
213     x_return_status       OUT NOCOPY    VARCHAR2,
214     x_msg_count           OUT NOCOPY    NUMBER,
215     x_msg_data            OUT NOCOPY    VARCHAR2,
216     x_location_id         OUT NOCOPY    NUMBER,
217     x_location_os         OUT NOCOPY    VARCHAR2,
218     x_location_osr        OUT NOCOPY    VARCHAR2
219   );
220 
221 /*#
225  * identification information, and creates or updates the object. The object type is HZ_LOCATION_OBJ for the Location
222  * Save Location Business Object (save_location_bo)
223  * Saves a Location business object. You pass new or modified object data to the procedure, packaged within an object type
224  * defined specifically for the API. The API then determines if the object exists in TCA, based upon the provided
226  * business object. For either case, the object type that you provide will be processed as if the respective API procedure
227  * is being called (create_location_bo or update_location_bo). Please see those procedures for more details. In addition to
228  * the object's business object attributes, the object type also includes embedded child business entities or objects that
229  * can be simultaneously created or updated.
230  *
231  * @param p_return_obj_flag Indicates if the saved object is to be returned to the caller as an output parameter. Default value: false
232  * @param p_validate_bo_flag Indicates if the passed business object is to be validated for completeness if it is being created
233  * @param p_location_obj The Location business object to be saved
234  * @param p_created_by_module The module saving this business object
235  * @param p_obj_source The source of this business object
236  * @param x_return_status Return status after the call
237  * @param x_return_obj The Location business object that was saved, returned as an output parameter
238  * @param x_messages Messages returned from the save of the business object
239  * @param x_location_id TCA identifier for the Location business object
240  * @param x_location_os Location original system name
241  * @param x_location_osr Location original system reference
242  * @rep:scope public
243  * @rep:lifecycle active
244  * @rep:displayname Save Location Business Object
245  * @rep:doccd 120hztig.pdf Save Location Business Object, Oracle Trading Community Architecture Technical Implementation Guide
246  */
247   PROCEDURE save_location_bo(
248     p_validate_bo_flag    IN            VARCHAR2 := fnd_api.g_true,
249     p_location_obj        IN            HZ_LOCATION_OBJ,
250     p_created_by_module   IN            VARCHAR2,
251     p_obj_source          IN            VARCHAR2 := null,
252     p_return_obj_flag     IN            VARCHAR2 := fnd_api.g_true,
253     x_return_status       OUT NOCOPY    VARCHAR2,
254     x_messages            OUT NOCOPY    HZ_MESSAGE_OBJ_TBL,
255     x_return_obj          OUT NOCOPY    HZ_LOCATION_OBJ,
256     x_location_id         OUT NOCOPY    NUMBER,
257     x_location_os         OUT NOCOPY    VARCHAR2,
258     x_location_osr        OUT NOCOPY    VARCHAR2
259   );
260 
261  --------------------------------------
262   --
263   -- PROCEDURE get_location_bo
264   --
265   -- DESCRIPTION
266   --     Get a logical location.
267   --
268   -- EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
269   --
270   -- ARGUMENTS
271   --   IN:
272   --     p_init_msg_list      Initialize message stack if it is set to  FND_API.G_TRUE. Default is FND_API.G_FALSE.
273  --      p_location_id        location ID. If this id is not passed in, multiple site objects will be returned.
274   --     p_location_os        location orig system.
275   --     p_location_osr       location orig system reference.
276   --   OUT:
277   --     x_location_objs         Logical location records.
278   --     x_return_status      Return status after the call. The status can
279   --                          be fnd_api.g_ret_sts_success (success),
280   --                          fnd_api.g_ret_sts_error (error),
281   --                          FND_API.G_RET_STS_UNEXP_ERROR (unexpected error).
282   --     x_msg_count          Number of messages in message stack.
283   --     x_msg_data           Message text if x_msg_count is 1.
284   --
285   -- NOTES
286   --
287   -- MODIFICATION HISTORY
288   --
289   --
290   --   2-NOV-2005   Arnold Ng          Created.
291   --
292 
293 /*
294 The Get location API Procedure is a retrieval service that returns a full location business object.
295 The user identifies a particular location business object using the TCA identifier and/or
296 the object Source System information. Upon proper validation of the object,
297 the full location business object is returned. The object consists of all data included within
298 the location business object, at all embedded levels. This includes the set of all data stored
299 in the TCA tables for each embedded entity.
300 
301 To retrieve the appropriate embedded business objects within the location business object,
302 the Get procedure calls the equivalent procedure for the following embedded objects:
303 
304 To retrieve the appropriate embedded entities within the location business object,
305 the Get procedure returns all records for the particular location from these TCA entity tables:
306 
307 Embedded TCA Entity	Mandatory	Multiple	TCA Table Entities
308 
309 Location		Y		N	HZ_LOCATIONS
310 */
311 
312 PROCEDURE get_location_bo (
313 	p_init_msg_list		IN	VARCHAR2 := FND_API.G_FALSE,
314 	p_location_id		IN	NUMBER,
315 	p_location_os		IN	VARCHAR2,
316 	p_location_osr	        IN      VARCHAR2,
317 	x_location_obj  	OUT NOCOPY	HZ_LOCATION_OBJ,
318 	x_return_status		OUT NOCOPY	VARCHAR2,
319 	x_msg_count		OUT NOCOPY	NUMBER,
320 	x_msg_data		OUT NOCOPY	VARCHAR2
321 );
322 
323 /*#
324  * Get Location Business Object (get_location_bo)
325  * Extracts a particular Location business object from TCA. You pass the object's identification information to the
326  * procedure, and the procedure returns the identified business object as it exists in TCA.
327  *
328  * @param p_location_id TCA identifier for the Location business object
329  * @param p_location_os Location original system name
330  * @param p_location_osr Location original system reference
331  * @param x_location_obj The retrieved Location business object
332  * @param x_return_status Return status after the call
336  * @rep:displayname Get Location Business Object
333  * @param x_messages Messages returned from the retrieval of the business object
334  * @rep:scope public
335  * @rep:lifecycle active
337  */
338 PROCEDURE get_location_bo (
339         p_location_id           IN      NUMBER,
340         p_location_os           IN      VARCHAR2,
341         p_location_osr          IN      VARCHAR2,
342         x_location_obj          OUT NOCOPY      HZ_LOCATION_OBJ,
343         x_return_status         OUT NOCOPY      VARCHAR2,
344         x_messages              OUT NOCOPY      HZ_MESSAGE_OBJ_TBL
345 );
346 
347   -- PUBLIC PROCEDURE assign_location_rec
348   --
349   -- DESCRIPTION
350   --     Assign attribute value from location object to plsql record.
351   --
352   -- EXTERNAL PROCEDURES/FUNCTIONS ACCESSED
353   --
354   -- ARGUMENTS
355   --   IN:
356   --     p_location_obj       Location object.
357   --     p_loc_os             Location original system.
358   --     p_loc_osr            Location original system reference.
359   --     p_create_or_update   Create or update flag.
360   --   IN/OUT:
361   --     px_location_rec      Location plsql record.
362   --
363   -- NOTES
364   --
365   -- MODIFICATION HISTORY
366   --
367   --   02-NOV-2005    Arnold Ng          Created.
368   --
369 
370   PROCEDURE assign_location_rec(
371     p_location_obj               IN            HZ_LOCATION_OBJ,
372     p_loc_os                     IN            VARCHAR2,
373     p_loc_osr                    IN            VARCHAR2,
374     p_create_or_update           IN            VARCHAR2 := 'C',
375     px_location_rec              IN OUT NOCOPY HZ_LOCATION_V2PUB.LOCATION_REC_TYPE
376   );
377 
378 END HZ_LOCATION_BO_PUB;