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