1 PACKAGE CZ_contracts_api_grp AUTHID CURRENT_USER AS
2 /* $Header: czgconas.pls 120.0 2005/05/25 06:37:11 appldev noship $ */
3 /*#
4 * This is the public interface for some operations in Oracle Configurator.
5 * @rep:scope internal
6 * @rep:product CZ
7 * @rep:displayname Contracts API
8 * @rep:lifecycle active
9 * @rep:compatibility S
10 * @rep:category BUSINESS_ENTITY CZ_CONFIG_MODEL
11 * @rep:category BUSINESS_ENTITY CZ_RP_FOLDER
12 */
13
14 ------------------------------------------------------------------------------------------
15 --
16 -- CONSTANTS
17 --
18 --integer constant for object_id of the ROOT folder in Repository
19 RP_ROOT_FOLDER CONSTANT PLS_INTEGER:=0;
20
21 -- Caption rule constants. OKC supplies caption rule IDs in generic import.
22 G_CAPTION_RULE_DESC CONSTANT PLS_INTEGER := 802;
23 G_CAPTION_RULE_NAME CONSTANT PLS_INTEGER := 801;
24
25 G_CZ_EPOCH_BEGIN CONSTANT DATE := CZ_UTILS.EPOCH_BEGIN_;
26 G_CZ_EPOCH_END CONSTANT DATE := CZ_UTILS.EPOCH_END_;
27
28 --
29 -- TYPES
30 --
31
32 TYPE t_ref IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
33 TYPE t_lang_code IS TABLE OF fnd_languages.language_code%TYPE INDEX BY BINARY_INTEGER;
34
35 -----------------------------------------------------
36 -- Start of comments
37 -- API name : rp_folder_exists
38 -- Type : Public.
39 -- Function : check if a repository folder exists
40 -- Pre-reqs : None.
41 -- Parameters :
42 -- IN : p_api_version IN NUMBER Required
43 -- : p_rp_folder_id IN NUMBER Required
44 -- the folder id (object_id) of the RP folder to check
45 -- : p_encl_folder_id IN NUMBER Required
46 -- The parent folder in which the p_rp_folder_id
47 -- will be checked for existance
48 -- Use RP_ROOT_FOLDER for folder id of the root folder
49 -- Pass NULL to check the folder anywhere in the repository
50 -- RETURNS : Boolean
51 -- TRUE when encl folder is null and
52 -- p_rp_folder exists anywhere in repository
53 -- TRUE when encl folder is not null and
54 -- it exists anywhere in repository and
55 -- p_rp_folder exists in it
56 -- FALSE when encl folder is null and
57 -- p_rp_folder doesn't exists anywhere in repository
58 -- FALSE when encl folder is not null and
59 -- it doesn't exists anywhere in repository
60 -- FALSE when encl folder is not null and
61 -- p_rp_folder is not in it
62 -- Version : Current version 1.0
63 -- Initial version 1.0
64 -- Notes :
65 --
66 -- End of comments
67 /*#
68 * check if repository folder exists
69 * @param p_api_version api verion
70 * @param p_encl_folder_id the folder id (object_id) of the RP folder to check
71 * @param p_rp_folder_id The parent folder in which the p_rp_folder_id
72 * will be checked for existance
73 * Use RP_ROOT_FOLDER for folder id of the root folder
74 * Pass NULL to check the folder anywhere in the repository
75 * @return TRUE when encl folder is null and
76 * p_rp_folder exists anywhere in repository TRUE when encl folder is not null and it exists anywhere in repository and
77 * p_rp_folder exists in it FALSE when encl folder is null and p_rp_folder doesn't exists anywhere in repository
78 * FALSE when encl folder is not null and it doesn't exists anywhere in repository FALSE when encl folder is not null and
79 * p_rp_folder is not in it
80 * @rep:scope public
81 * @rep:lifecycle active
82 * @rep:displayname Check if Repository folder exists
83 * @rep:category BUSINESS_ENTITY CZ_RP_FOLDER
84 */
85 FUNCTION rp_folder_exists (p_api_version IN NUMBER
86 ,p_encl_folder_id IN NUMBER
87 ,p_rp_folder_id IN NUMBER) RETURN BOOLEAN;
88 -----------------------------------------------------
89 -- Start of comments
90 -- API name : create_rp_folder
91 -- Type : Public.
92 --
93 -- Function : Creates a Repository folder in the specified enclosing folder.
94 -- If a folder with the same name exists in the enclosing folder
95 -- then its id is returned in x_new_folder_id OUT paramater
96 --
97 -- Pre-reqs : None.
98 -- Parameters :
99 -- IN : p_api_version IN NUMBER Required
100 -- p_encl_folder_id IN NUMBER Required
101 -- The parent folder to create new folder
102 -- use RP_ROOT_FOLDER constant for root folder
103 -- p_new_folder_name IN VARCHAR2 Required
104 -- The new folder name
105 -- p_folder_desc IN VARCHAR2 DEFAULT NULL
106 -- p_folder_notes IN VARCHAR2 DEFAULT NULL
107 -- OUT :
108 -- x_new_folder_id OUT NOCOPY NUMBER Required
109 -- the new folder id created, or the
110 -- folder id of the folder with the same name
111 -- in the same enclosing folder
112 -- x_return_status OUT NOCOPY VARCHAR2 Required
113 -- x_msg_count OUT NOCOPY NUMBER Required
114 -- x_msg_data OUT NOCOPY VARCHAR2 Required
115 --
116 -- Version : Current version 1.0
117 -- Initial version 1.0
118 -- Notes : if a folder with the same name exists in the enclosing folder
119 -- then its id is returned in x_new_folder_id OUT paramater
120 --
121 -- End of comments
122 /*#
123 * Create new Repostitory folder
124 * @param p_api_version api verion
125 * @param p_encl_folder_id The parent folder to create new folder use RP_ROOT_FOLDER constant for root folder
126 * @param p_new_folder_name The new folder name
127 * @param p_folder_desc folder description
128 * @param p_folder_notes folder notes
129 * @param x_new_folder_id the new folder id created, or the folder id of the folder with the same name in the same enclosing folder
130 * @param x_return_status status string
131 * @param x_msg_count number of error messages
132 * @param x_msg_data string which contains error messages
133 * @rep:scope public
134 * @rep:lifecycle active
135 * @rep:displayname Create new Repostitory folder
136 * @rep:category BUSINESS_ENTITY CZ_RP_FOLDER
137 */
138 PROCEDURE create_rp_folder(p_api_version IN NUMBER
139 ,p_encl_folder_id IN CZ_RP_ENTRIES.OBJECT_ID%TYPE
140 ,p_new_folder_name IN CZ_RP_ENTRIES.NAME%TYPE
141 ,p_folder_desc IN CZ_RP_ENTRIES.DESCRIPTION%TYPE
142 ,p_folder_notes IN CZ_RP_ENTRIES.NOTES%TYPE
143 ,x_new_folder_id OUT NOCOPY CZ_RP_ENTRIES.OBJECT_ID%TYPE
144 ,x_return_status OUT NOCOPY VARCHAR2
145 ,x_msg_count OUT NOCOPY NUMBER
146 ,x_msg_data OUT NOCOPY VARCHAR2
147 );
148 -----------------------------------------------------
149 -- Start of comments
150 -- API name : import_generic
151 -- Type : Public.
152 -- Function : process and import data in CZ interface tables
153 -- Pre-reqs : None.
154 -- Parameters :
155 -- IN : p_api_version IN NUMBER Required
156 -- IN : p_run_id IN NUMBER Required
157 -- Specify the run_id to process. If NULL, all records
158 -- in interface tables where run_id is NULL will be processed.
159 -- IN : p_rp_folder_id IN NUMBER Required
160 -- The repository folder to import the model into,
161 -- use RP_ROOT_FOLDER constant for the root folder id
162 -- OUT : x_run_id OUT NOCOPY NUMBER Required
163 -- Used to get results from cz_xfr_run_infos and cz_xfr_run_results
164 -- Also CZ_DB_LOGS.run_id, if there are warnings or errors
165 -- OUT : x_status OUT NOCOPY NUMBER Required
166 -- G_ERROR or G_SUCCESS (constants from this package)
167 -- Version : Current version 1.0
168 -- Initial version 1.0
169 -- Notes :
170 --
171 -- End of comments
172 /*#
173 * Generic Import
174 * @param p_api_version api verion
175 * @param p_run_id Specify the run_id to process. If NULL, all records in interface tables where run_id is NULL will be processed.
176 * @param p_rp_folder_id The repository folder to import the model into, use RP_ROOT_FOLDER constant for the root folder id
177 * @param x_run_id CZ_DB_LOGS.run_id if there are warnings and/or errors, 0 if not
178 * @param x_status G_ERROR, G_WARNING or G_SUCCESS (constants from this package)
179 * @rep:scope public
180 * @rep:lifecycle active
181 * @rep:displayname Generic Import
182 * @rep:category BUSINESS_ENTITY CZ_CONFIG_MODEL
183 */
184 PROCEDURE import_generic(p_api_version IN NUMBER
185 ,p_run_id IN NUMBER
186 ,p_rp_folder_id IN NUMBER
187 ,x_run_id OUT NOCOPY NUMBER
188 ,x_status OUT NOCOPY NUMBER);
189
190 -----------------------------------------------------
191 -- Start of comments
192 -- API name : delete_model
193 -- Type : Public.
194 -- Function : Deletes a model in cz_devl_projects table (imported models only)
195 -- Pre-reqs : None.
196 -- Parameters :
197 -- IN : p_api_version IN NUMBER Required
198 -- IN : p_model_id IN NUMBER Required
199 -- the devl_project_id in cz_devl_projects table
200 -- IN : p_orig_sys_ref IN VARCHAR2 Required
201 -- the orig_sys_ref in cz_devl_projects table - cannot be null
202 --
203 -- OUT :
204 -- x_return_status OUT NOCOPY VARCHAR2 Required
205 -- x_msg_count OUT NOCOPY NUMBER Required
206 -- x_msg_data OUT NOCOPY VARCHAR2 Required
207 --
208 -- Version : Current version 1.0
209 -- Initial version 1.0
210 --
211 -- Notes :
212 -- 1. Both p_model_id and p_orig_sys_ref must match for deleting a model in cz_devl_projects
213 -- 2. It will not delete and return error if any of the following is true
214 -- a) If the devl project is referened by any other devl_project(s)
215 -- To delete the devl project, first remove all the references to this devl project
216 -- b) If the model is in the process of being published (any export status except 'OK')
217 -- To delete the model first delete all pending publications of this model and/or wait
218 -- for processing publications of this model to complete.
219 -- c) If the model structure (including any referenced models),
220 -- any of its user interfaces (including any child UIs)
221 -- or any of the rule folders (including any subfolders) are locked
222 -- at the time the delete_model is called.
223 -- To delete, unlock any locked components and re-run the delete_model
224 -- End of comments
225 /*#
226 * delete model
227 * @param p_api_version api verion
228 * @param p_model_id the devl_project_id in cz_devl_projects table
229 * @param p_orig_sys_ref the orig_sys_ref in cz_devl_projects table - cannot be null
230 * @param x_return_status status string
231 * @param x_msg_count number of error messages
232 * @param x_msg_data string which contains error messages
233 * @rep:scope public
234 * @rep:lifecycle active
235 * @rep:displayname Delete Model
236 * @rep:category BUSINESS_ENTITY CZ_CONFIG_MODEL
237 */
238 PROCEDURE delete_model(p_api_version IN NUMBER
239 ,p_model_id IN NUMBER
240 ,p_orig_sys_ref IN VARCHAR2
241 ,x_return_status OUT NOCOPY VARCHAR2
242 ,x_msg_count OUT NOCOPY NUMBER
243 ,x_msg_data OUT NOCOPY VARCHAR2);
244
245
246
247
248 ----start of comments
249 ---- create publication request
250 ---- Parameters
251 ---- IN: p_api_version IN NUMBER Required
252 ---- p_model_id IN NUMBER, Required
253 --- p_ui_def_id IN NUMBER, Required
254 ---- p_publication_mode IN NUMBER,
255 ---- p_server_id IN NUMBER,
256 ---- p_appl_id_tbl IN number_type_tbl,
257 ---- p_usg_id_tbl IN number_type_tbl,
258 ---- p_lang_tbl IN varchar_type_tbl,
259 ---- p_start_date IN DATE,
260 ---- p_end_date IN DATE,
261 ----
262 ---- OUT
263 ---- x_publication_id OUT NOCOPY NUMBER,
264 ---- x_return_status OUT NOCOPY VARCHAR2,
265 ---- x_msg_count OUT NOCOPY NUMBER,
266 ---- x_msg_data OUT NOCOPY VARCHAR2
267 ----
268 ----Parameter Description
269 ---- IN
270 ---- p_api_version Version: Current version :1.0
271 ---- p_model_id: devl_project_id of the model being published
272 ---- p_ui_def_id : ui_def_id of the model being published
273 ----
274 ---- p_publication_mode: Publication mode.
275 ---- If no publication mode is passed, production mode ('P') is defaulted
276 ---- Valid values are 'P' (production mode), 'T' (Test mode).
277 ----
278 ---- p_appl_id_tbl: application that would access the published model
279 ---- This is an array that contains the application id(s). For contracts we
280 ---- Can default this to the application id of 'OKC' and not allow any other
281 ---- Values.
282 ----
283 ---- p_usg_id_tbl: publication usage.
284 ---- This is an array containing usage id(s).
285 ---- For contracts, we can default this to "Any Usage" (-1).
286 ----
287 ---- p_lang_tbl: an array containing the languages.
288 ----
289 ---- p_start_date: date from which the publication would be applicable
290 ---- p_end_date: date until which the publication would be applicable
291 ---- If none of the above dates are passed, the start date would have a
292 ---- Default value of epoch begin and end date would be defaulted to
293 ---- Epoch end.
294 ---- P_server_id: would be defaulted to 0 for contracts
295 ----
296 ---- OUT
297 ---- x_publication_id : the id of the publication request
298 ---- (I don't think OKC should care about this, but it is good for debugging purposes.)
299 ----
300 ---- x_return_status : FND_API.G_RET_STS_SUCCESS
301 ---- FND_API.G_RET_STS_ERROR
305
302 ---- FND_API.G_RET_STS_UNEXPECTED
303 ---- x_msg_count Count of error messages.
304 ---- x_msg_data error message
306
307 PROCEDURE create_publication_request (p_api_version IN NUMBER,
308 p_model_id IN NUMBER,
309 p_ui_def_id IN NUMBER,
310 p_publication_mode IN VARCHAR2,
311 p_server_id IN NUMBER,
312 p_appl_id_tbl IN t_ref,
313 p_usg_id_tbl IN t_ref,
314 p_lang_tbl IN t_lang_code,
315 p_start_date IN DATE,
316 p_end_date IN DATE,
317 x_publication_id OUT NOCOPY NUMBER,
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 ----start of comments
325 ---- edit_publication
326 ---- Parameters
327 ---- IN: p_api_version IN NUMBER Required
328 ---- p_publicationId IN NUMBER, Required
329 --- p_applicationId IN NUMBER, Required
330 ---- p_publication_mode IN VARCHAR2,
331 ---- p_languageId IN NUMBER,
332 ---- p_usageId IN NUMBER,
333 ---- p_startdate IN DATE,
334 ---- p_disabledate IN DATE,
335 ----
336 ---- OUT:
337 ---- x_return_status OUT NOCOPY VARCHAR2,
338 ---- x_msg_count OUT NOCOPY NUMBER,
339 ---- x_msg_data OUT NOCOPY VARCHAR2
340 -----
341 PROCEDURE EDIT_PUBLICATION(p_api_version IN NUMBER,
342 p_publicationId IN NUMBER,
343 p_applicationId IN OUT NOCOPY t_ref,
344 p_languageId IN OUT NOCOPY t_lang_code,
345 p_usageId IN OUT NOCOPY t_ref,
346 p_startDate IN DATE,
347 p_disableDate IN DATE,
348 p_publicationMode IN VARCHAR2,
349 x_return_status OUT NOCOPY VARCHAR2,
350 x_msg_count OUT NOCOPY NUMBER,
351 x_msg_data OUT NOCOPY VARCHAR2);
352
353
354 PROCEDURE EDIT_PUBLICATION(p_api_version IN NUMBER,
355 p_publicationId IN NUMBER,
356 p_applicationId IN OUT NOCOPY VARCHAR2,
357 p_languageId IN OUT NOCOPY VARCHAR2,
358 p_usageId IN OUT NOCOPY VARCHAR2,
359 p_startDate IN DATE,
360 p_disableDate IN DATE,
361 p_publicationMode IN VARCHAR2,
362 x_return_status OUT NOCOPY VARCHAR2,
363 x_msg_count OUT NOCOPY NUMBER,
364 x_msg_data OUT NOCOPY VARCHAR2);
365
366
367
368 ----start of comments
369 ---- delete_publication
370 ---- Parameters
371 ---- IN: p_api_version IN NUMBER Required
372 ---- publicationId IN NUMBER, Required
373 ----
374 ---- OUT:
375 ---- x_return_status OUT NOCOPY VARCHAR2,
376 ---- x_msg_count OUT NOCOPY NUMBER,
377 ---- x_msg_data OUT NOCOPY VARCHAR2
378 -----
379 PROCEDURE DELETE_PUBLICATION(p_api_version IN NUMBER,
380 publicationId IN NUMBER,
381 x_return_status OUT NOCOPY VARCHAR2,
382 x_msg_count OUT NOCOPY NUMBER,
383 x_msg_data OUT NOCOPY VARCHAR2
384 );
385
386
387 ----start of comments
388 ---- delete_ui_def
389 ---- Parameters
390 ---- IN: p_api_version IN NUMBER Required = 1.0
391 ---- p_ui_def_id IN NUMBER, Required
392 ----
393 ---- OUT:
394 ---- x_return_status OUT NOCOPY VARCHAR2,
395 ---- x_msg_count OUT NOCOPY NUMBER,
396 ---- x_msg_data OUT NOCOPY VARCHAR2
397 -----
398 PROCEDURE delete_ui_def(p_api_version IN NUMBER,
399 p_ui_def_id IN NUMBER,
400 x_return_status OUT NOCOPY VARCHAR2,
401 x_msg_count OUT NOCOPY NUMBER,
402 x_msg_data OUT NOCOPY VARCHAR2
403 );
404
405 ----start of comments
406 ---- generate_logic
407 ---- Parameters
408 ---- IN: p_api_version IN NUMBER Required = 1.0
409 ---- p_devl_project_id IN NUMBER, Required
410 ----
411 ---- OUT:
412 ---- x_run_id OUT NOCOPY NUMBER,
413 ---- x_return_status OUT NOCOPY VARCHAR2,
414 ---- x_msg_count OUT NOCOPY NUMBER,
415 ---- x_msg_data OUT NOCOPY VARCHAR2
416 ----
417 -- End of comments
418 PROCEDURE generate_logic(p_api_version IN NUMBER,
419 p_devl_project_id IN NUMBER,
420 x_run_id OUT NOCOPY NUMBER,
421 x_return_status OUT NOCOPY VARCHAR2,
422 x_msg_count OUT NOCOPY NUMBER,
423 x_msg_data OUT NOCOPY VARCHAR2);
424
425 -- Start of comments
426 -- API name : Publish_Model
427 -- Type : Public.
428 -- Function : Publish a model
429 -- Pre-reqs : None.
430 -- Parameters :
431 -- IN : p_api_version IN NUMBER Required = 1.0
432 -- p_publication_id IN NUMBER Required
433 -- OUT:
434 -- x_run_id OUT NOCOPY NUMBER,
438 --
435 -- x_return_status OUT NOCOPY VARCHAR2,
436 -- x_msg_count OUT NOCOPY NUMBER,
437 -- x_msg_data OUT NOCOPY VARCHAR2
439 -- Version : Current version 1.0
440 -- Initial version 1.0
441 -- Notes : It should only be run on publications with a status of 'Pending'
442 --
443 -- End of comments
444 PROCEDURE publish_model(p_api_version IN NUMBER,
445 p_publication_id IN NUMBER,
446 x_run_id OUT NOCOPY NUMBER,
447 x_return_status OUT NOCOPY VARCHAR2,
448 x_msg_count OUT NOCOPY NUMBER,
449 x_msg_data OUT NOCOPY VARCHAR2);
450 --------------------------------------------------------------------------------------------
451 -- Start of comments
452 -- API name : create_JRAD_UI
453 -- Type : Public.
454 -- Function : Generates a new JRAD style user interface for a model
455 -- Pre-reqs : None.
456 -- Parameters :
457 -- IN :
458 -- p_api_version -- identifies version of API
459 -- p_devl_project_id -- identifies Model for which UI will be generated
460 -- p_show_all_nodes -- '1' - ignore ps node property "DO NOT SHOW IN UI"
461 -- p_master_template_id -- identifies UI Master Template
462 -- p_create_empty_ui -- '1' - create empty UI ( which contains only one record in CZ_UI_DEFS )
463 -- x_ui_def_id -- ui_def_id of UI that has been generated
464 -- OUT :
465 -- x_return_status -- status string
466 -- x_msg_count -- number of error messages
467 -- x_msg_data -- string which contains error messages
468 --
469 -- Version : Current version 1.0
470 -- Initial version 1.0
471 -- Notes :
472 --
473 -- End of comments
474
475 PROCEDURE create_jrad_ui(p_api_version IN NUMBER,
476 p_devl_project_id IN NUMBER,
477 p_show_all_nodes IN VARCHAR2,
478 p_master_template_id IN NUMBER,
479 p_create_empty_ui IN VARCHAR2,
480 x_ui_def_id OUT NOCOPY NUMBER,
481 x_return_status OUT NOCOPY VARCHAR2,
482 x_msg_count OUT NOCOPY NUMBER,
483 x_msg_data OUT NOCOPY VARCHAR2);
484
485 --------------------------API status return codes-----------------------------------------
486 G_STATUS_SUCCESS constant NUMBER :=0;
487 G_STATUS_ERROR constant NUMBER :=1;
488 G_STATUS_WARNING constant NUMBER :=2;
489
490 ------------------------------------------------------------------------------------------
491
492 END CZ_contracts_api_grp;