DBA Data[Home] [Help]

PACKAGE BODY: APPS.IRC_CMP_SHD

Source


1 Package Body irc_cmp_shd as
2 /* $Header: ircmprhi.pkb 120.0 2007/11/19 11:38:55 sethanga noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  irc_cmp_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 = 'IRC_COMM_PROPERTIES_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   Else
27     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
28     fnd_message.set_token('PROCEDURE', l_proc);
29     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
30     fnd_message.raise_error;
31   End If;
32   --
33 End constraint_error;
34 --
35 -- ----------------------------------------------------------------------------
36 -- |-----------------------------< api_updating >-----------------------------|
37 -- ----------------------------------------------------------------------------
38 Function api_updating
39   (p_communication_property_id            in     number
40   ,p_object_version_number                in     number
41   )
42   Return Boolean Is
43   --
44   --
45   -- Cursor selects the 'current' row from the HR Schema
46   --
47   Cursor C_Sel1 is
48     select
49        communication_property_id
50       ,object_type
51       ,object_id
52       ,default_comm_status
53       ,allow_attachment_flag
54       ,auto_notification_flag
55       ,allow_add_recipients
56       ,default_moderator
57       ,attribute_category
58       ,attribute1
59       ,attribute2
60       ,attribute3
61       ,attribute4
62       ,attribute5
63       ,attribute6
64       ,attribute7
65       ,attribute8
66       ,attribute9
67       ,attribute10
68       ,information_category
69       ,information1
70       ,information2
71       ,information3
72       ,information4
73       ,information5
74       ,information6
75       ,information7
76       ,information8
77       ,information9
78       ,information10
79       ,object_version_number
80     from        irc_comm_properties
81     where       communication_property_id = p_communication_property_id;
82   --
83   l_fct_ret     boolean;
84   --
85 Begin
86   --
87   If (p_communication_property_id is null and
88       p_object_version_number is null
89      ) Then
90     --
91     -- One of the primary key arguments is null therefore we must
92     -- set the returning function value to false
93     --
94     l_fct_ret := false;
95   Else
96     If (p_communication_property_id
97         = irc_cmp_shd.g_old_rec.communication_property_id and
98         p_object_version_number
99         = irc_cmp_shd.g_old_rec.object_version_number
100        ) Then
101       --
102       -- The g_old_rec is current therefore we must
103       -- set the returning function to true
104       --
105       l_fct_ret := true;
106     Else
107       --
108       -- Select the current row into g_old_rec
109       --
110       Open C_Sel1;
111       Fetch C_Sel1 Into irc_cmp_shd.g_old_rec;
112       If C_Sel1%notfound Then
113         Close C_Sel1;
114         --
115         -- The primary key is invalid therefore we must error
116         --
117         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
118         fnd_message.raise_error;
119       End If;
120       Close C_Sel1;
121       If (p_object_version_number
122           <> irc_cmp_shd.g_old_rec.object_version_number) Then
123         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
124         fnd_message.raise_error;
125       End If;
126       l_fct_ret := true;
127     End If;
128   End If;
129   Return (l_fct_ret);
130 --
131 End api_updating;
132 --
133 -- ----------------------------------------------------------------------------
134 -- |---------------------------------< lck >----------------------------------|
135 -- ----------------------------------------------------------------------------
136 Procedure lck
137   (p_communication_property_id            in     number
138   ,p_object_version_number                in     number
139   ) is
140 --
141 -- Cursor selects the 'current' row from the HR Schema
142 --
143   Cursor C_Sel1 is
144     select
145        communication_property_id
146       ,object_type
147       ,object_id
148       ,default_comm_status
149       ,allow_attachment_flag
150       ,auto_notification_flag
151       ,allow_add_recipients
152       ,default_moderator
153       ,attribute_category
154       ,attribute1
155       ,attribute2
156       ,attribute3
157       ,attribute4
158       ,attribute5
159       ,attribute6
160       ,attribute7
161       ,attribute8
162       ,attribute9
163       ,attribute10
164       ,information_category
165       ,information1
166       ,information2
167       ,information3
168       ,information4
169       ,information5
170       ,information6
171       ,information7
172       ,information8
173       ,information9
174       ,information10
175       ,object_version_number
176     from        irc_comm_properties
177     where       communication_property_id = p_communication_property_id
178     for update nowait;
179 --
180   l_proc        varchar2(72) := g_package||'lck';
181 --
182 Begin
183   hr_utility.set_location('Entering:'||l_proc, 5);
184   --
185   hr_api.mandatory_arg_error
186     (p_api_name           => l_proc
187     ,p_argument           => 'COMMUNICATION_PROPERTY_ID'
188     ,p_argument_value     => p_communication_property_id
189     );
190   hr_utility.set_location(l_proc,6);
191   hr_api.mandatory_arg_error
192     (p_api_name           => l_proc
193     ,p_argument           => 'OBJECT_VERSION_NUMBER'
194     ,p_argument_value     => p_object_version_number
195     );
196   --
197   Open  C_Sel1;
198   Fetch C_Sel1 Into irc_cmp_shd.g_old_rec;
199   If C_Sel1%notfound then
200     Close C_Sel1;
201     --
202     -- The primary key is invalid therefore we must error
203     --
204     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
205     fnd_message.raise_error;
206   End If;
207   Close C_Sel1;
208   If (p_object_version_number
209       <> irc_cmp_shd.g_old_rec.object_version_number) Then
210         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
211         fnd_message.raise_error;
212   End If;
213   --
214   hr_utility.set_location(' Leaving:'||l_proc, 10);
215   --
216   -- We need to trap the ORA LOCK exception
217   --
218 Exception
219   When HR_Api.Object_Locked then
220     --
221     -- The object is locked therefore we need to supply a meaningful
222     -- error message.
223     --
224     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
225     fnd_message.set_token('TABLE_NAME', 'irc_comm_properties');
226     fnd_message.raise_error;
227 End lck;
228 --
229 -- ----------------------------------------------------------------------------
230 -- |-----------------------------< convert_args >-----------------------------|
231 -- ----------------------------------------------------------------------------
232 Function convert_args
233   (p_communication_property_id      in number
234   ,p_object_type                    in varchar2
235   ,p_object_id                      in number
236   ,p_default_comm_status            in varchar2
237   ,p_allow_attachment_flag          in varchar2
238   ,p_auto_notification_flag         in varchar2
239   ,p_allow_add_recipients           in varchar2
240   ,p_default_moderator              in varchar2
241   ,p_attribute_category             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   ,p_attribute6                     in varchar2
248   ,p_attribute7                     in varchar2
249   ,p_attribute8                     in varchar2
250   ,p_attribute9                     in varchar2
251   ,p_attribute10                    in varchar2
252   ,p_information_category           in varchar2
253   ,p_information1                   in varchar2
254   ,p_information2                   in varchar2
255   ,p_information3                   in varchar2
256   ,p_information4                   in varchar2
257   ,p_information5                   in varchar2
258   ,p_information6                   in varchar2
259   ,p_information7                   in varchar2
260   ,p_information8                   in varchar2
261   ,p_information9                   in varchar2
262   ,p_information10                  in varchar2
263   ,p_object_version_number          in number
264   )
265   Return g_rec_type is
266 --
267   l_rec   g_rec_type;
268 --
269 Begin
270   --
271   -- Convert arguments into local l_rec structure.
272   --
273   l_rec.communication_property_id        := p_communication_property_id;
274   l_rec.object_type                      := p_object_type;
275   l_rec.object_id                        := p_object_id;
276   l_rec.default_comm_status              := p_default_comm_status;
277   l_rec.allow_attachment_flag            := p_allow_attachment_flag;
278   l_rec.auto_notification_flag           := p_auto_notification_flag;
279   l_rec.allow_add_recipients             := p_allow_add_recipients;
280   l_rec.default_moderator                := p_default_moderator;
281   l_rec.attribute_category               := p_attribute_category;
282   l_rec.attribute1                       := p_attribute1;
283   l_rec.attribute2                       := p_attribute2;
284   l_rec.attribute3                       := p_attribute3;
285   l_rec.attribute4                       := p_attribute4;
286   l_rec.attribute5                       := p_attribute5;
287   l_rec.attribute6                       := p_attribute6;
288   l_rec.attribute7                       := p_attribute7;
289   l_rec.attribute8                       := p_attribute8;
290   l_rec.attribute9                       := p_attribute9;
291   l_rec.attribute10                      := p_attribute10;
292   l_rec.information_category             := p_information_category;
293   l_rec.information1                     := p_information1;
294   l_rec.information2                     := p_information2;
295   l_rec.information3                     := p_information3;
296   l_rec.information4                     := p_information4;
297   l_rec.information5                     := p_information5;
298   l_rec.information6                     := p_information6;
299   l_rec.information7                     := p_information7;
300   l_rec.information8                     := p_information8;
301   l_rec.information9                     := p_information9;
302   l_rec.information10                    := p_information10;
303   l_rec.object_version_number            := p_object_version_number;
304   --
305   -- Return the plsql record structure.
306   --
307   Return(l_rec);
308 --
309 End convert_args;
310 --
311 end irc_cmp_shd;