DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_KI_UI_CONTEXTS_API

Source


1 Package Body HR_KI_UI_CONTEXTS_API as
2 /* $Header: hrucxapi.pkb 120.0 2005/05/31 03:37:19 appldev noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := 'HR_KI_UI_CONTEXTS_API';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< CREATE_UI_CONTEXT >--------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure CREATE_UI_CONTEXT
13     (p_validate                      in     boolean  default false
14     ,p_label                         in     varchar2
15     ,p_location                      in     varchar2
16     ,p_user_interface_id             in     number
17     ,p_ui_context_id                 out    nocopy   number
18     ,p_object_version_number         out    nocopy   number
19   ) is
20   --
21   -- Declare cursors and local variables
22   --
23   l_proc                varchar2(72) := g_package||'CREATE_UI_CONTEXT';
24   l_ui_context_id      number;
25   l_object_version_number number;
26 
27 begin
28   hr_utility.set_location('Entering:'|| l_proc, 10);
29   --
30   -- Issue a savepoint
31   --
32   savepoint CREATE_UI_CONTEXT;
33   --
34   -- Remember IN OUT parameter IN values
35   --
36   --l_in_out_parameter := p_in_out_parameter;
37 
38   --
39   -- Call Before Process User Hook
40   --
41   begin
42     hr_ki_ui_contexts_bk1.CREATE_UI_CONTEXT_b
43       (
44         p_user_interface_id =>p_user_interface_id
45        ,p_label             => p_label
46        ,p_location          => p_location
47       );
48   exception
49     when hr_api.cannot_find_prog_unit then
50       hr_api.cannot_find_prog_unit_error
51         (p_module_name => 'CREATE_UI_CONTEXT'
52         ,p_hook_type   => 'BP'
53         );
54   end;
55 
56   --
57   -- Process Logic
58   --
59   hr_ucx_ins.ins
60      ( p_user_interface_id       => p_user_interface_id
61       ,p_label                   => p_label
62       ,p_location                => p_location
63       ,p_ui_context_id           => l_ui_context_id
64       ,p_object_version_number   => l_object_version_number
65       );
66 
67   --
68   -- Call After Process User Hook
69   --
70   begin
71     hr_ki_ui_contexts_bk1.CREATE_UI_CONTEXT_a
72       (
73        p_user_interface_id       =>    p_user_interface_id
74       ,p_label                   =>    p_label
75       ,p_location                =>    p_location
76       ,p_ui_context_id           =>    l_ui_context_id
77       ,p_object_version_number   =>    l_object_version_number
78       );
79   exception
80     when hr_api.cannot_find_prog_unit then
81       hr_api.cannot_find_prog_unit_error
82         (p_module_name => 'CREATE_UI_CONTEXT'
83         ,p_hook_type   => 'AP'
84         );
85   end;
86   --
87   -- When in validation only mode raise the Validate_Enabled exception
88   --
89   if p_validate then
90     raise hr_api.validate_enabled;
91   end if;
92   --
93   -- Set all IN OUT and OUT parameters with out values
94   --
95   p_ui_context_id          := l_ui_context_id;
96   p_object_version_number  := l_object_version_number;
97 
98   --
99   hr_utility.set_location(' Leaving:'||l_proc, 70);
100 exception
101   when hr_api.validate_enabled then
102     --
103     -- As the Validate_Enabled exception has been raised
104     -- we must rollback to the savepoint
105     --
106     rollback to CREATE_UI_CONTEXT;
107     --
108     -- Reset IN OUT parameters and set OUT parameters
109     -- (Any key or derived arguments must be set to null
110     -- when validation only mode is being used.)
111     --
112 
113     p_ui_context_id         := null;
114     p_object_version_number  := null;
115 
116     hr_utility.set_location(' Leaving:'||l_proc, 80);
117   when others then
118     --
119     -- A validation or unexpected error has occured
120     --
121     rollback to CREATE_UI_CONTEXT;
122     --
123     -- Reset IN OUT parameters and set all
124     -- OUT parameters, including warnings, to null
125     --
126 
127     p_ui_context_id         := null;
128     p_object_version_number  := null;
129 
130     hr_utility.set_location(' Leaving:'||l_proc, 90);
131     raise;
132 end CREATE_UI_CONTEXT;
133 --
134 --
135 -- ----------------------------------------------------------------------------
136 -- |--------------------------< DELETE_UI_CONTEXT >---------------------------|
137 -- ----------------------------------------------------------------------------
138 --
139 procedure DELETE_UI_CONTEXT
140   (
141    p_validate                 in boolean         default false
142   ,p_ui_context_id            in number
143   ,p_object_version_number    in number
144   ) is
145   --
146   -- Declare cursors and local variables
147   --
148   l_proc                varchar2(72) := g_package||'DELETE_UI_CONTEXT';
149 
150 begin
151   hr_utility.set_location('Entering:'|| l_proc, 10);
152   --
153   -- Issue a savepoint
154   --
155   savepoint DELETE_UI_CONTEXT;
156   --
157   -- Remember IN OUT parameter IN values
158   --
159 
160   -- Call Before Process User Hook
161   --
162   begin
163     hr_ki_ui_contexts_bk2.DELETE_UI_CONTEXT_b
164       (
165         p_ui_context_id           => p_ui_context_id
166        ,p_object_version_number   => p_object_version_number
167 
168       );
169   exception
170     when hr_api.cannot_find_prog_unit then
171       hr_api.cannot_find_prog_unit_error
172         (p_module_name => 'DELETE_UI_CONTEXT'
173         ,p_hook_type   => 'BP'
174         );
175   end;
176 
177   --
178   -- Process Logic
179   --
180   hr_ucx_shd.lck
181      (
182       p_ui_context_id           => p_ui_context_id
183      ,p_object_version_number   => p_object_version_number
184      );
185   hr_ucx_del.del
186      (
187       p_ui_context_id          => p_ui_context_id
188      ,p_object_version_number   => p_object_version_number
189       );
190 
191 
192   --
193   -- Call After Process User Hook
194   --
195   begin
196     hr_ki_ui_contexts_bk2.DELETE_UI_CONTEXT_a
197       (
198        p_ui_context_id           =>    p_ui_context_id
199       ,p_object_version_number   =>    p_object_version_number
200       );
201   exception
202     when hr_api.cannot_find_prog_unit then
203       hr_api.cannot_find_prog_unit_error
204         (p_module_name => 'DELETE_UI_CONTEXT'
205         ,p_hook_type   => 'AP'
206         );
207   end;
208   --
209   -- When in validation only mode raise the Validate_Enabled exception
210   --
211   if p_validate then
212     raise hr_api.validate_enabled;
213   end if;
214   --
215   -- Set all IN OUT and OUT parameters with out values
216   --
217 
218   --
219   hr_utility.set_location(' Leaving:'||l_proc, 70);
220 exception
221   when hr_api.validate_enabled then
222     --
223     -- As the Validate_Enabled exception has been raised
224     -- we must rollback to the savepoint
225     --
226     rollback to DELETE_UI_CONTEXT;
227     --
228     -- Reset IN OUT parameters and set OUT parameters
229     -- (Any key or derived arguments must be set to null
230     -- when validation only mode is being used.)
231     --
232 
233     hr_utility.set_location(' Leaving:'||l_proc, 80);
234   when others then
235     --
236     -- A validation or unexpected error has occured
237     --
238     rollback to DELETE_UI_CONTEXT;
239     --
240     -- Reset IN OUT parameters and set all
241     -- OUT parameters, including warnings, to null
242     --
243     hr_utility.set_location(' Leaving:'||l_proc, 90);
244     raise;
245 end DELETE_UI_CONTEXT;
246 end HR_KI_UI_CONTEXTS_API;