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