1 Package IRC_DOCUMENT_API as
2 /* $Header: iridoapi.pkh 120.7.12010000.1 2008/07/28 12:41:55 appldev ship $ */
3 /*#
4 * This package contains Document APIs.
5 * @rep:scope public
6 * @rep:product irc
7 * @rep:displayname Document
8 */
9 -- Global variables
10 --
11 IRC_MARKUP_STARTTAG VARCHAR2(100) := '<b style="BACKGROUND-COLOR: #ffff66">';
12 IRC_MARKUP_ENDTAG VARCHAR2(100) := '</b>';
13 --
14 -- ----------------------------------------------------------------------------
15 -- |----------------------------< synchronize_index >-------------------------|
16 -- ----------------------------------------------------------------------------
17 --
18 -- {Start Of Comments}
19 /*#
20 * This API synchronizes the document text indexes.
21 *
22 * The API will either add new entries (ONLINE mode) or update and delete old
23 * entries (FULL mode). If the mode is NONE then no action will be performed.
24 *
25 * <p><b>Licensing</b><br>
26 * This API is licensed for use with iRecruitment.
27 *
28 * <p><b>Prerequisites</b><br>
29 * No known prerequisites.
30 *
31 * <p><b>Post Success</b><br>
32 * The API will rebuild the index
33 *
34 * <p><b>Post Failure</b><br>
35 * The API will not rebuild the index and an error will be raised
36 * @param p_mode Mode can be ONLINE, FULL or NONE
37 * @rep:displayname Synchronize Index
38 * @rep:category BUSINESS_ENTITY IRC_RECRUITING_DOCUMENT
39 * @rep:scope public
40 * @rep:lifecycle active
41 * @rep:ihelp PER/@scalapi APIs in Oracle HRMS
42 */
43 --
44 -- {End Of Comments}
45 --
46 Procedure synchronize_index(p_mode in varchar2);
47 --
48 -- ----------------------------------------------------------------------------
49 -- |-----------------------------< create_document >--------------------------|
50 -- ----------------------------------------------------------------------------
51 --
52 -- {Start Of Comments}
53 /*#
54 * This API creates a document for a candidate.
55 *
56 * This API inserts an empty_blob in to the database that can subsequently be
57 * used to stream the file in to. This is a second step subsequent to running
58 * the API. After streaming the document in to the binary_doc column, the
59 * process_document procedure in this package must be run to synchronize this
60 * data with the other columns.
61 *
62 * <p><b>Licensing</b><br>
63 * This API is licensed for use with iRecruitment.
64 *
65 * <p><b>Prerequisites</b><br>
66 * The person must already exist
67 *
68 * <p><b>Post Success</b><br>
69 * The document will be created in the database
70 *
71 * <p><b>Post Failure</b><br>
72 * The document will not be created in the database and an error will be raised
73 * @param p_validate If true, then validation alone will be performed and the
74 * database will remain unchanged. If false and all validation checks pass,
75 * then the database will be modified.
76 * @param p_effective_date Reference date for validating lookup values are
77 * applicable during the start to end active date range. This date does not
78 * determine when the changes take effect.
79 * @param p_type The type of document. Valid values are defined by
80 * 'IRC_DOCUMENT_TYPE' lookup type.
81 * @param p_person_id Identifies the person for whom you create the document
82 * record.
83 * @param p_mime_type MIME type of the file
84 * @param p_assignment_id Identifies the assignment for which you create the
85 * document record. Not yet used in the iRecruitment application.
86 * @param p_file_name The name of the file
87 * @param p_description A description of the file
88 * @param p_end_date Identifies the date when the record is end dated.
89 * @param p_document_id If p_validate is false, then this uniquely identifies
90 * the document created. If p_validate is true, then set to null.
91 * @param p_object_version_number If p_validate is false, then set to the
92 * version number of the created document. If p_validate is true, then the
93 * value will be null.
94 * @rep:displayname Create Document
95 * @rep:category BUSINESS_ENTITY IRC_RECRUITING_DOCUMENT
96 * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
97 * @rep:scope public
98 * @rep:lifecycle active
99 * @rep:ihelp PER/@scalapi APIs in Oracle HRMS
100 */
101 --
102 -- {End Of Comments}
103 --
104 procedure CREATE_DOCUMENT
105 (p_validate in boolean default false
106 ,p_effective_date in date
107 ,p_type in varchar2
108 ,p_person_id in number
109 ,p_mime_type in varchar2
110 ,p_assignment_id in number default null
111 ,p_file_name in varchar2 default null
112 ,p_description in varchar2 default Null
113 ,p_end_date in date default Null
114 ,p_document_id out nocopy number
115 ,p_object_version_number out nocopy number
116 );
117 --
118 -- ----------------------------------------------------------------------------
119 -- |-----------------------------< update_document >--------------------------|
120 -- ----------------------------------------------------------------------------
121 --
122 -- {Start Of Comments}
123 /*#
124 * This API updates the details of a document.
125 *
126 * This API does not update the actual document itself. If you need to do that
127 * then you should select the binary_doc blob from the database and stream the
128 * new contents in to it. After streaming the document in to the binary_doc
129 * column, the process_document procedure in this package must be run to
130 * synchronize this data with the other columns.
131 *
132 * <p><b>Licensing</b><br>
133 * This API is licensed for use with iRecruitment.
134 *
135 * <p><b>Prerequisites</b><br>
136 * The document must exist in the database
137 *
138 * <p><b>Post Success</b><br>
139 * The document will be updated in the database
140 *
141 * <p><b>Post Failure</b><br>
142 * The document will not be updated in the database and an error will be raised
143 * @param p_validate If true, then validation alone will be performed and the
144 * database will remain unchanged. If false and all validation checks pass,
145 * then the database will be modified.
146 * @param p_effective_date Reference date for validating lookup values are
147 * applicable during the start to end active date range. This date does not
148 * determine when the changes take effect.
149 * @param p_document_id Identifies the document which is being updated
150 * @param p_mime_type MIME type of upload file
151 * @param p_type The type of document. Valid values are defined by
152 * 'IRC_DOCUMENT_TYPE' lookup type.
153 * @param p_file_name The name of the file
154 * @param p_description A description of the file
155 * @param p_object_version_number Pass in the current version number of the
156 * document to be updated. When the API completes if p_validate is false, will
157 * be set to the new version number of the updated document. If p_validate is
158 * true will be set to the same value which was passed in.
159 * @rep:displayname Update Document
160 * @rep:category BUSINESS_ENTITY IRC_RECRUITING_DOCUMENT
161 * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
162 * @rep:scope public
163 * @rep:lifecycle active
164 * @rep:ihelp PER/@scalapi APIs in Oracle HRMS
165 */
166 --
167 -- {End Of Comments}
168 --
169 procedure UPDATE_DOCUMENT
170 (p_validate in boolean default false
171 ,p_effective_date in date
172 ,p_document_id in number
173 ,p_mime_type in varchar2 default HR_API.G_VARCHAR2
174 ,p_type in varchar2 default HR_API.G_VARCHAR2
175 ,p_file_name in varchar2 default HR_API.G_VARCHAR2
176 ,p_description in varchar2 default HR_API.G_VARCHAR2
177 ,p_object_version_number in out nocopy number
178 );
179 --
180 -- ----------------------------------------------------------------------------
181 -- |-----------------------------< update_document_track >---------------------|
182 -- ----------------------------------------------------------------------------
183 --
184 -- {Start Of Comments}
185 /*#
186 * This API updates the details of a document and track the documents for
187 * internet applicants.
188 *
189 * This API does not update the actual document itself. If you need to do that
190 * then you should select the binary_doc blob from the database and stream the
191 * new contents in to it. After streaming the document in to the binary_doc
192 * column, the process_document procedure in this package must be run to
193 * synchronize this data with the other columns.
194 *
195 * <p><b>Licensing</b><br>
196 * This API is licensed for use with iRecruitment.
197 *
198 * <p><b>Prerequisites</b><br>
199 * The document must exist in the database
200 *
201 * <p><b>Post Success</b><br>
202 * The document will be updated in the database
203 *
204 * <p><b>Post Failure</b><br>
205 * The document will not be updated in the database and an error will be raised
206 * @param p_validate If true, then validation alone will be performed and the
207 * database will remain unchanged. If false and all validation checks pass,
208 * then the database will be modified.
209 * @param p_effective_date Reference date for validating lookup values are
210 * applicable during the start to end active date range. This date does not
211 * determine when the changes take effect.
212 * @param p_document_id Identifies the document which is being updated
213 * @param p_mime_type MIME type of upload file
214 * @param p_type The type of document. Valid values are defined by
215 * 'IRC_DOCUMENT_TYPE' lookup type.
216 * @param p_file_name The name of the file
217 * @param p_description A description of the file
218 * @param p_person_id Identifies the person_id of the person
219 * to whom the document belongs to.
220 * @param p_party_id Identifies the party_id of the person
221 * to whom the document belongs to.
222 * @param p_end_date Identifies the date when the record is end dated.
223 * @param p_assignment_id Identifies the assignment id of the applicantion.
224 * @param p_object_version_number Pass in the current version number of the
225 * document to be updated. When the API completes if p_validate is false, will
226 * be set to the new version number of the updated document. If p_validate is
227 * true will be set to the same value which was passed in.
228 * @param p_new_doc_id If p_validate is false, then this uniquely identifies
229 * the new document. If p_validate is true, then set to null.
230 * @rep:displayname Update Document
231 * @rep:category BUSINESS_ENTITY IRC_RECRUITING_DOCUMENT
232 * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
233 * @rep:scope public
234 * @rep:lifecycle active
235 * @rep:ihelp PER/@scalapi APIs in Oracle HRMS
236 */
237 --
238 -- {End Of Comments}
239 --
240 procedure UPDATE_DOCUMENT_TRACK
241 (p_validate in boolean default false
242 ,p_effective_date in date
243 ,p_document_id in number
244 ,p_mime_type in varchar2 default HR_API.G_VARCHAR2
245 ,p_type in varchar2 default HR_API.G_VARCHAR2
246 ,p_file_name in varchar2 default HR_API.G_VARCHAR2
247 ,p_description in varchar2 default HR_API.G_VARCHAR2
248 ,p_person_id in number default HR_API.G_NUMBER
249 ,p_party_id in number default HR_API.G_NUMBER
250 ,p_end_date in date default HR_API.G_DATE
251 ,p_assignment_id in number default HR_API.G_NUMBER
252 ,p_object_version_number in out nocopy number
253 ,p_new_doc_id out nocopy number
254 );
255 --
256 -- ----------------------------------------------------------------------------
257 -- |-----------------------------< delete_document >--------------------------|
258 -- ----------------------------------------------------------------------------
259 --
260 -- {Start Of Comments}
261 /*#
262 * This API deletes a document.
263 *
264 *
265 * <p><b>Licensing</b><br>
266 * This API is licensed for use with iRecruitment.
267 *
268 * <p><b>Prerequisites</b><br>
269 * The document must exist in the database
270 *
271 * <p><b>Post Success</b><br>
272 * The document will be deleted from the database
273 *
274 * <p><b>Post Failure</b><br>
275 * The document will not be deleted from the database and an error will be
276 * raised
277 * @param p_validate If true, then validation alone will be performed and the
278 * database will remain unchanged. If false and all validation checks pass,
279 * then the database will be modified.
280 * @param p_effective_date Reference date for validating lookup values are
281 * applicable during the start to end active date range. This date does not
282 * determine when the changes take effect.
283 * @param p_document_id Identifies the document which is being updated
284 * @param p_object_version_number Current version number of the document to be
285 * deleted.
286 * @param p_person_id Identifies the person_id of the person
287 * to whom the document belongs to.
288 * @param p_party_id Identifies the party_id of the person
289 * to whom the document belongs to.
290 * @param p_end_date Identifies the date when the record is deleted.
291 * @param p_type Identifies the document type.
292 * @param p_purge Identifies if the document should be deleted or end_dated.
293 * @rep:displayname Delete Document
294 * @rep:category BUSINESS_ENTITY IRC_RECRUITING_DOCUMENT
295 * @rep:category MISC_EXTENSIONS HR_USER_HOOKS
296 * @rep:scope public
300 --
297 * @rep:lifecycle active
298 * @rep:ihelp PER/@scalapi APIs in Oracle HRMS
299 */
301 -- {End Of Comments}
302 --
303 procedure DELETE_DOCUMENT
304 (p_validate in boolean default false
305 ,p_effective_date in date
306 ,p_document_id in number
307 ,p_object_version_number in number
308 ,p_person_id in number
309 ,p_party_id in number
310 ,p_end_date in Date
311 ,p_type in varchar2
312 ,p_purge in varchar2 default 'N'
313 );
314 --
315 -- ----------------------------------------------------------------------------
316 -- |--------------------------< PROCESS_DOCUMENT >----------------------------|
317 -- ----------------------------------------------------------------------------
318 -- {Start Of Comments}
319 --
320 -- Description:
321 -- This API is provided to perform required post insert / update processing
322 -- on documents stored in the IRC_DOCUMENTS table. This procedure MUST be
323 -- called after every call to CREATE_DOCUMENT or UPDATE_DOCUMENT. This
324 -- procedure performs the conversion from character data stored in
325 -- IRC_DOCUMENTS.BINARY_DOC into character data stored in
326 -- IRC_DOCUMENTS.CHARACTER_DOC. In addition it also performs fast / full
327 -- synchronization of the data in CHARACTER_DOC to allow it to be searched.
328 --
329 -- NOTE: Full synchronization should only be performed at a time when NO
330 -- DML is being performed on IRC_DOCUMENTS. If DML exists, it will
331 -- FAIL.
332 --
333 -- Prerequisites:
334 -- (i) The DOCUMENT_ID must exist within the IRC_DOCUMENTS table.
335 --
336 --
337 -- In Parameters:
338 -- Name Reqd Type Description
339 -- p_validate No boolean Commit or rollback
340 -- p_document_id Yes number PK of document
341 -- p_synchronization_level Yes varchar2 Full / Fast snychronization
342 --
343 -- Post Success:
344 -- The IRC_DOCUMENTS.CHARACTER_DOC will be populated with inserted / updated
345 -- data. interMedia index will be resynchronized.
346 --
347 -- Post Failure:
348 -- An error will be raised.
349 --
350 -- Access Status:
351 -- Public.
352 --
353 -- {End Of Comments}
354 --
355 procedure PROCESS_DOCUMENT
356 (p_document_id in number
357 );
358 --
359 -- ----------------------------------------------------------------------------
360 -- |--------------------------< GET_HTML_PREVIEW >----------------------------|
361 -- ----------------------------------------------------------------------------
362 -- {Start Of Comments}
363 --
364 -- Description:
365 -- This API is provided to return a html representation of the binary file
366 -- stored in irc_documents.binary_doc. If the highlight string is passed
367 -- then the keywords are highlighted accordingly in the html document.
368 --
369 -- Prerequisites:
370 -- (i) The DOCUMENT_ID must exist within the IRC_DOCUMENTS table.
371 --
372 --
373 -- In Parameters:
374 -- Name Reqd Type Description
375 -- p_document_id Yes number PK of IRC_DOCUMENTS
376 -- p_highlight_string No varchar2 Keywords to be highlighted
377 -- Out Parameters:
378 -- clob HTML representation of file
379 --
380 -- Post Success:
381 -- The clob returned will contain an HTML representation of the binary file.
382 --
383 -- Post Failure:
384 -- An error will be raised.
385 --
386 -- Access Status:
387 -- Public.
388 --
389 -- {End Of Comments}
390 --
391 function GET_HTML_PREVIEW
392 (p_document_id in number,p_highlight_string in varchar2 default null) return clob;
393 --
394 --
395 -- ----------------------------------------------------------------------------
396 -- |--------------------------< IS_INTERNET_APPLICANT >------------------------|
397 -- ----------------------------------------------------------------------------
398 -- {Start Of Comments}
399 --
400 -- Description:
401 -- This API is provided check whether the Applicant Is an Internet Applicant.
402 -- To be an Internet Applicant, the Applicant should have atleast one active
403 -- Job Application in the Business Group which has Applicant Tracking
404 -- enabled.
405 --
406 -- Prerequisites:
407 --
408 --
409 -- In Parameters:
410 -- Name Reqd Type Description
411 -- p_document_id Yes number PK of IRC_DOCUMENTS
412 -- p_person_id No number Person id
413 -- p_party_id Yes number Party id For the person
414 -- Out Parameters:
415 -- p_num_job_applications number number of job applications
416 -- for the party id in the
417 -- BG which has Applicant
418 -- tracking enabled
419 --
420 -- Post Success:
421 -- The number of job applications for the applicant will be returned
422 --
423 -- Post Failure:
424 --
425 --
426 -- Access Status:
427 -- Public.
428 --
429 -- {End Of Comments}
430 --
431 procedure IS_INTERNET_APPLICANT
432 ( p_document_id in number,
433 p_person_id in number,
434 p_party_id in number,
435 p_num_job_applications out nocopy number ) ;
436 --
437
438 end IRC_DOCUMENT_API;