1 PACKAGE BODY ota_lp_xmlp_pkg AS
2 /* $Header: otalpxmlp.pkb 120.0.12010000.2 2009/09/23 09:27:52 pekasi noship $ */
3
4 FUNCTION C_LP_NAME_p RETURN varchar2 IS
5
6 CURSOR c_lp_name_csr IS
7 select name
8 from ota_learning_paths_tl
9 where learning_path_id = P_LP_ID
10 and language = userenv('LANG');
11
12 BEGIN
13 open c_lp_name_csr;
14 fetch c_lp_name_csr into C_LP_NAME;
15 close c_lp_name_csr;
16 return C_LP_NAME;
17
18 END C_LP_NAME_p;
19
20 FUNCTION C_LP_STATUS_p RETURN varchar2 IS
21
22 CURSOR c_lookup_code IS
23 select es.meaning
24 from hr_lookups es
25 WHERE es.lookup_type = 'OTA_LP_CURRENT_STATUS'
26 AND sysdate BETWEEN NVL(es.start_date_active,sysdate) AND NVL (es.end_date_active, sysdate)
27 AND es.enabled_flag ='Y'
28 AND es.lookup_code = P_LP_STATUS_CODE ;
29
30 BEGIN
31 open c_lookup_code;
32 fetch c_lookup_code into C_LP_STATUS;
33 close c_lookup_code;
34 return C_LP_STATUS;
35
36 END C_LP_STATUS_p;
37
38 FUNCTION C_LEARNER_NAME_p return varchar2 IS
39
40 CURSOR c_learner_name_csr IS
41 SELECT ppf.full_name
42 FROM per_all_people_f ppf
43 WHERE trunc(sysdate) BETWEEN nvl(ppf.effective_start_date, trunc(sysdate)) AND nvl(ppf.effective_end_date, trunc(sysdate))
44 AND ppf.person_id = P_LEARNER_ID;
45
46 BEGIN
47 open c_learner_name_csr;
48 fetch c_learner_name_csr into C_LEARNER_NAME;
49 close c_learner_name_csr;
50 return C_LEARNER_NAME;
51
52 END C_LEARNER_NAME_p;
53
54 FUNCTION AfterPForm RETURN BOOLEAN IS
55 error_msg varchar2(4000);
56 BEGIN
57 IF ((P_LP_ID IS NULL and P_LEARNER_ID IS NULL) or (P_LP_ID IS NOT NULL and P_LEARNER_ID IS NOT NULL)) THEN
58
59 fnd_message.set_name('OTA', 'OTA_467206_LP_REPORT_PARAM_ERR');
60 error_msg := fnd_message.get;
61 RAISE_application_error(-20101, error_msg);
62 RETURN(FALSE);
63
64 END IF;
65
66 RETURN(TRUE);
67
68 END;
69
70 END ota_lp_xmlp_pkg;
71