1 Package irc_ido_shd AUTHID CURRENT_USER as
2 /* $Header: iridorhi.pkh 120.2.12010000.2 2008/08/05 10:48:35 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (document_id number(15)
10 ,party_id number(15)
11 ,person_id number(15)
12 ,assignment_id number(15)
13 ,file_name varchar2(240)
14 ,file_format varchar2(30)
15 ,mime_type varchar2(150)
16 ,description varchar2(240)
17 ,type varchar2(30)
18 ,object_version_number number(9)
19 ,end_date Date
20 );
21 --
22 -- ----------------------------------------------------------------------------
23 -- | Global Definitions - Internal Development Use Only |
24 -- ----------------------------------------------------------------------------
25 --
26 g_old_rec g_rec_type; -- Global record definition
27 g_api_dml boolean; -- Global api dml status
28 --
29 -- ----------------------------------------------------------------------------
30 -- |------------------------< return_api_dml_status >-------------------------|
31 -- ----------------------------------------------------------------------------
32 -- {Start Of Comments}
33 --
34 -- Description:
35 -- This function will return the current g_api_dml private global
36 -- boolean status.
37 -- The g_api_dml status determines if at the time of the function
38 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
39 -- is being issued from within an api.
40 -- If the status is TRUE then a dml statement is being issued from
41 -- within this entity api.
42 -- This function is primarily to support database triggers which
43 -- need to maintain the object_version_number for non-supported
44 -- dml statements (i.e. dml statement issued outside of the api layer).
45 --
46 -- Prerequisites:
47 -- none
48 --
49 -- In Parameters:
50 -- None.
51 --
52 -- Post Success:
53 -- Processing continues.
54 -- If the function returns a TRUE value then, dml is being executed from
55 -- within this api.
56 --
57 -- Post Failure:
58 -- None.
59 --
60 -- Access Status:
61 -- Internal Row Handler Use Only.
62 --
63 -- {End Of Comments}
64 --
65 ----------------------------------------------------------------------------
66 Function return_api_dml_status Return Boolean;
67 --
68 -- ----------------------------------------------------------------------------
69 -- |---------------------------< constraint_error >---------------------------|
70 -- ----------------------------------------------------------------------------
71 -- {Start Of Comments}
72 --
73 -- Description:
74 -- This procedure is called when a constraint has been violated (i.e.
75 -- The exception hr_api.check_integrity_violated,
76 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
77 -- hr_api.unique_integrity_violated has been raised).
78 -- The exceptions can only be raised as follows:
79 -- 1) A check constraint can only be violated during an INSERT or UPDATE
80 -- dml operation.
81 -- 2) A parent integrity constraint can only be violated during an
82 -- INSERT or UPDATE dml operation.
83 -- 3) A child integrity constraint can only be violated during an
84 -- DELETE dml operation.
85 -- 4) A unique integrity constraint can only be violated during INSERT or
86 -- UPDATE dml operation.
87 --
88 -- Prerequisites:
89 -- 1) Either hr_api.check_integrity_violated,
90 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
91 -- hr_api.unique_integrity_violated has been raised with the subsequent
92 -- stripping of the constraint name from the generated error message
93 -- text.
94 -- 2) Standalone validation test which corresponds with a constraint error.
95 --
96 -- In Parameter:
97 -- p_constraint_name is in upper format and is just the constraint name
98 -- (e.g. not prefixed by brackets, schema owner etc).
99 --
100 -- Post Success:
101 -- Development dependant.
102 --
103 -- Post Failure:
104 -- Developement dependant.
105 --
106 -- Developer Implementation Notes:
107 -- For each constraint being checked the hr system package failure message
108 -- has been generated as a template only. These system error messages should
109 -- be modified as required (i.e. change the system failure message to a user
110 -- friendly defined error message).
111 --
112 -- Access Status:
113 -- Internal Development Use Only.
114 --
115 -- {End Of Comments}
116 -- ----------------------------------------------------------------------------
117 Procedure constraint_error
118 (p_constraint_name in all_constraints.constraint_name%TYPE);
119 --
120 -- ----------------------------------------------------------------------------
121 -- |-----------------------------< api_updating >-----------------------------|
122 -- ----------------------------------------------------------------------------
123 -- {Start Of Comments}
124 --
125 -- Description:
126 -- This function is used to populate the g_old_rec record with the
127 -- current row from the database for the specified primary key
128 -- provided that the primary key exists and is valid and does not
129 -- already match the current g_old_rec. The function will always return
130 -- a TRUE value if the g_old_rec is populated with the current row.
131 -- A FALSE value will be returned if all of the primary key arguments
132 -- are null.
133 --
134 -- Prerequisites:
135 -- None.
136 --
137 -- In Parameters:
138 --
139 -- Post Success:
140 -- A value of TRUE will be returned indiciating that the g_old_rec
141 -- is current.
142 -- A value of FALSE will be returned if all of the primary key arguments
143 -- have a null value (this indicates that the row has not be inserted into
144 -- the Schema), and therefore could never have a corresponding row.
145 --
146 -- Post Failure:
147 -- A failure can only occur under two circumstances:
148 -- 1) The primary key is invalid (i.e. a row does not exist for the
149 -- specified primary key values).
150 -- 2) If an object_version_number exists but is NOT the same as the current
151 -- g_old_rec value.
152 --
153 -- Developer Implementation Notes:
154 -- None.
155 --
156 -- Access Status:
157 -- Internal Development Use Only.
158 --
159 -- {End Of Comments}
160 -- ----------------------------------------------------------------------------
161 Function api_updating
162 (p_document_id in number
163 ,p_object_version_number in number
164 ) Return Boolean;
165 --
166 -- ----------------------------------------------------------------------------
167 -- |---------------------------------< lck >----------------------------------|
168 -- ----------------------------------------------------------------------------
169 -- {Start of comments}
170 --
171 -- Description:
172 -- The Lck process has two main functions to perform. Firstly, the row to be
173 -- updated or deleted must be locked. The locking of the row will only be
174 -- successful if the row is not currently locked by another user.
175 -- Secondly, during the locking of the row, the row is selected into
176 -- the g_old_rec data structure which enables the current row values from
177 -- the server to be available to the api.
178 --
179 -- Prerequisites:
180 -- When attempting to call the lock the object version number (if defined)
181 -- is mandatory.
182 --
183 -- In Parameters:
184 -- The arguments to the Lck process are the primary key(s) which uniquely
185 -- identify the row and the object version number of row.
186 --
187 -- Post Success:
188 -- On successful completion of the Lck process the row to be updated or
189 -- deleted will be locked and selected into the global data structure
190 -- g_old_rec.
191 --
192 -- Post Failure:
193 -- The Lck process can fail for three reasons:
194 -- 1) When attempting to lock the row the row could already be locked by
195 -- another user. This will raise the HR_Api.Object_Locked exception.
196 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
197 -- This error is trapped and reported using the message name
198 -- 'HR_7220_INVALID_PRIMARY_KEY'.
199 -- 3) The row although existing in the HR Schema has a different object
200 -- version number than the object version number specified.
201 -- This error is trapped and reported using the message name
202 -- 'HR_7155_OBJECT_INVALID'.
203 --
204 -- Developer Implementation Notes:
205 -- For each primary key and the object version number arguments add a
206 -- call to hr_api.mandatory_arg_error procedure to ensure that these
207 -- argument values are not null.
208 --
209 -- Access Status:
210 -- Internal Development Use Only.
211 --
212 -- {End of comments}
213 -- ----------------------------------------------------------------------------
214 Procedure lck
215 (p_document_id in number
216 ,p_object_version_number in number
217 );
218 --
219 -- ----------------------------------------------------------------------------
220 -- |-----------------------------< convert_args >-----------------------------|
221 -- ----------------------------------------------------------------------------
222 -- {Start Of Comments}
223 --
224 -- Description:
225 -- This function is used to turn attribute parameters into the record
226 -- structure parameter g_rec_type.
227 --
228 -- Prerequisites:
229 -- This is a private function and can only be called from the ins or upd
230 -- attribute processes.
231 --
232 -- In Parameters:
233 --
234 -- Post Success:
235 -- A returning record structure will be returned.
236 --
237 -- Post Failure:
238 -- No direct error handling is required within this function. Any possible
239 -- errors within this function will be a PL/SQL value error due to
240 -- conversion of datatypes or data lengths.
241 --
242 -- Developer Implementation Notes:
243 -- None.
244 --
245 -- Access Status:
246 -- Internal Row Handler Use Only.
247 --
248 -- {End Of Comments}
249 -- ----------------------------------------------------------------------------
250 Function convert_args
251 (p_document_id in number
252 ,p_party_id in number
253 ,p_person_id in number
254 ,p_assignment_id in number
255 ,p_character_doc in clob
256 ,p_file_name in varchar2
257 ,p_mime_type in varchar2
258 ,p_description in varchar2
259 ,p_type in varchar2
260 ,p_parsed_xml in clob
261 ,p_object_version_number in number
262 ,p_end_date in Date
263 )
264 Return g_rec_type;
265 --
266 end irc_ido_shd;