DBA Data[Home] [Help]

PACKAGE: APPS.HR_LOT_SHD

Source


1 Package hr_lot_shd AUTHID CURRENT_USER as
2 /* $Header: hrlotrhi.pkh 120.0 2005/05/31 01:22:20 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (
10   location_id                       number(15),
11   language                          varchar2(9),      -- Increased length
12   source_lang                       varchar2(9),      -- Increased length
13   location_code                     varchar2(60),
14   description                       varchar2(240)
15   );
16 --
17 -- ----------------------------------------------------------------------------
18 -- |           Global Definitions - Internal Development Use Only             |
19 -- ----------------------------------------------------------------------------
20 --
21 g_old_rec  g_rec_type;                            -- Global record definition
22 --
23 -- ----------------------------------------------------------------------------
24 -- |---------------------------< constraint_error >---------------------------|
25 -- ----------------------------------------------------------------------------
26 -- {Start Of Comments}
27 --
28 -- Description:
29 --   This procedure is called when a constraint has been violated (i.e.
30 --   The exception hr_api.check_integrity_violated,
31 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
32 --   hr_api.unique_integrity_violated has been raised).
33 --   The exceptions can only be raised as follows:
34 --   1) A check constraint can only be violated during an INSERT or UPDATE
35 --      dml operation.
36 --   2) A parent integrity constraint can only be violated during an
37 --      INSERT or UPDATE dml operation.
38 --   3) A child integrity constraint can only be violated during an
39 --      DELETE dml operation.
40 --   4) A unique integrity constraint can only be violated during INSERT or
41 --      UPDATE dml operation.
42 --
43 -- Prerequisites:
44 --   1) Either hr_api.check_integrity_violated,
45 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
46 --      hr_api.unique_integrity_violated has been raised with the subsequent
47 --      stripping of the constraint name from the generated error message
48 --      text.
49 --   2) Standalone validation test which corresponds with a constraint error.
50 --
51 -- In Parameter:
52 --   p_constraint_name is in upper format and is just the constraint name
53 --   (e.g. not prefixed by brackets, schema owner etc).
54 --
55 -- Post Success:
56 --   Development dependant.
57 --
58 -- Post Failure:
59 --   Developement dependant.
60 --
61 -- Developer Implementation Notes:
62 --   For each constraint being checked the hr system package failure message
63 --   has been generated as a template only. These system error messages should
64 --   be modified as required (i.e. change the system failure message to a user
65 --   friendly defined error message).
66 --
67 -- Access Status:
68 --   Internal Development Use Only.
69 --
70 -- {End Of Comments}
71 -- ----------------------------------------------------------------------------
72 Procedure constraint_error
73   (p_constraint_name in all_constraints.constraint_name%type);
74 --
75 -- ----------------------------------------------------------------------------
76 -- |-----------------------------< api_updating >-----------------------------|
77 -- ----------------------------------------------------------------------------
78 -- {Start Of Comments}
79 --
80 -- Description:
81 --   This function is used to populate the g_old_rec record with the
82 --   current row from the database for the specified primary key
83 --   provided that the primary key exists and is valid and does not
84 --   already match the current g_old_rec. The function will always return
85 --   a TRUE value if the g_old_rec is populated with the current row.
86 --   A FALSE value will be returned if all of the primary key arguments
87 --   are null.
88 --
89 -- Prerequisites:
90 --   None.
91 --
92 -- In Parameters:
93 --
94 -- Post Success:
95 --   A value of TRUE will be returned indiciating that the g_old_rec
96 --   is current.
97 --   A value of FALSE will be returned if all of the primary key arguments
98 --   have a null value (this indicates that the row has not be inserted into
99 --   the Schema), and therefore could never have a corresponding row.
100 --
101 -- Post Failure:
102 --   A failure can only occur under two circumstances:
103 --   1) The primary key is invalid (i.e. a row does not exist for the
104 --      specified primary key values).
105 --   2) If an object_version_number exists but is NOT the same as the current
106 --      g_old_rec value.
107 --
108 -- Developer Implementation Notes:
109 --   None.
110 --
111 -- Access Status:
112 --   Internal Development Use Only.
113 --
114 -- {End Of Comments}
115 -- ----------------------------------------------------------------------------
116 Function api_updating
117   (
118   p_location_id                        in number,
119   p_language                           in varchar2
120   )      Return Boolean;
121 --
122 --
123 -- ----------------------------------------------------------------------------
124 -- |---------------------------------< lck >----------------------------------|
125 -- ----------------------------------------------------------------------------
126 -- {Start Of Comments}
127 --
128 -- Description:
129 --   The Lck process has two main functions to perform. Firstly, the row to be
130 --   updated or deleted must be locked. The locking of the row will only be
131 --   successful if the row is not currently locked by another user.
132 --   Secondly, during the locking of the row, the row is selected into
133 --   the g_old_rec data structure which enables the current row values from the
134 --   server to be available to the api.
135 --
136 -- Prerequisites:
137 --   When attempting to call the lock the object version number (if defined)
138 --   is mandatory.
139 --
140 -- In Parameters:
141 --   The arguments to the Lck process are the primary key(s) which uniquely
142 --   identify the row and the object version number of row.
143 --
144 -- Post Success:
145 --   On successful completion of the Lck process the row to be updated or
146 --   deleted will be locked and selected into the global data structure
147 --   g_old_rec.
148 --
149 -- Post Failure:
150 --   The Lck process can fail for three reasons:
151 --   1) When attempting to lock the row the row could already be locked by
152 --      another user. This will raise the HR_Api.Object_Locked exception.
153 --   2) The row which is required to be locked doesn't exist in the HR Schema.
154 --      This error is trapped and reported using the message name
155 --      'HR_7220_INVALID_PRIMARY_KEY'.
156 --   3) The row although existing in the HR Schema has a different object
157 --      version number than the object version number specified.
158 --      This error is trapped and reported using the message name
159 --      'HR_7155_OBJECT_INVALID'.
160 --
161 -- Developer Implementation Notes:
162 --   For each primary key and the object version number arguments add a
163 --   call to hr_api.mandatory_arg_error procedure to ensure that these
164 --   argument values are not null.
165 --
166 -- Access Status:
167 --   Internal Development Use Only.
168 --
169 -- {End Of Comments}
170 -- ----------------------------------------------------------------------------
171 Procedure lck
172   (
173   p_location_id                        in number,
174   p_language                           in varchar2
175   );
176 --
177 -- ----------------------------------------------------------------------------
178 -- |-----------------------------< convert_args >-----------------------------|
179 -- ----------------------------------------------------------------------------
180 -- {Start Of Comments}
181 --
182 -- Description:
183 --   This function is used to turn attribute parameters into the record
184 --   structure parameter g_rec_type.
185 --
186 -- Prerequisites:
187 --   This is a private function and can only be called from the ins or upd
188 --   attribute processes.
189 --
190 -- In Parameters:
191 --
192 -- Post Success:
193 --   A returning record structure will be returned.
194 --
195 -- Post Failure:
196 --   No direct error handling is required within this function. Any possible
197 --   errors within this function will be a PL/SQL value error due to conversion
198 --   of datatypes or data lengths.
199 --
200 -- Developer Implementation Notes:
201 --   None.
202 --
203 -- Access Status:
204 --   Internal Row Handler Use Only.
205 --
206 -- {End Of Comments}
207 -- ----------------------------------------------------------------------------
208 Function convert_args
209 	(
210 	p_location_id                   in number,
211 	p_language                      in varchar2,
212 	p_source_lang                   in varchar2,
213 	p_location_code                 in varchar2,
214 	p_description                   in varchar2
215 	)
216 	Return g_rec_type;
217 --
218 -- ------------------------------------------------------------------------
219 -- |--------------------------< add_language >----------------------------|
220 -- ------------------------------------------------------------------------
221 -- {Start Of Comments}
222 --
223 -- Description:
224 --   Maintains the _TL table. Ensures there is translation for every
225 --   installed language, removes any orphaned translation rows and
226 --   corrects any translations which have got out of synchronisation.
227 --
228 -- Prerequisites:
229 --
230 -- In Parameters:
231 --
232 -- Post Success:
233 --   A translation row exists for every installed language.
234 --
235 -- Post Failure:
236 --   Maintenance is aborted.
237 --
238 -- Developer Implementation Notes:
239 --   None.
240 --
241 -- Access Status:
242 --   Internal Development Use Only.
243 --
244 -- {End Of Comments}
245 -- ------------------------------------------------------------------------
246 Procedure add_language;
247 --
248 --
249 -- ------------------------------------------------------------------------
250 -- |------------------< return_value_business_group_id >------------------|
251 -- ------------------------------------------------------------------------
252 -- {Start Of Comments}
253 --
254 -- Description:
255 --
256 --   Maintains the efficiency global g_business_group_id.  Called
257 --   only when updating a row.
258 --
259 --   Returns the value of business_group_id linked to the location_id
260 --   parameter.  This is used when checking the unique constraint on
261 --   location_code.  Only makes call to database when required, otherwise
262 --   returns the global variable g_business_group_id.
263 --
264 -- Prerequisites:
265 --
266 -- In Parameters:
267 --    p_location_id
268 --
269 
270 -- Post Success:
271 --   A translation row exists for every installed language.
272 --
273 -- Post Failure:
274 --   Maintenance is aborted.
275 --
276 -- Developer Implementation Notes:
277 --   None.
278 --
279 -- Access Status:
280 --   Internal Development Use Only.
281 --
282 -- {End Of Comments}
283 -- ------------------------------------------------------------------------
284 Function return_value_business_group_id (p_location_id number) Return number;
285 --
286 -- ------------------------------------------------------------------------
287 -- |-------------------< set_value_business_group_id >--------------------|
288 -- ------------------------------------------------------------------------
289 -- {Start Of Comments}
290 --
291 -- Description:
292 --   Set the efficiency global g_business_group_id.  Called on row insert.
293 --
294 -- Prerequisites:
295 --
296 -- In Parameters:
297 --    p_business_group_id
298 --
299 -- Post Failure:
300 --   Maintenance is aborted.
301 --
302 -- Developer Implementation Notes:
303 --   None.
304 --
305 -- Access Status:
306 --   Internal Development Use Only.
307 --
308 -- {End Of Comments}
309 -- ------------------------------------------------------------------------
310 Procedure set_value_business_group_id (p_business_group_id number);
311 --
312 end hr_lot_shd;