DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_WNP_SHD

Source


1 Package Body hr_wnp_shd as
2 /* $Header: hrwnprhi.pkb 115.2 2002/12/03 14:20:10 raranjan noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  hr_wnp_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_WINDOW_PROPERTIES_B_PK') 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_WINDOW_PROPERTIES_B_UK') 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   ElsIf (p_constraint_name = 'HR_WINDOW_PROPERTIES_FK1') Then
32     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
33     fnd_message.set_token('PROCEDURE', l_proc);
34     fnd_message.set_token('STEP','15');
35     fnd_message.raise_error;
36   ElsIf (p_constraint_name = 'HR_WINDOW_PROPERTIES_FK2') Then
37     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
38     fnd_message.set_token('PROCEDURE', l_proc);
39     fnd_message.set_token('STEP','20');
40     fnd_message.raise_error;
41   Else
42     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
43     fnd_message.set_token('PROCEDURE', l_proc);
44     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
45     fnd_message.raise_error;
46   End If;
47   --
48 End constraint_error;
49 --
50 -- ----------------------------------------------------------------------------
51 -- |-----------------------------< api_updating >-----------------------------|
52 -- ----------------------------------------------------------------------------
53 Function api_updating
54   (p_window_property_id                   in     number
55   )
56   Return Boolean Is
57 --
58   --
59   -- Cursor selects the 'current' row from the HR Schema
60   --
61   Cursor C_Sel1 is
62     select
63        window_property_id
64       ,form_window_id
65       ,template_window_id
66       ,height
67       ,width
68       ,x_position
69       ,y_position
70       ,information_category
71       ,information1
72       ,information2
73       ,information3
74       ,information4
75       ,information5
76       ,information6
77       ,information7
78       ,information8
79       ,information9
80       ,information10
81       ,information11
82       ,information12
83       ,information13
84       ,information14
85       ,information15
86       ,information16
87       ,information17
88       ,information18
89       ,information19
90       ,information20
91       ,information21
92       ,information22
93       ,information23
94       ,information24
95       ,information25
96       ,information26
97       ,information27
98       ,information28
99       ,information29
100       ,information30
101     from	hr_window_properties_b
102     where	window_property_id = p_window_property_id;
103 --
104   l_fct_ret	boolean;
105 --
106 Begin
107   --
108   If (p_window_property_id is null
109      ) Then
110     --
111     -- One of the primary key arguments is null therefore we must
112     -- set the returning function value to false
113     --
114     l_fct_ret := false;
115   Else
116     If (p_window_property_id
117         = hr_wnp_shd.g_old_rec.window_property_id
118        ) Then
119       --
120       -- The g_old_rec is current therefore we must
121       -- set the returning function to true
122       --
123       l_fct_ret := true;
124     Else
125       --
126       -- Select the current row into g_old_rec
127       --
128       Open C_Sel1;
129       Fetch C_Sel1 Into hr_wnp_shd.g_old_rec;
130       If C_Sel1%notfound Then
131         Close C_Sel1;
132         --
133         -- The primary key is invalid therefore we must error
134         --
135         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
136         fnd_message.raise_error;
137       End If;
138       Close C_Sel1;
139       --
140       l_fct_ret := true;
141     End If;
142   End If;
143   Return (l_fct_ret);
144 --
145 End api_updating;
146 --
147 -- ----------------------------------------------------------------------------
148 -- |---------------------------------< lck >----------------------------------|
149 -- ----------------------------------------------------------------------------
150 Procedure lck
151   (p_window_property_id                   in     number
152   ) is
153 --
154 -- Cursor selects the 'current' row from the HR Schema
155 --
156   Cursor C_Sel1 is
157     select
158        window_property_id
159       ,form_window_id
160       ,template_window_id
161       ,height
162       ,width
163       ,x_position
164       ,y_position
165       ,information_category
166       ,information1
167       ,information2
168       ,information3
169       ,information4
170       ,information5
171       ,information6
172       ,information7
173       ,information8
174       ,information9
175       ,information10
176       ,information11
177       ,information12
178       ,information13
179       ,information14
180       ,information15
181       ,information16
182       ,information17
183       ,information18
184       ,information19
185       ,information20
186       ,information21
187       ,information22
188       ,information23
189       ,information24
190       ,information25
191       ,information26
192       ,information27
193       ,information28
194       ,information29
195       ,information30
196     from	hr_window_properties_b
197     where	window_property_id = p_window_property_id
198     for	update nowait;
199 --
200   l_proc	varchar2(72) := g_package||'lck';
201 --
202 Begin
203   hr_utility.set_location('Entering:'||l_proc, 5);
204   --
205   hr_api.mandatory_arg_error
206     (p_api_name           => l_proc
207     ,p_argument           => 'WINDOW_PROPERTY_ID'
208     ,p_argument_value     => p_window_property_id
209     );
210   --
211   Open  C_Sel1;
212   Fetch C_Sel1 Into hr_wnp_shd.g_old_rec;
213   If C_Sel1%notfound then
214     Close C_Sel1;
215     --
216     -- The primary key is invalid therefore we must error
217     --
218     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
219     fnd_message.raise_error;
220   End If;
221   Close C_Sel1;
222   --
223   --
224   hr_utility.set_location(' Leaving:'||l_proc, 10);
225   --
226   -- We need to trap the ORA LOCK exception
227   --
228 Exception
229   When HR_Api.Object_Locked then
230     --
231     -- The object is locked therefore we need to supply a meaningful
232     -- error message.
233     --
234     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
235     fnd_message.set_token('TABLE_NAME', 'hr_window_properties_b');
236     fnd_message.raise_error;
237 End lck;
238 --
239 -- ----------------------------------------------------------------------------
240 -- |-----------------------------< convert_args >-----------------------------|
241 -- ----------------------------------------------------------------------------
242 Function convert_args
243   (p_window_property_id             in number
244   ,p_form_window_id                 in number
245   ,p_template_window_id             in number
246   ,p_height                         in number
247   ,p_width                          in number
248   ,p_x_position                     in number
249   ,p_y_position                     in number
250   ,p_information_category           in varchar2
251   ,p_information1                   in varchar2
252   ,p_information2                   in varchar2
253   ,p_information3                   in varchar2
254   ,p_information4                   in varchar2
255   ,p_information5                   in varchar2
256   ,p_information6                   in varchar2
257   ,p_information7                   in varchar2
258   ,p_information8                   in varchar2
259   ,p_information9                   in varchar2
260   ,p_information10                  in varchar2
261   ,p_information11                  in varchar2
262   ,p_information12                  in varchar2
263   ,p_information13                  in varchar2
264   ,p_information14                  in varchar2
265   ,p_information15                  in varchar2
266   ,p_information16                  in varchar2
267   ,p_information17                  in varchar2
268   ,p_information18                  in varchar2
269   ,p_information19                  in varchar2
270   ,p_information20                  in varchar2
271   ,p_information21                  in varchar2
272   ,p_information22                  in varchar2
273   ,p_information23                  in varchar2
274   ,p_information24                  in varchar2
275   ,p_information25                  in varchar2
276   ,p_information26                  in varchar2
277   ,p_information27                  in varchar2
278   ,p_information28                  in varchar2
279   ,p_information29                  in varchar2
280   ,p_information30                  in varchar2
281   )
282   Return g_rec_type is
283 --
284   l_rec   g_rec_type;
285 --
286 Begin
287   --
288   -- Convert arguments into local l_rec structure.
289   --
290   l_rec.window_property_id               := p_window_property_id;
291   l_rec.form_window_id                   := p_form_window_id;
292   l_rec.template_window_id               := p_template_window_id;
293   l_rec.height                           := p_height;
294   l_rec.width                            := p_width;
295   l_rec.x_position                       := p_x_position;
296   l_rec.y_position                       := p_y_position;
297   l_rec.information_category             := p_information_category;
298   l_rec.information1                     := p_information1;
299   l_rec.information2                     := p_information2;
300   l_rec.information3                     := p_information3;
301   l_rec.information4                     := p_information4;
302   l_rec.information5                     := p_information5;
303   l_rec.information6                     := p_information6;
304   l_rec.information7                     := p_information7;
305   l_rec.information8                     := p_information8;
306   l_rec.information9                     := p_information9;
307   l_rec.information10                    := p_information10;
308   l_rec.information11                    := p_information11;
309   l_rec.information12                    := p_information12;
310   l_rec.information13                    := p_information13;
311   l_rec.information14                    := p_information14;
312   l_rec.information15                    := p_information15;
313   l_rec.information16                    := p_information16;
314   l_rec.information17                    := p_information17;
315   l_rec.information18                    := p_information18;
316   l_rec.information19                    := p_information19;
317   l_rec.information20                    := p_information20;
318   l_rec.information21                    := p_information21;
319   l_rec.information22                    := p_information22;
320   l_rec.information23                    := p_information23;
321   l_rec.information24                    := p_information24;
322   l_rec.information25                    := p_information25;
323   l_rec.information26                    := p_information26;
324   l_rec.information27                    := p_information27;
325   l_rec.information28                    := p_information28;
326   l_rec.information29                    := p_information29;
327   l_rec.information30                    := p_information30;
328   --
329   -- Return the plsql record structure.
330   --
331   Return(l_rec);
332 --
333 End convert_args;
334 --
335 end hr_wnp_shd;