[Home] [Help]
PACKAGE BODY: APPS.HR_IPT_SHD
Source
1 Package Body hr_ipt_shd as
2 /* $Header: hriptrhi.pkb 120.1 2011/04/28 11:53:14 sidsaxen ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' hr_ipt_shd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |---------------------------< constraint_error >---------------------------|
12 -- ----------------------------------------------------------------------------
13 Procedure constraint_error
14 (p_constraint_name in all_constraints.constraint_name%TYPE
15 ) Is
16 --
17 l_proc varchar2(72) := g_package||'constraint_error';
18 --
19 Begin
20 --
21 If (p_constraint_name = 'HR_ITEM_PROPERTIES_TL_FK1') Then
22 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
23 fnd_message.set_token('PROCEDURE', l_proc);
24 fnd_message.set_token('STEP','5');
25 fnd_message.raise_error;
26 ElsIf (p_constraint_name = 'HR_ITEM_PROPERTIES_TL_PK') Then
27 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
28 fnd_message.set_token('PROCEDURE', l_proc);
29 fnd_message.set_token('STEP','10');
30 fnd_message.raise_error;
31 Else
32 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
33 fnd_message.set_token('PROCEDURE', l_proc);
34 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
35 fnd_message.raise_error;
36 End If;
37 --
38 End constraint_error;
39 --
40 -- ----------------------------------------------------------------------------
41 -- |-----------------------------< api_updating >-----------------------------|
42 -- ----------------------------------------------------------------------------
43 Function api_updating
44 (p_item_property_id in number
45 ,p_language in varchar2
46 ) Return Boolean Is
47 --
48 --
49 -- Cursor selects the 'current' row from the HR Schema
50 --
51 Cursor C_Sel1 is
52 select
53 item_property_id
54 ,language
55 ,source_lang
56 ,default_value
57 ,information_prompt
58 ,label
59 ,prompt_text
60 ,tooltip_text
61 from hr_item_properties_tl
62 where item_property_id = p_item_property_id
63 and language = p_language;
64 --
65 l_fct_ret boolean;
66 --
67 Begin
68 --
69 If (p_item_property_id is null or
70 p_language is null
71 ) Then
72 --
73 -- One of the primary key arguments is null therefore we must
74 -- set the returning function value to false
75 --
76 l_fct_ret := false;
77 Else
78 If (p_item_property_id
79 = hr_ipt_shd.g_old_rec.item_property_id and
80 p_language
81 = hr_ipt_shd.g_old_rec.language
82 ) Then
83 --
84 -- The g_old_rec is current therefore we must
85 -- set the returning function to true
86 --
87 l_fct_ret := true;
88 Else
89 --
90 -- Select the current row into g_old_rec
91 --
92 Open C_Sel1;
93 Fetch C_Sel1 Into hr_ipt_shd.g_old_rec;
94 If C_Sel1%notfound Then
95 Close C_Sel1;
96 --
97 -- The primary key is invalid therefore we must error
98 --
99 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
100 fnd_message.raise_error;
101 End If;
102 Close C_Sel1;
103 --
104 l_fct_ret := true;
105 End If;
106 End If;
107 Return (l_fct_ret);
108 --
109 End api_updating;
110 --
111 -- ----------------------------------------------------------------------------
112 -- |---------------------------------< lck >----------------------------------|
113 -- ----------------------------------------------------------------------------
114 Procedure lck
115 (p_item_property_id in number
116 ,p_language in varchar2
117 ) is
118 --
119 -- Cursor selects the 'current' row from the HR Schema
120 --
121 Cursor C_Sel1 is
122 select
123 item_property_id
124 ,language
125 ,source_lang
126 ,default_value
127 ,information_prompt
128 ,label
129 ,prompt_text
130 ,tooltip_text
131 from hr_item_properties_tl
132 where item_property_id = p_item_property_id
133 and language = p_language
134 for update nowait;
135 --
136 l_proc varchar2(72) := g_package||'lck';
137 --
138 Begin
139 hr_utility.set_location('Entering:'||l_proc, 5);
140 --
141 hr_api.mandatory_arg_error
142 (p_api_name => l_proc
143 ,p_argument => 'ITEM_PROPERTY_ID'
144 ,p_argument_value => p_item_property_id
145 );
146 hr_utility.set_location(l_proc,6);
147 hr_api.mandatory_arg_error
148 (p_api_name => l_proc
149 ,p_argument => 'LANGUAGE'
150 ,p_argument_value => p_language
151 );
152 --
153 Open C_Sel1;
154 Fetch C_Sel1 Into hr_ipt_shd.g_old_rec;
155 If C_Sel1%notfound then
156 Close C_Sel1;
157 --
158 -- The primary key is invalid therefore we must error
159 --
160 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
161 fnd_message.raise_error;
162 End If;
163 Close C_Sel1;
164 --
165 --
166 hr_utility.set_location(' Leaving:'||l_proc, 10);
167 --
168 -- We need to trap the ORA LOCK exception
169 --
170 Exception
171 When HR_Api.Object_Locked then
172 --
173 -- The object is locked therefore we need to supply a meaningful
174 -- error message.
175 --
176 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
177 fnd_message.set_token('TABLE_NAME', 'hr_item_properties_tl');
178 fnd_message.raise_error;
179 End lck;
180 --
181 -- ----------------------------------------------------------------------------
182 -- |----------------------------< add_language >------------------------------|
183 -- ----------------------------------------------------------------------------
184 Procedure add_language is
185 --
186 cursor csr_item_properties is
187 select ipt.item_property_id
188 ,ipt.default_value
189 ,ipt.information_prompt
190 ,ipt.label
191 ,ipt.prompt_text
192 ,ipt.tooltip_text
193 ,ipt.source_lang
194 from hr_item_properties_tl ipt
195 where ipt.language = userenv('LANG');
196 --
197 Begin
198 -- 115.8 after AOL recommendation the UPDATE and DELETE statements were removed
199 -- to assist performance of PERNLINS
200 --
201 for l_item_property in csr_item_properties loop
202 hr_ipt_ins.ins_tl
203 (p_language_code => l_item_property.source_lang
204 ,p_item_property_id => l_item_property.item_property_id
205 ,p_default_value => l_item_property.default_value
206 ,p_information_prompt => l_item_property.information_prompt
207 ,p_label => l_item_property.label
208 ,p_prompt_text => l_item_property.prompt_text
209 ,p_tooltip_text => l_item_property.tooltip_text
210 );
211 end loop;
212 --
213 End;
214 --
215 -- ----------------------------------------------------------------------------
216 -- |-----------------------------< convert_args >-----------------------------|
217 -- ----------------------------------------------------------------------------
218 Function convert_args
219 (p_item_property_id in number
220 ,p_language in varchar2
221 ,p_source_lang in varchar2
222 ,p_default_value in varchar2
223 ,p_information_prompt in varchar2
224 ,p_label in varchar2
225 ,p_prompt_text in varchar2
226 ,p_tooltip_text in varchar2
227 )
228 Return g_rec_type is
229 --
230 l_rec g_rec_type;
231 --
232 Begin
233 --
234 -- Convert arguments into local l_rec structure.
235 --
236 l_rec.item_property_id := p_item_property_id;
237 l_rec.language := p_language;
238 l_rec.source_lang := p_source_lang;
239 l_rec.default_value := p_default_value;
240 l_rec.information_prompt := p_information_prompt;
241 l_rec.label := p_label;
242 l_rec.prompt_text := p_prompt_text;
243 l_rec.tooltip_text := p_tooltip_text;
244 --
245 -- Return the plsql record structure.
246 --
247 Return(l_rec);
248 --
249 End convert_args;
250 --
251 end hr_ipt_shd;