DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_ULC_SHD

Source


1 Package Body hxc_ulc_shd as
2 /* $Header: hxculcrhi.pkb 120.2 2005/09/23 06:07:43 rchennur noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  hxc_ulc_shd.';  -- Global package name
9 g_debug boolean := hr_utility.debug_enabled;
10 --
11 -- ----------------------------------------------------------------------------
12 -- |---------------------------< constraint_error >---------------------------|
13 -- ----------------------------------------------------------------------------
14 Procedure constraint_error
15   (p_constraint_name in all_constraints.constraint_name%TYPE
16   ) Is
17 --
18   l_proc 	varchar2(72) := g_package||'constraint_error';
19 --
20 Begin
21   --
22   If (p_constraint_name = 'HXC_LAYOUT_COMPONENTS_FK1') Then
23     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
24     fnd_message.set_token('PROCEDURE', l_proc);
25     fnd_message.set_token('STEP','5');
26     fnd_message.raise_error;
27   ElsIf (p_constraint_name = 'HXC_LAYOUT_COMPONENTS_FK2') Then
28     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
29     fnd_message.set_token('PROCEDURE', l_proc);
30     fnd_message.set_token('STEP','10');
31     fnd_message.raise_error;
32   ElsIf (p_constraint_name = 'HXC_LAYOUT_COMPONENTS_PK') Then
33     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
34     fnd_message.set_token('PROCEDURE', l_proc);
35     fnd_message.set_token('STEP','15');
36     fnd_message.raise_error;
37   ElsIf (p_constraint_name = 'HXC_LAYOUT_COMPONENTS_UK1') Then
38     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
39     fnd_message.set_token('PROCEDURE', l_proc);
40     fnd_message.set_token('STEP','20');
41     fnd_message.raise_error;
42   Else
43     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
44     fnd_message.set_token('PROCEDURE', l_proc);
45     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
46     fnd_message.raise_error;
47   End If;
48   --
49 End constraint_error;
50 --
51 -- ----------------------------------------------------------------------------
52 -- |-----------------------------< api_updating >-----------------------------|
53 -- ----------------------------------------------------------------------------
54 Function api_updating
55   (p_layout_component_id                  in     number
56   ,p_object_version_number                in     number
57   )
58   Return Boolean Is
59 --
60   --
61   -- Cursor selects the 'current' row from the hxc Schema
62   --
63   Cursor C_Sel1 is
64     select
65        layout_component_id
66       ,layout_id
67       ,parent_component_id
68       ,component_name
69       ,component_value
70       ,sequence
71       ,name_value_string
72       ,region_code
73       ,region_code_app_id
74       ,attribute_code
75       ,attribute_code_app_id
76       ,object_version_number
77       ,layout_comp_definition_id
78       ,component_alias
79       ,parent_bean
80       ,attribute1
81       ,attribute2
82       ,attribute3
83       ,attribute4
84       ,attribute5
85     from	hxc_layout_components
86     where	layout_component_id = p_layout_component_id;
87 --
88   l_fct_ret	boolean;
89 --
90 Begin
91   --
92   If (p_layout_component_id is null and
93       p_object_version_number is null
94      ) Then
95     --
96     -- One of the primary key arguments is null therefore we must
97     -- set the returning function value to false
98     --
99     l_fct_ret := false;
100   Else
101     If (p_layout_component_id
102         = hxc_ulc_shd.g_old_rec.layout_component_id and
103         p_object_version_number
104         = hxc_ulc_shd.g_old_rec.object_version_number
105        ) Then
106       --
107       -- The g_old_rec is current therefore we must
108       -- set the returning function to true
109       --
110       l_fct_ret := true;
111     Else
112       --
113       -- Select the current row into g_old_rec
114       --
115       Open C_Sel1;
116       Fetch C_Sel1 Into hxc_ulc_shd.g_old_rec;
117       If C_Sel1%notfound Then
118         Close C_Sel1;
119         --
120         -- The primary key is invalid therefore we must error
121         --
122         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
123         fnd_message.raise_error;
124       End If;
125       Close C_Sel1;
126       If (p_object_version_number
127           <> hxc_ulc_shd.g_old_rec.object_version_number) Then
128         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
129         fnd_message.raise_error;
130       End If;
131       l_fct_ret := true;
132     End If;
133   End If;
134   Return (l_fct_ret);
135 --
136 End api_updating;
137 --
138 -- ----------------------------------------------------------------------------
139 -- |---------------------------------< lck >----------------------------------|
140 -- ----------------------------------------------------------------------------
141 Procedure lck
142   (p_layout_component_id                  in     number
143   ,p_object_version_number                in     number
144   ) is
145 --
146 -- Cursor selects the 'current' row from the hxc Schema
147 --
148   Cursor C_Sel1 is
149     select
150        layout_component_id
151       ,layout_id
152       ,parent_component_id
153       ,component_name
154       ,component_value
155       ,sequence
156       ,name_value_string
157       ,region_code
158       ,region_code_app_id
159       ,attribute_code
160       ,attribute_code_app_id
161       ,object_version_number
162       ,layout_comp_definition_id
163       ,component_alias
164       ,parent_bean
165       ,attribute1
166       ,attribute2
167       ,attribute3
168       ,attribute4
169       ,attribute5
170     from	hxc_layout_components
171     where	layout_component_id = p_layout_component_id
172     for	update nowait;
173 --
174   l_proc	varchar2(72) ;
175 --
176 Begin
177   g_debug :=hr_utility.debug_enabled;
178   if g_debug then
179   	l_proc := g_package||'lck';
180   	hr_utility.set_location('Entering:'||l_proc, 5);
181   end if;
182   --
183   hr_api.mandatory_arg_error
184     (p_api_name           => l_proc
185     ,p_argument           => 'LAYOUT_COMPONENT_ID'
186     ,p_argument_value     => p_layout_component_id
187     );
188   --
189   Open  C_Sel1;
190   Fetch C_Sel1 Into hxc_ulc_shd.g_old_rec;
191   If C_Sel1%notfound then
192     Close C_Sel1;
193     --
194     -- The primary key is invalid therefore we must error
195     --
196     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
197     fnd_message.raise_error;
198   End If;
199   Close C_Sel1;
200   If (p_object_version_number
201       <> hxc_ulc_shd.g_old_rec.object_version_number) Then
202         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
203         fnd_message.raise_error;
204   End If;
205   --
206   if g_debug then
207   	hr_utility.set_location(' Leaving:'||l_proc, 10);
208   end if;
209   --
210   -- We need to trap the ORA LOCK exception
211   --
212 Exception
213   When HR_Api.Object_Locked then
214     --
215     -- The object is locked therefore we need to supply a meaningful
216     -- error message.
217     --
218     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
219     fnd_message.set_token('TABLE_NAME', 'hxc_layout_components');
220     fnd_message.raise_error;
221 End lck;
222 --
223 -- ----------------------------------------------------------------------------
224 -- |-----------------------------< convert_args >-----------------------------|
225 -- ----------------------------------------------------------------------------
226 Function convert_args
227   (p_layout_component_id            in number
228   ,p_layout_id                      in number
229   ,p_parent_component_id            in number
230   ,p_component_name                 in varchar2
231   ,p_component_value                in varchar2
232   ,p_sequence                       in number
233   ,p_name_value_string              in varchar2
234   ,p_region_code                    in varchar2
235   ,p_region_code_app_id             in number
236   ,p_attribute_code                 in varchar2
237   ,p_attribute_code_app_id          in number
238   ,p_object_version_number          in number
239   ,p_layout_comp_definition_id      in number
240   ,p_component_alias                in varchar2
241   ,p_parent_bean                    in varchar2
242   ,p_attribute1                     in varchar2
243   ,p_attribute2                     in varchar2
244   ,p_attribute3                     in varchar2
245   ,p_attribute4                     in varchar2
246   ,p_attribute5                     in varchar2
247   )
248   Return g_rec_type is
249 --
250   l_rec   g_rec_type;
251 --
252 Begin
253   --
254   -- Convert arguments into local l_rec structure.
255   --
256   l_rec.layout_component_id              := p_layout_component_id;
257   l_rec.layout_id                        := p_layout_id;
258   l_rec.parent_component_id              := p_parent_component_id;
259   l_rec.component_name                   := p_component_name;
260   l_rec.component_value                  := p_component_value;
261   l_rec.sequence                         := p_sequence;
262   l_rec.name_value_string                := p_name_value_string;
263   l_rec.region_code                      := p_region_code;
264   l_rec.region_code_app_id               := p_region_code_app_id;
265   l_rec.attribute_code                   := p_attribute_code;
266   l_rec.attribute_code_app_id            := p_attribute_code_app_id;
267   l_rec.object_version_number            := p_object_version_number;
268   l_rec.layout_comp_definition_id        := p_layout_comp_definition_id;
269   l_rec.component_alias                  := p_component_alias;
270   l_rec.parent_bean                      := p_parent_bean;
271   l_rec.attribute1                       := p_attribute1;
272   l_rec.attribute2                       := p_attribute2;
273   l_rec.attribute3                       := p_attribute3;
274   l_rec.attribute4                       := p_attribute4;
275   l_rec.attribute5                       := p_attribute5;
276   --
277   -- Return the plsql record structure.
278   --
279   Return(l_rec);
280 --
281 End convert_args;
282 --
283 end hxc_ulc_shd;