1 Package Body hxc_uld_bus as
2 /* $Header: hxculdrhi.pkb 120.2 2005/09/23 06:19:32 rchennur noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' hxc_uld_bus.'; -- Global package name
9 g_debug boolean := hr_utility.debug_enabled;
10 --
11 -- ----------------------------------------------------------------------------
12 -- |-----------------------< chk_component_definition >-----------------------|
13 -- ----------------------------------------------------------------------------
14 PROCEDURE chk_component_definition
15 (p_layout_comp_definition_id IN NUMBER DEFAULT NULL
16 ,p_component_type IN VARCHAR2
17 ,p_component_class IN VARCHAR2
18 ,p_render_type IN VARCHAR2
19 )
20 IS
21 --
22 CURSOR csr_chk_comp_definition_unique IS
23 SELECT 1
24 FROM hxc_layout_comp_definitions
25 WHERE component_type = p_component_type
26 AND render_type = p_render_type
27 AND (p_layout_comp_definition_id IS NULL
28 OR layout_comp_definition_id <> p_layout_comp_definition_id);
29 --
30 l_result NUMBER;
31 --
32 BEGIN
33 --
34 OPEN csr_chk_comp_definition_unique;
35 --
36 FETCH csr_chk_comp_definition_unique INTO l_result;
37 --
38 IF csr_chk_comp_definition_unique%FOUND THEN
39 CLOSE csr_chk_comp_definition_unique;
40 fnd_message.set_name('HXC', 'HXC_xxxxx_COMPONENT_DEFINITION_NOT_UNIQUE');
41 fnd_message.raise_error;
42 END IF;
43 --
44 CLOSE csr_chk_comp_definition_unique;
45 --
46 END chk_component_definition;
47 --
48 -- ----------------------------------------------------------------------------
49 -- |-----------------------< chk_non_updateable_args >------------------------|
50 -- ----------------------------------------------------------------------------
51 -- {Start Of Comments}
52 --
53 -- Description:
54 -- This procedure is used to ensure that non updateable attributes have
55 -- not been updated. If an attribute has been updated an error is generated.
56 --
57 -- Pre Conditions:
58 -- g_old_rec has been populated with details of the values currently in
59 -- the database.
60 --
61 -- In Arguments:
62 -- p_rec has been populated with the updated values the user would like the
63 -- record set to.
64 --
65 -- Post Success:
66 -- Processing continues if all the non updateable attributes have not
67 -- changed.
68 --
69 -- Post Failure:
70 -- An application error is raised if any of the non updatable attributes
71 -- have been altered.
72 --
73 -- {End Of Comments}
74 -- ----------------------------------------------------------------------------
75 Procedure chk_non_updateable_args
76 (p_rec in hxc_uld_shd.g_rec_type
77 ) IS
78 --
79 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
80 l_error EXCEPTION;
81 l_argument varchar2(30);
82 --
83 Begin
84 --
85 -- Only proceed with the validation if a row exists for the current
89 (p_layout_comp_definition_id => p_rec.layout_comp_definition_id
86 -- record in the hxc Schema.
87 --
88 IF NOT hxc_uld_shd.api_updating
90 ,p_object_version_number => p_rec.object_version_number
91 ) THEN
92 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
93 fnd_message.set_token('PROCEDURE ', l_proc);
94 fnd_message.set_token('STEP ', '5');
95 fnd_message.raise_error;
96 END IF;
97 --
98 -- EDIT_HERE: Add checks to ensure non-updateable args have
99 -- not been updated.
100 --
101 EXCEPTION
102 WHEN l_error THEN
103 hr_api.argument_changed_error
104 (p_api_name => l_proc
105 ,p_argument => l_argument);
106 WHEN OTHERS THEN
107 RAISE;
108 End chk_non_updateable_args;
109 --
110 -- ----------------------------------------------------------------------------
111 -- |---------------------------< insert_validate >----------------------------|
112 -- ----------------------------------------------------------------------------
113 Procedure insert_validate
114 (p_rec in hxc_uld_shd.g_rec_type
115 ) is
116 --
117 l_proc varchar2(72) ;
118 --
119 Begin
120 g_debug :=hr_utility.debug_enabled;
121 if g_debug then
122 l_proc := g_package||'insert_validate';
123 hr_utility.set_location('Entering:'||l_proc, 5);
124 end if;
125 --
126 -- Call all supporting business operations
127 --
128 --
129 -- EDIT_HERE: As this table does not have a mandatory business_group_id
130 -- column, ensure client_info is populated by calling a suitable
131 -- ???_???_bus.set_security_group_id procedure, or add one of the following
132 -- comments:
133 -- "-- No business group context. HR_STANDARD_LOOKUPS used for validation."
134 -- "-- CLIENT_INFO not set. No lookup validation or joins to HR_LOOKUPS."
135 --
136 -- Check that the combination of component_type and component_class is
137 -- unique
138 --
139 chk_component_definition
140 (p_component_type => p_rec.component_type
141 ,p_component_class => p_rec.component_class
142 ,p_render_type => p_rec.render_type);
143 --
144 if g_debug then
145 hr_utility.set_location(' Leaving:'||l_proc, 10);
146 end if;
147 End insert_validate;
148 --
149 -- ----------------------------------------------------------------------------
150 -- |---------------------------< update_validate >----------------------------|
151 -- ----------------------------------------------------------------------------
152 Procedure update_validate
153 (p_rec in hxc_uld_shd.g_rec_type
154 ) is
155 --
156 l_proc varchar2(72) ;
157 --
158 Begin
159 g_debug :=hr_utility.debug_enabled;
160 if g_debug then
161 l_proc := g_package||'update_validate';
162 hr_utility.set_location('Entering:'||l_proc, 5);
163 end if;
164 --
165 -- Call all supporting business operations
166 --
167 --
168 -- EDIT_HERE: As this table does not have a mandatory business_group_id
169 -- column, ensure client_info is populated by calling a suitable
170 -- ???_???_bus.set_security_group_id procedure, or add one of the following
171 -- comments:
172 -- "-- No business group context. HR_STANDARD_LOOKUPS used for validation."
173 -- "-- CLIENT_INFO not set. No lookup validation or joins to HR_LOOKUPS."
174 --
175 chk_non_updateable_args
176 (p_rec => p_rec
177 );
178 --
179 -- Check that the combination of component_type and component_class is
180 -- unique
181 --
182 chk_component_definition
183 (p_layout_comp_definition_id => p_rec.layout_comp_definition_id
184 ,p_component_type => p_rec.component_type
185 ,p_component_class => p_rec.component_class
186 ,p_render_type => p_rec.render_type);
187 --
188 if g_debug then
189 hr_utility.set_location(' Leaving:'||l_proc, 10);
190 end if;
191 End update_validate;
192 --
193 -- ----------------------------------------------------------------------------
194 -- |---------------------------< delete_validate >----------------------------|
195 -- ----------------------------------------------------------------------------
196 Procedure delete_validate
197 (p_rec in hxc_uld_shd.g_rec_type
198 ) is
199 --
200 l_proc varchar2(72) ;
201 --
202 Begin
203 g_debug :=hr_utility.debug_enabled;
204 if g_debug then
205 l_proc := g_package||'delete_validate';
206 hr_utility.set_location('Entering:'||l_proc, 5);
207 end if;
208 --
209 -- Call all supporting business operations
210 --
211 if g_debug then
212 hr_utility.set_location(' Leaving:'||l_proc, 10);
213 end if;
214 End delete_validate;
215 --
216 end hxc_uld_bus;